mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00: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
|
@ -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