freebsd-dev/sys
Konstantin Belousov 695e0701a0 buffer pager: deref ucred immediately after read.
Ucred is passed to bread(9) so that non-local filesystems use proper
credentials.  But, since clean buffer might be cached unless
buf_pager_relbuf is not enabled, it makes credentials to have extra
reference until buffer is reclaimed.  Ucred reference would prevent
jail from destroying if creds are jailed.

Dereferencing the read credentials on the valid buffer avoid that, and
should be fine because the buffer is valid and does not need re-read.

PR:	238032
Reported by:	bz
Reproduced and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23775
2020-03-05 15:52:34 +00:00
..
amd64 amd64 pmap.c: minor codegen optimization in flag access 2020-02-28 18:32:40 +00:00
arm arm: zynq: An SPI driver for Zynq platforms 2020-02-28 10:57:23 +00:00
arm64 Mark the arm64 machdep.h as kernel only 2020-03-05 10:52:16 +00:00
bsm vfs: add realpathat syscall 2020-02-20 16:58:19 +00:00
cam All paths lead to xpt_done, so move it after the switch. 2020-03-05 06:21:00 +00:00
cddl Increase number of write completion threads, matching ZoL. 2020-03-03 15:05:13 +00:00
compat Move compat.linux.map_sched_prio sysctl definition to linux_mib.c so it is 2020-03-05 14:41:27 +00:00
conf Remove BROOKTREE_ALLOC_PAGES now that bktr is now gone. 2020-03-02 00:23:31 +00:00
contrib Retire macros: 2020-03-02 23:25:02 +00:00
crypto Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
ddb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
dev Remove unused function. 2020-03-04 22:31:41 +00:00
dts arm: zynq: An SPI driver for Zynq platforms 2020-02-28 10:57:23 +00:00
fs nullfs: don't pre lock exclusive in nullfs_root 2020-03-04 19:52:00 +00:00
gdb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
geom Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
gnu dts: Update our copy for arm, arm64 and riscv dts to Linux 5.5 2020-02-28 15:42:51 +00:00
i386 Finish removal of bktr 2020-03-01 20:37:42 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern buffer pager: deref ucred immediately after read. 2020-03-05 15:52:34 +00:00
kgssapi Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
libkern Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
mips Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
modules Remove bktr(4) 2020-03-01 19:15:03 +00:00
net Implement optional table entry limits for if_llatbl. 2020-03-04 17:17:02 +00:00
net80211 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
netgraph Fix spelling of "dropped". 2020-03-04 22:32:40 +00:00
netinet When using automatically generated flow labels and using TCP SYN 2020-03-04 16:41:25 +00:00
netinet6 ip6: retire in6_selectroute_fib() as promised 8 years ago 2020-03-03 13:48:12 +00:00
netipsec Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
netpfil Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
netsmb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfsclient
nfsserver
nlm Remove stale FreeBSD_version checks. 2020-03-01 23:01:37 +00:00
ofed Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
opencrypto Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
powerpc [PowerPC64] fix uma_small_free panic 2020-03-05 12:24:48 +00:00
riscv riscv: Add a GENERIC-NODEBUG (copied from amd64) 2020-02-27 20:26:37 +00:00
rpc Remove obsolete old-freebsd version compat shim. 2020-03-01 23:01:51 +00:00
security In r358471, we interrupted the case block that would eventually lead 2020-03-03 01:46:35 +00:00
sys Remove an #include erroneously added in r358432. 2020-03-04 22:23:24 +00:00
teken Adjust teken to allow build as part of loader 2019-09-05 18:07:40 +00:00
tests Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
tools vfs: stop null checking routines in vop wrappers 2020-01-26 00:41:38 +00:00
ufs fd: move vnodes out of filedesc into a dedicated structure 2020-03-01 21:53:46 +00:00
vm Introduce kern_mmap_req(). 2020-03-04 21:27:12 +00:00
x86 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
xen Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many) 2020-02-25 19:04:39 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00