| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
scsi: add LBA boundary check for all read/write commands Previously only READ_10/WRITE_10 had LBA boundary validation in ScsiRequest::new(), leaving READ_6/12/16, WRITE_6/12/16, and WRITE_VERIFY_10/12/16 vulnerable to out-of-bounds access. Extend the check to cover all NON_EMULATE_SCSI_OPS (except SYNCHRONIZE_CACHE which doesn't use LBA-based addressing) and extract it into ScsiCommand::check_lba_invalid() for clarity. Fixes: 88c2490f ("scsi-bus: check read/write buffer size to avoid out of range") Signed-off-by: liuxiangdong <liuxiangdong5@huawei.com> (cherry picked from commit 6b2c38cc1dfe9f27b831bc3f35215eb63c627bf2) | 3 天前 | |
usbhost: introduce quirks mechanism During USB device passthrough, varying and hardware firmware quality leads to inconsistent behavior when handling set_config requests from the guest: 1. Some devices require an explicit set_config ioctl to properly activate their internal state machines, even if the target configuration is already active on the host OS 2. Other devices will crash, stall, or break functionality if they receive a redundant set_config request for the currently active configuration To resolve these compatibility issues, this patch introduces a static USB quirks mechanism: 1. Add the bitflags crate dependency to define UsbQuirk attributes (ALWAYS_SET_CONFIG and IGNORE_SET_CONFIG) 2. Implement a OnceLock based table to map specific device Vendor IDs and Product IDs (VID/PID) to their corresponding quirks 3. Update the UsbHost struct to query and store device quirks during the attachment phase 4. Refactor the set_config handler to fetch the device's current active configuration and evaluate it against the device's specific quirks before deciding whether to dispatch the actual ioctl to the host Signed-off-by: Fan Xuan Zhe <fanxuanzhe@huawei.com> (cherry picked from commit 97c83f638a995fcdccac216de07b4345deb6d663) | 3 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 天前 | ||
| 3 天前 |