diff options
| author | Eric Biggers <[email protected]> | 2024-09-10 17:52:59 +0000 |
|---|---|---|
| committer | Mikulas Patocka <[email protected]> | 2024-09-11 12:04:41 +0000 |
| commit | 9c2010bccc0ce012f52de18ebd0c3add241f75b8 (patch) | |
| tree | 1f09bb76902e101475e301d3b1b3490b383bdb02 /drivers/usb/cdns3/cdns3-pci-wrap.c | |
| parent | dm-integrity: support recalculation in the 'I' mode (diff) | |
| download | kernel-9c2010bccc0ce012f52de18ebd0c3add241f75b8.tar.gz kernel-9c2010bccc0ce012f52de18ebd0c3add241f75b8.zip | |
dm-integrity: check mac_size against HASH_MAX_DIGESTSIZE in sb_mac()
sb_mac() verifies that the superblock + MAC don't exceed 512 bytes.
Because the superblock is currently 64 bytes, this really verifies
mac_size <= 448. This confuses smatch into thinking that mac_size may
be as large as 448, which is inconsistent with the later code that
assumes the MAC fits in a buffer of size HASH_MAX_DIGESTSIZE (64).
In fact mac_size <= HASH_MAX_DIGESTSIZE is guaranteed by the crypto API,
as that is the whole point of HASH_MAX_DIGESTSIZE. But, let's be
defensive and explicitly check for this. This suppresses the false
positive smatch warning. It does not fix an actual bug.
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Mikulas Patocka <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-pci-wrap.c')
0 files changed, 0 insertions, 0 deletions
