| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/06 17:14 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": [
"BLK_NVMEM",
"NVMEM",
"OF",
"BT"
],
"FocusSymbols": [
"blk_nvmem_reg_read",
"blk_nvmem_add",
"blk_nvmem_del",
"hci_dev_get_bd_addr_from_nvmem",
"of_get_nvmem_eui48"
],
"Reasoning": "The patch adds a new feature to expose block devices and partitions as NVMEM providers, allowing MAC and Bluetooth addresses to be read from them. It also modifies the Bluetooth core to read BD_ADDR from NVMEM. This introduces new reachable logic in the block layer and networking/bluetooth core that should be fuzzed.",
"WorthFuzzing": true
} |
| 1/1 | 2026/08/06 17:14 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit a527c7a18e8655e9fd4f7c61720c5bf0b8faa488\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Aug 6 17:14:40 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml\nindex a61d6c96df759..0422894508478 100644\n--- a/Documentation/devicetree/bindings/mmc/mmc-card.yaml\n+++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml\n@@ -38,7 +38,9 @@ patternProperties:\n properties:\n compatible:\n contains:\n- const: fixed-partitions\n+ enum:\n+ - fixed-partitions\n+ - fixed-layout\n \n required:\n - compatible\n@@ -86,6 +88,25 @@ examples:\n read-only;\n };\n };\n+\n+ partitions-boot2 {\n+ compatible = \"fixed-layout\";\n+\n+ #address-cells = \u003c1\u003e;\n+ #size-cells = \u003c1\u003e;\n+\n+ mac-addr@4400 {\n+ compatible = \"mac-base\";\n+ reg = \u003c0x4400 0x6\u003e;\n+ #nvmem-cell-cells = \u003c1\u003e;\n+ };\n+\n+ bd-addr@5400 {\n+ compatible = \"mac-base\";\n+ reg = \u003c0x5400 0x6\u003e;\n+ #nvmem-cell-cells = \u003c1\u003e;\n+ };\n+ };\n };\n };\n \ndiff --git a/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml b/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml\nindex c8e9c55c1afb4..7cb28f30c9af0 100644\n--- a/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml\n+++ b/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml\n@@ -22,4 +22,13 @@ properties:\n description:\n boot firmware is incorrectly passing the address in big-endian order\n \n+ nvmem-cells:\n+ maxItems: 1\n+ description:\n+ Nvmem data cell that contains a 6 byte BD address with the most\n+ significant byte first (big-endian).\n+\n+ nvmem-cell-names:\n+ const: local-bd-address\n+\n additionalProperties: true\ndiff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml\nindex d4f4d72ee0d38..7f9d16cb7c143 100644\n--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml\n+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml\n@@ -92,6 +92,22 @@ properties:\n \n ieee80211-freq-limit: true\n \n+ nvmem-cells:\n+ minItems: 1\n+ maxItems: 3\n+ description:\n+ References to nvmem cells for MAC address and/or calibration data.\n+ Supported cell names are mac-address, calibration, and pre-calibration.\n+\n+ nvmem-cell-names:\n+ minItems: 1\n+ maxItems: 3\n+ items:\n+ enum:\n+ - mac-address\n+ - calibration\n+ - pre-calibration\n+\n qcom,calibration-data:\n $ref: /schemas/types.yaml#/definitions/uint8-array\n description:\ndiff --git a/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts b/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts\nindex bf088fa9807f0..38839b8a361e7 100644\n--- a/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts\n+++ b/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts\n@@ -409,7 +409,33 @@ \u0026sdhc_1 {\n \tno-sdio;\n \tno-sd;\n \n+\t#address-cells = \u003c1\u003e;\n+\t#size-cells = \u003c0\u003e;\n+\n \tstatus = \"okay\";\n+\n+\tcard@0 {\n+\t\tcompatible = \"mmc-card\";\n+\t\treg = \u003c0\u003e;\n+\n+\t\tpartitions-boot1 {\n+\t\t\tcompatible = \"fixed-layout\";\n+\t\t\t#address-cells = \u003c1\u003e;\n+\t\t\t#size-cells = \u003c1\u003e;\n+\n+\t\t\twifi_mac_addr: mac-addr@4400 {\n+\t\t\t\tcompatible = \"mac-base\";\n+\t\t\t\treg = \u003c0x4400 0x6\u003e;\n+\t\t\t\t#nvmem-cell-cells = \u003c1\u003e;\n+\t\t\t};\n+\n+\t\t\tbd_addr: bd-addr@5400 {\n+\t\t\t\tcompatible = \"mac-base\";\n+\t\t\t\treg = \u003c0x5400 0x6\u003e;\n+\t\t\t\t#nvmem-cell-cells = \u003c1\u003e;\n+\t\t\t};\n+\t\t};\n+\t};\n };\n \n \u0026spi5 {\n@@ -512,6 +538,9 @@ bluetooth {\n \t\tvddch0-supply = \u003c\u0026pm4125_l22\u003e;\n \t\tenable-gpios = \u003c\u0026tlmm 87 GPIO_ACTIVE_HIGH\u003e;\n \t\tmax-speed = \u003c3000000\u003e;\n+\n+\t\tnvmem-cells = \u003c\u0026bd_addr 0\u003e;\n+\t\tnvmem-cell-names = \"local-bd-address\";\n \t};\n };\n \n@@ -557,6 +586,9 @@ \u0026wifi {\n \tqcom,ath10k-calibration-variant = \"ArduinoImola\";\n \tfirmware-name = \"qcm2290\";\n \n+\tnvmem-cells = \u003c\u0026wifi_mac_addr 0\u003e;\n+\tnvmem-cell-names = \"mac-address\";\n+\n \tstatus = \"okay\";\n };\n \ndiff --git a/block/Kconfig b/block/Kconfig\nindex 70e4a66d941ff..4899ad572c71f 100644\n--- a/block/Kconfig\n+++ b/block/Kconfig\n@@ -209,6 +209,17 @@ config BLK_INLINE_ENCRYPTION_FALLBACK\n \t by falling back to the kernel crypto API when inline\n \t encryption hardware is not present.\n \n+config BLK_NVMEM\n+\tbool \"Block device NVMEM provider\"\n+\tdepends on OF\n+\tdepends on NVMEM\n+\thelp\n+\t Allow block devices (or partitions) to act as NVMEM providers,\n+\t exposing factory-provisioned data such as MAC addresses or Wi-Fi\n+\t calibration blobs to the drivers that consume them. This is\n+\t typically used on embedded devices where such data is stored in a\n+\t dedicated area of an eMMC, instead of a separate EEPROM or OTP.\n+\n source \"block/partitions/Kconfig\"\n \n config BLK_PM\ndiff --git a/block/Makefile b/block/Makefile\nindex e7bd320e3d697..8200297fbcbab 100644\n--- a/block/Makefile\n+++ b/block/Makefile\n@@ -39,3 +39,4 @@ obj-$(CONFIG_BLK_INLINE_ENCRYPTION)\t+= blk-crypto.o blk-crypto-profile.o \\\n \t\t\t\t\t blk-crypto-sysfs.o\n obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK)\t+= blk-crypto-fallback.o\n obj-$(CONFIG_BLOCK_HOLDER_DEPRECATED)\t+= holder.o\n+obj-$(CONFIG_BLK_NVMEM) += blk-nvmem.o\ndiff --git a/block/blk-nvmem.c b/block/blk-nvmem.c\nnew file mode 100644\nindex 0000000000000..69b69184e1630\n--- /dev/null\n+++ b/block/blk-nvmem.c\n@@ -0,0 +1,112 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * block device NVMEM provider\n+ *\n+ * Copyright (c) 2024 Daniel Golle \u003cdaniel@makrotopia.org\u003e\n+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n+ *\n+ * Useful on devices using a whole disk or a partition (e.g. an eMMC boot\n+ * partition) to store MAC addresses, Bluetooth addresses or Wi-Fi\n+ * calibration EEPROM data.\n+ *\n+ * The NVMEM device is a side channel onto a block device that stays fully\n+ * usable. This is somewhat mitigated by opening the device exclusively.\n+ */\n+\n+#include \u003clinux/device.h\u003e\n+#include \u003clinux/file.h\u003e\n+#include \u003clinux/fs.h\u003e\n+#include \u003clinux/nvmem-provider.h\u003e\n+#include \u003clinux/nvmem-consumer.h\u003e\n+#include \u003clinux/of.h\u003e\n+#include \u003clinux/property.h\u003e\n+\n+#include \"blk.h\"\n+\n+static int blk_nvmem_reg_read(void *priv, unsigned int from,\n+\t\t\t void *val, size_t bytes)\n+{\n+\tstruct block_device *bdev = priv;\n+\tstruct file *bdev_file;\n+\tloff_t pos = from;\n+\tssize_t ret;\n+\n+\t/* open and prevent other exclusive openers */\n+\tbdev_file = bdev_file_open_by_dev(bdev-\u003ebd_dev,\n+\t\t\t\t\t BLK_OPEN_READ | BLK_OPEN_EXCL,\n+\t\t\t\t\t blk_nvmem_reg_read, NULL);\n+\tif (IS_ERR(bdev_file))\n+\t\treturn PTR_ERR(bdev_file);\n+\n+\tif (file_bdev(bdev_file) != bdev) {\n+\t\tfput(bdev_file);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tret = kernel_read(bdev_file, val, bytes, \u0026pos);\n+\tfput(bdev_file);\n+\n+\tif (ret \u003c 0)\n+\t\treturn ret;\n+\tif (ret != bytes)\n+\t\treturn -EIO;\n+\treturn 0;\n+}\n+\n+int blk_nvmem_add(struct block_device *bdev)\n+{\n+\tstruct device *dev = \u0026bdev-\u003ebd_device;\n+\tstruct device_node *np = dev_of_node(dev);\n+\tstruct nvmem_config config = {\n+\t\t.id\t\t= NVMEM_DEVID_NONE,\n+\t\t.owner\t\t= THIS_MODULE,\n+\t\t.word_size\t= 1,\n+\t\t.stride\t\t= 1,\n+\t\t.read_only\t= true,\n+\t\t.root_only\t= true,\n+\t\t.ignore_wp\t= true,\n+\t};\n+\tstruct nvmem_device *nvmem;\n+\tstruct device_node *child;\n+\n+\t/* skip devices which do not have a device tree node */\n+\tif (!np)\n+\t\treturn 0;\n+\n+\t/*\n+\t * The layout is described either by an \"nvmem-layout\" child node or\n+\t * by the device node itself being a \"fixed-layout\" container.\n+\t */\n+\tchild = of_get_child_by_name(np, \"nvmem-layout\");\n+\tif (child)\n+\t\tof_node_put(child);\n+\telse if (!of_device_is_compatible(np, \"fixed-layout\"))\n+\t\treturn 0;\n+\n+\tif (bdev_nr_bytes(bdev) \u003e INT_MAX) {\n+\t\tdev_warn(dev, \"block device too large to be an NVMEM\\n\");\n+\t\treturn 0;\n+\t}\n+\n+\tconfig.dev = dev;\n+\tconfig.name = dev_name(dev);\n+\tconfig.priv = bdev;\n+\tconfig.reg_read = blk_nvmem_reg_read;\n+\tconfig.size = bdev_nr_bytes(bdev);\n+\tconfig.of_node = np;\n+\n+\tnvmem = nvmem_register(\u0026config);\n+\tif (IS_ERR(nvmem))\n+\t\treturn dev_err_probe(dev, PTR_ERR(nvmem),\n+\t\t\t\t \"Failed to register NVMEM device\\n\");\n+\n+\tbdev-\u003ebd_nvmem = nvmem;\n+\n+\treturn 0;\n+}\n+\n+void blk_nvmem_del(struct block_device *bdev)\n+{\n+\tnvmem_unregister(bdev-\u003ebd_nvmem);\n+\tbdev-\u003ebd_nvmem = NULL;\n+}\ndiff --git a/block/blk.h b/block/blk.h\nindex eaac05815cb03..079edb9fbc37a 100644\n--- a/block/blk.h\n+++ b/block/blk.h\n@@ -817,4 +817,12 @@ static inline void blk_debugfs_unlock(struct request_queue *q,\n \tmemalloc_noio_restore(memflags);\n }\n \n+#ifdef CONFIG_BLK_NVMEM\n+int blk_nvmem_add(struct block_device *bdev);\n+void blk_nvmem_del(struct block_device *bdev);\n+#else\n+static inline int blk_nvmem_add(struct block_device *bdev) { return 0; }\n+static inline void blk_nvmem_del(struct block_device *bdev) {}\n+#endif\n+\n #endif /* BLK_INTERNAL_H */\ndiff --git a/block/genhd.c b/block/genhd.c\nindex df2c3c69b467d..fc632122fae8a 100644\n--- a/block/genhd.c\n+++ b/block/genhd.c\n@@ -417,6 +417,8 @@ static void add_disk_final(struct gendisk *disk)\n \t\t */\n \t\tdev_set_uevent_suppress(ddev, 0);\n \t\tdisk_uevent(disk, KOBJ_ADD);\n+\n+\t\tblk_nvmem_add(disk-\u003epart0);\n \t}\n \n \tblk_apply_bdi_limits(disk-\u003ebdi, \u0026disk-\u003equeue-\u003elimits);\n@@ -700,6 +702,8 @@ static void __del_gendisk(struct gendisk *disk)\n \n \tdisk_del_events(disk);\n \n+\tblk_nvmem_del(disk-\u003epart0);\n+\n \t/*\n \t * Prevent new openers by unlinked the bdev inode.\n \t */\ndiff --git a/block/partitions/check.h b/block/partitions/check.h\nindex b0997467b61a5..326081499d9a6 100644\n--- a/block/partitions/check.h\n+++ b/block/partitions/check.h\n@@ -17,6 +17,7 @@ struct parsed_partitions {\n \t\tint flags;\n \t\tbool has_info;\n \t\tstruct partition_meta_info info;\n+\t\tstruct fwnode_handle *fwnode;\n \t} *parts;\n \tint next;\n \tint limit;\ndiff --git a/block/partitions/core.c b/block/partitions/core.c\nindex b5c59b79ca7cb..c83227710584a 100644\n--- a/block/partitions/core.c\n+++ b/block/partitions/core.c\n@@ -11,6 +11,7 @@\n #include \u003clinux/sysfs.h\u003e\n #include \u003clinux/ctype.h\u003e\n #include \u003clinux/vmalloc.h\u003e\n+#include \u003clinux/property.h\u003e\n #include \u003clinux/raid/detect.h\u003e\n #include \"check.h\"\n \n@@ -110,8 +111,17 @@ static struct parsed_partitions *allocate_partitions(struct gendisk *hd)\n \treturn state;\n }\n \n+static void drop_partitions_fwnodes(struct parsed_partitions *state)\n+{\n+\tfor (int i = 0; i \u003c state-\u003elimit; i++) {\n+\t\tfwnode_handle_put(state-\u003eparts[i].fwnode);\n+\t\tstate-\u003eparts[i].fwnode = NULL;\n+\t}\n+}\n+\n static void free_partitions(struct parsed_partitions *state)\n {\n+\tdrop_partitions_fwnodes(state);\n \tvfree(state-\u003eparts);\n \tkfree(state);\n }\n@@ -139,6 +149,7 @@ static struct parsed_partitions *check_partition(struct gendisk *hd)\n \n \ti = res = err = 0;\n \twhile (!res \u0026\u0026 check_part[i]) {\n+\t\tdrop_partitions_fwnodes(state);\n \t\tmemset(state-\u003eparts, 0, state-\u003elimit * sizeof(state-\u003eparts[0]));\n \t\tres = check_part[i++](state);\n \t\tif (res \u003c 0) {\n@@ -247,6 +258,7 @@ static const struct attribute_group *part_attr_groups[] = {\n \n static void part_release(struct device *dev)\n {\n+\tfwnode_handle_put(dev_fwnode(dev));\n \tput_disk(dev_to_bdev(dev)-\u003ebd_disk);\n \tbdev_drop(dev_to_bdev(dev));\n }\n@@ -277,6 +289,8 @@ void drop_partition(struct block_device *part)\n \txa_erase(\u0026part-\u003ebd_disk-\u003epart_tbl, bdev_partno(part));\n \tkobject_put(part-\u003ebd_holder_dir);\n \n+\tblk_nvmem_del(part);\n+\n \tdevice_del(\u0026part-\u003ebd_device);\n \tput_device(\u0026part-\u003ebd_device);\n }\n@@ -294,7 +308,8 @@ static const DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL);\n */\n static struct block_device *add_partition(struct gendisk *disk, int partno,\n \t\t\t\tsector_t start, sector_t len, int flags,\n-\t\t\t\tstruct partition_meta_info *info)\n+\t\t\t\tstruct partition_meta_info *info,\n+\t\t\t\tstruct fwnode_handle *fwnode)\n {\n \tdev_t devt = MKDEV(0, 0);\n \tstruct device *ddev = disk_to_dev(disk);\n@@ -343,6 +358,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,\n \tpdev-\u003eclass = \u0026block_class;\n \tpdev-\u003etype = \u0026part_type;\n \tpdev-\u003eparent = ddev;\n+\tdevice_set_node(pdev, fwnode_handle_get(fwnode));\n \n \t/* in consecutive minor range? */\n \tif (bdev_partno(bdev) \u003c disk-\u003eminors) {\n@@ -392,6 +408,9 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,\n \t/* suppress uevent if the disk suppresses it */\n \tif (!dev_get_uevent_suppress(ddev))\n \t\tkobject_uevent(\u0026pdev-\u003ekobj, KOBJ_ADD);\n+\n+\tblk_nvmem_add(bdev);\n+\n \treturn bdev;\n \n out_del:\n@@ -449,7 +468,7 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,\n \t}\n \n \tpart = add_partition(disk, partno, start, length,\n-\t\t\tADDPART_FLAG_NONE, NULL);\n+\t\t\tADDPART_FLAG_NONE, NULL, NULL);\n \tret = PTR_ERR_OR_ZERO(part);\n out:\n \tmutex_unlock(\u0026disk-\u003eopen_mutex);\n@@ -564,7 +583,7 @@ static bool blk_add_partition(struct gendisk *disk,\n \t}\n \n \tpart = add_partition(disk, p, from, size, state-\u003eparts[p].flags,\n-\t\t\t \u0026state-\u003eparts[p].info);\n+\t\t\t \u0026state-\u003eparts[p].info, state-\u003eparts[p].fwnode);\n \tif (IS_ERR(part)) {\n \t\tif (PTR_ERR(part) != -ENXIO) {\n \t\t\tprintk(KERN_ERR \" %s: p%d could not be added: %pe\\n\",\ndiff --git a/block/partitions/of.c b/block/partitions/of.c\nindex 53664ea06b654..4fc7c80c407de 100644\n--- a/block/partitions/of.c\n+++ b/block/partitions/of.c\n@@ -3,6 +3,7 @@\n #include \u003clinux/blkdev.h\u003e\n #include \u003clinux/major.h\u003e\n #include \u003clinux/of.h\u003e\n+#include \u003clinux/property.h\u003e\n #include \u003clinux/string.h\u003e\n #include \"check.h\"\n \n@@ -62,6 +63,8 @@ static void add_of_partition(struct parsed_partitions *state, int slot,\n \t\tpartname = of_get_property(np, \"name\", \u0026len);\n \tstrscpy(info-\u003evolname, partname, sizeof(info-\u003evolname));\n \n+\tstate-\u003eparts[slot].fwnode = fwnode_handle_get(of_fwnode_handle(np));\n+\n \tseq_buf_printf(\u0026state-\u003epp_buf, \"(%s)\", info-\u003evolname);\n }\n \ndiff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c\nindex 10c496eaea2c1..3c6f021b76216 100644\n--- a/drivers/bluetooth/btqca.c\n+++ b/drivers/bluetooth/btqca.c\n@@ -723,8 +723,11 @@ static int qca_check_bdaddr(struct hci_dev *hdev, const struct qca_fw_config *co\n \t}\n \n \tbda = (struct hci_rp_read_bd_addr *)skb-\u003edata;\n-\tif (!bacmp(\u0026bda-\u003ebdaddr, \u0026config-\u003ebdaddr))\n+\tif (!bacmp(\u0026bda-\u003ebdaddr, \u0026config-\u003ebdaddr)) {\n \t\thci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY);\n+\t\thci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM);\n+\t\thci_set_quirk(hdev, HCI_QUIRK_BDADDR_NVMEM_BE);\n+\t}\n \n \tkfree_skb(skb);\n \ndiff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c\nindex b90584e1b99ea..efa631ce7283b 100644\n--- a/drivers/nvmem/layouts.c\n+++ b/drivers/nvmem/layouts.c\n@@ -167,7 +167,18 @@ static int nvmem_layout_bus_populate(struct nvmem_device *nvmem,\n \n struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem)\n {\n-\treturn of_get_child_by_name(nvmem-\u003edev.of_node, \"nvmem-layout\");\n+\tstruct device_node *np;\n+\n+\t/* Search for nvmem-layout child */\n+\tnp = of_get_child_by_name(nvmem-\u003edev.of_node, \"nvmem-layout\");\n+\tif (np)\n+\t\treturn np;\n+\n+\t/* The nvmem of_node is itself a fixed-layout node */\n+\tif (of_device_is_compatible(nvmem-\u003edev.of_node, \"fixed-layout\"))\n+\t\treturn of_node_get(nvmem-\u003edev.of_node);\n+\n+\treturn NULL;\n }\n EXPORT_SYMBOL_GPL(of_nvmem_layout_get_container);\n \ndiff --git a/include/linux/blk_types.h b/include/linux/blk_types.h\nindex 8808ee76e73c0..6ed173c649025 100644\n--- a/include/linux/blk_types.h\n+++ b/include/linux/blk_types.h\n@@ -15,6 +15,7 @@\n struct bio_set;\n struct bio;\n struct bio_integrity_payload;\n+struct nvmem_device;\n struct page;\n struct io_context;\n struct cgroup_subsys_state;\n@@ -73,6 +74,9 @@ struct block_device {\n \tint\t\t\tbd_writers;\n #ifdef CONFIG_SECURITY\n \tvoid\t\t\t*bd_security;\n+#endif\n+#ifdef CONFIG_BLK_NVMEM\n+\tstruct nvmem_device\t*bd_nvmem;\n #endif\n \t/*\n \t * keep this out-of-line as it's both big and not needed in the fast\ndiff --git a/include/linux/of_net.h b/include/linux/of_net.h\nindex d88715a0b3a52..7854ba555d9a5 100644\n--- a/include/linux/of_net.h\n+++ b/include/linux/of_net.h\n@@ -15,6 +15,7 @@ struct net_device;\n extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);\n extern int of_get_mac_address(struct device_node *np, u8 *mac);\n extern int of_get_mac_address_nvmem(struct device_node *np, u8 *mac);\n+int of_get_nvmem_eui48(struct device_node *np, const char *cell_name, u8 *addr);\n int of_get_ethdev_address(struct device_node *np, struct net_device *dev);\n extern struct net_device *of_find_net_device_by_node(struct device_node *np);\n #else\n@@ -34,6 +35,12 @@ static inline int of_get_mac_address_nvmem(struct device_node *np, u8 *mac)\n \treturn -ENODEV;\n }\n \n+static inline int of_get_nvmem_eui48(struct device_node *np,\n+\t\t\t\t const char *cell_name, u8 *addr)\n+{\n+\treturn -ENODEV;\n+}\n+\n static inline int of_get_ethdev_address(struct device_node *np, struct net_device *dev)\n {\n \treturn -ENODEV;\ndiff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h\nindex 50f0eef71fb19..74fa402504012 100644\n--- a/include/net/bluetooth/hci.h\n+++ b/include/net/bluetooth/hci.h\n@@ -161,6 +161,24 @@ enum {\n \t */\n \tHCI_QUIRK_BDADDR_PROPERTY_BROKEN,\n \n+\t/* When this quirk is set, the public Bluetooth address\n+\t * initially reported by HCI Read BD Address command\n+\t * is considered invalid. The public BD Address can be\n+\t * retrieved via a 'local-bd-address' NVMEM cell.\n+\t *\n+\t * This quirk can be set before hci_register_dev is called or\n+\t * during the hdev-\u003esetup vendor callback.\n+\t */\n+\tHCI_QUIRK_USE_BDADDR_NVMEM,\n+\n+\t/* When this quirk is set, the Bluetooth Device Address provided by\n+\t * the 'local-bd-address' NVMEM is stored in big-endian order.\n+\t *\n+\t * This quirk can be set before hci_register_dev is called or\n+\t * during the hdev-\u003esetup vendor callback.\n+\t */\n+\tHCI_QUIRK_BDADDR_NVMEM_BE,\n+\n \t/* When this quirk is set, the duplicate filtering during\n \t * scanning is based on Bluetooth devices addresses. To allow\n \t * RSSI based updates, restart scanning if needed.\ndiff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c\nindex c8d14128c363d..8132a1487ac25 100644\n--- a/net/bluetooth/hci_sync.c\n+++ b/net/bluetooth/hci_sync.c\n@@ -7,6 +7,7 @@\n */\n \n #include \u003clinux/property.h\u003e\n+#include \u003clinux/of_net.h\u003e\n \n #include \u003cnet/bluetooth/bluetooth.h\u003e\n #include \u003cnet/bluetooth/hci_core.h\u003e\n@@ -3701,6 +3702,39 @@ int hci_powered_update_sync(struct hci_dev *hdev)\n \treturn 0;\n }\n \n+/**\n+ * hci_dev_get_bd_addr_from_nvmem - Get the Bluetooth Device Address\n+ *\t\t\t\t (BD_ADDR) for a HCI device from\n+ *\t\t\t\t an NVMEM cell.\n+ * @hdev:\tThe HCI device\n+ *\n+ * Search for 'local-bd-address' NVMEM cell in the device firmware node.\n+ *\n+ * All-zero BD addresses are rejected (unprovisioned).\n+ *\n+ * Return: 0 on success, or a negative error code on failure.\n+ */\n+static int hci_dev_get_bd_addr_from_nvmem(struct hci_dev *hdev)\n+{\n+\tstruct device_node *np = dev_of_node(hdev-\u003edev.parent);\n+\tu8 ba[sizeof(bdaddr_t)];\n+\tint err;\n+\n+\tif (!np)\n+\t\treturn -ENODEV;\n+\n+\terr = of_get_nvmem_eui48(np, \"local-bd-address\", ba);\n+\tif (err)\n+\t\treturn err;\n+\n+\tif (hci_test_quirk(hdev, HCI_QUIRK_BDADDR_NVMEM_BE))\n+\t\tbaswap(\u0026hdev-\u003epublic_addr, (bdaddr_t *)ba);\n+\telse\n+\t\tbacpy(\u0026hdev-\u003epublic_addr, (bdaddr_t *)ba);\n+\n+\treturn 0;\n+}\n+\n /**\n * hci_dev_get_bd_addr_from_property - Get the Bluetooth Device Address\n *\t\t\t\t (BD_ADDR) for a HCI device from\n@@ -5180,12 +5214,17 @@ static int hci_dev_setup_sync(struct hci_dev *hdev)\n \t * its setup callback.\n \t */\n \tinvalid_bdaddr = hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) ||\n-\t\t\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY);\n+\t\t\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) ||\n+\t\t\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM);\n \tif (!ret) {\n \t\tif (hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) \u0026\u0026\n \t\t !bacmp(\u0026hdev-\u003epublic_addr, BDADDR_ANY))\n \t\t\thci_dev_get_bd_addr_from_property(hdev);\n \n+\t\tif (hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM) \u0026\u0026\n+\t\t !bacmp(\u0026hdev-\u003epublic_addr, BDADDR_ANY))\n+\t\t\thci_dev_get_bd_addr_from_nvmem(hdev);\n+\n \t\tif (invalid_bdaddr \u0026\u0026 bacmp(\u0026hdev-\u003epublic_addr, BDADDR_ANY) \u0026\u0026\n \t\t hdev-\u003eset_bdaddr) {\n \t\t\tret = hdev-\u003eset_bdaddr(hdev, \u0026hdev-\u003epublic_addr);\ndiff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c\nindex 167d75e345266..a39d763a4225a 100644\n--- a/net/bluetooth/mgmt.c\n+++ b/net/bluetooth/mgmt.c\n@@ -614,7 +614,8 @@ static bool is_configured(struct hci_dev *hdev)\n \t\treturn false;\n \n \tif ((hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) ||\n-\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY)) \u0026\u0026\n+\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) ||\n+\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM)) \u0026\u0026\n \t !bacmp(\u0026hdev-\u003epublic_addr, BDADDR_ANY))\n \t\treturn false;\n \n@@ -630,7 +631,8 @@ static __le32 get_missing_options(struct hci_dev *hdev)\n \t\toptions |= MGMT_OPTION_EXTERNAL_CONFIG;\n \n \tif ((hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) ||\n-\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY)) \u0026\u0026\n+\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) ||\n+\t hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM)) \u0026\u0026\n \t !bacmp(\u0026hdev-\u003epublic_addr, BDADDR_ANY))\n \t\toptions |= MGMT_OPTION_PUBLIC_ADDRESS;\n \ndiff --git a/net/core/of_net.c b/net/core/of_net.c\nindex 93ea425b9248a..999ca0e9258c4 100644\n--- a/net/core/of_net.c\n+++ b/net/core/of_net.c\n@@ -61,9 +61,7 @@ static int of_get_mac_addr(struct device_node *np, const char *name, u8 *addr)\n int of_get_mac_address_nvmem(struct device_node *np, u8 *addr)\n {\n \tstruct platform_device *pdev = of_find_device_by_node(np);\n-\tstruct nvmem_cell *cell;\n-\tconst void *mac;\n-\tsize_t len;\n+\tu8 mac[ETH_ALEN] __aligned(sizeof(u16));\n \tint ret;\n \n \t/* Try lookup by device first, there might be a nvmem_cell_lookup\n@@ -75,27 +73,57 @@ int of_get_mac_address_nvmem(struct device_node *np, u8 *addr)\n \t\treturn ret;\n \t}\n \n-\tcell = of_nvmem_cell_get(np, \"mac-address\");\n+\tret = of_get_nvmem_eui48(np, \"mac-address\", mac);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (!is_valid_ether_addr(mac))\n+\t\treturn -EINVAL;\n+\n+\tmemcpy(addr, mac, ETH_ALEN);\n+\treturn 0;\n+}\n+EXPORT_SYMBOL(of_get_mac_address_nvmem);\n+\n+/**\n+ * of_get_nvmem_eui48 - Read a 6-byte EUI-48 address from a named NVMEM cell.\n+ * @np:\t\tDevice node to look up the NVMEM cell from.\n+ * @cell_name:\tName of the NVMEM cell (e.g. \"mac-address\", \"local-bd-address\").\n+ * @addr:\tOutput buffer for the 6-byte address.\n+ *\n+ * Reads the named NVMEM cell and validates that it contains a non-zero 6-byte\n+ * address. Returns 0 on success, negative errno on failure.\n+ */\n+int of_get_nvmem_eui48(struct device_node *np, const char *cell_name, u8 *addr)\n+{\n+\tstruct nvmem_cell *cell;\n+\tconst void *eui48;\n+\tsize_t len;\n+\n+\tcell = of_nvmem_cell_get(np, cell_name);\n \tif (IS_ERR(cell))\n \t\treturn PTR_ERR(cell);\n \n-\tmac = nvmem_cell_read(cell, \u0026len);\n+\teui48 = nvmem_cell_read(cell, \u0026len);\n \tnvmem_cell_put(cell);\n \n-\tif (IS_ERR(mac))\n-\t\treturn PTR_ERR(mac);\n+\tif (IS_ERR(eui48))\n+\t\treturn PTR_ERR(eui48);\n \n-\tif (len != ETH_ALEN || !is_valid_ether_addr(mac)) {\n-\t\tkfree(mac);\n+\t/* Reject unprogrammed cells that read as all-zeroes or all-ones */\n+\tif (len != ETH_ALEN ||\n+\t !memchr_inv(eui48, 0x00, ETH_ALEN) ||\n+\t !memchr_inv(eui48, 0xff, ETH_ALEN)) {\n+\t\tkfree(eui48);\n \t\treturn -EINVAL;\n \t}\n \n-\tmemcpy(addr, mac, ETH_ALEN);\n-\tkfree(mac);\n+\tmemcpy(addr, eui48, ETH_ALEN);\n+\tkfree(eui48);\n \n \treturn 0;\n }\n-EXPORT_SYMBOL(of_get_mac_address_nvmem);\n+EXPORT_SYMBOL_GPL(of_get_nvmem_eui48);\n \n /**\n * of_get_mac_address()\n"
} |
| 2/1 | 2026/08/06 17:14 | agent | patch-evaluator |
1mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"BLK_NVMEM",
"NVMEM",
"OF",
"BT"
],
"FocusSymbols": [
"blk_nvmem_reg_read",
"blk_nvmem_add",
"blk_nvmem_del",
"hci_dev_get_bd_addr_from_nvmem",
"of_get_nvmem_eui48"
],
"Reasoning": "The patch adds a new feature to expose block devices and partitions as NVMEM providers, allowing MAC and Bluetooth addresses to be read from them. It also modifies the Bluetooth core to read BD_ADDR from NVMEM. This introduces new reachable logic in the block layer and networking/bluetooth core that should be fuzzed.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit a527c7a18e8655e9fd4f7c61720c5bf0b8faa488
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Aug 6 17:14:40 2026 +0000
syz-cluster: applied patch under review
diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
index a61d6c96df759..0422894508478 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-card.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
@@ -38,7 +38,9 @@ patternProperties:
properties:
compatible:
contains:
- const: fixed-partitions
+ enum:
+ - fixed-partitions
+ - fixed-layout
required:
- compatible
@@ -86,6 +88,25 @@ examples:
read-only;
};
};
+
+ partitions-boot2 {
+ compatible = "fixed-layout";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ mac-addr@4400 {
+ compatible = "mac-base";
+ reg = <0x4400 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+
+ bd-addr@5400 {
+ compatible = "mac-base";
+ reg = <0x5400 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
};
diff --git a/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml b/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml
index c8e9c55c1afb4..7cb28f30c9af0 100644
--- a/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml
+++ b/Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml
@@ -22,4 +22,13 @@ properties:
description:
boot firmware is incorrectly passing the address in big-endian order
+ nvmem-cells:
+ maxItems: 1
+ description:
+ Nvmem data cell that contains a 6 byte BD address with the most
+ significant byte first (big-endian).
+
+ nvmem-cell-names:
+ const: local-bd-address
+
additionalProperties: true
diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml
index d4f4d72ee0d38..7f9d16cb7c143 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml
@@ -92,6 +92,22 @@ properties:
ieee80211-freq-limit: true
+ nvmem-cells:
+ minItems: 1
+ maxItems: 3
+ description:
+ References to nvmem cells for MAC address and/or calibration data.
+ Supported cell names are mac-address, calibration, and pre-calibration.
+
+ nvmem-cell-names:
+ minItems: 1
+ maxItems: 3
+ items:
+ enum:
+ - mac-address
+ - calibration
+ - pre-calibration
+
qcom,calibration-data:
$ref: /schemas/types.yaml#/definitions/uint8-array
description:
diff --git a/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts b/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts
index bf088fa9807f0..38839b8a361e7 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts
@@ -409,7 +409,33 @@ &sdhc_1 {
no-sdio;
no-sd;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
status = "okay";
+
+ card@0 {
+ compatible = "mmc-card";
+ reg = <0>;
+
+ partitions-boot1 {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ wifi_mac_addr: mac-addr@4400 {
+ compatible = "mac-base";
+ reg = <0x4400 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+
+ bd_addr: bd-addr@5400 {
+ compatible = "mac-base";
+ reg = <0x5400 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
};
&spi5 {
@@ -512,6 +538,9 @@ bluetooth {
vddch0-supply = <&pm4125_l22>;
enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
max-speed = <3000000>;
+
+ nvmem-cells = <&bd_addr 0>;
+ nvmem-cell-names = "local-bd-address";
};
};
@@ -557,6 +586,9 @@ &wifi {
qcom,ath10k-calibration-variant = "ArduinoImola";
firmware-name = "qcm2290";
+ nvmem-cells = <&wifi_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
+
status = "okay";
};
diff --git a/block/Kconfig b/block/Kconfig
index 70e4a66d941ff..4899ad572c71f 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -209,6 +209,17 @@ config BLK_INLINE_ENCRYPTION_FALLBACK
by falling back to the kernel crypto API when inline
encryption hardware is not present.
+config BLK_NVMEM
+ bool "Block device NVMEM provider"
+ depends on OF
+ depends on NVMEM
+ help
+ Allow block devices (or partitions) to act as NVMEM providers,
+ exposing factory-provisioned data such as MAC addresses or Wi-Fi
+ calibration blobs to the drivers that consume them. This is
+ typically used on embedded devices where such data is stored in a
+ dedicated area of an eMMC, instead of a separate EEPROM or OTP.
+
source "block/partitions/Kconfig"
config BLK_PM
diff --git a/block/Makefile b/block/Makefile
index e7bd320e3d697..8200297fbcbab 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -39,3 +39,4 @@ obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += blk-crypto.o blk-crypto-profile.o \
blk-crypto-sysfs.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
obj-$(CONFIG_BLOCK_HOLDER_DEPRECATED) += holder.o
+obj-$(CONFIG_BLK_NVMEM) += blk-nvmem.o
diff --git a/block/blk-nvmem.c b/block/blk-nvmem.c
new file mode 100644
index 0000000000000..69b69184e1630
--- /dev/null
+++ b/block/blk-nvmem.c
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * block device NVMEM provider
+ *
+ * Copyright (c) 2024 Daniel Golle <daniel@makrotopia.org>
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ *
+ * Useful on devices using a whole disk or a partition (e.g. an eMMC boot
+ * partition) to store MAC addresses, Bluetooth addresses or Wi-Fi
+ * calibration EEPROM data.
+ *
+ * The NVMEM device is a side channel onto a block device that stays fully
+ * usable. This is somewhat mitigated by opening the device exclusively.
+ */
+
+#include <linux/device.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+#include <linux/nvmem-provider.h>
+#include <linux/nvmem-consumer.h>
+#include <linux/of.h>
+#include <linux/property.h>
+
+#include "blk.h"
+
+static int blk_nvmem_reg_read(void *priv, unsigned int from,
+ void *val, size_t bytes)
+{
+ struct block_device *bdev = priv;
+ struct file *bdev_file;
+ loff_t pos = from;
+ ssize_t ret;
+
+ /* open and prevent other exclusive openers */
+ bdev_file = bdev_file_open_by_dev(bdev->bd_dev,
+ BLK_OPEN_READ | BLK_OPEN_EXCL,
+ blk_nvmem_reg_read, NULL);
+ if (IS_ERR(bdev_file))
+ return PTR_ERR(bdev_file);
+
+ if (file_bdev(bdev_file) != bdev) {
+ fput(bdev_file);
+ return -ENODEV;
+ }
+
+ ret = kernel_read(bdev_file, val, bytes, &pos);
+ fput(bdev_file);
+
+ if (ret < 0)
+ return ret;
+ if (ret != bytes)
+ return -EIO;
+ return 0;
+}
+
+int blk_nvmem_add(struct block_device *bdev)
+{
+ struct device *dev = &bdev->bd_device;
+ struct device_node *np = dev_of_node(dev);
+ struct nvmem_config config = {
+ .id = NVMEM_DEVID_NONE,
+ .owner = THIS_MODULE,
+ .word_size = 1,
+ .stride = 1,
+ .read_only = true,
+ .root_only = true,
+ .ignore_wp = true,
+ };
+ struct nvmem_device *nvmem;
+ struct device_node *child;
+
+ /* skip devices which do not have a device tree node */
+ if (!np)
+ return 0;
+
+ /*
+ * The layout is described either by an "nvmem-layout" child node or
+ * by the device node itself being a "fixed-layout" container.
+ */
+ child = of_get_child_by_name(np, "nvmem-layout");
+ if (child)
+ of_node_put(child);
+ else if (!of_device_is_compatible(np, "fixed-layout"))
+ return 0;
+
+ if (bdev_nr_bytes(bdev) > INT_MAX) {
+ dev_warn(dev, "block device too large to be an NVMEM\n");
+ return 0;
+ }
+
+ config.dev = dev;
+ config.name = dev_name(dev);
+ config.priv = bdev;
+ config.reg_read = blk_nvmem_reg_read;
+ config.size = bdev_nr_bytes(bdev);
+ config.of_node = np;
+
+ nvmem = nvmem_register(&config);
+ if (IS_ERR(nvmem))
+ return dev_err_probe(dev, PTR_ERR(nvmem),
+ "Failed to register NVMEM device\n");
+
+ bdev->bd_nvmem = nvmem;
+
+ return 0;
+}
+
+void blk_nvmem_del(struct block_device *bdev)
+{
+ nvmem_unregister(bdev->bd_nvmem);
+ bdev->bd_nvmem = NULL;
+}
diff --git a/block/blk.h b/block/blk.h
index eaac05815cb03..079edb9fbc37a 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -817,4 +817,12 @@ static inline void blk_debugfs_unlock(struct request_queue *q,
memalloc_noio_restore(memflags);
}
+#ifdef CONFIG_BLK_NVMEM
+int blk_nvmem_add(struct block_device *bdev);
+void blk_nvmem_del(struct block_device *bdev);
+#else
+static inline int blk_nvmem_add(struct block_device *bdev) { return 0; }
+static inline void blk_nvmem_del(struct block_device *bdev) {}
+#endif
+
#endif /* BLK_INTERNAL_H */
diff --git a/block/genhd.c b/block/genhd.c
index df2c3c69b467d..fc632122fae8a 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -417,6 +417,8 @@ static void add_disk_final(struct gendisk *disk)
*/
dev_set_uevent_suppress(ddev, 0);
disk_uevent(disk, KOBJ_ADD);
+
+ blk_nvmem_add(disk->part0);
}
blk_apply_bdi_limits(disk->bdi, &disk->queue->limits);
@@ -700,6 +702,8 @@ static void __del_gendisk(struct gendisk *disk)
disk_del_events(disk);
+ blk_nvmem_del(disk->part0);
+
/*
* Prevent new openers by unlinked the bdev inode.
*/
diff --git a/block/partitions/check.h b/block/partitions/check.h
index b0997467b61a5..326081499d9a6 100644
--- a/block/partitions/check.h
+++ b/block/partitions/check.h
@@ -17,6 +17,7 @@ struct parsed_partitions {
int flags;
bool has_info;
struct partition_meta_info info;
+ struct fwnode_handle *fwnode;
} *parts;
int next;
int limit;
diff --git a/block/partitions/core.c b/block/partitions/core.c
index b5c59b79ca7cb..c83227710584a 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -11,6 +11,7 @@
#include <linux/sysfs.h>
#include <linux/ctype.h>
#include <linux/vmalloc.h>
+#include <linux/property.h>
#include <linux/raid/detect.h>
#include "check.h"
@@ -110,8 +111,17 @@ static struct parsed_partitions *allocate_partitions(struct gendisk *hd)
return state;
}
+static void drop_partitions_fwnodes(struct parsed_partitions *state)
+{
+ for (int i = 0; i < state->limit; i++) {
+ fwnode_handle_put(state->parts[i].fwnode);
+ state->parts[i].fwnode = NULL;
+ }
+}
+
static void free_partitions(struct parsed_partitions *state)
{
+ drop_partitions_fwnodes(state);
vfree(state->parts);
kfree(state);
}
@@ -139,6 +149,7 @@ static struct parsed_partitions *check_partition(struct gendisk *hd)
i = res = err = 0;
while (!res && check_part[i]) {
+ drop_partitions_fwnodes(state);
memset(state->parts, 0, state->limit * sizeof(state->parts[0]));
res = check_part[i++](state);
if (res < 0) {
@@ -247,6 +258,7 @@ static const struct attribute_group *part_attr_groups[] = {
static void part_release(struct device *dev)
{
+ fwnode_handle_put(dev_fwnode(dev));
put_disk(dev_to_bdev(dev)->bd_disk);
bdev_drop(dev_to_bdev(dev));
}
@@ -277,6 +289,8 @@ void drop_partition(struct block_device *part)
xa_erase(&part->bd_disk->part_tbl, bdev_partno(part));
kobject_put(part->bd_holder_dir);
+ blk_nvmem_del(part);
+
device_del(&part->bd_device);
put_device(&part->bd_device);
}
@@ -294,7 +308,8 @@ static const DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL);
*/
static struct block_device *add_partition(struct gendisk *disk, int partno,
sector_t start, sector_t len, int flags,
- struct partition_meta_info *info)
+ struct partition_meta_info *info,
+ struct fwnode_handle *fwnode)
{
dev_t devt = MKDEV(0, 0);
struct device *ddev = disk_to_dev(disk);
@@ -343,6 +358,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,
pdev->class = &block_class;
pdev->type = &part_type;
pdev->parent = ddev;
+ device_set_node(pdev, fwnode_handle_get(fwnode));
/* in consecutive minor range? */
if (bdev_partno(bdev) < disk->minors) {
@@ -392,6 +408,9 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,
/* suppress uevent if the disk suppresses it */
if (!dev_get_uevent_suppress(ddev))
kobject_uevent(&pdev->kobj, KOBJ_ADD);
+
+ blk_nvmem_add(bdev);
+
return bdev;
out_del:
@@ -449,7 +468,7 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,
}
part = add_partition(disk, partno, start, length,
- ADDPART_FLAG_NONE, NULL);
+ ADDPART_FLAG_NONE, NULL, NULL);
ret = PTR_ERR_OR_ZERO(part);
out:
mutex_unlock(&disk->open_mutex);
@@ -564,7 +583,7 @@ static bool blk_add_partition(struct gendisk *disk,
}
part = add_partition(disk, p, from, size, state->parts[p].flags,
- &state->parts[p].info);
+ &state->parts[p].info, state->parts[p].fwnode);
if (IS_ERR(part)) {
if (PTR_ERR(part) != -ENXIO) {
printk(KERN_ERR " %s: p%d could not be added: %pe\n",
diff --git a/block/partitions/of.c b/block/partitions/of.c
index 53664ea06b654..4fc7c80c407de 100644
--- a/block/partitions/of.c
+++ b/block/partitions/of.c
@@ -3,6 +3,7 @@
#include <linux/blkdev.h>
#include <linux/major.h>
#include <linux/of.h>
+#include <linux/property.h>
#include <linux/string.h>
#include "check.h"
@@ -62,6 +63,8 @@ static void add_of_partition(struct parsed_partitions *state, int slot,
partname = of_get_property(np, "name", &len);
strscpy(info->volname, partname, sizeof(info->volname));
+ state->parts[slot].fwnode = fwnode_handle_get(of_fwnode_handle(np));
+
seq_buf_printf(&state->pp_buf, "(%s)", info->volname);
}
diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 10c496eaea2c1..3c6f021b76216 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -723,8 +723,11 @@ static int qca_check_bdaddr(struct hci_dev *hdev, const struct qca_fw_config *co
}
bda = (struct hci_rp_read_bd_addr *)skb->data;
- if (!bacmp(&bda->bdaddr, &config->bdaddr))
+ if (!bacmp(&bda->bdaddr, &config->bdaddr)) {
hci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY);
+ hci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM);
+ hci_set_quirk(hdev, HCI_QUIRK_BDADDR_NVMEM_BE);
+ }
kfree_skb(skb);
diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c
index b90584e1b99ea..efa631ce7283b 100644
--- a/drivers/nvmem/layouts.c
+++ b/drivers/nvmem/layouts.c
@@ -167,7 +167,18 @@ static int nvmem_layout_bus_populate(struct nvmem_device *nvmem,
struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem)
{
- return of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout");
+ struct device_node *np;
+
+ /* Search for nvmem-layout child */
+ np = of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout");
+ if (np)
+ return np;
+
+ /* The nvmem of_node is itself a fixed-layout node */
+ if (of_device_is_compatible(nvmem->dev.of_node, "fixed-layout"))
+ return of_node_get(nvmem->dev.of_node);
+
+ return NULL;
}
EXPORT_SYMBOL_GPL(of_nvmem_layout_get_container);
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 8808ee76e73c0..6ed173c649025 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -15,6 +15,7 @@
struct bio_set;
struct bio;
struct bio_integrity_payload;
+struct nvmem_device;
struct page;
struct io_context;
struct cgroup_subsys_state;
@@ -73,6 +74,9 @@ struct block_device {
int bd_writers;
#ifdef CONFIG_SECURITY
void *bd_security;
+#endif
+#ifdef CONFIG_BLK_NVMEM
+ struct nvmem_device *bd_nvmem;
#endif
/*
* keep this out-of-line as it's both big and not needed in the fast
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index d88715a0b3a52..7854ba555d9a5 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -15,6 +15,7 @@ struct net_device;
extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
extern int of_get_mac_address(struct device_node *np, u8 *mac);
extern int of_get_mac_address_nvmem(struct device_node *np, u8 *mac);
+int of_get_nvmem_eui48(struct device_node *np, const char *cell_name, u8 *addr);
int of_get_ethdev_address(struct device_node *np, struct net_device *dev);
extern struct net_device *of_find_net_device_by_node(struct device_node *np);
#else
@@ -34,6 +35,12 @@ static inline int of_get_mac_address_nvmem(struct device_node *np, u8 *mac)
return -ENODEV;
}
+static inline int of_get_nvmem_eui48(struct device_node *np,
+ const char *cell_name, u8 *addr)
+{
+ return -ENODEV;
+}
+
static inline int of_get_ethdev_address(struct device_node *np, struct net_device *dev)
{
return -ENODEV;
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 50f0eef71fb19..74fa402504012 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -161,6 +161,24 @@ enum {
*/
HCI_QUIRK_BDADDR_PROPERTY_BROKEN,
+ /* When this quirk is set, the public Bluetooth address
+ * initially reported by HCI Read BD Address command
+ * is considered invalid. The public BD Address can be
+ * retrieved via a 'local-bd-address' NVMEM cell.
+ *
+ * This quirk can be set before hci_register_dev is called or
+ * during the hdev->setup vendor callback.
+ */
+ HCI_QUIRK_USE_BDADDR_NVMEM,
+
+ /* When this quirk is set, the Bluetooth Device Address provided by
+ * the 'local-bd-address' NVMEM is stored in big-endian order.
+ *
+ * This quirk can be set before hci_register_dev is called or
+ * during the hdev->setup vendor callback.
+ */
+ HCI_QUIRK_BDADDR_NVMEM_BE,
+
/* When this quirk is set, the duplicate filtering during
* scanning is based on Bluetooth devices addresses. To allow
* RSSI based updates, restart scanning if needed.
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index c8d14128c363d..8132a1487ac25 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -7,6 +7,7 @@
*/
#include <linux/property.h>
+#include <linux/of_net.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
@@ -3701,6 +3702,39 @@ int hci_powered_update_sync(struct hci_dev *hdev)
return 0;
}
+/**
+ * hci_dev_get_bd_addr_from_nvmem - Get the Bluetooth Device Address
+ * (BD_ADDR) for a HCI device from
+ * an NVMEM cell.
+ * @hdev: The HCI device
+ *
+ * Search for 'local-bd-address' NVMEM cell in the device firmware node.
+ *
+ * All-zero BD addresses are rejected (unprovisioned).
+ *
+ * Return: 0 on success, or a negative error code on failure.
+ */
+static int hci_dev_get_bd_addr_from_nvmem(struct hci_dev *hdev)
+{
+ struct device_node *np = dev_of_node(hdev->dev.parent);
+ u8 ba[sizeof(bdaddr_t)];
+ int err;
+
+ if (!np)
+ return -ENODEV;
+
+ err = of_get_nvmem_eui48(np, "local-bd-address", ba);
+ if (err)
+ return err;
+
+ if (hci_test_quirk(hdev, HCI_QUIRK_BDADDR_NVMEM_BE))
+ baswap(&hdev->public_addr, (bdaddr_t *)ba);
+ else
+ bacpy(&hdev->public_addr, (bdaddr_t *)ba);
+
+ return 0;
+}
+
/**
* hci_dev_get_bd_addr_from_property - Get the Bluetooth Device Address
* (BD_ADDR) for a HCI device from
@@ -5180,12 +5214,17 @@ static int hci_dev_setup_sync(struct hci_dev *hdev)
* its setup callback.
*/
invalid_bdaddr = hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) ||
- hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY);
+ hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) ||
+ hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM);
if (!ret) {
if (hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) &&
!bacmp(&hdev->public_addr, BDADDR_ANY))
hci_dev_get_bd_addr_from_property(hdev);
+ if (hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM) &&
+ !bacmp(&hdev->public_addr, BDADDR_ANY))
+ hci_dev_get_bd_addr_from_nvmem(hdev);
+
if (invalid_bdaddr && bacmp(&hdev->public_addr, BDADDR_ANY) &&
hdev->set_bdaddr) {
ret = hdev->set_bdaddr(hdev, &hdev->public_addr);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 167d75e345266..a39d763a4225a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -614,7 +614,8 @@ static bool is_configured(struct hci_dev *hdev)
return false;
if ((hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) ||
- hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY)) &&
+ hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) ||
+ hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM)) &&
!bacmp(&hdev->public_addr, BDADDR_ANY))
return false;
@@ -630,7 +631,8 @@ static __le32 get_missing_options(struct hci_dev *hdev)
options |= MGMT_OPTION_EXTERNAL_CONFIG;
if ((hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) ||
- hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY)) &&
+ hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) ||
+ hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_NVMEM)) &&
!bacmp(&hdev->public_addr, BDADDR_ANY))
options |= MGMT_OPTION_PUBLIC_ADDRESS;
diff --git a/net/core/of_net.c b/net/core/of_net.c
index 93ea425b9248a..999ca0e9258c4 100644
--- a/net/core/of_net.c
+++ b/net/core/of_net.c
@@ -61,9 +61,7 @@ static int of_get_mac_addr(struct device_node *np, const char *name, u8 *addr)
int of_get_mac_address_nvmem(struct device_node *np, u8 *addr)
{
struct platform_device *pdev = of_find_device_by_node(np);
- struct nvmem_cell *cell;
- const void *mac;
- size_t len;
+ u8 mac[ETH_ALEN] __aligned(sizeof(u16));
int ret;
/* Try lookup by device first, there might be a nvmem_cell_lookup
@@ -75,27 +73,57 @@ int of_get_mac_address_nvmem(struct device_node *np, u8 *addr)
return ret;
}
- cell = of_nvmem_cell_get(np, "mac-address");
+ ret = of_get_nvmem_eui48(np, "mac-address", mac);
+ if (ret)
+ return ret;
+
+ if (!is_valid_ether_addr(mac))
+ return -EINVAL;
+
+ memcpy(addr, mac, ETH_ALEN);
+ return 0;
+}
+EXPORT_SYMBOL(of_get_mac_address_nvmem);
+
+/**
+ * of_get_nvmem_eui48 - Read a 6-byte EUI-48 address from a named NVMEM cell.
+ * @np: Device node to look up the NVMEM cell from.
+ * @cell_name: Name of the NVMEM cell (e.g. "mac-address", "local-bd-address").
+ * @addr: Output buffer for the 6-byte address.
+ *
+ * Reads the named NVMEM cell and validates that it contains a non-zero 6-byte
+ * address. Returns 0 on success, negative errno on failure.
+ */
+int of_get_nvmem_eui48(struct device_node *np, const char *cell_name, u8 *addr)
+{
+ struct nvmem_cell *cell;
+ const void *eui48;
+ size_t len;
+
+ cell = of_nvmem_cell_get(np, cell_name);
if (IS_ERR(cell))
return PTR_ERR(cell);
- mac = nvmem_cell_read(cell, &len);
+ eui48 = nvmem_cell_read(cell, &len);
nvmem_cell_put(cell);
- if (IS_ERR(mac))
- return PTR_ERR(mac);
+ if (IS_ERR(eui48))
+ return PTR_ERR(eui48);
- if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
- kfree(mac);
+ /* Reject unprogrammed cells that read as all-zeroes or all-ones */
+ if (len != ETH_ALEN ||
+ !memchr_inv(eui48, 0x00, ETH_ALEN) ||
+ !memchr_inv(eui48, 0xff, ETH_ALEN)) {
+ kfree(eui48);
return -EINVAL;
}
- memcpy(addr, mac, ETH_ALEN);
- kfree(mac);
+ memcpy(addr, eui48, ETH_ALEN);
+ kfree(eui48);
return 0;
}
-EXPORT_SYMBOL(of_get_mac_address_nvmem);
+EXPORT_SYMBOL_GPL(of_get_nvmem_eui48);
/**
* of_get_mac_address()
|
| 3/2 | 2026/08/06 17:14 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11647 output: 21 thoughts: 761 Thoughts: **Fuzzing Target Identification: NVMEM and Block/Network Interface Integration** Okay, let's break this down systematically. My initial assessment indicates this patch series introduces potential functional changes to the kernel that *definitely* warrant fuzzing. We have several areas here, so I'll need to confirm the impact of each. First, there are documentation and Device Tree changes (devicetree bindings and qrb2210-arduino-imola.dts). These are unlikely to be fuzz targets directly, though incorrect documentation can lead to indirect issues. However, the meat of the series is more interesting. We're looking at a new NVMEM integration with the block layer (CONFIG_BLK_NVMEM). This involves adding `blk-nvmem.c` and modifying existing block layer files (`genhd.c`, `core.c`, `of.c`) to register NVMEM devices for block devices and partitions. The Bluetooth changes are also relevant as it sets a quirk (`HCI_QUIRK_USE_BDADDR_NVMEM`) and modifies Bluetooth code (`btqca.c`, `hci_sync.c`, `mgmt.c`) to read the Bluetooth Device Address (BD_ADDR) from NVMEM. There are also changes to NVMEM layout (`layouts.c`) to support fixed-layout nodes and, finally, changes to Net core (`of_net.c`) to add `of_get_nvmem_eui48` and refactor `of_get_mac_address_nvmem`. Crucially, the block layer changes and the net core changes, specifically the interaction with `of_get_nvmem_eui48` are directly functional and reachable. The block layer code is reachable when a block device is added, conditional on `CONFIG_BLK_NVMEM`. The Bluetooth code is reachable when a Bluetooth device is initialized, if the quirk is set. Let's dig in. I need to confirm whether `CONFIG_BLK_NVMEM` can be enabled or is enabled. It depends on `OF` and `NVMEM`, which are likely enabled on any modern system. Further, `blk_nvmem_add` is called from `add_disk_final` and `add_partition`, meaning it is directly reachable through block device operations. And `of_get_nvmem_eui48` is called from `of_get_mac_address_nvmem` and `hci_dev_get_bd_addr_from_nvmem`, so we can reach this with a BT device. So, is this worth fuzzing? Absolutely! We're adding a *new* method to expose block devices as NVMEM providers, and this involves reading MAC/BD addresses from NVMEM. The block device NVMEM provider reads from the block device using `kernel_read` on a block device file. Wait, even better, `blk_nvmem_reg_read` opens the block device *exclusively* and reads from it, which means we can trigger this read through the NVMEM sysfs interface, or indirectly through other kernel subsystems that consume NVMEM. This could reveal interesting interactions. Therefore, I need to focus on these functions: * `blk_nvmem_reg_read` * `blk_nvmem_add` * `blk_nvmem_del` * `hci_dev_get_bd_addr_from_nvmem` * `of_get_nvmem_eui48` For the configuration, I'll definitely need to enable these: * `BLK_NVMEM` * `NVMEM` * `OF` Now, let's verify those config options and make sure my assumptions hold. |
| 4/2 | 2026/08/06 17:15 | tool | grepper |
0mArgs:{
"Expression": "config BLK_NVMEM"
}Results: {
"Output": "block/Kconfig=202=config BLK_INLINE_ENCRYPTION_FALLBACK\n--\nblock/Kconfig-211-\nblock/Kconfig:212:config BLK_NVMEM\nblock/Kconfig-213-\tbool \"Block device NVMEM provider\"\n"
} |
| 5/2 | 2026/08/06 17:15 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 13331 output: 26 thoughts: 101 Thoughts: **Analyzing Configuration Options for Non-Volatile Memory** Okay, so I'm looking at these configuration options: `BLK_NVMEM`, `NVMEM`, and `OF`. My immediate thought is, "Wait, `OF`...that's Open Firmware, right?" That typically shows up in ARM or PowerPC systems, usually coupled with Device Tree. I remember there's a possibility to enable it on x86, maybe through `OF_UNITTEST` or something like that for testing purposes. Actually, let me clarify, `OF` corresponds to `CONFIG_OF`. Just to confirm, I'll need to check the function `of_get_nvmem_eui48` in the `net/core/of_net.c` file. This should give me a more direct understanding of how Open Firmware is related to non-volatile memory in this context. |
| 6/2 | 2026/08/06 17:15 | tool | grepper |
0mArgs:{
"Expression": "int of_get_nvmem_eui48"
}Results: {
"Output": "include/linux/of_net.h=17=extern int of_get_mac_address_nvmem(struct device_node *np, u8 *mac);\ninclude/linux/of_net.h:18:int of_get_nvmem_eui48(struct device_node *np, const char *cell_name, u8 *addr);\ninclude/linux/of_net.h-19-int of_get_ethdev_address(struct device_node *np, struct net_device *dev);\n--\ninclude/linux/of_net.h=33=static inline int of_get_mac_address_nvmem(struct device_node *np, u8 *mac)\n--\ninclude/linux/of_net.h-37-\ninclude/linux/of_net.h:38:static inline int of_get_nvmem_eui48(struct device_node *np,\ninclude/linux/of_net.h-39-\t\t\t\t const char *cell_name, u8 *addr)\n--\nnet/core/of_net.c=86=EXPORT_SYMBOL(of_get_mac_address_nvmem);\n--\nnet/core/of_net.c-96- */\nnet/core/of_net.c:97:int of_get_nvmem_eui48(struct device_node *np, const char *cell_name, u8 *addr)\nnet/core/of_net.c-98-{\n"
} |
| 7/2 | 2026/08/06 17:15 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 14012 output: 22 thoughts: 14 Thoughts: Okay, here's my interpretation of that thought process, assuming I'm deep in the code as an expert: **Investigating `blk_nvmem_reg_read`** Alright, time to dive in. My mind immediately goes to the function name, `blk_nvmem_reg_read`. Right, that's the one we use for reading those non-volatile memory registers within the block device subsystem. I'm going to start by confirming my understanding: It's likely handling the low-level interaction, abstracting away some of the hardware details for the upper layers. I need to refresh my memory on its role in the complete workflow and double check its exact purpose in context. Let's see how it’s implemented and where it's being called. My goal is to understand how it handles the reading from a non-volatile memory region, what error checks are implemented, and how it reports potential issues. It's a critical piece, and I need to be completely clear on its behavior before I continue. |
| 8/2 | 2026/08/06 17:15 | tool | grepper |
0mArgs:{
"Expression": "blk_nvmem_reg_read"
}Results: {
"Output": "block/blk-nvmem.c-25-\nblock/blk-nvmem.c:26:static int blk_nvmem_reg_read(void *priv, unsigned int from,\nblock/blk-nvmem.c-27-\t\t\t void *val, size_t bytes)\n--\nblock/blk-nvmem.c-36-\t\t\t\t\t BLK_OPEN_READ | BLK_OPEN_EXCL,\nblock/blk-nvmem.c:37:\t\t\t\t\t blk_nvmem_reg_read, NULL);\nblock/blk-nvmem.c-38-\tif (IS_ERR(bdev_file))\n--\nblock/blk-nvmem.c=56=int blk_nvmem_add(struct block_device *bdev)\n--\nblock/blk-nvmem.c-93-\tconfig.priv = bdev;\nblock/blk-nvmem.c:94:\tconfig.reg_read = blk_nvmem_reg_read;\nblock/blk-nvmem.c-95-\tconfig.size = bdev_nr_bytes(bdev);\n"
} |
| 9/2 | 2026/08/06 17:15 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 14541 output: 23 thoughts: 234 Thoughts: **My Assessment of the Key Functions and Configuration Dependencies** Okay, so I'm looking at this code and trying to get a handle on the core changes and dependencies. It seems the primary functions to focus on are `blk_nvmem_reg_read`, `blk_nvmem_add`, `blk_nvmem_del`, `hci_dev_get_bd_addr_from_nvmem`, and `of_get_nvmem_eui48`. These are the functions driving the new functionality tied into NVMe memory. Now, regarding the configurations. `BLK_NVMEM` is obviously the most important one here; it's the core enabler of this entire feature. Then we have bluetooth. My initial thought was `BT_HCIUART_QCA` because I saw `btqca.c` mentioned. But, the quirk handling appears to be in the core bluetooth code, meaning just `BT` should cover core functionality. However, I need to keep in mind that the quirk *is* set within `btqca.c`, and that `hci_dev_get_bd_addr_from_nvmem` is in `hci_sync.c` which is core bluetooth. So, it might be that `BT_QCA` or even `BT_HCIUART_QCA` are necessary to get the quirk activated. I'll need to double-check that. Ultimately, I'll need to check the config in `btqca.c`. |
| 10/2 | 2026/08/06 17:15 | tool | grepper |
0mArgs:{
"Expression": "config BT_HCIUART_QCA"
}Results: {
"Output": "drivers/bluetooth/Kconfig=227=config BT_HCIUART_RTL\n--\ndrivers/bluetooth/Kconfig-240-\ndrivers/bluetooth/Kconfig:241:config BT_HCIUART_QCA\ndrivers/bluetooth/Kconfig-242-\tbool \"Qualcomm Atheros protocol support\"\n"
} |
| 11/2 | 2026/08/06 17:15 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 15207 output: 28 thoughts: 75 Thoughts: Okay, here's my summary, considering my expertise: **Checking Bluetooth HCI Initialization with NVMEM and OF** Alright, let's get down to brass tacks. I'm going to make sure the Bluetooth HCI initialization is correctly handled, which means I absolutely *must* account for `BLK_NVMEM` and `BT_HCIUART_QCA`, or just `BT` in general, during this process. In particular, I also know that `OF` is essential when we're dealing with `BLK_NVMEM`. Now, before I commit to anything, I need to verify how the Bluetooth device's BD address is retrieved from NV memory. To do this, I will need to double-check the function `hci_dev_get_bd_addr_from_nvmem`, specifically looking in `net/bluetooth/hci_sync.c`. I need to ensure the logic there properly integrates with both the NVMEM handling and any quirks related to QCA based UART implementations that might be present. |
| 12/2 | 2026/08/06 17:15 | tool | grepper |
0mArgs:{
"Expression": "hci_dev_get_bd_addr_from_nvmem"
}Results: {
"Output": "net/bluetooth/hci_sync.c=3647=int hci_powered_update_sync(struct hci_dev *hdev)\n--\nnet/bluetooth/hci_sync.c-3705-/**\nnet/bluetooth/hci_sync.c:3706: * hci_dev_get_bd_addr_from_nvmem - Get the Bluetooth Device Address\nnet/bluetooth/hci_sync.c-3707- *\t\t\t\t (BD_ADDR) for a HCI device from\n--\nnet/bluetooth/hci_sync.c-3716- */\nnet/bluetooth/hci_sync.c:3717:static int hci_dev_get_bd_addr_from_nvmem(struct hci_dev *hdev)\nnet/bluetooth/hci_sync.c-3718-{\n--\nnet/bluetooth/hci_sync.c=5190=static int hci_dev_setup_sync(struct hci_dev *hdev)\n--\nnet/bluetooth/hci_sync.c-5225-\t\t !bacmp(\u0026hdev-\u003epublic_addr, BDADDR_ANY))\nnet/bluetooth/hci_sync.c:5226:\t\t\thci_dev_get_bd_addr_from_nvmem(hdev);\nnet/bluetooth/hci_sync.c-5227-\n"
} |
| 13/2 | 2026/08/06 17:15 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 15858 output: 18 thoughts: 164 Thoughts: **Analyzing the Block Device NVMEM Integration** Okay, so this patch is introducing a cool new functionality: making block devices accessible as NVMEM providers. That's interesting, and it looks like it's already functional and reachable, which is always a good start. The core idea seems to be reading MAC/BD addresses directly from the NVMEM. My focus is naturally drawn to these symbols: `blk_nvmem_reg_read`, `blk_nvmem_add`, `blk_nvmem_del`, `hci_dev_get_bd_addr_from_nvmem`, and `of_get_nvmem_eui48`. They pretty much spell out the implementation: reading, adding, deleting, getting BD addresses, and retrieving EUI48 from the device tree, respectively. It gives me a good idea of the code's high-level flow. Now, let's look at the configs: `BLK_NVMEM`, `OF`, and `NVMEM`. I'm guessing `BLK_NVMEM` is the primary feature flag for this new functionality. `OF`, of course, is Device Tree related. Then there's `NVMEM`, but wait a second... `NVMEM` is a *subsystem*! I need to be sure. I'm going to quickly check if `CONFIG_NVMEM` is a bool or tristate. That's crucial; I need to know the configuration dependencies and how deeply it's integrated with the core NVMEM infrastructure. This will tell me how well this new feature adheres to the existing design. |
| 14/2 | 2026/08/06 17:15 | tool | grepper |
0mArgs:{
"Expression": "config NVMEM"
}Results: {
"Output": "drivers/nvmem/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/nvmem/Kconfig:2:menuconfig NVMEM\ndrivers/nvmem/Kconfig-3-\tbool \"NVMEM Support\"\n--\ndrivers/nvmem/Kconfig=13=if NVMEM\ndrivers/nvmem/Kconfig-14-\ndrivers/nvmem/Kconfig:15:config NVMEM_SYSFS\ndrivers/nvmem/Kconfig-16-\tbool \"/sys/bus/nvmem/devices/*/nvmem (sysfs interface)\"\n--\ndrivers/nvmem/Kconfig=27=source \"drivers/nvmem/layouts/Kconfig\"\n--\ndrivers/nvmem/Kconfig-30-\ndrivers/nvmem/Kconfig:31:config NVMEM_AN8855_EFUSE\ndrivers/nvmem/Kconfig-32-\ttristate \"Airoha AN8855 eFuse support\"\n--\ndrivers/nvmem/Kconfig-41-\ndrivers/nvmem/Kconfig:42:config NVMEM_APPLE_EFUSES\ndrivers/nvmem/Kconfig-43-\ttristate \"Apple eFuse support\"\n--\ndrivers/nvmem/Kconfig-52-\ndrivers/nvmem/Kconfig:53:config NVMEM_APPLE_SPMI\ndrivers/nvmem/Kconfig-54-\ttristate \"Apple SPMI NVMEM\"\n--\ndrivers/nvmem/Kconfig-65-\ndrivers/nvmem/Kconfig:66:config NVMEM_BCM_OCOTP\ndrivers/nvmem/Kconfig-67-\ttristate \"Broadcom On-Chip OTP Controller support\"\n--\ndrivers/nvmem/Kconfig-77-\ndrivers/nvmem/Kconfig:78:config NVMEM_BRCM_NVRAM\ndrivers/nvmem/Kconfig-79-\ttristate \"Broadcom's NVRAM support\"\n--\ndrivers/nvmem/Kconfig-86-\ndrivers/nvmem/Kconfig:87:config NVMEM_IMX_IIM\ndrivers/nvmem/Kconfig-88-\ttristate \"i.MX IC Identification Module support\"\n--\ndrivers/nvmem/Kconfig-97-\ndrivers/nvmem/Kconfig:98:config NVMEM_IMX_OCOTP\ndrivers/nvmem/Kconfig-99-\ttristate \"i.MX 6/7/8 On-Chip OTP Controller support\"\n--\ndrivers/nvmem/Kconfig-109-\ndrivers/nvmem/Kconfig:110:config NVMEM_IMX_OCOTP_ELE\ndrivers/nvmem/Kconfig-111-\ttristate \"i.MX On-Chip OTP Controller support\"\n--\ndrivers/nvmem/Kconfig-118-\ndrivers/nvmem/Kconfig:119:config NVMEM_IMX_OCOTP_SCU\ndrivers/nvmem/Kconfig-120-\ttristate \"i.MX8 SCU On-Chip OTP Controller support\"\n--\ndrivers/nvmem/Kconfig-126-\ndrivers/nvmem/Kconfig:127:config NVMEM_JZ4780_EFUSE\ndrivers/nvmem/Kconfig-128-\ttristate \"JZ4780 EFUSE Memory Support\"\n--\ndrivers/nvmem/Kconfig-138-\ndrivers/nvmem/Kconfig:139:config NVMEM_LAN9662_OTPC\ndrivers/nvmem/Kconfig-140-\ttristate \"Microchip LAN9662 OTP controller support\"\n--\ndrivers/nvmem/Kconfig-146-\ndrivers/nvmem/Kconfig:147:config NVMEM_LAYERSCAPE_SFP\ndrivers/nvmem/Kconfig-148-\ttristate \"Layerscape SFP (Security Fuse Processor) support\"\n--\ndrivers/nvmem/Kconfig-159-\ndrivers/nvmem/Kconfig:160:config NVMEM_LPC18XX_EEPROM\ndrivers/nvmem/Kconfig-161-\ttristate \"NXP LPC18XX EEPROM Memory Support\"\n--\ndrivers/nvmem/Kconfig-169-\ndrivers/nvmem/Kconfig:170:config NVMEM_LPC18XX_OTP\ndrivers/nvmem/Kconfig-171-\ttristate \"NXP LPC18XX OTP Memory Support\"\n--\ndrivers/nvmem/Kconfig-179-\ndrivers/nvmem/Kconfig:180:config NVMEM_MAX77759\ndrivers/nvmem/Kconfig-181-\ttristate \"Maxim Integrated MAX77759 NVMEM Support\"\n--\ndrivers/nvmem/Kconfig-191-\ndrivers/nvmem/Kconfig:192:config NVMEM_MESON_EFUSE\ndrivers/nvmem/Kconfig-193-\ttristate \"Amlogic Meson GX eFuse Support\"\n--\ndrivers/nvmem/Kconfig-201-\ndrivers/nvmem/Kconfig:202:config NVMEM_MESON_MX_EFUSE\ndrivers/nvmem/Kconfig-203-\ttristate \"Amlogic Meson6/Meson8/Meson8b eFuse Support\"\n--\ndrivers/nvmem/Kconfig-211-\ndrivers/nvmem/Kconfig:212:config NVMEM_MICROCHIP_OTPC\ndrivers/nvmem/Kconfig-213-\ttristate \"Microchip OTPC support\"\n--\ndrivers/nvmem/Kconfig-218-\ndrivers/nvmem/Kconfig:219:config NVMEM_MTK_EFUSE\ndrivers/nvmem/Kconfig-220-\ttristate \"Mediatek SoCs EFUSE support\"\n--\ndrivers/nvmem/Kconfig-229-\ndrivers/nvmem/Kconfig:230:config NVMEM_MXS_OCOTP\ndrivers/nvmem/Kconfig-231-\ttristate \"Freescale MXS On-Chip OTP Memory Support\"\n--\ndrivers/nvmem/Kconfig-241-\ndrivers/nvmem/Kconfig:242:config NVMEM_NINTENDO_OTP\ndrivers/nvmem/Kconfig-243-\ttristate \"Nintendo Wii and Wii U OTP Support\"\n--\ndrivers/nvmem/Kconfig-253-\ndrivers/nvmem/Kconfig:254:config NVMEM_S32G_OCOTP\ndrivers/nvmem/Kconfig-255-\ttristate \"S32G SoC OCOTP support\"\n--\ndrivers/nvmem/Kconfig-263-\ndrivers/nvmem/Kconfig:264:config NVMEM_QCOM_QFPROM\ndrivers/nvmem/Kconfig-265-\ttristate \"QCOM QFPROM Support\"\n--\ndrivers/nvmem/Kconfig-274-\ndrivers/nvmem/Kconfig:275:config NVMEM_QCOM_SEC_QFPROM\ndrivers/nvmem/Kconfig-276- tristate \"QCOM SECURE QFPROM Support\"\n--\ndrivers/nvmem/Kconfig-287-\ndrivers/nvmem/Kconfig:288:config NVMEM_QNAP_MCU_EEPROM\ndrivers/nvmem/Kconfig-289-\ttristate \"QNAP MCU EEPROM Support\"\n--\ndrivers/nvmem/Kconfig-296-\ndrivers/nvmem/Kconfig:297:config NVMEM_RAVE_SP_EEPROM\ndrivers/nvmem/Kconfig-298-\ttristate \"Rave SP EEPROM Support\"\n--\ndrivers/nvmem/Kconfig-302-\ndrivers/nvmem/Kconfig:303:config NVMEM_RCAR_EFUSE\ndrivers/nvmem/Kconfig-304-\ttristate \"Renesas R-Car Gen4 E-FUSE support\"\n--\ndrivers/nvmem/Kconfig-313-\ndrivers/nvmem/Kconfig:314:config NVMEM_RMEM\ndrivers/nvmem/Kconfig-315-\ttristate \"Reserved Memory Based Driver Support\"\n--\ndrivers/nvmem/Kconfig-324-\ndrivers/nvmem/Kconfig:325:config NVMEM_ROCKCHIP_EFUSE\ndrivers/nvmem/Kconfig-326-\ttristate \"Rockchip eFuse Support\"\n--\ndrivers/nvmem/Kconfig-335-\ndrivers/nvmem/Kconfig:336:config NVMEM_ROCKCHIP_OTP\ndrivers/nvmem/Kconfig-337-\ttristate \"Rockchip OTP controller support\"\n--\ndrivers/nvmem/Kconfig-346-\ndrivers/nvmem/Kconfig:347:config NVMEM_SC27XX_EFUSE\ndrivers/nvmem/Kconfig-348-\ttristate \"Spreadtrum SC27XX eFuse Support\"\n--\ndrivers/nvmem/Kconfig-357-\ndrivers/nvmem/Kconfig:358:config NVMEM_SNVS_LPGPR\ndrivers/nvmem/Kconfig-359-\ttristate \"Support for Low Power General Purpose Register\"\n--\ndrivers/nvmem/Kconfig-367-\ndrivers/nvmem/Kconfig:368:config NVMEM_SPMI_SDAM\ndrivers/nvmem/Kconfig-369-\ttristate \"SPMI SDAM Support\"\n--\ndrivers/nvmem/Kconfig-375-\ndrivers/nvmem/Kconfig:376:config NVMEM_SPRD_EFUSE\ndrivers/nvmem/Kconfig-377-\ttristate \"Spreadtrum SoC eFuse Support\"\n--\ndrivers/nvmem/Kconfig-386-\ndrivers/nvmem/Kconfig:387:config NVMEM_STM32_BSEC_OPTEE_TA\ndrivers/nvmem/Kconfig-388-\tdef_bool NVMEM_STM32_ROMEM \u0026\u0026 OPTEE\n--\ndrivers/nvmem/Kconfig-395-\ndrivers/nvmem/Kconfig:396:config NVMEM_STM32_ROMEM\ndrivers/nvmem/Kconfig-397-\ttristate \"STMicroelectronics STM32 factory-programmed memory support\"\n--\ndrivers/nvmem/Kconfig-406-\ndrivers/nvmem/Kconfig:407:config NVMEM_SUNPLUS_OCOTP\ndrivers/nvmem/Kconfig-408-\ttristate \"Sunplus SoC OTP support\"\n--\ndrivers/nvmem/Kconfig-418-\ndrivers/nvmem/Kconfig:419:config NVMEM_SUNXI_SID\ndrivers/nvmem/Kconfig-420-\ttristate \"Allwinner SoCs SID support\"\n--\ndrivers/nvmem/Kconfig-428-\ndrivers/nvmem/Kconfig:429:config NVMEM_U_BOOT_ENV\ndrivers/nvmem/Kconfig-430-\ttristate \"U-Boot environment variables support\"\n--\ndrivers/nvmem/Kconfig-441-\ndrivers/nvmem/Kconfig:442:config NVMEM_UNIPHIER_EFUSE\ndrivers/nvmem/Kconfig-443-\ttristate \"UniPhier SoCs eFuse support\"\n--\ndrivers/nvmem/Kconfig-452-\ndrivers/nvmem/Kconfig:453:config NVMEM_VF610_OCOTP\ndrivers/nvmem/Kconfig-454-\ttristate \"VF610 SoC OCOTP support\"\n--\ndrivers/nvmem/Kconfig-463-\ndrivers/nvmem/Kconfig:464:config NVMEM_ZYNQMP\ndrivers/nvmem/Kconfig-465-\ttristate \"Xilinx ZYNQMP SoC nvmem firmware support\"\n--\ndrivers/nvmem/Kconfig-473-\ndrivers/nvmem/Kconfig:474:config NVMEM_QORIQ_EFUSE\ndrivers/nvmem/Kconfig-475-\ttristate \"NXP QorIQ eFuse support\"\n--\ndrivers/nvmem/layouts/Kconfig-2-\ndrivers/nvmem/layouts/Kconfig:3:config NVMEM_LAYOUTS\ndrivers/nvmem/layouts/Kconfig-4-\tbool\n--\ndrivers/nvmem/layouts/Kconfig=9=menu \"Layout Types\"\ndrivers/nvmem/layouts/Kconfig-10-\ndrivers/nvmem/layouts/Kconfig:11:config NVMEM_LAYOUT_SL28_VPD\ndrivers/nvmem/layouts/Kconfig-12-\ttristate \"Kontron sl28 VPD layout support\"\n--\ndrivers/nvmem/layouts/Kconfig-19-\ndrivers/nvmem/layouts/Kconfig:20:config NVMEM_LAYOUT_ONIE_TLV\ndrivers/nvmem/layouts/Kconfig-21-\ttristate \"ONIE tlv support\"\n--\ndrivers/nvmem/layouts/Kconfig-28-\ndrivers/nvmem/layouts/Kconfig:29:config NVMEM_LAYOUT_U_BOOT_ENV\ndrivers/nvmem/layouts/Kconfig-30-\ttristate \"U-Boot environment variables layout\"\n--\ndrivers/power/reset/Kconfig=332=config POWER_RESET_SC27XX\n--\ndrivers/power/reset/Kconfig-340-\ndrivers/power/reset/Kconfig:341:config NVMEM_REBOOT_MODE\ndrivers/power/reset/Kconfig-342-\ttristate \"Generic NVMEM reboot mode driver\"\n"
} |
| 15/2 | 2026/08/06 17:15 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 19762 output: 177 thoughts: 23 Thoughts: Okay, here's my summary, tailored as if I'm an expert in the field thinking through this problem: **Analyzing the Data Flow and Preparing the Output** Alright, so the core piece of information here, the key variable for this section, is `NVMEM`. It's a boolean, meaning it's either true or false. Knowing this is fundamental. My analysis hinges on correctly interpreting and utilizing its state. My plan to present the result is also clear. I'm going to leverage `set-results` to properly expose my findings from the data analysis. This is the correct method, and makes the correct function call in this situation. |
| 16/2 | 2026/08/06 17:15 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BLK_NVMEM",
"NVMEM",
"OF",
"BT"
],
"FocusSymbols": [
"blk_nvmem_reg_read",
"blk_nvmem_add",
"blk_nvmem_del",
"hci_dev_get_bd_addr_from_nvmem",
"of_get_nvmem_eui48"
],
"Reasoning": "The patch adds a new feature to expose block devices and partitions as NVMEM providers, allowing MAC and Bluetooth addresses to be read from them. It also modifies the Bluetooth core to read BD_ADDR from NVMEM. This introduces new reachable logic in the block layer and networking/bluetooth core that should be fuzzed.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BLK_NVMEM",
"NVMEM",
"OF",
"BT"
],
"FocusSymbols": [
"blk_nvmem_reg_read",
"blk_nvmem_add",
"blk_nvmem_del",
"hci_dev_get_bd_addr_from_nvmem",
"of_get_nvmem_eui48"
],
"Reasoning": "The patch adds a new feature to expose block devices and partitions as NVMEM providers, allowing MAC and Bluetooth addresses to be read from them. It also modifies the Bluetooth core to read BD_ADDR from NVMEM. This introduces new reachable logic in the block layer and networking/bluetooth core that should be fuzzed.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|