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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user