History log of /freebsd-11-stable/sys/kern/vfs_syscalls.c
Revision Date Author Comments
# 362426 20-Jun-2020 kib

MFC r311286:
The callers of kern_getfsstat(UIO_SYSSPACE) expect that *buf always
returns memory which must be freed, regardless of the error. Assign
NULL to *buf in case we are not going to allocate any memory due to
invalid mode.


# 338987 27-Sep-2018 gordon

Check to ensure the buffer returned is not NULL.

Direct commit to the branch as this behavior is only seeing in stable/11.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: wes@
Approved by: so
Security: FreeBSD-EN-18:10.syscall
Security: CVE-2018-17154


# 338943 26-Sep-2018 kib

MFC r338798:
Fix state of dquot-less vnodes after failed quotaoff.


# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 331679 28-Mar-2018 emaste

MFC r324560: allow posix_fallocate in capability mode

posix_fallocate is logically equivalent to writing zero blocks to the
desired file size and there is no reason to prevent calling it in
capability mode. posix_fallocate already checked for the CAP_WRITE
right, so we merely need to list it in capabilities.conf.

Also MFC r324564: allow posix_fallocate in 32-bit compat capability mode

Sponsored by: The FreeBSD Foundation


# 331643 27-Mar-2018 dim

MFC r314568 (by emaste):

kern_sig.c: ANSIfy and remove archaic register keyword

Sponsored by: The FreeBSD Foundation

MFC r318389 (by emaste):

Remove register keyword from sys/ and ANSIfy prototypes

A long long time ago the register keyword told the compiler to store
the corresponding variable in a CPU register, but it is not relevant
for any compiler used in the FreeBSD world today.

ANSIfy related prototypes while here.

Reviewed by: cem, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10193


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 330343 03-Mar-2018 eadler

MFC r302519:

Audit the file-descriptor number argument for openat(2). Remove a comment
about the desirability of auditing the number, as it was in fact in the
wrong place (in the common path for open(2) and openat(2), and only the
latter accepts a file-descriptor argument). Where other ABIs support
openat(2), it may be necessary to do additional argument auditing as it is
not performed in kern_openat(9).

MFC after: 3 days


# 325098 29-Oct-2017 kib

MFC r324853:
Remove the support for mknod(S_IFMT), which created dummy vnodes with
VBAD type.


# 322340 10-Aug-2017 dchagin

MFC r321839:

Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
Linux specific things to the native fdescfs file system.

Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
links to the actual files, which the process has open.
A readlink(2) call on this file returns a full path in case of regular file
or a string in a special format (type:[inode], anon_inode:<file-type>, etc..).
As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
equivalent to duplicating the corresponding file descriptor.

Here we have mutually exclusive requirements:
- in case of readlink(2) call fdescfs lookup() method should return VLNK
vnode otherwise our kern_readlink() fail with EINVAL error;
- in the other calls fdescfs lookup() method should return non VLNK vnode.

For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed
mounted with linrdlnk option an modified kern_readlinkat() to properly handle it.

For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:

mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11452


# 315551 19-Mar-2017 trasz

MFC r313016:

Replace calls to sys_truncate() with kern_truncate().

Sponsored by: DARPA, AFRL


# 315550 19-Mar-2017 trasz

MFC r312987:

Add kern_lseek() and use it instead of sys_lseek() in various compats.
I didn't touch svr4/, there's no point.

Sponsored by: DARPA, AFRL


# 315548 19-Mar-2017 trasz

MFC r312986:

Replace sys_ftruncate() with kern_ftruncate() in various compats.

Sponsored by: DARPA, AFRL


# 313450 08-Feb-2017 jhb

MFC 310638:
Rename the 'flags' argument to getfsstat() to 'mode' and validate it.

This argument is not a bitmask of flags, but only accepts a single value.
Fail with EINVAL if an invalid value is passed to 'flag'. Rename the
'flags' argument to getmntinfo(3) to 'mode' as well to match.

This is a followup to r308088.


# 311957 12-Jan-2017 kib

MFC r311452:
Do not allocate struct statfs on kernel stack.


# 311956 12-Jan-2017 kib

MFC r311447:
Some style fixes for getfstat(2)-related code.


# 311776 09-Jan-2017 kib

MFC r311113:
There is no need to use temporary statfs buffer for fsid obliteration
and prison enforcement. Do it on the caller buffer directly.


# 311775 09-Jan-2017 kib

MFC r311111:
Style.


# 311774 09-Jan-2017 kib

MFC r311108:
Move common code from kern_statfs() and kern_fstatfs() into a new helper.


# 310953 31-Dec-2016 mjg

MFC r309893,r309929:

vfs: add vrefact, to be used when the vnode has to be already active

This allows blind increment of relevant counters which under contention
is cheaper than inc-not-zero loops at least on amd64.

Use it in some of the places which are guaranteed to see already active
vnodes.

==

vfs: use vrefact in getcwd and fchdir


# 309515 03-Dec-2016 trasz

MFC r308209:

Fix getfsstat(2) with MNT_WAIT to not skip filesystems that are in the
process of being unmounted. Previously it would skip them, even if the
unmount eventually failed eg due to the filesystem being busy.

This behaviour broke autounmountd(8) - if you tried to manually unmount
a mounted filesystem, using 'automount -u', and the autounmountd attempted
to refresh the filesystem list in that very moment, it would conclude that
the filesystem got unmounted and not try to unmount it afterwards.


# 309514 03-Dec-2016 trasz

MFC r308088:

Fix getfsstat(2) handling of flags. The 'flags' argument is an enum,
not a bitfield. For the intended usage - being passed either MNT_WAIT,
or MNT_NOWAIT - this shouldn't introduce any changes in behaviour.


# 308732 16-Nov-2016 kib

MFC r308212:
Allow some dotdot lookups in capability mode.


# 304987 29-Aug-2016 kib

MFC r304182 (by ed):
Let CloudABI use fdatasync() as well.

MFC r304185 (by ed):
Eliminate use of sys_fsync() and sys_fdatasync().


# 304977 28-Aug-2016 kib

MFC r304176:
Add a trivial implementation of fdatasync(2).


# 303192 22-Jul-2016 kib

MFC r302893:
Do not allow creation of char or block special nodes with VNOVAL dev_t.

Approved by: re (gjb)