Skip to content

Commit 8aa0f49

Browse files
committed
Merge tag 'stable/for-linus-6.14-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft
Pull ibft fixes from Konrad Rzeszutek Wilk: "Two tiny fixes to IBFT code: one for Kconfig and another for IPv6" * tag 'stable/for-linus-6.14-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft: iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry
2 parents a67d0a0 + 07e0d99 commit 8aa0f49

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

drivers/firmware/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ config ISCSI_IBFT
106106
select ISCSI_BOOT_SYSFS
107107
select ISCSI_IBFT_FIND if X86
108108
depends on ACPI && SCSI && SCSI_LOWLEVEL
109-
default n
109+
default n
110110
help
111111
This option enables support for detection and exposing of iSCSI
112112
Boot Firmware Table (iBFT) via sysfs to userspace. If you wish to

drivers/firmware/iscsi_ibft.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ static ssize_t ibft_attr_show_nic(void *data, int type, char *buf)
310310
str += sprintf_ipaddr(str, nic->ip_addr);
311311
break;
312312
case ISCSI_BOOT_ETH_SUBNET_MASK:
313-
val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
313+
if (nic->subnet_mask_prefix > 32)
314+
val = cpu_to_be32(~0);
315+
else
316+
val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
314317
str += sprintf(str, "%pI4", &val);
315318
break;
316319
case ISCSI_BOOT_ETH_PREFIX_LEN:

0 commit comments

Comments
 (0)