1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00
Files
u-boot-megous/drivers
Bin Meng 52a5690efb nvme: Fix potential sign extension issue in nvme_blk_rw()
"lbas" with type "u16" (16 bits, unsigned) is promoted in
"lbas << ns->lba_shift" to type "int" (32 bits, signed), then
sign-extended to type "unsigned long long" (64 bits, unsigned).
If "lbas << ns->lba_shift" is greater than 0x7FFFFFFF, the upper
bits of the result will all be 1.

Fix it by casting "lbas" to "u32".

Reported-by: Coverity (CID: 166730)
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-09-03 15:30:33 -04:00
..
2017-06-01 07:03:13 -06:00
2017-08-16 08:30:24 -04:00
2017-08-16 08:30:24 -04:00
2017-08-13 15:17:37 -04:00
2017-08-30 09:03:11 +09:00
2017-08-24 11:00:47 +08:00
2017-07-28 23:34:44 +02:00
2017-07-28 12:02:47 -06:00
2017-06-01 19:56:54 -07:00
2017-08-30 09:07:04 +09:00
2017-08-16 08:30:24 -04:00
2017-06-01 07:03:10 -06:00
2017-06-01 07:03:01 -06:00
2017-06-01 07:03:01 -06:00
2017-09-01 10:40:59 -04:00
2017-08-13 15:17:31 -04:00