Age | Commit message (Collapse) | Author |
|
There used to be a predefined null vattr for !DIAGNOSTIC
but that was removed in vnode.h rev 1.84 in 2007.
ok semarie@ miod@
|
|
pair, and also provides their names. Internally, 3 NDINIT+namei operations
access /dev/[tp]ty[p-zP-T][0-9a-zA-Z], of these 2 followed unveil restrictions.
I argue if you unveil /dev/ptm, (and not the 372 other nodes), you still want
openpty() to provide you with working fd's, and the names, which the caller
will probably never open manually, because the fd's are given.
So change all NDINIT to use KERNELPATH, bypassing unveil.
ok semarie
|
|
Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.
Some addenda from jsg@.
OK miod@ mpi@
|
|
* Implement EVFILT_EXCEPT for ttys for HUP condition detection.
This filter is used when pollfd.events has no read/write events.
* Add HUP condition detection to filt_ptcwrite() and filt_ttywrite()
to reflect ptcpoll() and ttpoll(). Only poll(2) and select(2) can
utilize the code; kevent(2) should behave as before with EVFILT_WRITE.
* Clear EV_EOF and __EV_HUP if the EOF/HUP condition ends.
OK mpi@
|
|
Restrict the circumstances where EVFILT_EXCEPT filters trigger:
* when out-of-band data is present and NOTE_OOB is requested.
* when the channel is fully closed and consumer is poll(2).
This should clarify the logic and suppress events that kqueue-based
poll(2) does not except.
OK mpi@
|
|
ok semarie@
|
|
This is a change of behavior and events wont be generated if there
is something to read on the fd. Only EV_EOF or NOTE_OOB will now
be reported.
While here a new filter for FIFOs supporting EV_EOF and __EV_HUP.
ok visa@
|
|
the initial falloc() calls and then regrab it for the fdinsert() or
fdremove() calls respectiviely. Also move closef() outside of the lock.
This replaces the previously reverted lock order change that was reverted.
OK mvs@ visa@
|
|
can not simply be vrele()-ed on error. The code currently depends on
closef() to do the cleanup.
Reported-by: syzbot+b0e18235e96adf81883d@syzkaller.appspotmail.com
|
|
the file descriptors early do it late. This way the fdplock is not held
during the VFS operations.
OK mvs@
|
|
Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remains intact because the kernel lock is still used
with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist
internally. This allows some code simplification.
OK mpi@
|
|
ok claudio@, pirofti@
|
|
arrive in the wrong context. Found by jcs.
|
|
VERASE would perform (sometimes irrelevant) compute in the kernel which
can be heavy (especially with our insufficient tty subsystem locking). Use
tsleep_nsec for 1 tick in such circumstances to yield cpu, and also bring
interruptability to ptcwrite()
https://syzkaller.appspot.com/bug?extid=462539bc18fef8fc26cc
ok kettenis millert, discussions with greg and anton
|
|
This filter, already implemented in macOS and Dragonfly BSD, returns
exceptional conditions like the reception of out-of-band data.
The functionnality is similar to poll(2)'s POLLPRI & POLLRDBAND and
it can be used by the kqfilter-based poll & select implementation.
ok millert@ on a previous version, ok visa@
|
|
This is only done in poll-compatibility mode, when __EV_POLL is set.
ok visa@, millert@
|
|
ok millert@, visa@
|
|
for example, with locking assertions.
OK mpi@, anton@
|
|
adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
|
ok bluhm@
|
|
make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
|
|
All callers sleep indefinitely.
With help from visa@.
ok visa@, ratchov@, kn@
|
|
previous commit message:
When closing the slave end of a pty, generate an EOF event to any kqueue
consumer of the master end. This behavior is equivalent to how pipes
already behave with kqueue. Also, FreeBSD and NetBSD behaves the same
way.
ok deraadt@ millert@ visa@
|
|
running vmd, as observed by mlarkin and myself.
discussed with anton and mlarkin
|
|
consumer of the master end. This behavior is equivalent to how pipes
already behave with kqueue. Also, FreeBSD and NetBSD behaves the same
way.
ok deraadt@ millert@
|
|
kern/tty_pty.c, allocation of ptys was made dynamic with the introduction of
check_pty(). Every time a new struct pty is allocated its corresponding struct
tty is also allocated. It's therefore no longer necessary to ensure that a pty
has a tty allocated after calling check_pty().
ok deraadt@ millert@ mpi@ visa@
|
|
the following: a new pty is allocated in which the kernel console output is
redirected to, poll(2):ing from /dev/console at this point would be delegated to
the device with the major number taken from the pty due to the earlier
redirection. Since the pty does not have its correct device major assigned, the
wrong device ends up being used.
ok deraadt@ millert@
|
|
to the namei args. This fixes a bug where chmod would be allowed when
with only READ. This also allows some further cleanup of some awkward
things like PLEDGE_STAT that will follow
Lots of assistence from semarie@ - thanks!
ok semarie@
|
|
setup, take 3.
LARVAL fd still exist, but they are no longer marked with a flag and no
longer reachable via `fd_ofiles[]' or the global linked list. This allows
us to simplifies a lot code grabbing new references to fds.
All of this is now possible because dup2(2) refuses to clone LARVAL fds.
Note that the `fdplock' could now be release in all open(2)-like syscalls,
just like it is done in accept(2).
With inputs from Mathieu Masson, visa@, guenther@ and art@
Previous version ok bluhm@, ok visa@, sthen@
|
|
closing a LARVAL file.
Found the hardway by sthen@.
|
|
setup.
LARVAL fd still exist, but they are no longer marked with a flag and no
longer reachable via `fd_ofiles[]'. This allows us to simplifies a lot
code grabbing new references to fds.
All of this is now possible because dup2(2) refuses to clone LARVAL fds.
Note that the `fdplock' could now be release in all open(2)-like syscalls,
just like it is done in accept(2).
With inputs from Mathieu -, visa@, guenther@ and art@
ok visa@, bluhm@
|
|
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.
OK mpi@, deraadt@
|
|
The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
|
|
corresponding user mode ioctls.
If the master part of the pseudo terminal previously enabled TIOCUCNTL,
it will now receive the TIOCUCNTL_{S,C}BRK commands. This allows to
send BREAKS commands over a pty(4) independently of the serial terminal
emulator used.
Guidance and ok nicm@, ok ccardenas@, looks ok to deraadt@
|
|
ok millert@ sthen@
|
|
add a little breathing room.
|
|
close-on-exec flag on the newly allocated fd. Make falloc()'s
return arguments non-optional: assert that they're not NULL.
ok mpi@ millert@
|
|
ptm/pty subsystem, and got left behind.
ok beck
|
|
torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt
|
|
|
|
Use 115200 the default speed for buffer sizing in ttymalloc(). A lot
of devices call ttymalloc(0) so this affects quite a few of them.
Increases the buffer size for 9600 < baud <= 115200 from 1k to 4k.
Make ppp use the lo/hi watermarks from the tty layer which are
adjusted according to speed + buffer size. The previous fixed values
of 100 and 400 were way too small
Make pty call ttymalloc() with baud == 1000000, which is the common
value used in the tree for "fast".
ok deraadt@
|
|
|
|
pledgenote is used for annotate the policy for a namei context. So make it
tracking the nameidata.
It is expected for the caller to explicitly define the policy. It is a kernel
bug to not do so.
ok deraadt@
|
|
NDINIT should be preceded by setting pledgenote to indicate what
the operation is for.
|
|
|
|
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@
|
|
ok miod@
|
|
|
|
after discussions with beck deraadt kettenis.
|
|
|