The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2794499bebefbd94ec109858e1b2cbbf60f6c76
commit c2794499bebefbd94ec109858e1b2cbbf60f6c76 Author: Jan Biedermann <j...@isomorfeus.com> AuthorDate: 2025-06-06 13:38:21 +0000 Commit: Warner Losh <i...@freebsd.org> CommitDate: 2025-06-11 23:16:21 +0000 usb: Don't call usb_msc_auto_quirk for UQ_MSC_IGNORE devices usb_msc_auto_quirk() potentially crashes usb devices with a hidden storage (see bug 287333). These devices may still operate normally if usb_msc_auto_quirk() would not be called all and the hidden storage is ignored. This patch makes sure, that usb_msc_auto_quirk() is not called when the UQ_MSC_IGNORE quirk is set for a device. It shouldn't be called anyway if the hidden storage supposed to be ignored. This gives users a chance to get their devices working by using 'usbconfig add_dev_quirk_vplh <vid> <pid> <lo_rev> <hi_rev> UQ_MSC_IGNORE'. Reviewed by: imp MFC After: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1716 Closes: https://github.com/freebsd/freebsd-src/pull/1716 --- sys/dev/usb/usb_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 49195bd0af38..60c2d6745b3f 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -2068,7 +2068,8 @@ repeat_set_config: usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_TEST_UNIT_READY) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0 && - usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { + usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0 && + usb_test_quirk(&uaa, UQ_MSC_IGNORE) == 0) { /* * Try to figure out if there are any MSC quirks we * should apply automatically: