mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
kern: fix panic with disabled ttys
PR: 277240, 277329 Reviewed by: kib (earlier version) Fixes:f1d0a0cbec("jail: Fix information leak.") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44086 (cherry picked from commit975d773082)
This commit is contained in:
parent
38595c9d73
commit
8d22744f5b
1 changed files with 4 additions and 3 deletions
|
|
@ -1313,7 +1313,8 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS)
|
|||
struct xtty *xtlist, *xt;
|
||||
struct tty *tp;
|
||||
struct proc *p;
|
||||
int cansee, error;
|
||||
int error;
|
||||
bool cansee;
|
||||
|
||||
sx_slock(&tty_list_sx);
|
||||
lsize = tty_list_count * sizeof(struct xtty);
|
||||
|
|
@ -1326,8 +1327,8 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS)
|
|||
|
||||
TAILQ_FOREACH(tp, &tty_list, t_list) {
|
||||
tty_lock(tp);
|
||||
if (tp->t_session != NULL) {
|
||||
p = tp->t_session->s_leader;
|
||||
if (tp->t_session != NULL &&
|
||||
(p = atomic_load_ptr(&tp->t_session->s_leader)) != NULL) {
|
||||
PROC_LOCK(p);
|
||||
cansee = (p_cansee(td, p) == 0);
|
||||
PROC_UNLOCK(p);
|
||||
|
|
|
|||
Loading…
Reference in a new issue