opnsense-src/lib/libc/sys
Lawrence Stewart 9891578a40 Plug a memory leak and potential NULL-pointer dereference introduced in r331214.
Each TCP connection that uses the system default cc_newreno(4) congestion
control algorithm module leaks a "struct newreno" (8 bytes of memory) at
connection initialisation time. The NULL-pointer dereference is only germane
when using the ABE feature, which is disabled by default.

While at it:

- Defer the allocation of memory until it is actually needed given that ABE is
  optional and disabled by default.

- Document the ENOMEM errno in getsockopt(2)/setsockopt(2).

- Document ENOMEM and ENOBUFS in tcp(4) as being synonymous given that they are
  used interchangeably throughout the code.

- Fix a few other nits also accidentally omitted from the original patch.

Reported by:	Harsh Jain on freebsd-net@
Tested by:	tjh@
Differential Revision:	https://reviews.freebsd.org/D15358
2018-05-17 02:46:27 +00:00
..
__error.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
__vdso_gettimeofday.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
_exit.2
_umtx_op.2 Fix formatting of _umtx_op(2) 2017-11-13 17:46:38 +00:00
abort2.2
accept.2
accept.c
accept4.c
access.2
acct.2
adjtime.2
aio_cancel.2
aio_error.2
aio_fsync.2
aio_mlock.2
aio_read.2
aio_return.2
aio_suspend.2 Bump man page revision dates for r324941 2017-10-24 14:34:25 +00:00
aio_suspend.c
aio_waitcomplete.2
aio_write.2
bind.2
bindat.2 Clarify bindat/connectat use with AT_FDCWD 2018-04-30 17:16:17 +00:00
brk.2
cap_enter.2
cap_fcntls_limit.2
cap_ioctls_limit.2
cap_rights_limit.2
chdir.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
chflags.2
chmod.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
chown.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
chroot.2
clock_gettime.2
clock_gettime.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
clock_nanosleep.c Remove 'All rights reserved' from my files 2018-05-09 20:12:59 +00:00
close.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
close.c
closefrom.2
compat-ino64.h
connect.2
connect.c
connectat.2 Clarify bindat/connectat use with AT_FDCWD 2018-04-30 17:16:17 +00:00
cpuset.2 Document new NUMA related syscalls and utility options. 2018-03-24 23:58:44 +00:00
cpuset_getaffinity.2 Document new NUMA related syscalls and utility options. 2018-03-24 23:58:44 +00:00
cpuset_getdomain.2 Add missing file from 4331508 2018-03-25 07:42:44 +00:00
dup.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
execve.2
extattr_get_file.2
fcntl.2 fcntl(2): Vaguely document that ENOTTY is possible, with light examples 2018-05-03 02:42:13 +00:00
fcntl.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
fdatasync.c
ffclock.2
fhopen.2
flock.2
fork.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
fork.c
fstat.c
fstatat.c
fstatfs.c
fsync.2 Don't put multiple names on a single .Nm line. This fixes apropos(1) 2018-04-17 09:05:46 +00:00
fsync.c
getdents.c
getdirentries.2
getdirentries.c
getdtablesize.2
getfh.2
getfsstat.2
getfsstat.c
getgid.2
getgroups.2
getitimer.2
getlogin.2
getloginclass.2
getpeername.2
getpgrp.2
getpid.2
getpriority.2
getrandom.2 Implement getrandom(2) and getentropy(3) 2018-03-21 01:15:45 +00:00
getrlimit.2
getrusage.2
getsid.2
getsockname.2
getsockopt.2 Plug a memory leak and potential NULL-pointer dereference introduced in r331214. 2018-05-17 02:46:27 +00:00
gettimeofday.2
gettimeofday.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
getuid.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
interposing_table.c
intro.2
ioctl.2
issetugid.2
jail.2
kenv.2
kevent.c
kill.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
kldfind.2
kldfirstmod.2
kldload.2
kldnext.2
kldstat.2
kldsym.2
kldunload.2
kqueue.2 Fix a few more speelling errors 2017-12-28 01:31:28 +00:00
ktrace.2
link.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
lio_listio.2 Bump man page revision dates for r324941 2017-10-24 14:34:25 +00:00
listen.2
lseek.2
lstat.c
madvise.2
Makefile.inc Document new NUMA related syscalls and utility options. 2018-03-24 23:58:44 +00:00
mincore.2
minherit.2
mkdir.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
mkfifo.2
mknod.2 Fix missing .Dd bump 2017-12-01 22:52:45 +00:00
mknod.c
mlock.2 Remove a lingering inaccuracy from mlock.2. 2018-03-20 20:45:47 +00:00
mlockall.2
mmap.2 Simplify language. 2017-07-08 07:33:30 +00:00
modfind.2
modnext.2
modstat.2
mount.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
mprotect.2
mq_close.2
mq_getattr.2
mq_notify.2
mq_open.2
mq_receive.2
mq_send.2
mq_setattr.2
msgctl.2 Rename kernel-only members of semid_ds and msgid_ds. 2018-03-02 22:10:48 +00:00
msgget.2 Refer to SysV IPC permissions as numeric constants. 2018-03-04 20:06:02 +00:00
msgrcv.2
msgsnd.2
msync.2
msync.c
munmap.2
nanosleep.2
nanosleep.c
nfssvc.2
ntp_adjtime.2
numa_getaffinity.2
open.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
open.c
openat.c use @@@ instead of @@ in __sym_default 2017-12-05 20:19:13 +00:00
pathconf.2
pdfork.2
pipe.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
pipe.c
poll.2
poll.c
posix_fadvise.2
posix_fallocate.2 posix_fallocate.2: add an EINVAL errno case 2017-11-05 03:02:19 +00:00
posix_openpt.2
ppoll.c
procctl.2 PROC_PDEATHSIG_CTL will appear first in 11.2. 2018-05-12 10:11:33 +00:00
profil.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
pselect.2
pselect.c
ptrace.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
ptrace.c
quotactl.2
rctl_add_rule.2
read.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
read.c
readlink.2
readv.c
reboot.2 Define RB_POWERCYCLE 2017-10-25 15:30:20 +00:00
recv.2 Fixed description of msg_name/msg_namelen in recvmsg(). 2017-10-03 11:13:25 +00:00
recvfrom.c
recvmsg.c
rename.2 rename(2): document capability mode errors 2017-09-15 20:12:38 +00:00
revoke.2
rfork.2
rmdir.2
rtprio.2 Remove "All rights reserved" from my files. 2018-05-10 06:41:08 +00:00
sched_get_priority_max.2
sched_setparam.2
sched_setscheduler.2
sched_yield.2
sctp_generic_recvmsg.2
sctp_generic_sendmsg.2
sctp_peeloff.2
select.2
select.c
semctl.2 Don't declare union semun in userspace unless _WANT_SEMUN is defined. 2018-03-02 22:32:53 +00:00
semget.2 Refer to SysV IPC permissions as numeric constants. 2018-03-04 20:06:02 +00:00
semop.2
send.2
sendfile.2 Add a space between a section number and a following comma. 2018-03-15 19:03:54 +00:00
sendmsg.c
sendto.c
setcontext.c use @@@ instead of @@ in __sym_default 2017-12-05 20:19:13 +00:00
setfib.2
setgroups.2 Update .Dd missed in -r328304. 2018-01-24 22:36:21 +00:00
setpgid.2
setregid.2
setresuid.2
setreuid.2
setsid.2
setuid.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
shm_open.2
shmat.2 o EMFILE errno documented. 2018-01-26 08:38:26 +00:00
shmctl.2
shmget.2 Refer to SysV IPC permissions as numeric constants. 2018-03-04 20:06:02 +00:00
shutdown.2
sigaction.2
sigaction.c
sigaltstack.2
sigpending.2
sigprocmask.2
sigprocmask.c
sigqueue.2
sigreturn.2
sigstack.2
sigsuspend.2
sigsuspend.c
sigtimedwait.c
sigwait.2
sigwait.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
sigwaitinfo.2
sigwaitinfo.c
socket.2
socketpair.2 socketpair.2: Reference relevant POSIX standards 2018-02-10 19:41:32 +00:00
stat.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
stat.c
statfs.2 Add a reference to getfsstat in statfs. 2017-11-22 05:27:18 +00:00
statfs.c
swapcontext.c use @@@ instead of @@ in __sym_default 2017-12-05 20:19:13 +00:00
swapon.2
Symbol.map getentropy(3): Fallback to kern.arandom sysctl on older kernels 2018-03-21 23:52:37 +00:00
symlink.2
sync.2 Correct history for Unix 2nd Edition through 6th Edition for the 2017-12-01 22:48:20 +00:00
sysarch.2
syscall.2
thr_exit.2
thr_kill.2
thr_new.2
thr_self.2
thr_set_name.2
thr_suspend.2
thr_wake.2
timer_create.2
timer_delete.2
timer_settime.2
trivial-vdso_tc.c
truncate.2
umask.2
undelete.2
unlink.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
utimensat.2
utimes.2
utrace.2
uuidgen.2
vfork.2
wait.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
wait4.c
wait6.c
write.2 Mark all the system calls that were in 1st Edition Unix as such in the 2017-12-01 22:26:36 +00:00
write.c
writev.c