History log of /openbsd/sys/kern/vfs_lockf.c (Results 1 – 25 of 50)
Revision Date Author Comments
# 0d280c5f 14-Aug-2022 jsg <jsg@openbsd.org>

remove unneeded includes in sys/kern
ok mpi@ miod@


# edfe0eef 02-Jun-2022 anton <anton@openbsd.org>

Stop hiding a few assertions behind the opt-in LOCKF_DIAGNOSTIC option.
This code has already been exercised quite extensively by syzkaller and
got decent test coverage.


# ee8a2252 01-Jun-2022 visa <visa@openbsd.org>

Fix ambiguity with lock range end

When the user requests a lock range that ends at LLONG_MAX, replace
the end point with the special EOF value -1. This avoids ambiguity
with lf_end in lf_split(). Th

Fix ambiguity with lock range end

When the user requests a lock range that ends at LLONG_MAX, replace
the end point with the special EOF value -1. This avoids ambiguity
with lf_end in lf_split(). The ambiguity could result in a broken
data structure.

This change is visible to userspace in a corner case. When a lock range
has been requested with an end point at absolute position LLONG_MAX,
fcntl(F_GETLK) returns l_len == 0, instead of a positive value, for that
range. This seems consistent with FreeBSD and Linux.

OK anton@

Reported-by: syzbot+c93afea6c27a3fa3af39@syzkaller.appspotmail.com

show more ...


# 8e999735 01-Jun-2022 visa <visa@openbsd.org>

Fix lock range start when l_whence == SEEK_END and l_len < 0.

OK anton@


# c30ab30f 27-Apr-2022 anton <anton@openbsd.org>

Remove the lock if an identical overlapping one is already present.
Preventing a use after free discovered by syzkaller.

ok visa@

Reported-by: syzbot+a2649c1d77e9d2463f33@syzkaller.appspotmail.com

Remove the lock if an identical overlapping one is already present.
Preventing a use after free discovered by syzkaller.

ok visa@

Reported-by: syzbot+a2649c1d77e9d2463f33@syzkaller.appspotmail.com
Reported-by: syzbot+182df9087f5f182daa44@syzkaller.appspotmail.com
Reported-by: syzbot+46d03139d7ed5e81ed2f@syzkaller.appspotmail.com
Reported-by: syzbot+892e886a6113db341da1@syzkaller.appspotmail.com

show more ...


# dfee912f 02-Dec-2019 visa <visa@openbsd.org>

Replace rwsleep(9) with rwsleep_nsec(9) in vfs_lockf.c.

Prompted by and OK cheloha@
OK mpi@ anton@


# 5f80893c 02-Dec-2019 visa <visa@openbsd.org>

Remove now unneeded kernel locking from vfs_lockf.c.

OK mpi@ anton@


# eb24b341 12-May-2019 anton <anton@openbsd.org>

no need to store the wmesg passed to rwsleep() as a static variable anymore


# fbb8d265 11-May-2019 anton <anton@openbsd.org>

Restore previous behavior of limiting deadlock detection to posix-style
locks.

ok jturner@ visa@

Reported-by: syzbot+f9f13034fd656af6c48f@syzkaller.appspotmail.com


# dec5d66e 08-May-2019 anton <anton@openbsd.org>

group function prototypes


# ff70b2d7 06-May-2019 anton <anton@openbsd.org>

Bring back lockf deadlock detection from the dead. Back in 2007, the deadlock
detection broke while changing the owner of a lock from struct proc to struct
filedesc/file. Instead of keeping track of

Bring back lockf deadlock detection from the dead. Back in 2007, the deadlock
detection broke while changing the owner of a lock from struct proc to struct
filedesc/file. Instead of keeping track of the owning proc for each lock,
introduce a new list for all pending blocked locks. This list is scanned before
waiting on a blocking lock in order to determine if sleeping would cause a
deadlock.

The new implementation is serialized by the recently added locking to the same
subsystem, meaning that acquiring the kernel lock is no longer necessary.

ok visa@

show more ...


# e2502dba 20-Apr-2019 anton <anton@openbsd.org>

print locked range in decimal in debug routines


# f22ff855 20-Apr-2019 anton <anton@openbsd.org>

Move lockf structures from header to implementation since external users
only need a lockf_state pointer by now.

ok mpi@ visa@


# d2bd3ff2 19-Apr-2019 visa <visa@openbsd.org>

Add a subsystem lock for vfs_lockf.c. This enables calling lf_advlock()
and lf_purgelocks() without the kernel lock.

OK anton@ mpi@


# e1b5dfd2 31-Mar-2019 visa <visa@openbsd.org>

Move the prototypes of internal lockf functions from <sys/lockf.h>
to vfs_lockf.c. This makes the public interface clearer.

The declaration of variable lockf_debug is removed from the header
because

Move the prototypes of internal lockf functions from <sys/lockf.h>
to vfs_lockf.c. This makes the public interface clearer.

The declaration of variable lockf_debug is removed from the header
because it is not needed outside of vfs_lockf.c.

OK anton@ tedu@

show more ...


# 98564c6c 24-Feb-2019 anton <anton@openbsd.org>

always include the lock id address in debug output


# 64818e36 24-Feb-2019 anton <anton@openbsd.org>

initialize struct lockf fields in a consistent order; ok millert@ mpi@ visa@


# 25e2de4f 30-Jan-2019 anton <anton@openbsd.org>

Replace hand rolled linked list with TAILQ. All made possible by the recent
introduction of struct lockf_state.

ok bluhm@ visa@


# 6bd4f7ca 21-Jan-2019 anton <anton@openbsd.org>

Introduce a dedicated entry point data structure for file locks. This new data
structure allows for better tracking of pending lock operations which is
essential in order to prevent a use-after-free

Introduce a dedicated entry point data structure for file locks. This new data
structure allows for better tracking of pending lock operations which is
essential in order to prevent a use-after-free once the underlying vnode is
gone.

Inspired by the lockf implementation in FreeBSD.

ok visa@

Reported-by: syzbot+d5540a236382f50f1dac@syzkaller.appspotmail.com

show more ...


# e9a43350 10-Nov-2018 anton <anton@openbsd.org>

use the LFPRINTF() debug macro consistently; ok mpi@


# b423aaf0 10-Nov-2018 anton <anton@openbsd.org>

Conform to POSIX-2001 in which the behavior of passing a negative length using
posix file locks is defined. Also, detect overflows when dealing with positive
lengths.

ok millert@ visa@


# 3c7ad812 02-Nov-2018 anton <anton@openbsd.org>

make debug flags continuous


# 4957d559 27-Oct-2018 anton <anton@openbsd.org>

Add assertions for lockf list manipulation, hidden behind LOCKF_DIAGNOSTIC.
While here, improve existing lockf debug routines and sprinkle some more logging
related to list manipulation.

ok deraadt@

Add assertions for lockf list manipulation, hidden behind LOCKF_DIAGNOSTIC.
While here, improve existing lockf debug routines and sprinkle some more logging
related to list manipulation.

ok deraadt@ visa@ (as part of a larger diff)

show more ...


# 7c825b7d 27-Oct-2018 anton <anton@openbsd.org>

Rework previous lockf fix; bluhm@ noticed a regress failure during consecutive
runs. This is a second attempt in which the lockf structure is turned into a
doubly linked list which makes it easier to

Rework previous lockf fix; bluhm@ noticed a regress failure during consecutive
runs. This is a second attempt in which the lockf structure is turned into a
doubly linked list which makes it easier to ensure correctness during list
insertion and deletion.

ok deraadt@ visa@

show more ...


# 47546510 06-Oct-2018 anton <anton@openbsd.org>

When freeing a lockf struct that already is part of a linked list, make sure to
update the next pointer for the preceding lock. Prevents a double free panic.

ok millert@


12