Race condition when accessing authorized_default for a root hub

2019-08-05 Thread Thiébaud Weksteen
Hi, I believe there is a race condition for userland in hcd.c where the kernel sends a uevent before the underlying sysfs is fully populated: (drivers/usb/core/hcd.c) /* starting here, usbcore will pay attention to this root hub */ retval = register_root_hub(hcd); if

[PATCH] usb: setup authorized_default using usb_bus_notify

2019-08-06 Thread Thiébaud Weksteen
on the usb_bus_notify dispatcher. Signed-off-by: Thiébaud Weksteen --- drivers/usb/core/hcd.c | 123 --- drivers/usb/core/sysfs.c | 121 ++ drivers/usb/core/usb.h | 5 ++ 3 files changed, 126 insertions(+), 123 deletions

Re: [PATCH] usb: setup authorized_default using usb_bus_notify

2019-08-07 Thread Thiébaud Weksteen
Yes, it does. Thanks Thiebaud On Tue, Aug 6, 2019 at 1:37 PM Greg Kroah-Hartman wrote: > > On Tue, Aug 06, 2019 at 01:00:50PM +0200, Thiébaud Weksteen wrote: > > Currently, the authorized_default and interface_authorized_default > > attributes for HCD are set up after the ue