mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
tty: Avoid a kernel memory discloure via kern.ttys
Four pad bytes at the end of each xtty structure were not being cleared before being copied out. Fix this by clearing the whole structure before populating fields. MFC after: 3 days Reported by: KMSAN
This commit is contained in:
parent
ce2f34ade8
commit
3c0fb026b2
1 changed files with 1 additions and 0 deletions
|
|
@ -1288,6 +1288,7 @@ tty_to_xtty(struct tty *tp, struct xtty *xt)
|
|||
|
||||
tty_assert_locked(tp);
|
||||
|
||||
memset(xt, 0, sizeof(*xt));
|
||||
xt->xt_size = sizeof(struct xtty);
|
||||
xt->xt_insize = ttyinq_getsize(&tp->t_inq);
|
||||
xt->xt_incc = ttyinq_bytescanonicalized(&tp->t_inq);
|
||||
|
|
|
|||
Loading…
Reference in a new issue