Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/dev/usb Pull up following revision(s) (requested by s...
details: https://anonhg.NetBSD.org/src/rev/62fc14103fd1
branches: netbsd-7
changeset: 447452:62fc14103fd1
user: martin <martin%NetBSD.org@localhost>
date: Fri Jan 11 15:58:23 2019 +0000
description:
Pull up following revision(s) (requested by skrll in ticket #1671):
sys/dev/usb/usbdi.c: revision 1.181
Avoid use after free when closing interrupt pipe transfer by calling
upm_close before destroying the interupt pipe xfer.
Found by kasan on wiz's machine.
diffstat:
sys/dev/usb/usbdi.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r 44781b46965f -r 62fc14103fd1 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c Mon Jan 07 14:01:02 2019 +0000
+++ b/sys/dev/usb/usbdi.c Fri Jan 11 15:58:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.161.2.3 2018/08/25 14:57:35 martin Exp $ */
+/* $NetBSD: usbdi.c,v 1.161.2.4 2019/01/11 15:58:23 martin Exp $ */
/*
* Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.161.2.3 2018/08/25 14:57:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.161.2.4 2019/01/11 15:58:23 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -254,13 +254,14 @@
LIST_REMOVE(pipe, up_next);
pipe->up_endpoint->ue_refcnt--;
+ pipe->up_methods->upm_close(pipe);
+
if (pipe->up_intrxfer != NULL) {
usbd_unlock_pipe(pipe);
usbd_destroy_xfer(pipe->up_intrxfer);
usbd_lock_pipe(pipe);
}
- pipe->up_methods->upm_close(pipe);
usbd_unlock_pipe(pipe);
kmem_free(pipe, pipe->up_dev->ud_bus->ub_pipesize);
Home |
Main Index |
Thread Index |
Old Index