]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic()
authorChengen Du <chengen.du@canonical.com>
Tue, 14 Jan 2025 04:12:34 +0000 (12:12 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 29 Jan 2025 19:58:31 +0000 (14:58 -0500)
commit07e0d99a2f701123ad3104c0f1a1e66bce74d6e5
treecdc89427b9b22837828adb61551a4529b8c651af
parente1e17a1715982201034024863efbf238bee2bdf9
iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic()

When performing an iSCSI boot using IPv6, iscsistart still reads the
/sys/firmware/ibft/ethernetX/subnet-mask entry. Since the IPv6 prefix
length is 64, this causes the shift exponent to become negative,
triggering a UBSAN warning. As the concept of a subnet mask does not
apply to IPv6, the value is set to ~0 to suppress the warning message.

Signed-off-by: Chengen Du <chengen.du@canonical.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/firmware/iscsi_ibft.c