aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_shm.c
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-04-13 17:55:31 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-04-13 17:55:31 +0000
commit605c4cda2f5c274f0b9fc874d254d62944a93a37 (patch)
treed3a11aa6955d38cff97414b2556b5f533503178f /sys/kern/uipc_shm.c
parent7c5e60c72e4fbdc4b3849690acf9728b328def62 (diff)
downloadsrc-605c4cda2f5c274f0b9fc874d254d62944a93a37.tar.gz
src-605c4cda2f5c274f0b9fc874d254d62944a93a37.zip
close_range/closefrom: fix regression from close_range introduction
close_range will clamp the range between [0, fdp->fd_lastfile], but failed to take into account that fdp->fd_lastfile can become -1 if all fds are closed. =-( In this scenario, just return because there's nothing further we can do at the moment. Add a test case for this, fork() and simply closefrom(0) twice in the child; on the second invocation, fdp->fd_lastfile == -1 and will trigger a panic before this change. X-MFC-With: r359836
Notes
Notes: svn path=/head/; revision=359891
Diffstat (limited to 'sys/kern/uipc_shm.c')
0 files changed, 0 insertions, 0 deletions