mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
USB: usbfs: don't leak kernel data in siginfo
commit f0c2b68198 upstream.
When a signal is delivered, the information in the siginfo structure
is copied to userspace. Good security practice dicatates that the
unused fields in this structure should be initialized to 0 so that
random kernel stack data isn't exposed to the user. This patch adds
such an initialization to the two places where usbfs raises signals.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Dave Mielke <dave@mielke.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e256bf1483
commit
92677959bd
@@ -501,6 +501,7 @@ static void async_completed(struct urb *urb)
|
||||
as->status = urb->status;
|
||||
signr = as->signr;
|
||||
if (signr) {
|
||||
memset(&sinfo, 0, sizeof(sinfo));
|
||||
sinfo.si_signo = as->signr;
|
||||
sinfo.si_errno = as->status;
|
||||
sinfo.si_code = SI_ASYNCIO;
|
||||
@@ -2228,6 +2229,7 @@ static void usbdev_remove(struct usb_device *udev)
|
||||
wake_up_all(&ps->wait);
|
||||
list_del_init(&ps->list);
|
||||
if (ps->discsignr) {
|
||||
memset(&sinfo, 0, sizeof(sinfo));
|
||||
sinfo.si_signo = ps->discsignr;
|
||||
sinfo.si_errno = EPIPE;
|
||||
sinfo.si_code = SI_ASYNCIO;
|
||||
|
||||
Reference in New Issue
Block a user