diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2015-02-13 10:54:53 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-24 11:38:46 -0500 |
commit | f0c2b68198589249afd2b1f2c4e8de8c03e19c16 (patch) | |
tree | 719882a5c2ab4ada82240fff4ffe0df6debe98eb | |
parent | 27082e2654dc148078b0abdfc3c8e5ccbde0ebfa (diff) |
USB: usbfs: don't leak kernel data in siginfo
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>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/core/devio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 66abdbcfbfa5..11635537c052 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -501,6 +501,7 @@ static void async_completed(struct urb *urb) | |||
501 | as->status = urb->status; | 501 | as->status = urb->status; |
502 | signr = as->signr; | 502 | signr = as->signr; |
503 | if (signr) { | 503 | if (signr) { |
504 | memset(&sinfo, 0, sizeof(sinfo)); | ||
504 | sinfo.si_signo = as->signr; | 505 | sinfo.si_signo = as->signr; |
505 | sinfo.si_errno = as->status; | 506 | sinfo.si_errno = as->status; |
506 | sinfo.si_code = SI_ASYNCIO; | 507 | sinfo.si_code = SI_ASYNCIO; |
@@ -2382,6 +2383,7 @@ static void usbdev_remove(struct usb_device *udev) | |||
2382 | wake_up_all(&ps->wait); | 2383 | wake_up_all(&ps->wait); |
2383 | list_del_init(&ps->list); | 2384 | list_del_init(&ps->list); |
2384 | if (ps->discsignr) { | 2385 | if (ps->discsignr) { |
2386 | memset(&sinfo, 0, sizeof(sinfo)); | ||
2385 | sinfo.si_signo = ps->discsignr; | 2387 | sinfo.si_signo = ps->discsignr; |
2386 | sinfo.si_errno = EPIPE; | 2388 | sinfo.si_errno = EPIPE; |
2387 | sinfo.si_code = SI_ASYNCIO; | 2389 | sinfo.si_code = SI_ASYNCIO; |