USB: change dev_WARN to dev_err triggerable from user space
Quoted 22 lines · Alan Stern
Quoted 11 lines · Johan Hovold
Quoted 10 lines · Oliver Neukum
Quoted 8 lines · Johan Hovold
Quoted 2 lines · Oliver Neukum
For those people who run with
panic_on_warnaWARN()triggered from user space is a DOS. It is worth returning todev_err()I think this should be
dev_warn()unless you want to bring back the returning of errors on these conditions as well (i.e. as was the case prior to0cb54a3e47cb("USB: debugging code shouldn't alter control flow")).Quoted 8 lines
Quoted 2 lines
Should I? A warning in syslog is pretty hardcore, so I have no idea whether
dev_warn()is enough.Perhaps there are two sides to this. If something really should not be happening and needs to be addressed (i.e. it's a driver bug) that
dev_WARNis warranted. If user space can be pass in bogus flags that gets propagated to USB core, perhaps those need to be sanitised sooner (in the vain of "don't trust anything coming from user space").
Quoted 8 lines
I'd go along with this. The usbfs code should fix or reject URBs submitted from userspace with bogus flags or an incorrect pipe value. (In fact, we already sanitize the flags to some extent, but we could do
more:ISO_ASAPshould apply only to isochronous URBs, andZERO_PACKETshould apply only to bulk-OUT URBS.)Similar errors coming from kernel drivers should be reported as actual bugs.
Very well, I am making a patch to do that.
Regards
Oliver