| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Prompted by and OK cheloha@
OK mpi@ anton@
|
|
|
|
| |
OK mpi@ anton@
|
| |
|
|
|
|
|
|
|
|
| |
locks.
ok jturner@ visa@
Reported-by: syzbot+f9f13034fd656af6c48f@syzkaller.appspotmail.com
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
| |
only need a lockf_state pointer by now.
ok mpi@ visa@
|
|
|
|
|
|
| |
and lf_purgelocks() without the kernel lock.
OK anton@ mpi@
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
| |
|
|
|
|
|
|
| |
introduction of struct lockf_state.
ok bluhm@ visa@
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
posix file locks is defined. Also, detect overflows when dealing with positive
lengths.
ok millert@ visa@
|
| |
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
update the next pointer for the preceding lock. Prevents a double free panic.
ok millert@
|
|
|
|
|
|
|
| |
Caller must call uid_release() after making whatever change they needed
on the result of uid_find().
Adapted from guenther@'s proctree diff, ok dlg@, visa@
|
|
|
|
|
|
| |
initial thread
ok jsing@ kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
| |
ok kettenis@
|
| |
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
| |
marker for which pools are not interrupt safe. ok dlg
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
ok deraadt@ fgs@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- file descriptor table becomes the owner of the lock instead of the proc.
- When grabbing the lock, we check if the fd hasn't changed under our
feet, this is more or less impossible to solve without a hack like
this. I've banged my head against the wall, I figured out a solution,
but implementing it correctly would cost me 12 gray hairs. Screw it,
this is ugly, but it works.
- Wait until usecount drains before releasing the posix lock in closef.
- Add missing FREF/FRELE to sys_flock
- keep the pid in the flock struct instead of abusing the fact that we
used to use the proc as the lock owner.
Pointed out by and discussed with Al Viro, big thanks.
miod@ ok
|
| |
|
|
|
|
| |
a hard limit of 2x. add a comment to this effect. reviewed by miod
|
|
|
|
|
|
| |
restrict lock count per uid to a global limit, add sysctl to adjust limit.
this prevents a user from creating too many locks. problem noticed
by devon o'dell. ok deraadt miod pedro
|
| |
|
|
|
|
|
|
| |
From NetBSD.
Tested by many people, ok art@.
|
|
|
|
| |
takes a void *. convert uiomove to take a void * as well. ok deraadt@
|
|
|
|
| |
rescinded 22 July 1999. Proofed by myself and Theo.
|
| |
|
|
|
|
| |
costa@ ok.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
but not wakeup'ed. In this case one entry can be placed twice at list of
blocked locks. As a result block list contain an entry which points to
itself. lf_wakelock can't remove such an entry and system livelocks
trying to remove a bad entry from block list.
Other changes include:
- repair debug functions and make vfs_lockf.c compilable with LOCKF_DEBUG
- simplify debug printing and remove useless debugging
- remove unnecessary casting, replace NOLOCKF with NULL
- free -> FREE (use one form over the file)
- convert list of blocked locks to use TAILQ_* macroses
- lf_addblock() -> TAILQ_INSERT_TAIL
- Fix bug in lf_findoverlap(): in old code
if (end == -1) && (lf->lf_end == -1) && (lf->lf_start <= start)
then lf_findoverlap() return 4 instead of 2
- work more carefully with pointers (probably fix one or two bugs)
- use wakeup_one()
- KNF
|
| |
|
|
|