Date: Sat, 1 Aug 2020 16:02:33 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363767 - head/sys/kern Message-ID: <202008011602.071G2XdZ097020@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sat Aug 1 16:02:32 2020 New Revision: 363767 URL: https://svnweb.freebsd.org/changeset/base/363767 Log: cred: add more asserts for td_realucred == td_ucred Modified: head/sys/kern/kern_prot.c head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sat Aug 1 14:58:43 2020 (r363766) +++ head/sys/kern/kern_prot.c Sat Aug 1 16:02:32 2020 (r363767) @@ -1881,7 +1881,8 @@ crunuse(struct thread *td) { struct ucred *cr, *crold; - cr = td->td_ucred; + MPASS(td->td_realucred == td->td_ucred); + cr = td->td_realucred; mtx_lock(&cr->cr_mtx); cr->cr_ref += td->td_ucredref; td->td_ucredref = 0; @@ -1897,6 +1898,7 @@ crunuse(struct thread *td) crold = NULL; } mtx_unlock(&cr->cr_mtx); + td->td_realucred = NULL; return (crold); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Aug 1 14:58:43 2020 (r363766) +++ head/sys/kern/kern_thread.c Sat Aug 1 16:02:32 2020 (r363767) @@ -543,6 +543,7 @@ thread_exit(void) (long)p->p_pid, td->td_name); SDT_PROBE0(proc, , , lwp__exit); KASSERT(TAILQ_EMPTY(&td->td_sigqueue.sq_list), ("signal pending")); + MPASS(td->td_realucred == td->td_ucred); /* * drop FPU & debug register state storage, or any other
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008011602.071G2XdZ097020>