aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/devio.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-09-25 05:27:20 -0400
committerEric W. Biederman <ebiederm@xmission.com>2018-10-03 10:47:43 -0400
commitae7795bc6187a15ec51cf258abae656a625f9980 (patch)
tree2456aa85c6b4be1ac58e272393056c0edbee038a /drivers/usb/core/devio.c
parent4cd2e0e70af6897ca2247fa1ffb1553ca16b4903 (diff)
signal: Distinguish between kernel_siginfo and siginfo
Linus recently observed that if we did not worry about the padding member in struct siginfo it is only about 48 bytes, and 48 bytes is much nicer than 128 bytes for allocating on the stack and copying around in the kernel. The obvious thing of only adding the padding when userspace is including siginfo.h won't work as there are sigframe definitions in the kernel that embed struct siginfo. So split siginfo in two; kernel_siginfo and siginfo. Keeping the traditional name for the userspace definition. While the version that is used internally to the kernel and ultimately will not be padded to 128 bytes is called kernel_siginfo. The definition of struct kernel_siginfo I have put in include/signal_types.h A set of buildtime checks has been added to verify the two structures have the same field offsets. To make it easy to verify the change kernel_siginfo retains the same size as siginfo. The reduction in size comes in a following change. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r--drivers/usb/core/devio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 6ce77b33da61..c260ea8808b0 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -582,7 +582,7 @@ static void async_completed(struct urb *urb)
582{ 582{
583 struct async *as = urb->context; 583 struct async *as = urb->context;
584 struct usb_dev_state *ps = as->ps; 584 struct usb_dev_state *ps = as->ps;
585 struct siginfo sinfo; 585 struct kernel_siginfo sinfo;
586 struct pid *pid = NULL; 586 struct pid *pid = NULL;
587 const struct cred *cred = NULL; 587 const struct cred *cred = NULL;
588 unsigned long flags; 588 unsigned long flags;
@@ -2599,7 +2599,7 @@ const struct file_operations usbdev_file_operations = {
2599static void usbdev_remove(struct usb_device *udev) 2599static void usbdev_remove(struct usb_device *udev)
2600{ 2600{
2601 struct usb_dev_state *ps; 2601 struct usb_dev_state *ps;
2602 struct siginfo sinfo; 2602 struct kernel_siginfo sinfo;
2603 2603
2604 while (!list_empty(&udev->filelist)) { 2604 while (!list_empty(&udev->filelist)) {
2605 ps = list_entry(udev->filelist.next, struct usb_dev_state, list); 2605 ps = list_entry(udev->filelist.next, struct usb_dev_state, list);