login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
April
»
27
BAD PATCH: USB: remove use of the bus rwsem, as it doesn't really protect anything.
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Alan Cox <alan@...>
To: Linux Kernel Mailing List <linux-kernel@...>
Cc: <torvalds@...>
Subject:
BAD PATCH: USB: remove use of the bus rwsem, as it doesn't really protect anything.
Date: Friday, April 27, 2007 - 5:49 pm
Unless there is something I'm missing most of these patches seem totally unsafe.
quoted text
> --- a/drivers/usb/core/devices.c > +++ b/drivers/usb/core/devices.c > @@ -246,7 +246,6 @@ static char *usb_dump_interface_descriptor(char *start, char *end, > > if (start > end) > return start; > - down_read(&usb_bus_type.subsys.rwsem); > if (iface) { > driver_name = (iface->dev.driver > ? iface->dev.driver->name
iface->dev.driver can now become NULL during the evaluation above
quoted text
> @@ -444,8 +441,6 @@ static int releaseintf(struct dev_state *ps, unsigned int ifnum) > if (ifnum >= 8*sizeof(ps->ifclaimed)) > return err; > dev = ps->dev; > - /* lock against other changes to driver bindings */ > - down_write(&usb_bus_type.subsys.rwsem); > intf = usb_ifnum_to_if(dev, ifnum); > if (!intf) > err = -ENOENT; > @@ -453,7 +448,6 @@ static int releaseintf(struct dev_state *ps, unsigned int ifnum) > usb_driver_release_interface(&usbfs_driver, intf);
Which takes iface->dev.driver to NULL
quoted text
> err = 0; > } > - up_write(&usb_bus_type.subsys.rwsem); > return err; > } > > @@ -813,7 +807,6 @@ static int proc_getdriver(struct dev_state *ps, void __user *arg) > > if (copy_from_user(&gd, arg, sizeof(gd))) > return -EFAULT; > - down_read(&usb_bus_type.subsys.rwsem); > intf = usb_ifnum_to_if(ps->dev, gd.interface); > if (!intf || !intf->dev.driver) > ret = -ENODATA;
Ditto ... -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
BAD PATCH: USB: remove use of the bus rwsem, as it doesn't r...
, Alan Cox
, (Fri Apr 27, 5:49 pm)
Re: BAD PATCH: USB: remove use of the bus rwsem, as it doesn...
, Greg KH
, (Wed May 2, 12:26 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
debian developer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg Kroah-Hartman
[PATCH 002/196] Chinese: rephrase English introduction in HOWTO
Jan Engelhardt
intel iommu (Re: -mm merge plans for 2.6.23)
Vladislav Bolkhovitin
Re: Integration of SCST in the mainstream Linux kernel
git
:
linux-netdev
:
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 15/37] dccp: Set per-connection CCIDs via socket options
Antonio Almeida
HTB accuracy for high speed
David Miller
[GIT]: Networking
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
604 guests
online.
Online users
iamhealthy101
Syndicate