History log of /freebsd/sys/kern/kern_descrip.c (Results 26 – 50 of 1297)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2af5ce5b 09-Oct-2023 Zhenlei Huang <zlei@FreeBSD.org>

fd: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

fd: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

1. kern.maxfiles
2. kern.maxfilesperproc

No functional change intended.

Reviewed by: kib, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42113

show more ...


# af93fea7 24-Aug-2023 Jake Freeland <jfree@freebsd.org>

timerfd: Move implementation from linux compat to sys/kern

Move the timerfd impelemntation from linux compat code to sys/kern. Use
it to implement the new system calls for timerfd. Add a hook to ker

timerfd: Move implementation from linux compat to sys/kern

Move the timerfd impelemntation from linux compat code to sys/kern. Use
it to implement the new system calls for timerfd. Add a hook to kern_tc
to allow timerfd to know when the system time has stepped. Add kqueue
support to timerfd. Adjust a few names to be less Linux centric.

RelNotes: YES
Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack)
Differential Revision: https://reviews.freebsd.org/D38459

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 6c049996 09-Jul-2023 Alan Somers <asomers@FreeBSD.org>

During F_SETFL, don't change file flags on error

Previously, even if the FIONBIO or FIOASYNC ioctl failed, the file's
f_flags variable would still be changed. Now, kern_fcntl will restore
the origi

During F_SETFL, don't change file flags on error

Previously, even if the FIONBIO or FIOASYNC ioctl failed, the file's
f_flags variable would still be changed. Now, kern_fcntl will restore
the original flags if the ioctl fails.

PR: 265736
Reported by: Yuval Pavel Zholkover <paulzhol@gmail.com>
MFC after: 2 weeks
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40955

show more ...


# 3d2fec7d 29-May-2023 Dmitry Chagin <dchagin@FreeBSD.org>

namei: Add the abilty for the ABI to specify an alternate root path

For now a non-native ABI (i.e., Linux) uses the kern_alternate_path()
facility to dynamically reroot lookups. First, an attempt is

namei: Add the abilty for the ABI to specify an alternate root path

For now a non-native ABI (i.e., Linux) uses the kern_alternate_path()
facility to dynamically reroot lookups. First, an attempt is made to
lookup the file in /compat/linux/original-path. If that fails, the
lookup is done in /original-path. Thats requires a bit of code in
every ABI syscall implementation where path name translation is needed.
Also our kern_alternate_path() does not properly lookups absolute symlinks
in second attempt, i.e., does not append /compat/linux part to the resolved
link.
The change is intended to avoid this by specifiyng the ABI root directory
for namei(), using one call to pwd_altroot() during exec-time into the ABI.
In that case namei() will dynamically reroot lookups as mentioned above.

PR: 72920
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D38933
MFC after: 2 month

show more ...


Revision tags: release/13.2.0
# 37b9fb16 28-Dec-2022 Konstantin Belousov <kib@FreeBSD.org>

Add descrip_check_write_mp() helper

... which verifies that given file table does not have file descriptors
referencing vnodes on the specified mount point. It is up to the caller
to ensure that th

Add descrip_check_write_mp() helper

... which verifies that given file table does not have file descriptors
referencing vnodes on the specified mount point. It is up to the caller
to ensure that the check is not racy.

Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37896

show more ...


Revision tags: release/12.4.0
# d07675a9 04-Aug-2022 Mark Johnston <markj@FreeBSD.org>

file: Move code to share fdtol structs into kern_descrip.c

This ensures the filedesc-to-leader code is consistently encapsulated in
kern_descrip.c.

No functional change intended.

Reviewed by: kib

file: Move code to share fdtol structs into kern_descrip.c

This ensures the filedesc-to-leader code is consistently encapsulated in
kern_descrip.c.

No functional change intended.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35988

show more ...


# c84c5e00 18-Jul-2022 Mitchell Horne <mhorne@FreeBSD.org>

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Spons

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35583

show more ...


Revision tags: release/13.1.0
# 362ff986 14-Apr-2022 Konstantin Belousov <kib@FreeBSD.org>

Revert rest of a5970a529c2d95271: use vrefact() when working on fp->f_vnode

Now, since O_PATH-opened file descriptors use use references instead
of the hold references, vrefact() chahges from that r

Revert rest of a5970a529c2d95271: use vrefact() when working on fp->f_vnode

Now, since O_PATH-opened file descriptors use use references instead
of the hold references, vrefact() chahges from that revision can be
reverted.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34906

show more ...


# bf13db08 13-Apr-2022 Konstantin Belousov <kib@FreeBSD.org>

Mostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-forced unmount

Problem is that open(O_PATH) on nullfs -o nocache is broken then,
because there is no reference on the

Mostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-forced unmount

Problem is that open(O_PATH) on nullfs -o nocache is broken then,
because there is no reference on the vnode after the open syscall exits.

Reported and tested by: ambrisko
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# b7262756 02-Apr-2022 Mateusz Guzik <mjg@FreeBSD.org>

vfs: fixup WANTIOCTLCAPS on open

In some cases vn_open_cred overwrites cn_flags, effectively nullifying
initialisation done in NDINIT. This will have to be fixed.

In the meantime make sure the flag

vfs: fixup WANTIOCTLCAPS on open

In some cases vn_open_cred overwrites cn_flags, effectively nullifying
initialisation done in NDINIT. This will have to be fixed.

In the meantime make sure the flag is passed.

Reported by: jenkins
Noted by: Mathieu <sigsys@gmail.com>

show more ...


# 0c805718 24-Mar-2022 Mateusz Guzik <mjg@FreeBSD.org>

vfs: fix memory leak on lookup with fds with ioctl caps

Reviewed by: markj
PR: 262515
Noted by: firk@cantconnect.ru
Differential Revision: https://reviews.freebsd.org/D34667


# fc7e121d 17-Mar-2022 Mark Johnston <markj@FreeBSD.org>

file: Move FILEDESC_FOREACH macros to kern_descrip.c

They are only used in kern_descrip.c, so make them private. No
functional change intended.

Discussed with: mjg
Sponsored by: The FreeBSD Founda

file: Move FILEDESC_FOREACH macros to kern_descrip.c

They are only used in kern_descrip.c, so make them private. No
functional change intended.

Discussed with: mjg
Sponsored by: The FreeBSD Foundation

show more ...


# c7022422 17-Mar-2022 Mark Johnston <markj@FreeBSD.org>

file: Avoid a read-after-free of fd tables in sysctl handlers

Some loops access the fd table of a different process, and drop the
filedesc lock while iterating, so they check the table's refcount.
H

file: Avoid a read-after-free of fd tables in sysctl handlers

Some loops access the fd table of a different process, and drop the
filedesc lock while iterating, so they check the table's refcount.
However, we access the table before the first iteration, in order to get
the number of table entries, and this access can be a use-after-free.

Fix the problem by checking the refcount before we start iterating.

Reported by: pho
Reviewed by: mjg
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34575

show more ...


# f3f3e3c4 03-Mar-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: add close_range(..., CLOSE_RANGE_CLOEXEC)

For compatibility with Linux.

MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34424


# f17ef286 22-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: rename fget*_locked to fget*_noref

This gets rid of the error prone naming where fget_unlocked returns with
a ref held, while fget_locked requires a lock but provides nothing in
terms of making

fd: rename fget*_locked to fget*_noref

This gets rid of the error prone naming where fget_unlocked returns with
a ref held, while fget_locked requires a lock but provides nothing in
terms of making sure the file lives past unlock.

No functional changes.

show more ...


# e68a5225 14-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: add fde_copy

To dedup handrolled memcpy. This will be used later to make fd code
atomic-clean.


# ec12b4f4 14-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: add missing seqc to dupfdopen


# c9a99599 14-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

seqc: rename seqc_consistent_nomb to seqc_consistent_no_fence

For more consistency with other primitives.


# 5c310250 29-Jan-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: use FILEDESC_FOREACH_{FDE,FP} where appropriate


# 809f3121 29-Jan-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: assign fd_freefile early when copying

This is to simplify an upcomming change.


# 893d20c9 29-Jan-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: move fd table sizing out of fdinit

now it is placed with the rest of actual initialisation


# 4103c3cd 29-Jan-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: drop volatile keyword from refcounts

While here move a comment where it belongs and do small whitespace clean up.


# 513c7a6e 11-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: make fget_unlocked take a thread argument

Just like other fget routines. This enables embedding fd table pointer
in struct thread, avoiding taking a trip through proc.


# 45bb8bea 01-Feb-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: elide one acquire fence in fget_unlocked_seq

Still validate we got the stable state before returning an error though.


12345678910>>...52