summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-08-11powerpc/configs: enable CONFIG_RAS to fix EDAC supportMichael Walle
Before commit e3c4ff6d8c94 ("EDAC: Remove EDAC_MM_EDAC") EDAC_MM_EDAC selected RAS, after that commit, EDAC depends on RAS, but nobody enables it. Enable it in the config again. Fixes: e3c4ff6d8c94 ("EDAC: Remove EDAC_MM_EDAC") Signed-off-by: Michael Walle <mwalle@kernel.org> Acked-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260730105546.3658570-1-mwalle@kernel.org
2026-08-11f2fs: refactor f2fs_evict_inode having three major partsJaegeuk Kim
1. f2fs_pre_evict_inode() : drop all in-memory structures 2. f2fs_delete_inode() : truncate inode blocks, if it was unlinked. 3. f2fs_post_evict_inode() : update inode records for future access Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2026-08-11f2fs: support dynamic reserve/release for device aliasingDaeho Jeong
This patch adds a dynamic management feature to the existing device aliasing functionality. It allows users to dynamically reserve or release specific devices from the filesystem's free pool at runtime through new ioctls. To support this, three new ioctls are introduced: - F2FS_IOC_RESERVE_DEV_ALIAS: This reclaims the space occupied by a device aliasing file. It first performs a capacity check, resets GC victim information for the target range, marks the segments as in-use to prevent new allocations, and then triggers GC to migrate existing valid data out of the range. Finally, it reserves these blocks in the SIT to effectively exclude the device from the usable capacity. - F2FS_IOC_RELEASE_DEV_ALIAS: This releases the reserved space of a previously reserved device aliasing file. It truncates the blocks associated with the file, which makes them available for general filesystem allocation again. - F2FS_IOC_GET_DEV_ALIAS_STATUS: This retrieves the current aliasing status of a device aliasing file, returning whether the file is released (inactive alias) or reserved (active alias, with blocks fully allocated on the device). Signed-off-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2026-08-11thunderbolt: Clamp DMA tunnel credits to what a hop register can holdFan Ye
struct tb_regs_hop::initial_credits is 7 bits wide, but neither of the values tb_tunnel_alloc_dma() picks from is bounded by that: the dma_credits module parameter has no upper limit, and neither does the host router's baMaxHI. A larger count survives until tb_path_activate() copies it into the register and keeps the low bits, leaving the path on a credit count nobody asked for. Clamp it in tb_tunnel_alloc_dma(), the only entry point for DMA tunnels; every step below it can only lower the value further. Carry the count in an unsigned int while at it. Assisted-by: Claude:claude-opus-5 Signed-off-by: Fan Ye <fy15309206903@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-08-10lib/crypto: aes-cmac: Use __cleanup() instead of memzero_explicit()Thomas Huth
By using __cleanup(aes_cmac_zeroize_key) for clearing the key data, we can save one line of code here. Signed-off-by: Thomas Huth <thuth@redhat.com> Link: https://patch.msgid.link/20260807125845.1477067-6-thuth@redhat.com Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10kunit: irq: Unregister on-stack timer and work from debugobjectsEric Biggers
In kunit_run_irq_test(), call destroy_hrtimer_on_stack() and destroy_work_on_stack() to unregister the hrtimer and work from the debugobjects infrastructure (when CONFIG_DEBUG_OBJECTS_TIMERS=y and CONFIG_DEBUG_OBJECTS_WORK=y) before the function returns. Found via code review; the lack of the unregistrations didn't actually cause a warning, since the objects are inactive upon return anyway. But they should be there, otherwise debugobjects keeps tracking the objects. Fixes: 950a81224e8b ("lib/crypto: tests: Add hash-test-template.h and gen-hash-testvecs.py") Reviewed-by: David Gow <david@davidgow.net> Link: https://patch.msgid.link/20260806053804.106724-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10kunit: irq: Continue increasing hrtimer interval for longerEric Biggers
Currently, kunit_irq_test_timer_func() stops increasing the hrtimer interval as soon as some forward progress is made in each of softirq and task context. Update it to use a more aggressive strategy: increase the interval as long as the hrtimer is running significantly faster than either context. This resolves an occasional hang in the CRC and crypto library tests under qemu-system-s390x. It was exposed by the change in the default preemption model on s390 from NONE to LAZY. That seems to have exposed the issue by allowing some forward progress to be made while the actual system timer tick is still starved, preventing jiffies from increasing or the task context from making much progress towards max_iterations. Fixes: 201ceb94aa1d ("kunit: irq: Ensure timer doesn't fire too frequently") Cc: stable@vger.kernel.org Reviewed-by: David Gow <david@davidgow.net> Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260803181842.44648-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: tests: Add KUnit test suite for AES-GCMEric Biggers
Add a KUnit test suite for the AES-GCM library API. It consists of: - All the shared test cases from aead-test-template.h. These include extensive consistency tests, a "Monte-Carlo test", and a benchmark. - Tests against hardcoded AES-GCM test vectors from external sources. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802233005.161467-6-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: tests: Add KUnit test suite for AES-CCMEric Biggers
Add a KUnit test suite for the AES-CCM library API. It consists of: - All the shared test cases from aead-test-template.h. These include extensive consistency tests, a "Monte-Carlo test", and a benchmark. - Tests against hardcoded AES-CCM test vectors from external sources. - Tests for CCM-specific message length validation. To generate the expected aes_ccm_monte_carlo_checksum[] value, add a script gen-aead-testvecs.py which computes it using python-cryptography. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802233005.161467-5-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: tests: Add aead-test-template.hEric Biggers
Add aead-test-template.h which contains shared test logic for AEAD algorithms. It's similar to the existing hash-test-template.h, which contains shared test logic for hash algorithms. The initial use cases for this will be AES-CCM and AES-GCM. It may be used by the existing ChaCha20Poly1305 test suite in the future as well, though the ChaCha20Poly1305 API currently lacks some of the functionality that the "template" expects to be present. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802233005.161467-4-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: tests: Use per-test-case buffers in hash testsEric Biggers
Make the test cases more self-contained by replacing the test suite scoped guarded buffer ('test_buf') with buffers allocated by each test case using the helper functions in test-utils.h. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802233005.161467-3-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: tests: Create test-utils.hEric Biggers
Move hash-test-template's test RNG code and the buffer allocation code from various test suites into a header test-utils.h. This allows them to be shared by other test suites. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802233005.161467-2-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: aes: Add FIPS self-tests for GCM and CCMEric Biggers
Upcoming changes will wire up architecture-optimized implementations of GCM and CCM. FIPS labs can consider such designs to meet the threshold for separate self-tests to be needed. Therefore, add FIPS self-tests for encryption and decryption in these modes. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802222408.91757-4-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: aes: Add FIPS self-tests for unauthenticated modesEric Biggers
Upcoming changes will wire up architecture-optimized implementations of ECB, CBC, CBC-CTS, CTR, and XTS. FIPS labs can consider such designs to meet the threshold for separate self-tests to be needed. The inverse direction of the block cipher also needs to be exercised, which the existing CMAC self-test doesn't do. Therefore, add FIPS self-tests for encryption and decryption in these modes as well as the "bare" AES. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802222408.91757-3-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.hEric Biggers
In preparation for adding FIPS self-tests for AES encryption modes, split fips.h into separate files for the AES and SHA test vectors. They are still generated by the same script, but this keeps things a bit more organized. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://patch.msgid.link/20260802222408.91757-2-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10lib/crypto: aes-cmac: Add zeroization functionsThomas Huth
Code that uses AES-CMAC might need to zeroize their local aes_cmac_key and/or aes_cmac_ctx structures after use to avoid leaking sensitive material on the stack. Provide an aes_cmac_zeroize_key() and an aes_cmac_zeroize_ctx() helper function that can be used with __cleanup() to automatically clear the key and context when they go out of scope. Signed-off-by: Thomas Huth <thuth@redhat.com> Link: https://patch.msgid.link/20260807125845.1477067-2-thuth@redhat.com Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-08-10scsi: fnic: Fix built-in NVMe/FC buildKaran Tilak Kumar
The fnic NVMe/FC code is guarded with IS_ENABLED(CONFIG_NVME_FC). That also evaluates true when NVME_FC is built as a module. When fnic is built into vmlinux and NVME_FC=m, fnic_nvme.o still references the NVMe/FC transport helpers even though those helpers are not reachable from built-in code. The final vmlinux link then fails with undefined nvme_fc_* symbols. Use IS_REACHABLE(CONFIG_NVME_FC) for the fnic NVMe/FC implementation and prototypes so built-in fnic uses the disabled stubs unless the NVMe/FC transport is reachable. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202608092246.XZe7Hlrt-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Reviewed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://patch.msgid.link/20260810110627.4521-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-10Merge branch 'update-null-pointer-handling-in-generated-code'Jakub Kicinski
Thaison Phan says: ==================== update NULL pointer handling in generated code This series fixes potential NULL pointer dereferences in YNL-generated C code during dump list freeing and memory allocation in parsing getters. ==================== Link: https://patch.msgid.link/20260807171500.7188-1-thaisonphan@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10tools: ynl: check alloc fails in generated getter codeThaison Phan
Generated YNL getter code does not check the return value of malloc() and calloc() before passing the resulting pointer to memcpy(). This could lead to a NULL pointer dereference on memory allocation failure. Updated the C code generator to check for allocation failures and to return an error code in getters. Signed-off-by: Thaison Phan <thaisonphan@google.com> Link: https://patch.msgid.link/20260807171500.7188-3-thaisonphan@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10tools: ynl: check for null ptr on dump freeThaison Phan
Static analysis detected code paths where freeing a dump list after early errors when creating the corresponding dump list like in ynl_exec_dump() can result in a null pointer dereference since the first node in the ynl_dump_state would still be zero initialized. To prevent this potential problem updated the ynl c generation script to check for a NULL pointer before continuing to free the nodes in a dump list. Signed-off-by: Thaison Phan <thaisonphan@google.com> Link: https://patch.msgid.link/20260807171500.7188-2-thaisonphan@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10selftests/livepatch: update test-ftrace.sh for deprecated ftrace_enabledAndrey Grodzovsky
kernel.ftrace_enabled=0 is now refused on kernels that deprecate the knob, so the old disable/reload flow no longer applies there. Probe for this with ftrace_disable_supported() and keep the full original scenario (disable, fail to load a livepatch, re-enable, load, confirm disable is refused while loaded) on kernels where it still works; otherwise just confirm the write is refused. Link: https://patch.msgid.link/20260806153000.4184871-3-andrey.grodzovsky@crowdstrike.com Suggested-by: Steven Rostedt <rostedt@goodmis.org> Suggested-by: Joe Lawrence <joe.lawrence@redhat.com> Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2026-08-10ftrace: deprecate disabling via ftrace_enabled sysctlAndrey Grodzovsky
Writing 0 to kernel.ftrace_enabled has not reliably disabled ftrace for years (FTRACE_OPS_FL_PERMANENT users already block it, and more callers rely on ftrace always being on). Refuse the write instead of leaving it in an inconsistent "disables some, not all" state: return -EOPNOTSUPP and log a message. Reads and enabling (writing 1) are unaffected. Update the docs to note the deprecation up front. Link: https://patch.msgid.link/20260806153000.4184871-2-andrey.grodzovsky@crowdstrike.com Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com> Acked-by: Song Liu <song@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2026-08-10selftests: bonding: disable DAD for IPv6 addressesJakub Kicinski
bond_reset() waits up to 2 seconds for IPv6 connectivity. With default settings DAD itself may take almost 2 seconds, causing flakes on debug builds. It used to flake once or twice a week, recently it started failing once a day. Probably some downstream changes to scheduler, or our machines go busier. A lot of selftests already use nodad, let's use nodad in bonding, too. I don't see an obvious reason why DAD would be important to the test. Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn> Link: https://patch.msgid.link/20260808162345.2442594-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10EDAC/thunderx: Orphan itBorislav Petkov (AMD)
Robert doesn't have hardware to test patches anymore and no one else has shown interest in maintaining this driver, so orphan it, for now at least. Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Robert Richter <rric@kernel.org> Link: https://lore.kernel.org/r/annRsN6UBDPsFLr2@rric.localdomain
2026-08-10selftests: drv-net: so_txtime: only send test traffic to sch_etfWillem de Bruijn
The ETF qdiscs drops traffic without a socket or txtime. Even with parameter skip_sock_check regular traffic is affected by ETF. This test ran fine when run manually in a pure software environment. But with drv-net across two hosts tests fail as early as when calling cfg.remote.deploy due to effectively losing connectivity. Isolate the intended test traffic: - mark that with SO_MARK 100 - install a regular permissive root prio qdisc for background traffic - install the ETF qdisc as leaf - install a filter that only directs SO_MARK 100 traffic to this leaf Technically other high prio traffic will map onto this leaf based on ToS band mapping too. But that is immaterial in practice. Fixes: 5c6baef3885c ("selftests: drv-net: convert so_txtime to drv-net") Signed-off-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260808160129.890119-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10PCI: ultrarisc: Use module_platform_driver()Jia Wang
CONFIG_PCIE_ULTRARISC is a tristate option and may be built as a module. Use module_platform_driver() so the driver uses the standard registration helper for both built-in and module configurations. Leave .remove() unset because the driver registers an internal MSI controller and the IRQs cannot be safely disposed during removal. Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260731-ultrarisc-pci-clk-v4-3-d738b491e49a@ultrarisc.com
2026-08-10PCI: ultrarisc: Get and enable DP1000 PCIe controller clocksJia Wang
Add the required core, dbi, and aux clocks for the DP1000 PCIe controller and enable them before initializing the controller. Also manage the clocks across system suspend and resume. Fixes: 5fc35740c3b3 ("PCI: ultrarisc: Add UltraRISC DP1000 PCIe Root Complex driver") Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260731-ultrarisc-pci-clk-v4-2-d738b491e49a@ultrarisc.com
2026-08-10dt-bindings: PCI: ultrarisc: Add required DP1000 PCIe clocksJia Wang
Require DP1000 PCIe controller nodes to provide clocks and clock-names, using the standard DesignWare clock names "core", "dbi", and "aux". Fixes: d9ff07f45955 ("dt-bindings: PCI: Add UltraRISC DP1000 PCIe controller") Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20260731-ultrarisc-pci-clk-v4-1-d738b491e49a@ultrarisc.com
2026-08-10et131x: propagate EEPROM readiness errorsAvi Weiss
eeprom_wait_ready() returns a negative error when the LBCIF status cannot be read or the device does not become ready for some other reason. eeprom_write() propagates this error before starting a write, but currently returns 0 when the same readiness check fails after the write begins. This behavior was introduced when the EEPROM code was refactored to use Linux error-return conventions (from 0 = failure to 0 = success). Return the error so callers do not treat a failed EEPROM write as successful and the function contract is maintained. Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path Signed-off-by: Avi Weiss <thnkslprpt@gmail.com> Acked-by: Mark Einon <mark.einon@gmail.com> Link: https://patch.msgid.link/20260808194347.813242-1-thnkslprpt@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10net: sfp: fix hwmon_name memory leak on hwmon registration failureKrishan Singh
hwmon_sanitize_name() allocates sfp->hwmon_name before hwmon_device_register_with_info() is called. If the registration fails, sfp->hwmon_dev is left pointing to an error while sfp->hwmon_name remains allocated. Later, when the SFP module is removed, sfp_hwmon_remove() only frees hwmon_name when hwmon_dev is valid. As a result, hwmon_name is leaked if hwmon_device_register_with_info() fails. Free hwmon_name independently of hwmon_dev. Continue to unregister the hwmon device only when hwmon_dev was successfully registered. Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Krishan Singh <krishanmohan298@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20260809064504.70579-1-krishanmohan298@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10Merge branch 'drivers-s390-net-enable-context_analysis'Jakub Kicinski
Heiko Carstens says: ==================== drivers/s390/net: Enable CONTEXT_ANALYSIS Enable CONTEXT_ANALYSYS for drivers/s390/net. Static code checking for acquiring and releasing locks used to be done with sparse. That was removed with [1] and replaced with a clang based approach [2]. The new approach requires that each subsystem needs to be explicitly enabled for checking. Do that for drivers/s390/net. In order to avoid false positives due to conditional locking, disable context analysis for specific functions of the ctcm driver. All comments in ctcm indicate that the code should stay as it is, and that such warnings should be ignored. Disabling context analysis for specific functions keeps analysis enabled for the rest of a file. [1] 5b63d0ae94cc ("compiler-context-analysis: Remove Sparse support") [2] 3269701cb256 ("compiler-context-analysis: Add infrastructure for Context Analysis with Clang") ==================== Link: https://patch.msgid.link/20260805145032.1409325-1-hca@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10drivers/s390/net: Enable CONTEXT_ANALYSISHeiko Carstens
All drivers in drivers/s390/net pass clang's compile time context analysis. Therefore enable CONTEXT_ANALYSIS. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260805145032.1409325-3-hca@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10s390/ctcm: Add __context_unsafe() attribute to various functionsHeiko Carstens
Disable context analysis for various functions to get rid of context analysis compile time warnings using clang caused by conditional locking like e.g.: drivers/s390/net/ctcm_fsms.c:1457:8: warning: spinlock 'arg->cdev->ccwlock' is not held on every path through here drivers/s390/net/ctcm_fsms.c:1459:4: warning: releasing spinlock 'arg->cdev->ccwlock' that was not held Use __context_unsafe() to provide a short comment why context analysis is disabled for each function. Each of those functions already contains a comment that the (previous) sparse context analysis warnings due to conditional locking should be ignored. Remove those comments everywhere and use the __context_unsafe() attribute instead. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260805145032.1409325-2-hca@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10nvme: raise FDP placement handle cap to U8_MAX and warn on overflowGuixin Liu
The RUH status buffer and the placement-handle clamp used S8_MAX - 1 (126) as the maximum descriptor count. That value was picked only so the io-mgmt-receive result fit in a page, not because of any protocol or driver restriction. The meaningful upper bound is U8_MAX: write hints (bio->bi_write_stream) are u8, so placement handles beyond U8_MAX can never be selected. Size the buffer and clamp nr_plids to U8_MAX. Suggested-by: Kanchan Joshi <joshi.k@samsung.com> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
2026-08-10apparmor: fix out-of-bounds write when null terminating a label vecHyunwoo Kim
aa_vec_unique() null terminates at vec[n - dups] when VEC_FLAG_TERMINATE is passed. If the components are all distinct no duplicates are dropped, dups is 0 and the terminator goes to vec[n], so the caller has to provide room for n + 1 entries. aa_label_strn_parse() sets up its vector with vec_setup(profile, vec, len, gfp) and then calls aa_vec_unique(vec, len, VEC_FLAG_TERMINATE), but vec_setup() does not reserve the terminator entry. Up to LOCAL_VEC_ENTRIES it uses the local array of LOCAL_VEC_ENTRIES pointers, above that it allocates exactly len pointers. The terminator therefore lands one entry past the end of the local array when len is LOCAL_VEC_ENTRIES, and one entry past the end of the allocation when len is larger. len comes from the number of "//&" separated components in the label name and label_count_strn_entries() does not bound it. An unprivileged task reaches the parse by writing to /proc/self/attr/apparmor/current or through lsm_set_self_attr(2), both of which go through do_setattr(), and the name is parsed before the change_profile permission is checked. The query_label() path behind the securityfs .access file, which is mode 0666, performs no permission check at all. Every component has to resolve to a loaded profile, so a system with policy loaded is required. The other two VEC_FLAG_TERMINATE users work on a label vec that aa_label_alloc() has already sized with "+ 1 for null terminator entry on vec". Reserve the same entry in vec_setup() and DEFINE_VEC(). Passing len + 1 from the caller instead would move len == LOCAL_VEC_ENTRIES out of the local array and into kzalloc(). Fixes: f1bd904175e8 ("apparmor: add the base fns() for domain labels") Cc: stable@vger.kernel.org Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
2026-08-10selftests: drv-net: let ethtool stats settle before readingJakub Kicinski
Some devices refresh the statistics exposed via ethtool only periodically, every stats-block-usecs (as reported by ethtool -c). ethtool_std_stats and ethtool_rmon sample the counters immediately after generating traffic, so on such devices they can read stale values and fail with a delta short of the packets just sent. Add a hw_stats_settle() helper which sleeps for 1.25x the configured stats-block-usecs (defaulting to 20ms when the device reports no, or a zero, period). Use it for ethtool std stats and RMON. The 1.25x/20msec heuristic matches what the Python tests do. Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://patch.msgid.link/20260808163653.2460381-2-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10selftests: drv-net: pace ethtool_std_stats packet generationJakub Kicinski
mausezahn defaults to sending packets back to back at the maximum rate, which can cause packet loss, especially if receiver is running a debug kernel. Space the generated packets out (-d 10usec), like ethtool_rmon already does. Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://patch.msgid.link/20260808163653.2460381-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10selftests: netdevsim: fix SIGPIPE flake in ethtool-coalesceJakub Kicinski
The adaptive-rx and adaptive-tx checks use 'ethtool -c | grep -q' under 'set -o pipefail'. grep -q exits as soon as it finds a match, which can happen before ethtool finishes writing its output. When that occurs, ethtool receives SIGPIPE causing (uninformative): # selftests: drivers/net/netdevsim: ethtool-coalesce.sh # FAILED 1/22 checks not ok 1 selftests: drivers/net/netdevsim: ethtool-coalesce.sh # exit=1 This happens on debug kernels in NIPA, ~4% of the time. Link: https://patch.msgid.link/20260808163416.2456810-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10netdev: check for nla_put_u32() failuresJakub Kicinski
Make sure we check if nla_put_u32(id) was successful after creating objects. This is theoretical today, the skbs are large enough to always fit the ID. Acked-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260809000609.327659-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10tap: fix incorrect variable used for USO check in set_offload()Rongguang Wei
The USO features in set_offload() incorrectly uses feature_mask and features argument. The USO feature was written to the local features variable instead of feature_mask. All other offload bits (TSO, TSO_ECN) are stored in feature_mask which becomes tap->tap_features and is used by tap_handle_frame() for GSO segmentation. Without NETIF_F_GSO_UDP_L4 in tap->tap_features, making USO on tap effectively non-functional. Keeping the USO handling inside the TUN_F_CSUM block avoids enabling GRO/LRO when userspace requests USO without CSUM. This has not worked since the beginning, so commit 399e0827642f ("driver/net/tun: Added features for USO.") Signed-off-by: Rongguang Wei <weirongguang@kylinos.cn> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260807070914.112698-1-clementwei90@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10selftests: tc-testing: add act_ct test for malformed header handlingHyunjung Ko
Add a tdc case covering the leak fixed by the previous patch. The test attaches "action ct" to a clsact ingress chain and injects ten IPv6 frames whose nexthdr says hop-by-hop but which carry nothing after the 40-byte header, so ipv6_find_hdr() fails and tcf_ct_ipv6_is_fragment() returns -EPROTO. Before the fix act_ct returned TC_ACT_CONSUMED for these packets, so tc_run() never reached its TC_ACT_SHOT arm and the clsact drop counter stayed at zero while the skbs leaked. After the fix the packets are dropped properly and the counter reflects them, which is what the test matches on: before: Sent 476 bytes 11 pkt (dropped 0, overlimits 0 requeues 0) after: Sent 400 bytes 10 pkt (dropped 10, overlimits 0 requeues 0) Signed-off-by: Hyunjung Ko <hj351016@gmail.com> Reviewed-by: Victor Nogueira <victor@mojatatu.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/20260806101235.809370-2-hj351016@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10net/sched: act_ct: fix sk_buff leak when the header checks reject a packetHyunjung Ko
tcf_ct_handle_fragments() runs its header sanity checks before handing anything to the defragmentation engine: if (family == NFPROTO_IPV4) err = tcf_ct_ipv4_is_fragment(skb, &frag); else err = tcf_ct_ipv6_is_fragment(skb, &frag); if (err || !frag) return err; tcf_ct_ipv4_is_fragment() returns -EINVAL or -ENOMEM; tcf_ct_ipv6_is_fragment() adds -EPROTO when ipv6_find_hdr() fails. None of them frees or queues the skb, so on that path the caller still owns it. tcf_ct_act() however funnels every non-zero return into the ownership-transfer exit: err = tcf_ct_handle_fragments(net, skb, family, p->zone, &defrag); if (err) goto out_frag; ... out_frag: if (err != -EINPROGRESS) tcf_action_inc_drop_qstats(&c->common); return TC_ACT_CONSUMED; TC_ACT_CONSUMED means the action took ownership of the skb, so no caller frees it - sch_handle_ingress(), sch_handle_egress() and tcf_qevent_handle() all deliberately skip the free for that verdict. The skb is therefore orphaned: one sk_buff plus its data buffer is leaked per malformed packet, unbounded. Note the drop counter is already incremented for these errors, so the statistics claim a drop that never happens. Three different ownership states reach out_frag: today - the skb may be queued by the defrag engine (-EINPROGRESS), already freed by nf_ct_handle_fragments(), or still owned by us. Tell the caller which of those it is, and free the packet ourselves in the last case, which restores the TC_ACT_SHOT behaviour that predated the Fixes: commit. Reproduced on v7.2-rc6 with a 54-byte frame carrying a 40-byte IPv6 header with nexthdr = 0 (hop-by-hop) and nothing after it, on a clsact ingress chain with "action ct". kmemleak reports one leaked 232-byte skbuff_head_cache object plus its 704-byte data buffer per packet; with this patch it reports none. Fixes: 3f14b377d01d ("net/sched: act_ct: fix skb leak and crash on ooo frags") Cc: stable@vger.kernel.org # v6.8+ Signed-off-by: Hyunjung Ko <hj351016@gmail.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/20260806101235.809370-1-hj351016@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10net: xilinx: axienet: Treat xlnx,rxmem as a required propertySuraj Gupta
"xlnx,rxmem" device-tree property is used to learn the size of the Rx/Tx packet buffer built into the ethernet IP, but return value of of_property_read_u32() is ignored. When the property is absent lp->rxmem is left at 0, which silently limits the interface to the default MTU and disables jumbo frames with no indication of the misconfiguration. "xlnx,rxmem" has been documented as a required property since the binding was introduced. Check the return value of of_property_read_u32() and fail probe when the property is missing, so a misconfigured device tree is reported rather than silently degrading functionality. Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> Link: https://patch.msgid.link/20260806170253.1199749-1-suraj.gupta2@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10keys, dns: Drop unused NUL terminator from upayload->dataThorsten Blum
upayload->data includes an extra NUL terminator even though it is never used as a C string. In-tree users access only the first upayload->datalen bytes. Remove the redundant NUL terminator and allocate one byte less for upayload->data in dns_resolver_preparse(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260806200454.245444-3-thorsten.blum@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10bonding: fix wrong extack attribute in ARP validate netlink error pathHangbin Liu
The attribute of netlink error message should be IFLA_BOND_ARP_VALIDATE when ARP validation setting fails. Added by commit 2bff369b2354 ("bonding: netlink error message support for options"). Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn> Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de> Link: https://patch.msgid.link/20260806-bond_arp_validate-v1-1-3ae005657ef9@kylinos.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10nilfs2: standardize the inode number type to u64Ryusuke Konishi
Variables handling inode numbers - such as the 'i_ino' member of the inode structure - have been converted to 'u64' within the kernel to ensure consistency. However, some parts of the nilfs2 implementation still use 'ino_t' or 'unsigned long' - both of which are architecture-dependent types - to handle inode numbers. Replace those remaining instances of 'ino_t' or 'unsigned long' with 'u64'. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
2026-08-10net: phy: realtek: fix EEE advertisement write on the internal PHY MMD pathOleksij Rempel
In rtlgen_write_mmd(), the MDIO_AN_EEE_ADV case swaps the arguments to rtlgen_write_vend2(): it passes the MMD register number as the OCP address and the OCP address constant as the value. The caller's value is discarded and the write lands on the wrong register, so the EEE advertisement cannot be configured on the affected PHYs. Mirror rtlgen_read_mmd() and write the value to RTL_MDIO_AN_EEE_ADV. Fixes: da681ed73fb9 ("net: phy: realtek: improve mmd register access for internal PHY's") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20260806134716.3511821-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10amt: Don't support cross-netns setup.Kuniyuki Iwashima
When a lower device is unregistered, amt_device_event() tries to unregister its upper AMT device, but it has two problems. 1. amt_lookup_upper_dev() looks up an upper device in the lower device's netns only 2. amt_device_event() unregisters a single upper device only If AMT device is created on a lower device in another netns, removing the lower device triggers the splat below and gets stuck until all upper devices are removed. [0] The cross-netns setup seems unintentional considering 1. and the following points: * amt_link_setup() sets dev->netns_immutable to true * skb_scrub_packet() is not called in the fast path * iproute2 binary fails to find cross-netns lower device via link-netns: # ip -n ns1 link add amt0 link-netns ns2 type amt dev veth1 Cannot find device "veth1" Instead of supporting it properly and preparing for per-netns netdev unreg, let's forbid cross-netns setup. Note that the problem 2. needs a separate fix. [0]: WARNING: net/core/dev.c:12518 at unregister_netdevice_many_notify+0x1cce/0x2250, CPU#48: ip/2031 Modules linked in: CPU: 48 UID: 0 PID: 2031 Comm: ip Not tainted 7.2.0-rc5+ #27 PREEMPT(full) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014 RIP: 0010:unregister_netdevice_many_notify (net/core/dev.c:12518) Code: 89 ef e8 d5 52 ae fe e9 d0 f4 ff ff 48 8d 3d f9 3b 9c 02 48 c7 c6 c0 0b 63 84 ba ab 1f 00 00 67 48 0f b9 3a e9 65 ff ff ff 90 <0f> 0b 90 eb 81 48 8d 3d f6 3b 9c 02 48 c7 c6 c0 0b 63 84 ba e2 1f RSP: 0018:ffffc90004abf160 EFLAGS: 00010212 RAX: ffff888104d38260 RBX: ffff88800b0911b8 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff85b9f880 RBP: ffffc90004abf2d0 R08: ffffffff85b9f887 R09: 1ffffffff0b73f10 R10: dffffc0000000000 R11: fffffbfff0b73f11 R12: ffff88800b091d08 R13: ffff88800b091178 R14: dffffc0000000000 R15: ffff88800b091000 FS: 00007f555b86c600(0000) GS:ffff8881942a0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000562107d489c0 CR3: 0000000109a40002 CR4: 0000000000372ef0 Call Trace: <TASK> rtnl_dellink (net/core/rtnetlink.c:3632 net/core/rtnetlink.c:3674) rtnetlink_rcv_msg (net/core/rtnetlink.c:7112) netlink_rcv_skb (net/netlink/af_netlink.c:2556) netlink_unicast (net/netlink/af_netlink.c:1319) netlink_sendmsg (net/netlink/af_netlink.c:1900) ____sys_sendmsg (net/socket.c:775) __sys_sendmsg (net/socket.c:2738) do_syscall_64 (arch/x86/entry/syscall_64.c:63) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) ... unregister_netdevice: waiting for veth0 to become free. Usage count = 7 ref_tracker: netdev@ffff88800d7496d8 has 3/3 users at __netdev_adjacent_dev_insert (./include/linux/netdevice.h:4525 ./include/linux/netdevice.h:4554 net/core/dev.c:8791) __netdev_upper_dev_link (net/core/dev.c:8879 net/core/dev.c:8963) netdev_upper_dev_link (net/core/dev.c:9009) amt_newlink (drivers/net/amt.c:3321) Fixes: b9022b53adad ("amt: add control plane of amt interface") Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Reviewed-by: Taehee Yoo <ap420073@gmail.com> Link: https://patch.msgid.link/20260807020326.2519445-1-kuniyu@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10tcp: fix icsk_ack.ato bitfield overflowJiayuan Chen
On cross-region connections we observed delayed ACKs suddenly turning into immediate ACKs plus a TCP_MAX_QUICKACKS burst, as if the connection had just received its first data segment. Commit 95b9a87c6a6b ("tcp: record last received ipv6 flowlabel") squeezed icsk_ack.ato into 8 bits, sized for TCP_DELACK_MAX. But both writers still bound ato by icsk_rto, which can be well above 255 jiffies, so the bitfield assignment silently wraps mod 256: repeated delack timer misses double ato up to icsk_rto, storing 320 as 64 and 256 as 0, and ato == 0 is the "first data packet" sentinel in tcp_event_data_recv(). Clamp both writers to TCP_DELACK_MAX, which the static_assert already guarantees to fit and tcp_send_delayed_ack() effectively caps ato at anyway. Fixes: 95b9a87c6a6b ("tcp: record last received ipv6 flowlabel") Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Reviewed-by: Neal Cardwell <ncardwell@google.com> Link: https://patch.msgid.link/20260807014437.36687-1-jiayuan.chen@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10nilfs2: enhance btree node keys checkWang Jianjian
syzbot reported a warning on nilfs_btree_assign: WARNING: fs/nilfs2/btree.c:2302 at nilfs_btree_assign+0x983/0xbe0 fs/nilfs2/btree.c:2302, Analysis found that a corrupted file has the following btree layout: Level2(key/ptr): [ 256/15 ] Level1(key/ptr): [ 0/8, 1/9, 0/10, 3/11, 4/12, 5/13, 6/14, 139637976727559/16, 0/17 ] The test truncated the file to 2 bytes, which partially zeroes the first block and adds the file to the dirty list. When the segment constructor writes it and assigns a new blocknr for the index block, it searches the btree with key=0 and min level=2, and apparently returns -ENOENT. Therefore, we should perform more checks on the btree nodes and return early. [ryusuke: split long lines in btree.c to satisfy checkpatch and improved the error message format for clarity] Reported-by: syzbot+158be45e4d99232e1900@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=158be45e4d99232e1900 Signed-off-by: Wang Jianjian <wangjianjian3@huawei.com> Fixes: 17c76b0104e4 ("nilfs2: B-tree based block mapping") Cc: stable+noautosel@kernel.org # Warning suppression primarily Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>