This issue was discovered by Jan Braunwarth when implementing the NVMe driver and full credit goes to him.
The b_blkno field of the buf struct uses 4-bytes int type and may cause overflow when block cache is used by bdev_read() and bdev_write() in devfs. To correct this, we changed the type to off_t.
This issue was discovered by Jan Braunwarth when implementing the NVMe driver and full credit goes to him.
The
b_blkno
field of thebuf
struct uses 4-bytesint
type and may cause overflow when block cache is used bybdev_read()
andbdev_write()
in devfs. To correct this, we changed the type tooff_t
.