summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-10-20alpha: determine tininess after rounding in the FP emulationMatt Turner
IEEE 754 lets an architecture determine tininess of a floating-point result either before or after rounding, but requires the same choice for every operation. Alpha determines it after rounding, and stdlib's tst-tininess confirms the hardware does so for the results it produces itself. The soft-fp emulation has no notion of the distinction and always determines tininess before rounding, so a result that the hardware would not consider tiny is reported as underflowing whenever the instruction happens to trap for software completion. The two paths then disagree on the same machine. A multiply of the largest subnormal double by 1 + 2^-52 rounds up to the smallest normal and raises no underflow when the operands are normal, but raises it when an operand is subnormal and the instruction traps: glibc math testsuite, test-float32x-float64-mul: Failure: mul_double (0x3.ffffffffffffcp-1024, 0x1.0000000000001p+0): Exception "Underflow" set Add _FP_TININESS_AFTER_ROUNDING, as glibc's copy of soft-fp has, and set it for alpha. It determines tininess by rounding a copy of the result as if the exponent range were unbounded, which is what the definition asks for. A plain check of whether the rounded result came out normal is not equivalent: it differs for values that are still tiny once rounded with an unbounded exponent range but reach the smallest normal on the coarser subnormal grid. That plain check is what the hardware itself does (it decides tininess from the delivered result), and it is why a divide such as -0x4p-128 / 0x1.000002p+0 in FE_DOWNWARD delivers -0x1p-126 and raises nothing although the result is tiny after rounding. Such cases do not trap, so the emulation never sees them; where it does get control, it follows the definition rather than reproducing that deviation, which is what glibc's soft-fp does as well. The macro defaults to zero, so powerpc, sh and sparc keep determining tininess before rounding as they do now. Cc: stable@vger.kernel.org # 5.15+ Reviewed-by: Magnus Lindholm <linmag7@gmail.com> Tested-by: Magnus Lindholm <linmag7@gmail.com> Link: https://lore.kernel.org/r/20260803-alpha-fp-exceptions-v1-3-c99d75608e60@gmail.com Signed-off-by: Matt Turner <mattst88@gmail.com>
2026-10-20Merge branch 'net-pse-pd-si3474-probe-error-path-cleanups'Jakub Kicinski
Carlo Szelinsky says: ==================== net: pse-pd: si3474: probe error path cleanups Two small changes to the error paths in si3474 probe. They do not depend on the PSE fixes for net ("net: pse-pd: assorted lifetime and error-path fixes" v2) and apply to net-next as they are. 1 The error message after a failed devm_add_action_or_reset() reads the ancillary I2C client, which was just unregistered. 2 Use dev_err_probe() for a failed controller registration, as pd692x0 and tps23881 do. 1 was found by code inspection and not reproduced. Both are build-tested only, with W=1. [1] https://lore.kernel.org/20261018082314.48950-1-github@szelinsky.de [2] https://lore.kernel.org/20261018081853.47484-1-github@szelinsky.de ==================== Link: https://patch.msgid.link/20261020171134.852878-1-github@szelinsky.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-20net: pse-pd: si3474: use dev_err_probe() for controller registrationCarlo Szelinsky
si3474 prints the error of a failed controller registration as a hex number, such as 0xfffffff4 for -ENOMEM. Use dev_err_probe(), as pd692x0 and tps23881 already do. It prints the error by name, and if the registration ever returns -EPROBE_DEFER, it does not log that as an error. Only the log message changes. Signed-off-by: Carlo Szelinsky <github@szelinsky.de> Link: https://patch.msgid.link/20261020171134.852878-3-github@szelinsky.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-20net: pse-pd: si3474: fix use-after-free in ancillary client error pathCarlo Szelinsky
If devm_add_action_or_reset() fails, it has already unregistered the ancillary I2C client, and the error message then reads that client's device. It can only fail with -ENOMEM, which is already reported, so drop the message. Found by code inspection. Not reproduced. Fixes: a2317231df4b ("net: pse-pd: Add Si3474 PSE controller driver") Reviewed-by: Kory Maincent <kory.maincent@bootlin.com> Signed-off-by: Carlo Szelinsky <github@szelinsky.de> Link: https://patch.msgid.link/20261020171134.852878-2-github@szelinsky.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-20MAINTAINERS: Update Michael Chan's email for tg3Michael Chan
My old email address doesn't work anymore. Update it to the current working one. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20261020225358.1130051-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-21ksmbd: reject FILE_ATTRIBUTE_TEMPORARY on directoriesMichail Andreas Michalopoulos
Setting FILE_ATTRIBUTE_TEMPORARY on a directory with SMB2 SET_INFO (FileBasicInformation) succeeds: ksmbd keeps the attribute and, with "store dos attributes" enabled, also writes it to the DOS attribute xattr. MS-FSA (FileBasicInformation) says the request must fail with STATUS_INVALID_PARAMETER when FILE_ATTRIBUTE_TEMPORARY is set on a directory, and Samba rejects it too. smbtorture's smb2.create.dosattr_tmp_dir checks this and fails against ksmbd. Return -EINVAL, which is sent as STATUS_INVALID_PARAMETER, when a directory is asked to become TEMPORARY. Do the check before any timestamp is changed, so a rejected request leaves the open file and the inode unchanged. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Assisted-by: LLM Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: deny access for an empty DACL instead of granting the requestAamir Ahmed
smb_check_perm_dacl() returns the access mask it computes to the SMB2 CREATE handler, which uses it as the granted access for the open. For a security descriptor whose DACL is present but contains no ACEs, the function is supposed to deny access: an empty (non-NULL) DACL grants no access to anyone except the object owner's implicit READ_CONTROL and WRITE_DAC (MS-DTYP 2.4.5). The empty-DACL branch only denies when both - the DACL has no trailing bytes (pdacl_size == sizeof(struct smb_acl)), and - the request contains bits beyond READ_CONTROL / WRITE_DAC. In every other case it takes the shared "goto err_out" with rc still 0, which returns success without modifying *pdaccess, so the caller grants the full requested access. Three problems follow: - The READ_CONTROL / WRITE_DAC carve-out models the owner's implicit rights, but the check runs before is_owner is computed, so those rights are handed to *every* caller, not just the owner. For READ_CONTROL the SMB2 CREATE path does not fall back to inode_permission(), so any user can read the security descriptor of an object whose empty DACL is meant to deny them. - A request of exactly READ_CONTROL and/or WRITE_DAC is granted to any caller. WRITE_DAC lets the handle rewrite the DACL. - A DACL that declares zero ACEs but carries trailing bytes (pdacl_size > sizeof(struct smb_acl)) skips the deny entirely and is granted whatever was requested. On shares where the NT ACL is the authoritative access control -- e.g. "force user" shares, where every client maps to one POSIX identity so POSIX cannot distinguish users -- this is an access-control bypass. Compute is_owner before the empty-DACL branch and deny access from an empty DACL unless the caller is the owner requesting no more than READ_CONTROL / WRITE_DAC. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Aamir Ahmed <elb12345@hotmail.co.uk> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21Merge tag 'drm-misc-next-2026-10-16' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/misc/kernel into drm-next drm-misc-next for v7.5: UAPI Changes: - Add Apple Interchange fourcc. - Expose amdxdna busy time via DRM fdinfo. Cross-subsystem Changes: - Improve DT bindings for display/ste,mcde - Add kunit test for dma_fence_dedup_array() to dma-buf/test. Core Changes: - Documentation updates to drm/scheduler, gpu/buddy. - Fail kmapping a bo without pages. Driver Changes: - Bugfixes and improvements to panel/Raystar RFF500F-AWH-DNN, accel/ivpu, vc4, accel/amdxdna, panthor, nouveau, panfrost, panthor, accel/qaic, accel/rocket, bridge/lontium-lt8713sx, appletbdrm. - Add support for BOE Novatek NT51021, Retroid Pocket 6, Raydium RM69220 DDIC panels, Sharp LQ138P1JX61 eDP, BOE NV140FHD-N43, AUO B140HAN04.0, AUO 0x0db3, panels. - Add support for Mali-G68 to panfrost. - Add Chrontel CH7218A to bridge/simple. - Support ARGB8888 for virtio primary planes. - Improve panfrost gpu reset handling and initialization. - Add HDMI 2.0 support to rockchip/dw-hdmi-qp and improve HPD handling. - Advertise HDMI 1.2 capabilities in sun4i, bridge/adv7511, it66121 & inno-hdmi. - Advertise HDMI 1.3 capabilities in bridge/ite-6263. - Advertise HDMI 1.4 capabilities in bridge/lt9611 & rockchip/rk3066_hdmi - Switch many drivers to drm_atomic_helper_create_state in preparation for readout. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patch.msgid.link/75e7de61-048c-4fdd-9ad2-6b47b29a4863@linux.intel.com
2026-10-20Merge tag 'chrome-platform-firmware-v7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform firmware loader updates from Tzung-Bi Shih: "New: - Rename drivers/firmware/google/ -> drivers/firmware/coreboot/ and corresponding Kconfig names - Separate firmware_attributes_class from drivers/platform/x86/ to drivers/firmware/ so that it is available for non-x86 platforms - Add CFR (coreboot form representation) driver to expose the attributes via sysfs Improvements: - Use named initializers for acpi_device_id" * tag 'chrome-platform-firmware-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: firmware: coreboot: Add CFR firmware attributes driver firmware: Move firmware attributes class helper firmware: coreboot: Use named initializers for acpi_device_id firmware: Rename google firmware directory to coreboot
2026-10-20Merge tag 'chrome-platform-v7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Tzung-Bi Shih: "Improvements: - Poll for role swap completion in cros_ec_typec Fixes: - Fix wrong returned data and length for deferred response in transport protocol - Check boundary for EC-returned data length in cros_ec_typec - Fix a regression for older ChromeOS devices after applying db65a06d10b3 ("ACPI: EC: Convert the driver to a platform one") Cleanups: - Fix typos" * tag 'chrome-platform-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_typec: Poll for role swap completion platform/chrome: cros_usbpd_notify: Only use drvdata when parent is GOOG0004 platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data platform/chrome: cros_ec_rpmsg: Fix repeated word 'from' in comment platform/chrome: Fix typos in comments platform/chrome: cros_ec_proto: Simplify cros_ec_wait_until_complete() platform/chrome: cros_ec_proto: Fix deferred response platform/chrome: cros_ec: Sync host command header with EC
2026-10-20Merge tag 'cmpxchg-emu.2026.10.12b' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull two-byte cmpxchg emulation from Paul McKenney: "These commits add a cmpxchg_emu_u16() function that emulates two-byte cmpxchg() in terms of four-byte cmpxchg() for architectures not having native instructions for this purpose. They also make use of this cmpxchg_emu_u16() function in those architectures, namely sh, arc, csky, and xtensa. This permits use of two-byte cmpxchg() in common code. However, it sadly does not permit easy implementation of all algorithms needing on two-byte atomic operations because there are some systems still supported by Linux that do not have native two-byte store instructions. There is reason to believe that these systems will soon no longer be supported by Linux [1]" Link: https://lore.kernel.org/all/20260908152808.3928630-4-arnd@kernel.org/ [1] * tag 'cmpxchg-emu.2026.10.12b' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: xtensa: Emulate two-byte cmpxchg csky: Emulate two-byte cmpxchg ARC: Emulate two-byte cmpxchg sh: Emulate two-byte cmpxchg lib: Add two-byte cmpxchg emulation function
2026-10-20Merge tag 'docs-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/docs/linuxLinus Torvalds
Pull documentation updates from Jonathan Corbet: "It was a reasonably busy cycle for docs; changes include: - Add the AGENTS.md symbolic link into the top-level directory in the hopes that LLMs will read it and produce better work - The removal of the Assisted-by requirement, as concluded at the Maintainer Summit - A new "testdocs" make target to run the documentation unit tests - Lots of work on the Portuguese, and Chinese translations; there is now maintenance for the traditional Chinese translations as well ...and the usual pile of minor fixes, documentation updates, etc" * tag 'docs-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/docs/linux: (125 commits) docs: add AGENTS.md as a symlink to README docs: kernel-parameters: adjust reserve_mem build option docs: kernel-parameters: don't mix cmdline options & build options docs/ja_JP: translate submitting-patches.rst (review and report tags) docs: remove Assisted-by references Revert "docs: landlock: fix ENOMSG condition in create_ruleset kernel-doc" docs: kdoc: parse context_lock_struct() as struct declaration docs: timers: hpet: Document userspace API and ioctl commands docs: timers: hpet: Modernize file references Documentation: sched-preemption: Add a SPDX license identifier docs: ABI: sysfs-driver-xdata: use literal blocks for console commands docs: ABI: sysfs-class-firmware-attributes: use literal blocks for console commands ABI: sysfs-bus-usb: use literal block for console commands docs/ABI: testing: aspeed-uart-routing: use literal block for console commands docs: kernel-parameters: fix a truncated sentence for preempt=lazy sched/doc: add a preemption model overview docs: ABI: TMR manager: use literal blocks for console I/O Documentation/ABI: IFS: use literal blocks for commands ABI: sysfs-bus-pci: use literal blocks for commands docs: translations: pt_BR: add debugging index ...
2026-10-20Merge tag 'nolibc-20261018-for-7.4-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc Pull nolibc updates from Thomas Weißschuh: - New architectures: Hexagon, 64-bit parisc - New library functionality: sendfile(), pread(), pwrite() - Various bugfixes and cleanups * tag 'nolibc-20261018-for-7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc: (28 commits) selftests/nolibc: explicitly disable position independent executables selftests/nolibc: use the configured kernel header directory tools/nolibc: fix the function argument order of calloc() tools/nolibc: check for overflow in malloc() tools/nolibc: stop rounding malloc() sizes up to 4096 bytes tools/nolibc: add support for pread() and pwrite() tools/nolibc: introduce __NOLIBC_BITS_PER_SYSCALL_ARG tools/nolibc: move __NOLIBC_LLARGPART() to compiler.h tools/nolibc: make 64-bit systemcall argument padding generic selftests/nolibc: make the broken MIPS N32 argument detection reusable tools/nolibc: add 64-bit parisc support selftests/nolibc: test the FD_* macros tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit tools/nolibc: fix readdir_r() with 64-bit directory offsets tools/nolibc: fix verrx() and errx() message formatting selftests/nolibc: add tests for the wait status macros tools/nolibc: fix WIFSIGNALED() for status 0 tools/nolibc/parisc: consistently use %dp to refer to register %r27 selftests/nolibc: validate ENOTDIR return values from opendir()/fdopendir() tools/nolibc: verify that a directory is opened ...
2026-10-20vxlan: vnifilter: validate the VXLAN_VNIFILTER_ENTRY nestAli Firas
vxlan_vnifilter_process() parses the message with vni_filter_policy, whose VXLAN_VNIFILTER_ENTRY is a bare NLA_NESTED with no nested policy attached. The entry attributes are therefore validated only later, one entry at a time, by the nla_parse_nested() inside vxlan_process_vni_filter(). Entries are parsed as they are dispatched: in a message whose first entry is valid and whose second is not, the first entry is applied and its RTM_NEWTUNNEL notification sent before the second is rejected. Link the nest to vni_filter_entry_policy with NLA_POLICY_NESTED() so every entry is checked against the entry policy up front, before any entry is acted on. A message whose entry the policy rejects -- a malformed attribute, or, with the next patch, an out-of-range endpoint -- is now refused as a unit and installs nothing. Faults the policy does not cover, such as a device or handler error raised on a later entry, are unchanged: entries are still dispatched and applied one at a time. This reorders two faults. The nest is validated before the device is looked up and before the vnifilter flag is checked, so a request rejected by the entry policy, aimed at a missing or non-vnifilter device, now returns that policy error where it previously returned -ENODEV or -EOPNOTSUPP. The request was invalid either way; only the errno an operator sees changes. The nla_parse_nested() in vxlan_process_vni_filter() stays: it is what fills the per-entry attribute table the handler reads. It can no longer fail on a message that has reached it. Suggested-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/netdev/20260921150904.65a704eb@kernel.org/ Signed-off-by: Ali Firas <alishmery18@gmail.com> Link: https://patch.msgid.link/20261014123814.388557-2-alishmery18@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-20Merge tag 'for-linus-7.4-rc1-tag' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: "This time only small fixes and cleanups all over Xen related drivers. Nothing really stands out here" * tag 'for-linus-7.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen-blkfront: Fix IO race during unplug xen-pciback: Fix pcistub_device ref leak in pcistub_get_gsi_from_sbdf() xen/pcifront: check that an AER callback exists before calling it xen/gntdev: Fix gntdev_dmabuf ref leak in dmabuf_exp_wait_released() x86/PVH: don't truncate initrd address/size xen/privcmd: Only claim ioreqs matching an ioeventfd xen/scsifront: check for a NULL shadow entry on a backend response xen: fix typos in comments xen/gntdev: prevent private mappings from becoming writable xen: remove unused hvm_vcpu.h header xen-blkfront: unbind irq before tearing down ring and shadow requests xen/blkback: Prevent missed completion when draining I/O xen/pcifront: Fix PCI device reference leak in AER handling
2026-10-20Merge tag 'alpha-for-v7.4-tag' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lindholm/alpha Pull alpha updates from Magnus Lindholm: "This completes Alpha's conversion to GENERIC_ENTRY and enables a range of kernel features through Kconfig updates, including UBSAN, gcov, kmemleak, page-table checking, fast GUP and sparse IRQs. It includes TLB and MMU context fixes prompted by glibc test-suite failures, HugeTLB support for 64KB, 512KB and 4MB pages, and fixes for poisoned-page faults and page-table checking. Machine-check handling is improved on Tsunami platforms, with bounded EV6 logout decoding, Clipper environmental event reporting and safer firmware console-log scanning. Other changes add self-extracting compressed kernels with support for all kernel compression formats, Alpha-specific XZ tuning, perf register and user-stack sampling, and Alpha support in the seccomp selftests. The series also fixes user stack-pointer reporting and IRQ entry ordering, adds 128-bit shift helpers, cleans up linker sections, and updates Kconfig help" * tag 'alpha-for-v7.4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/lindholm/alpha: (57 commits) alpha: add bounded Clipper console-log scanning alpha: decode Clipper environmental events alpha: decode and acknowledge Tsunami system machine checks alpha: bound EV6 logout decoding by the processor area alpha: describe the Tsunami system machine check frame alpha: move Tsunami machine check handling to err_tsunami.c alpha: fill in pc for software event samples alpha: add HAVE_PERF_REGS and HAVE_PERF_USER_STACK_DUMP support alpha: use user_stack_pointer() in KSTK_ESP() and dump_elf_thread() alpha: stop storing the user stack pointer in pt_regs alpha: fix stale user_stack_pointer() selftests/seccomp: add Alpha support to seccomp_bpf alpha: do not skip TLB shootdown IPIs for kthread-borrowed mms alpha: do not clear remote MMU contexts in migrate_flush_tlb_page() alpha: invalidate the local context in flush_icache_user_page() alpha: invalidate the local context in flush_tlb_mm() alpha: fix the local TLB invalidate in the UP flush_tlb_page() alpha: fix the local TLB invalidate in flush_tlb_page() alpha: invalidate the local context in flush_tlb_page() alpha: only use a targeted tbi() when the target mm is really current ...
2026-10-20Merge tag 's390-7.4-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Heiko Carstens: - Add support for sclp-vt220 terminal resize events e.g. for QEMU - Warn if kernel command line contains non-printable EBCDIC characters - Improve show_code() disassembly output by using reliable markers for the instruction address and faulting instruction - Rework exception handling to require only a single exception table entry per faulting instruction: convert all inline assemblies from EX_TABLE to the new EX_TABLE_INSN macros. The previous exception handling was error prone since it usually required two EX_TABLE entries: one pointing at the instruction, and one pointing behind it - Disallow kprobes on instructions with exception table entries to avoid exception handlers decoding a breakpoint instead of the original instruction - Preemptible percpu ops changes: - Simplify percpu_entry() and percpu_exit() by encoding the percpu base, offset, and pointer registers into the lowcore marker, allowing percpu_exit() to update the percpu pointer on CPU migration without comparing the interrupted instruction - Convert this_cpu_cmpxchg(), this_cpu_xchg(), and this_cpu_cmpxchg128() to preemptible percpu ops; provide this_cpu_try_cmpxchg() - Emulate virtual timer in appldata via delayed work and remove the s390 specific vtimer infrastructure - Add lock contention tracepoints to rwlock slowpath - Fix incorrect return address in signal frame setup - Fix cpum_cf CPU hotplug handling - Convert various __get_free_pages() / get_zeroed_page() users to kmalloc() / kzalloc() - PCI: - Improve RPCIT instruction tracing - Fix double-free, use-after-free, and resource leaks in zPCI MSI and IRQ setup / cleanup paths - Crypto and zcrypt: - Improve reply message and length verification checks for CCA, EP11, and ICA messages to prevent out-of-bounds reads - Add missing array_index_nospec() for domain index uses in zcrypt to prevent speculative execution bypass - Fix out-of-bounds read in cca_query_crypto_facility() - Various other small fixes and improvements * tag 's390-7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (102 commits) s390/signal: Cleanup coding style s390/signal: Fix incorrect return address in signal frame s390/probes: Fix wrong mnemonic comment for clgib s390/probes: Add missing fixup for bctgr and bic s390/probes: Fix wrong opcode for cgrb fixup s390: Select ARCH_MEMORY_ORDER_TSO s390/mm: Cleanup pXXp_flush_lazy() routines s390/pci: Add function handle to RPCIT insn trace s390/pci: Use 32-bit fh outside of inline asm s390/pci: Adjust alignment in insn trace s390/sclp: Remove redundant memset after memblock_alloc_low() s390/entry: Save lowcore on invalid kernel stack s390/entry: Last breaking event vs invalid kernel stack s390/percpu: ImplemenHeiko Carstenst this_cpu_try_cmpxchg() s390/percpu: Drop unused output register from arch_this_cpu_to_op() s390/percpu: Drop unused output register from arch_this_cpu_add() s390/percpu: Use asm_inline for arch_this_cpu_add() s390/extable: Remove EX_TABLE macros and fallback extable search s390/bpf: Simplify exception table entry handling s390/sclp: Convert inline assembly to EX_TABLE_INSN ...
2026-10-20Merge tag 'nios2_update_for_v7.4_part_2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux Pull NIOS2 update from Dinh Nguyen - Declare __mulsi3 export * tag 'nios2_update_for_v7.4_part_2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: nios2: ksyms: Declare __mulsi3 export
2026-10-20Merge tag 'm68k-for-v7.4-tag1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - Add and enable support for the SVEthLANa Ethernet interface on the Atari SuperVidel FPGA expansion card - Enable support for the IDE interface on the Amiga CS-Lab Warp expension card - defconfig updates - Miscellaneous fixes and improvements * tag 'm68k-for-v7.4-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: defconfig: Enable ATARI_SVETHLANA and ETHOC m68k: defconfig: Update defconfigs for v7.3-rc1 zorro: Use assign_bit() where applicable m68k: apollo: Fix interrupt setup m68k: defconfig: Enable PATA_CSWARP m68k: Add support for SVEthLANa m68k: Add include guard to asm/serial.h m68k: Use generic BASE_BAUD in asm/serial.h
2026-10-21ksmbd: reject foreign RPC pipe handles on IPC$ read and writeMohammed Alquraini
RPC pipe handles on IPC$ are allocated from a single server-global IDA, and ksmbd.mountd looks a pipe up by handle alone, with no session information. smb2_read_pipe() and smb2_write_pipe() take the handle straight from the client request (VolatileFileId) and pass it to the daemon without checking that the requesting session opened it. An authenticated user can therefore issue an SMB2 READ or WRITE on IPC$ with another session's handle and receive that session's in-flight DCERPC response, or write attacker-chosen bytes into its pipe stream. A tree connect to IPC$, which every RPC client already has, is the only requirement. Validate ownership before the transfer, the way the sibling pipe paths already do: under sess->rpc_lock, ksmbd_session_rpc_method() returns 0 for a handle the session did not open. smb2_get_info_file_pipe() and the FSCTL_PIPE_TRANSCEIVE ioctl already reject such handles; read and write were the remaining gap. Reject them with STATUS_FILE_CLOSED, as the ioctl path does. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Assisted-by: LLM Signed-off-by: Mohammed Alquraini <mohammed.saad.alquraini@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-20net/smc: queue the copied chunk when smc_tx_sendmsg() faultsBryam Vargas
When a send wraps the end of the send buffer, smc_tx_sendmsg() copies the data in two chunks. If memcpy_from_msg() faults on the second one, smc_tx_sendmsg() returns send_done, which already counts the first chunk, but leaves tx_curs_prep and sndbuf_space as they were. send() reports bytes the peer never receives, and the next send() overwrites them. Any caller can hit this on its own stream with a buffer whose tail is unreadable. On a fault in the second chunk, queue the first one. The next pass retries the rest and returns send_done if it faults again, so send() reports only what it queued, as TCP does. Fixes: e6727f39004b ("smc: send data (through RDMA)") Cc: stable@vger.kernel.org Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me> Link: https://patch.msgid.link/20261013-b4-disp-872a3689-v1-1-2a4c63b04761@proton.me Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-21ksmbd: fix fd_limit accounting across durable reconnectsNamjae Jeon
A disconnected durable handle keeps its ksmbd_file and the fd_limit reservation taken at its initial open. Reconnecting allocates another volatile ID and takes another reservation for the same file. Final close returns only one reservation, so repeated reconnects permanently reduce the server-wide open-file budget. Move reservation into ksmbd_open_fd() and release it on every creation failure. Keep the reservation until final close, including while a durable handle is disconnected. Make ID allocation independent of fd_limit so reconnects neither consume nor return slots. This also avoids returning an unreserved slot when persistent ID allocation fails. New opens continue to return -EMFILE when the budget is exhausted, keeping the existing STATUS_INSUFFICIENT_RESOURCES mapping. Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2") Reported-by: Mohammed <mohammed.saad.alquraini@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: drain session procfs readers before dropping table referencesNamjae Jeon
Session registration failure and connection cleanup can drop the table reference while the per-session procfs entry is still accessible. If a reader holds the last remaining reference, its final put calls proc_remove() from its own callback and waits for that callback to finish. Remove the procfs entry before dropping the table reference in the registration failure path. Queue sessions removed during connection cleanup and drain their procfs readers after releasing both session locks, then return their table references. Keep the global hash node unhashed while a session is queued so a concurrent unregister cannot drop the reference again. Previous-session replacement also destroys the file table before the session is finally freed. Detach the idr under the lock used by procfs file counters, and report zero files after it has been detached. This prevents a reader from accessing the idr during or after its destruction. Fixes: d7fd1f98607f ("ksmbd: follow SMB2 session expiration semantics") Cc: stable@vger.kernel.org Reported-by: Abdifatah Suruur <suruurism@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: reclaim ended sessions on logoff and expirationNamjae Jeon
LOGOFF and previous-session replacement leave sessions Expired with a zero credential expiry. Ended sessions can retain their memory and connection slots when no further setup arrives on the owning connection. Unpublish a logged-off session while the request reference keeps its response signing and encryption keys alive. Remove its procfs entry before dropping the table reference so a reader cannot remove its own entry on the last put. Clear proc_entry after removal to avoid removing it twice. Reclaim ended sessions from the global table in the existing expiration worker before it acquires conn_list_lock. Only select Expired sessions with zero credential expiry and no references beyond the table reference. Keep sessions whose Kerberos credentials expired available for reauthentication. Unlink the session from its setup connection and all channel connections, so SMB2 sessions and sessions with only secondary SMB3 channels are covered. The session already holds connection references, and sessions_table_lock prevents concurrent channel removal. Queue sessions on a separate disposal list, leaving their hash nodes unhashed, and remove procfs entries and drop table references outside the locks. Keep the pending setup check before allocating a new session so abandoned InProgress sessions can release their slots even at the connection limit. Retain the timeout and reference checks and dispose of those sessions outside the locks. Leave ended Expired sessions to the expiration worker. Fixes: d7fd1f98607f ("ksmbd: follow SMB2 session expiration semantics") Cc: stable@vger.kernel.org Reported-by: Abdifatah Suruur <suruurism@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: limit sessions on each connectionNamjae Jeon
The pending setup limit only counts InProgress sessions. A client can complete authentication repeatedly and retain an unbounded number of Valid sessions on one connection. Reserve a connection slot before allocating a session and retain a connection reference while authentication is in progress. The first SMB3 channel takes over that reservation; binding to another connection reserves one slot there. Reauthentication and authentication continuation reuse the existing reservation. Return slots on allocation or insertion failure, channel removal, and final session destruction. Accept max_sessions_per_connection in reserved startup-request space and default to 64 when older tools leave it zero. Keep the request size and existing field offsets unchanged. Expose the configured limit in procfs. The existing connection limits bound the aggregate number of sessions without a separate global session allocation limit. Fixes: d7fd1f98607f ("ksmbd: follow SMB2 session expiration semantics") Cc: stable@vger.kernel.org Reported-by: Abdifatah Suruur <suruurism@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: hold a connection reference for each session channelNamjae Jeon
ksmbd_session_unregister() removes a session from the global and per- connection tables before dropping the table reference. A concurrent reference holder can keep the session and its channel list alive after those removals. Connection cleanup can no longer find the unpublished session to remove its channels. Since a channel only stores a raw conn pointer, the connection can be freed while another session reference holder is still accessing it, for example during SMB3.1.1 binding or a procfs read. Take a connection reference when registering a channel and release it on insertion failure, channel removal, or final session destruction. Keep the channels and signing keys until the session is destroyed so a response can still be signed after the session has been unregistered. Fixes: d7fd1f98607f ("ksmbd: follow SMB2 session expiration semantics") Cc: stable@vger.kernel.org Reported-by: Abdifatah Suruur <suruurism@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: defer connection scavenging while session locks are busyNamjae Jeon
The expiration worker holds conn_list_lock for reading while checking for authenticated sessions. Without this change, the check can wait for conn->session_lock or sessions_table_lock. In destroy_previous_session(), the status updates after ksmbd_conn_wait_idle_sess() run with both session locks held for writing. Both the KSMBD_SESS_GOOD error path and the KSMBD_SESS_NEED_SETUP success path call ksmbd_all_conn_set_status(), which takes conn_list_lock for reading. A writer queued on conn_list_lock can block these new read acquisitions. The worker then waits for a session lock held by destroy_previous_session(), which waits behind the writer. The writer cannot proceed until the worker releases conn_list_lock. Try both session locks instead of waiting in the scavenging check. Keep the connection when either lock is busy and let the periodic worker retry later. Fixes: d7fd1f98607f ("ksmbd: follow SMB2 session expiration semantics") Cc: stable@vger.kernel.org Reported-by: Abdifatah Suruur <suruurism@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: accept share config responses from ksmbd-tools before 3.5.3Michail Andreas Michalopoulos
ksmbd-tools releases before 3.5.2 do not have the payload_sz field in struct ksmbd_share_config_response; the field occupies the last word of their reserved[] area, so the kernel always sees payload_sz == 0 from them. ipc_validate_msg() and share_config_request() used to treat payload_sz == 0 as "legacy userspace" and skip the payload size checks. That case was removed by commit f25e93768fcc ("ksmbd: prevent out-of-bounds reads in share config responses"). With payload_sz == 0: - the IPC$ (pipe) response fails the final message size comparison: these tools always send a one-byte payload, so msg_sz is sizeof(*resp) + 1, but the expected size is now computed as sizeof(*resp) + 0; - every other share fails "payload_sz <= veto_list_sz". In addition, ksmbd-tools before 3.5.3 copy a global "veto files" setting into the IPC$ response, so with such a configuration IPC$ also fails the now unconditional "veto_list_sz > payload_sz" check, even though pipe shares never use a veto list. ksmbd_ipc_share_config_request() then returns NULL and every tree connect fails with STATUS_BAD_NETWORK_NAME, so ksmbd cannot serve any share when used with these ksmbd-tools releases, for example the 3.5.1 package shipped by Ubuntu 24.04. Login still works, which makes the failure look like a configuration problem: CIFS: VFS: BAD_NETWORK_NAME: \\127.0.0.1\IPC$ CIFS: VFS: \\127.0.0.1 failed to connect to IPC (rc=-2) When payload_sz is zero, derive it from the size of the message actually received and store it back in the response, so that the checks in ipc_validate_msg() and the path and veto list parsing in share_config_request() all use the same bound. The response is the kernel's own copy made by handle_response(), and msg_sz has already been checked to be at least sizeof(*resp), so this cannot underflow. All checks added by that commit then apply unchanged, bounded by the bytes that really arrived, and newer ksmbd-tools that fill in payload_sz are unaffected. Also skip the veto list size check for pipe shares: share_config_request() reads neither the path nor the veto list for them. Tested in QEMU with ksmbd-tools 3.5.1 and 3.5.7 and the in-kernel SMB client over loopback, with and without a global "veto files" setting. Fixes: f25e93768fcc ("ksmbd: prevent out-of-bounds reads in share config responses") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: round SetAllocation to the advertised allocation unitDaeMyung Kang
SetAllocation rounds requests to 512-byte blocks, although FS_SIZE_INFORMATION advertises the filesystem's f_bsize as its allocation unit. For example, on a filesystem with a 4 KiB unit, a 1000-byte request can truncate an 8 KiB file to 1024 bytes instead of 4 KiB. Round the request to the advertised unit and use the same result for the block-count decision, fallocate, truncate, and the size stored on the open handle. Validate the unit and rounded size before either operation. Use DIV_ROUND_UP_ULL() so the calculation works on 32-bit kernels. This does not change the existing block-count decision for whether to call fallocate. In particular, success does not yet guarantee reservation of holes within the requested range on a sparse file. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Signed-off-by: DaeMyung Kang <charsyam@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: avoid restoring only in-memory EOF after allocation changeDaeMyung Kang
When SetAllocation requests a size below the allocated block count but above EOF, ksmbd truncates the file to that size and restores only the in-memory i_size. The larger EOF remains on disk and reappears after a reboot. A 3-byte file preallocated to 64 KiB can acquire a 4 KiB EOF after reducing its allocation to 4 KiB. Extending EOF this way is not a reliable way to reclaim the preallocation beyond the old EOF either. Only use this truncate path when the requested allocation is at or below the observed EOF. A truncate to the existing EOF still lets filesystems release preallocated blocks beyond EOF. Remove the in-memory-only i_size restoration. The size check still precedes vfs_truncate() taking the inode lock, so a concurrent shrink can make the truncate extend EOF; that race also existed in the original path. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: DaeMyung Kang <charsyam@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: inherit FileIds in related compound requestsNamjae Jeon
MS-SMB2 specifies that subsequent related operations use the FileId from the preceding operation. Track FileIds from handle-bearing requests so related requests that use the all-ones placeholder resolve to the inherited handle. Return STATUS_INVALID_HANDLE when a related request refers to a FileId but the preceding operation neither contained nor generated one. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Reported-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: reserve space for the UTF-16 terminator in stream infoAbdifatah Suruur
smb_strtoUTF16() always writes a terminating zero UTF-16 unit after the converted characters, but get_file_stream_info() budgets only sizeof(struct smb2_file_stream_info) + streamlen * 2 for a stream entry and sizeof(struct smb2_file_stream_info) + 7 * 2 for the trailing "::$DATA" entry. When an entry exactly fills the 448-byte small response buffer, the terminator is written two bytes past the allocation. Reserve one extra UTF-16 unit in both budget checks. The terminator is not part of the wire format, so the reported lengths are unchanged. Cc: stable@vger.kernel.org Signed-off-by: Abdifatah Suruur <suruurism@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: reject FSCTL_SET_ZERO_DATA on a directory handleLee Seong Hyeon
An authenticated client with a writable tree connection can open a directory with FILE_WRITE_DATA and send FSCTL_SET_ZERO_DATA on that handle. The handler only checks fp->daccess & FILE_WRITE_DATA_LE, but on a directory FILE_WRITE_DATA is the legitimate add-file right, so the check passes. ksmbd_vfs_zero_data() then calls kernel_write() on the directory file, which has no FMODE_WRITE, and __kernel_write_iter() hits WARN_ON_ONCE(!(file->f_mode & FMODE_WRITE)), panicking a panic_on_warn kernel. Before commit 25e414db7033 ("ksmbd: report holes in allocated range queries") the dense-file path used vfs_fallocate(), which rejects directories with -EISDIR. The kernel_write() loop that replaced it has no such check. Reject a directory handle in ksmbd_vfs_zero_data() before writing, as ksmbd_vfs_write() already does for SMB2_WRITE. WARNING: fs/read_write.c:608 at __kernel_write_iter+0x74b/0x8c0 Workqueue: ksmbd-io handle_ksmbd_work Call Trace: kernel_write+0x1ef/0x4d0 ksmbd_vfs_zero_data+0x413/0x590 smb2_ioctl+0x21fa/0x66a0 handle_ksmbd_work+0x61b/0x1ff0 Fixes: 25e414db7033 ("ksmbd: report holes in allocated range queries") Signed-off-by: Lee Seong Hyeon <ihopenre@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: correct POSIX filesystem block size and response lengthNamjae Jeon
POSIX filesystem information uses f_bsize for BlockSize even when the filesystem reports a distinct fragment size for its block counts. Use f_frsize when available, falling back to f_bsize. Keep f_bsize as the optimal transfer size and derive the response length from the information structure instead of a hard-coded value. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: query POSIX filesystem info through the open fileNamjae Jeon
POSIX filesystem queries use the share root for statfs and do not validate the requested file handle. This can report the wrong filesystem for files below a mount point within the share. Require SMB3.1.1 POSIX extensions and a valid POSIX open. Resolve the requested handle, including compound file IDs, and use its referenced path for the filesystem query. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: require POSIX opens for file and directory queriesNamjae Jeon
POSIX file information queries only check the tree's extension flag, while directory queries do not verify that the directory was opened with a POSIX create context. Require SMB3.1.1, negotiated POSIX tree extensions and a POSIX open for both file and directory POSIX information requests. Return STATUS_INVALID_INFO_CLASS when these conditions are not met. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: include filenames in POSIX query infoNamjae Jeon
The POSIX file query response ends after the owner and group SIDs, omitting the filename length and filename. Append the path relative to the share in UTF-16, without a leading separator, and include its byte length in the response. Check both the fixed fields and the converted filename against the available output buffer before writing the response. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: correct POSIX file metadata in responsesNamjae Jeon
POSIX responses omit special permission bits, and the create response reports a file identifier as its reparse tag without encoding the file type. Directory and file queries also report rdev as the filesystem device identifier. Report the POSIX mode and file type in create responses, include special permission bits in all three response paths, and use the special-file reparse tag consistently. Set the corresponding DOS attribute in directory and file queries, report the filesystem device identifier and initialize reserved fields. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: apply POSIX mode ACEs in security updatesNamjae Jeon
Explicit modes carried by NFS mode ACEs can be overwritten by the DACL permission fallback, and security updates discard special mode bits. Track modes supplied by ACCESS_ALLOWED NFS mode ACEs and bypass the permission fallback for them. Apply both permission and special bits when setting an explicit POSIX mode. For SET_INFO, require a POSIX open for explicit mode changes and apply the mode only when DACL security information is requested. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: use requested mode in POSIX createsNamjae Jeon
The share mode helpers treat a requested POSIX mode of zero as an unspecified mode, replacing it with the share's default permissions. Use the requested mode, including zero, before applying the share masks and forced modes. Pass an explicit default-mode sentinel for non-POSIX creates to keep their existing mode selection. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: apply byte-range lock checks per openNamjae Jeon
Using the tree's POSIX extension flag to skip byte-range lock checks also skips them for ordinary opens on a POSIX-enabled tree. Base the read and write lock checks on each file's POSIX create context instead. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: enforce POSIX append-only writesNamjae Jeon
POSIX append-only opens do not set O_APPEND, and the SMB append sentinel is rejected as a negative write offset. Track append-only POSIX opens, set O_APPEND and require the U64_MAX offset sentinel for their writes. Accept FILE_WRITE_DATA or FILE_APPEND_DATA for WRITE requests, preserving ordinary SMB write permissions. Use the POSIX append flag and offset check to prevent POSIX append-only opens from overwriting existing data. For synchronous writes, derive the fsync range from the completed write position so append writes flush the range actually written. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: validate POSIX create contextsNamjae Jeon
POSIX create contexts are only examined when the tree has POSIX extensions enabled, and IPC requests bypass this validation. Examine POSIX contexts before selecting the IPC create path. Reject duplicate contexts and require an SMB3.1.1 connection, a POSIX-enabled tree and a non-IPC share for POSIX creates. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: validate POSIX negotiate contextsNamjae Jeon
The POSIX negotiate context currently enables extensions without checking its payload, and duplicate contexts are accepted. Reject duplicate contexts and invalid payload lengths. Enable POSIX extensions only for the published tag, and use the same tag constant when building the negotiate response. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: expire unacknowledged lease breaksNamjae Jeon
Arm a lease break acknowledgment timer once the common notification path accepts an ACK-required notification for transmission. Keep the deadline on the lease across channel retries and scan every lease in the global lease tables when the timer expires. Set timed-out leases and all their opens to NONE, then rearm for the next deadline. Serialize client acknowledgments, notification state and timer expiry under the lease lock, taking each open's state lock after it. Update every open before publishing break completion so a late acknowledgment cannot restore an expired lease. Wake blocked opens on timeout, send failure and global lease-table teardown, and cancel the timer at teardown. Keep the existing connection-independent lease-table lifetime and use the notifier's opinfo reference to retain the lease. Stop after selecting one open during lease-key lookup. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: expire unacknowledged oplock breaksNamjae Jeon
Arm the oplock break acknowledgment timer once the common notification path accepts a classic break for transmission. Preserve its shared retry deadline when another channel is tried. Store a deadline per open and scan the global open table when the earliest deadline expires. Drop expired breaks to NONE and restart the timer while other breaks remain. Serialize timer expiry with client acknowledgments and close using the oplock state lock. Wake blocked requests when a break expires or sending the notification fails, and invalidate durable reconnect for the open. Use wake_up_all() for acknowledgment, timeout, close and send failure. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: track SMB2 locks above OFFSET_MAX in server lock tableNamjae Jeon
SMB2 lock ranges use unsigned 64-bit offsets, but file_lock stores signed loff_t values. Track valid ranges above OFFSET_MAX in ksmbd's inode-based lock index and arbitrate conflicts there. Keep these offsets out of file_lock, and handle blocking requests, unlocks, rollback, close cleanup and cancellation in the SMB layer. Reserve large ranges under the index spinlock until the full request commits. Keep lookup and ownership independent of the connection so channel removal and hard-link opens use the same conflict checks. Finish large-range unlocks in the SMB layer after unlocking any VFS portion. Wake large-range lock waiters when normal locks are removed by unlock or close. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: rebind completed CREATE replays without draining the old channelNamjae Jeon
A completed DurableHandleReqV2 CREATE can be replayed through another channel while its original channel is exiting. The existing replay path returns the open but leaves its connection and oplock references pointing at the old channel. Its open count also stays on that channel, and a later CLOSE through the surviving channel decrements the wrong counter. After checking the owner, lease key and persistent flag, verify that an active open is still published in the requesting session's file table. Do this even when no oplock was granted, and before processing a consumed replay. Do not read a borrowed opinfo session pointer for this check. Keep a healthy original binding. If the original channel is exiting or releasing, move the open and its own oplock references to the requesting channel. Serialize this with CLOSE using the session file-table lock, and with detach, reconnect and notification snapshots using m_lock. The earlier lock index and lease-table changes make their lifetimes independent of this connection change. No old-channel r_count wait is needed, including when an unrelated request remains active there. Account final close against fp->conn in one place, balance durable detach and reconnect, and transfer the count with a replay binding change. A final global lookup put may run after CLOSE has removed the volatile id; unlink the open from the inode list on that final close as well. A live completed CREATE replay may follow a break that lowered the durable open's batch oplock. Apply the batch eligibility check only to detached reconnects, while retaining the owner, lease key and persistent flag checks for active replays. Fixes: bb8bf7eb13b5 ("ksmbd: add SMB3 request replay support") Reported-by: Pan Guihua <pan.guihua@datatom.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: index byte-range locks independently of their connectionNamjae Jeon
SMB locks belong to an open, but the lock conflict and UNLOCK scan only visits connections in conn_list. When a channel is removed, its locks remain attached to live opens and become invisible to another channel. An exact UNLOCK returns STATUS_RANGE_NOT_LOCKED, and zero-byte lock conflicts are no longer detected. A request finishing on the old channel after it is removed can publish another invisible lock. Index granted SMB locks by VFS inode, with the open's lock_list retaining ownership. Protect lookup, publication and removal with one spinlock. Use the inode rather than the dentry-based ksmbd_inode so hard-link opens still participate in the same conflict checks. Keep these entries through durable detach and reconnect. Publish a batch only after the existing LOCK handler commits it, and remove every entry before final close drops the file reference. Drop the per-lock connection references and connection-local lists; channel changes no longer require moving lock entries or waiting for unrelated requests to finish. Prefer an exclusive lock when several locks on an open match an UNLOCK. This preserves stacked zero-byte lock behavior despite the inode hash inserting newer locks before older entries. Fixes: d63528eb0d43 ("ksmbd: free ksmbd_lock when file is closed") Reported-by: Pan Guihua <pan.guihua@datatom.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-10-21ksmbd: keep lease tables until their last lease is closedNamjae Jeon
Disconnecting one channel destroys the lease table for its ClientGuid, even when another channel still uses the same opens. A lease break ACK on the surviving channel can no longer find the lease. Detached durable opens also lose their lease lookup entries before reconnect or expiry. Tie a client table to its lease entries instead of the connection which created it. Remove the table when its last lease is removed, and release any remaining entries at server shutdown. Do not destroy client tables from connection teardown or keep a connection reference in each table. For a detached lease, collect break candidates using the table's ClientGuid directly. The existing notification retry path takes its own references on matching live connections. Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers") Reported-by: Pan Guihua <pan.guihua@datatom.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>