Skip to content
Commit 8889676c authored by jackysliu's avatar jackysliu Committed by Martin K. Petersen
Browse files

scsi: sd: Fix VPD page 0xb7 length check



sd_read_block_limits_ext() currently assumes that vpd->len excludes the
size of the page header. However, vpd->len describes the size of the entire
VPD page, therefore the sanity check is incorrect.

In practice this is not really a problem since we don't attach VPD
pages unless they actually report data trailing the header. But fix
the length check regardless.

This issue was identified by Wukong-Agent (formerly Tencent Woodpecker), a
code security AI agent, through static code analysis.

[mkp: rewrote patch description]

Signed-off-by: default avatarjackysliu <1972843537@qq.com>
Link: https://lore.kernel.org/r/tencent_ADA5210D1317EEB6CD7F3DE9FE9DA4591D05@qq.com


Fixes: 96b171d6 ("scsi: core: Query the Block Limits Extension VPD page")
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 00f452a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment