summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-08-17ksmbd: preserve access denied status for copychunkNamjae Jeon
The copychunk error mapping handles -EACCES in an independent if statement. The following error chain therefore reaches its final else clause and overwrites STATUS_ACCESS_DENIED with STATUS_UNEXPECTED_IO_ERROR. Join the -EACCES check to the remaining error chain so an access failure is returned as STATUS_ACCESS_DENIED. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: preserve data during overlapping copy chunkNamjae Jeon
Copying an overlapping range within the same file through do_splice_direct() can overwrite source data that has not yet been read. This corrupts the destination when the target range starts inside and after the source range. Handle overlapping ranges with a bounded temporary buffer. Copy from the end when the destination follows the source and from the beginning otherwise, providing memmove semantics without allocating the entire copy length. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: return complete resume key responseNamjae Jeon
The FSCTL_SRV_REQUEST_RESUME_KEY response contains a mandatory four-byte context field after ContextLength. Defining the context as a flexible array excludes it from sizeof(struct resume_key_ioctl_rsp), so ksmbd sends only 28 bytes instead of the required 32 bytes. The truncated response cannot be decoded and results in an NDR buffer size error. Define the reserved context as a fixed four-byte field. This makes the response size match the wire format and ensures the field is zeroed and included in OutputCount. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: support empty snapshot enumerationNamjae Jeon
FSCTL_SRV_ENUM_SNAPS is currently unimplemented, causing clients to treat shadow-copy enumeration as unsupported even when the share simply has no snapshots. Handle the count-only SRV_SNAPSHOT_ARRAY request and return a valid empty snapshot list after validating the file handle and minimum output buffer size. Report a two-byte empty UTF-16 MULTI_SZ array and zero snapshot counts. This allows smb2.ioctl.shadow_copy to run without a snapshot backend. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: require read control for security informationNamjae Jeon
SMB2 QUERY_INFO security requests currently return owner, group, and DACL information without checking the access granted to the opened handle. A handle opened with only SYNCHRONIZE or READ_ATTRIBUTES can consequently read the security descriptor. Require READ_CONTROL when OWNER_SECINFO, GROUP_SECINFO, or DACL_SECINFO is requested and return STATUS_ACCESS_DENIED otherwise. This fixes smb2.getinfo.getinfo_access. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: support normalized name informationNamjae Jeon
FILE_NORMALIZED_NAME_INFORMATION is not handled and is returned as STATUS_INVALID_INFO_CLASS. SMB 3.1.1 clients use this information class to obtain the share-relative path with the on-disk name casing. Build the normalized path from the opened dentry, remove the leading share-relative separator, and recover the canonical named-stream casing from its backing xattr. Return an empty name for the share root and STATUS_NOT_SUPPORTED for dialects older than SMB 3.1.1. Also distinguish a named $DATA stream on a directory from the unnamed data stream so that directory:stream:$DATA can be opened normally. This fixes smb2.getinfo.normalized. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: return buffer too small for short security queriesNamjae Jeon
SMB2 QUERY_INFO security requests with an output buffer too small for the self-relative security descriptor header can fall through descriptor construction and be reported as STATUS_INVALID_INFO_CLASS. After validating the file handle, reject buffers shorter than struct smb_ntsd with STATUS_BUFFER_TOO_SMALL before building the descriptor. This fixes smb2.getinfo.qsec_buffercheck. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: fix partial file information responsesNamjae Jeon
Variable-length file information handlers use the client output length while constructing the response. FILE_ALL_INFORMATION can consequently return -EINVAL before the common buffer check, while stream information can stop building the complete result too early. Build the complete response within the available server response buffer and apply the client output length only when selecting the final status and transmitted length. Use the protocol-defined fixed sizes for all, alternate-name, and stream information to distinguish STATUS_INFO_LENGTH_MISMATCH from STATUS_BUFFER_OVERFLOW. This fixes smb2.getinfo.qfile_buffercheck. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: Do not skip lock checks for single-byte rangesGuangshuo Li
check_lock_range() uses inclusive ranges. Its callers pass the end offset as start + length - 1, so start == end represents a valid single-byte range rather than an empty range. The start == end shortcut therefore skips mandatory byte-range lock checks for one-byte reads, writes, copychunk operations and one-byte truncate ranges. A conflicting lock covering that byte is not checked and the operation is allowed to proceed. Remove the shortcut. The truncate size == inode->i_size case is already handled by only calling check_lock_range() when the new size differs from the current file size. Fixes: 5d510ac31626 ("ksmbd: skip lock-range check on equal size to avoid size==0 underflow") Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: return buffer overflow for partial filesystem infoNamjae Jeon
The query-info buffer check returns STATUS_INFO_LENGTH_MISMATCH for every output buffer smaller than the complete response. Variable-length filesystem information instead requires STATUS_BUFFER_OVERFLOW when the fixed portion fits but the complete data does not. Pass the fixed size for each filesystem information class to the buffer checker. Keep INFO_LENGTH_MISMATCH for buffers below that size, and return BUFFER_OVERFLOW with a response truncated to the requested length for larger partial buffers. This fixes smb2.getinfo.qfs_buffercheck. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: allow I/O on directory named streamsNamjae Jeon
Named streams are stored as extended attributes on the base inode. The VFS read and write helpers reject directory inodes before or together with checking whether the handle represents a stream. Permit read and write operations when a directory-backed handle is a named stream. Continue rejecting direct I/O on ordinary directory handles. This fixes creation of the directory stream in smb2.getinfo.complex. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: protect private extended attributesNamjae Jeon
SMB clients can currently create an EA named NTACL because SMB EAs are mapped into the user namespace while the ksmbd security descriptor is stored as security.NTACL. Allowing the reserved logical name makes the server-private ACL metadata appear writable through the SMB EA API. Reject NTACL, DOSATTRIB, and DosStream-prefixed EA names without regard to case. Filter the same private names from EA query results so stale or externally-created user namespace attributes cannot be exposed. This fixes smb2.ea.acl_xattr when acl_xattr_name is configured as NTACL. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: reject delete-on-close for read-only filesNamjae Jeon
DELETE_ON_CLOSE is currently accepted for files carrying the read-only DOS attribute. The server consequently creates or opens the file and marks it for deletion instead of returning STATUS_CANNOT_DELETE. Reject creation of a new read-only file with DELETE_ON_CLOSE. For an existing file, load the stored DOS attributes before accepting the create option. Also reject FileDispositionInformation when the opened file has the read-only attribute. Preserve the explicit STATUS_CANNOT_DELETE value while unwinding the CREATE request. This fixes smb2.delete-on-close-perms.READONLY. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: honor owner rights ACEs in maximal accessNamjae Jeon
The SMB2 create maximal-access context is currently calculated from POSIX mode bits when the client does not request MAXIMUM_ALLOWED. This overwrites the access granted by a stored Windows DACL. Calculate the create-context result with the DACL permission checker. Recognize the S-1-3-4 Owner Rights SID as applying to the object owner and process its allow and deny ACEs in ACL order. When an Owner Rights ACE is present, do not add the owner implicit READ_CONTROL and WRITE_DAC rights. The Owner Rights ACE replaces those implicit grants as required by Windows access-check semantics. Without an Owner Rights ACE, preserve the existing implicit owner grants, including FILE_READ_ATTRIBUTES and DELETE. This fixes smb2.acls.OWNER-RIGHTS and its deny variants without regressing smb2.acls.GENERIC. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: support access-based directory enumerationNamjae Jeon
SMB shares can advertise access-based directory enumeration. ksmbd does not currently provide a share option or filter inaccessible directory entries. Add a hide-unreadable share flag and advertise SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM when it is enabled. During QUERY_DIRECTORY, omit entries unless the connected user has FILE_READ_DATA, FILE_READ_EA, and FILE_READ_ATTRIBUTES access according to the Windows ACL. Keep the existing implicit access allowances for normal CREATE permission checks while using strict access-mask matching for directory enumeration. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: fix maximum allowed access checksNamjae Jeon
The DACL permission check looks for an ACE matching the current user and falls back to the Everyone ACE. It does not consider an Authenticated Users ACE, even though an authenticated session is a member of that well-known group. As a result, opening a file whose access is granted through S-1-5-11 can incorrectly fail with STATUS_ACCESS_DENIED. Treat an Authenticated Users ACE as a fallback entry alongside Everyone. The maximal access calculation also combines access masks from every ACE, regardless of whether its SID applies to the current user. This can grant rights belonging to an unrelated principal. Process only ACEs applying to the user, Everyone, or Authenticated Users, and accumulate allowed and denied masks in ACL order. Preserve explicitly requested access bits so they are validated against the resulting maximal mask. When ACCESS_SYSTEM_SECURITY is denied, report STATUS_PRIVILEGE_NOT_HELD instead of the generic STATUS_ACCESS_DENIED. Access to the system ACL requires a security privilege that ksmbd does not grant. For regular files, include FILE_EXECUTE in maximal access when the client requested GENERIC_EXECUTE and the DACL grants the complete file-read set. Keep a direct FILE_EXECUTE request subject to the explicit DACL bit. This matches the POSIX file ACL mapping without broadening specific execute requests. Do not replace rights from an applicable NT ACE with a POSIX ACL entry. The POSIX ACL is only a fallback when no user, Everyone, or Authenticated Users ACE applies; otherwise it can incorrectly broaden the stored DACL. This fixes smb2.maximum_allowed.maximum_allowed. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: validate SMB2 write offsetsNamjae Jeon
An SMB2 WRITE request with a negative offset returns -EINVAL directly from smb2_write(). This bypasses the common error response path, leaving the client waiting until the request times out. ksmbd also allows nonempty writes at or beyond MAXFILESIZE as defined by [MS-FSA]. Writes beyond the limit must fail with STATUS_INVALID_PARAMETER. Writes ending at the limit fail with STATUS_DISK_FULL, while a zero-length write remains valid. Route negative offsets through the common error path and validate the end offset of nonempty writes against MAXFILESIZE. This fixes smb2.rw.invalid. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17ksmbd: reject SMB3.1.1 binding with mismatched cipherNamjae Jeon
SMB3.1.1 multichannel connections belonging to the same session must use the same negotiated encryption cipher. ksmbd validates the dialect and client GUID during session binding, but does not compare the cipher negotiated by the new connection with the cipher used by the existing session channels. This allows a channel negotiated with AES-128-CCM to bind to a session using AES-128-GCM. Compare the new connection's cipher with an existing session channel and return STATUS_INVALID_PARAMETER when they differ. This fixes smb2.session.bind_negative_smb3encGtoCs. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2026-08-17net: ionic: Fetch RCQ sign bit from firmwareAbhijit Gangurde
Read the rcq_sign_bit from the RDMA LIF identity reported by firmware. Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
2026-08-17Revert "esp: do not unref managed frag pages in esp_ssg_unref()"Steffen Klassert
This reverts commit 21697720ff43b8dfa25b8e8d9ca7f56f4597fc80. The patch does not fix the issue completely, so revert for now and wait for an updated version. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2026-08-16Merge branch 'bpf-reject-mixed-arena-and-ordinary-atomic-paths'Eduard Zingerman
Yiyang Chen says: ==================== bpf: Reject mixed arena and ordinary atomic paths Atomic RMW instructions use a single aux pointer type to select their final instruction encoding. The verifier currently records that type only for PTR_TO_ARENA, allowing a second path with an ordinary pointer to reach the same instruction before fixups rewrite it to BPF_PROBE_ATOMIC. Patch 1 records the destination type for every atomic RMW path so the existing pointer mismatch check rejects incompatible uses of one instruction. Patch 2 adds a verifier regression test with PTR_TO_ARENA and PTR_TO_STACK paths converging on one atomic add. ==================== Link: https://patch.msgid.link/20260816-bpf-next-038-mixed-atomic-v1-v2-0-4644c1886dbc@mails.tsinghua.edu.cn Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
2026-08-16selftests/bpf: Cover mixed arena and stack atomicsYiyang Chen
Add a verifier test with one atomic RMW instruction reached through PTR_TO_ARENA and PTR_TO_STACK paths. The verifier must reject the shared instruction with the existing incompatible-pointer diagnostic. Signed-off-by: Yiyang Chen <chenyy23@mails.tsinghua.edu.cn> Link: https://patch.msgid.link/20260816-bpf-next-038-mixed-atomic-v1-v2-2-4644c1886dbc@mails.tsinghua.edu.cn Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
2026-08-17rust: pci: expose the allocated interrupt typeDanilo Krummrich
Add irq_type() on IrqVectorRegistration and IrqVector, wrapping the new pci_irq_type() C function. A driver whose interrupt acknowledgment depends on the type (MSI-X vs MSI vs INTx) queries it here rather than assuming which type the PCI core selected. Tested-by: John Hubbard <jhubbard@nvidia.com> Suggested-by: John Hubbard <jhubbard@nvidia.com> Link: https://lore.kernel.org/all/20260808031120.363869-4-jhubbard@nvidia.com/ Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260813165234.620555-6-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-08-17PCI: Add pci_irq_type() to query the allocated interrupt typeDanilo Krummrich
Add a helper that returns PCI_IRQ_MSIX, PCI_IRQ_MSI, or PCI_IRQ_INTX based on the interrupt type the PCI core selected after pci_alloc_irq_vectors(). Several drivers already open-code this check against pdev->msix_enabled and pdev->msi_enabled, or even open code this helper [1]. A common helper avoids the duplication and keeps drivers from accessing the bitfield directly (see also [2]). Acked-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: John Hubbard <jhubbard@nvidia.com> Link: https://elixir.bootlin.com/linux/v7.1/source/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c#L196 [1] Inspired-by: John Hubbard <jhubbard@nvidia.com> Link: https://lore.kernel.org/all/DKKG2QM3YJYB.Z2H2B2UXJ75N@kernel.org/ [2] Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260813165234.620555-5-dakr@kernel.org [ Add missing pci_irq_type() stub for CONFIG_PCI=n. ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-08-17rust: pci: remove request_irq() and request_threaded_irq() from DeviceDanilo Krummrich
Remove the thin wrappers on Device<Bound> that only forwarded to irq::Registration::new() and irq::ThreadedRegistration::new(). With IrqVector embedding a resolved IrqRequest, the conversion is infallible and drivers call irq::Registration::new(vector.into(), ...) directly. Unlike the platform equivalents, which combine a fallible IRQ lookup with handler registration, the PCI wrappers add no value beyond namespacing. They also introduce a redundant device reference. IrqVector already carries a device borrow through its embedded IrqRequest, yet the wrappers required a second, potentially unrelated, &self receiver. Tested-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260813165234.620555-4-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-08-17rust: pci: resolve IRQ in index() and embed IrqRequest in IrqVectorDanilo Krummrich
Move the pci_irq_vector() call from the TryInto<IrqRequest> impl into IrqVectorRegistration::index(), so the IRQ number is resolved eagerly. IrqVector now embeds the resolved IrqRequest and a reference to the IrqVectorRegistration. The conversion to IrqRequest is infallible, which removes the need for pin_init_scope() in request_irq() / request_threaded_irq(). Tested-by: John Hubbard <jhubbard@nvidia.com> Inspired-by: John Hubbard <jhubbard@nvidia.com> Link: https://lore.kernel.org/all/20260808031120.363869-3-jhubbard@nvidia.com/ Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260813165234.620555-3-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-08-17rust: pci: convert IrqVectorRegistration to a lifetime-managed owning typeDanilo Krummrich
Convert IrqVectorRegistration from a devres-managed internal type to a lifetime-annotated type that owns the PCI interrupt vector allocation. Dropping it frees the vectors. IrqVector gains a reference to the IrqVectorRegistration it was derived from. Since index() borrows the registration, the compiler prevents the allocation from being dropped while any IrqVector (and hence any irq::Registration built from it) is still live. alloc_irq_vectors() returns IrqVectorRegistration<'_> directly, giving drivers explicit control over the allocation lifetime, which is needed by net and block drivers that re-allocate vectors at runtime, e.g. during queue reconfiguration or device recovery. Tested-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260813165234.620555-2-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-08-16bpf: Check pointer type for all atomic RMW pathsYiyang Chen
Atomic RMW verification records an instruction pointer type only when the current destination is PTR_TO_ARENA. A second path can therefore reach the same instruction with an ordinary pointer without comparing it against the saved arena type. The post-verification fixup uses the saved type to rewrite the instruction to BPF_PROBE_ATOMIC for every path. Record the actual destination type for all atomic RMW paths so the existing mismatch check rejects incompatible uses of one instruction. Fixes: d503a04f8bc0 ("bpf: Add support for certain atomics in bpf_arena to x86 JIT") Signed-off-by: Yiyang Chen <chenyy23@mails.tsinghua.edu.cn> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://patch.msgid.link/20260816-bpf-next-038-mixed-atomic-v1-v2-1-4644c1886dbc@mails.tsinghua.edu.cn Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
2026-08-16hwmon: (emc1403) Drop hysteresis for low limit temperatureMarius Cristea
Remove the hysteresis for low temperature limit, in hardware the hysteresis is applied only to the maxim limit and the critical limit temperature. Fixes: 54392ce4446e3 ("hwmon: (emc1403) Add support for min_hyst attributes") Signed-off-by: Marius Cristea <marius.cristea@microchip.com> Link: https://lore.kernel.org/r/20260813-emc1403_remove_min_hyst-v1-1-43a0d05d9f49@microchip.com [groeck: Updated subject] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-16hwmon: (coretemp) Fix core_data leak on CPUs without PTSSzymon Wilczek
pdata->core_data is allocated in init_temp_data() when the first core temp_data of a package is created, but it is only released from destroy_temp_data(), and only in the branch that handles the package temp_data. Package temp_data is created solely when the CPU supports X86_FEATURE_PTS. On a CPU without it, coretemp_cpu_online() never calls coretemp_add_core() with pkg_flag set, so pdata->pkg_data stays NULL. coretemp_cpu_offline() then skips the removal of the package interface, destroy_temp_data() is never called for package data, and the array is still allocated when coretemp_device_remove() frees the platform data that pointed at it. Release the array in coretemp_device_remove(). destroy_temp_data() sets pdata->core_data to NULL when it frees it, so the added kfree() is a no-op on CPUs that do have PTS. Tested on an Intel Core i5-1135G7. The driver was instrumented to log every allocation and release of pdata->core_data, and the PTS check in coretemp_cpu_online() was patched out to emulate a CPU without package thermal support. Without this change the array was allocated and never released, and coretemp_device_remove() still saw a non-NULL pointer. With it the array is released and the pointer accounting balances. On an unmodified build the release still happens via the package temp_data and the added kfree() sees NULL, with no slab warnings over repeated module load and unload cycles. Fixes: 1a793caf6f69 ("hwmon: (coretemp) Use dynamic allocated memory for core temp_data") Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com> Link: https://lore.kernel.org/r/20260810192344.3733721-1-swilczek.lx@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-16hwmon: (max6621) fix negative temperature offset and crit readingsCong Nguyen
max6621_read() reads the CONFIG2 offset and the critical alert threshold registers into a u32 and scales them without sign extension: /* offset */ *val = (regval >> MAX6621_REG_TEMP_SHIFT) * 1000L; /* crit */ *val = regval * 1000L; Both attributes are writable and their write paths clamp to a negative minimum and encode negative values, so a value written as negative is read back as a large positive number. For example, writing a -10 degrees C offset stores max6621_temp_mc2reg(-10000) = (-10 << 6) = 0xfd80; the read then computes 0xfd80 >> 6 = 1014 -> 1014000 instead of -10000. Cast the register value to s16 before scaling so the read preserves the sign the write path encodes. The temperature input path already uses an s8 intermediate and is left unchanged. Fixes: 92b64580f14b ("hwmon: (max6621) Add support for Maxim MAX6621 temperature sensor") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4 Signed-off-by: Cong Nguyen <congnt264@gmail.com> Link: https://lore.kernel.org/r/ad0baddbd6163cf73545c8e9273258136718585c.1786334038.git.congnt264@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-16hwmon: (max6621) fix temperature clamp rangeCong Nguyen
MAX6621_TEMP_INPUT_MIN and MAX6621_TEMP_INPUT_MAX are used to clamp the writable offset and critical thresholds. They are defined as -127000 and 128000. The driver decodes the temperature through an s8 and its own comment in max6621_read() documents an 8-bit two's complement value, whose range is -128 to +127 degrees C. The current limits therefore reject the valid -128 degrees C and accept +128 degrees C, which does not fit the 8-bit range. Correct the limits to -128000 and 127000. Fixes: 92b64580f14b ("hwmon: (max6621) Add support for Maxim MAX6621 temperature sensor") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4 Signed-off-by: Cong Nguyen <congnt264@gmail.com> Link: https://lore.kernel.org/r/9d3a4f1895a47794bb359a2a32fb1ccd6a15812c.1786334038.git.congnt264@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-16Linux 7.2v7.2Linus Torvalds
2026-08-16Merge tag 'sched_urgent_for_v7.2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: - Make sure a delayed sched entity's runtime stats are updated at the right time so that it receives the proper lag compensation * tag 'sched_urgent_for_v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Update time before requeueing delayed entities
2026-08-16Merge tag 'timers_urgent_for_v7.2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fixes from Borislav Petkov: - Detect a broken EL2 virtual timer in the bcm2712 SoC boards (RPi5) and fallback to the physical one instead - Fix a build error with ARM rpc_defconfig and function tracer enabled * tag 'timers_urgent_for_v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/arm_arch_timer: Workaround bcm2712 broken EL2 virtual timer tick: Include ktime.h and jiffies.h in linux/tick.h
2026-08-16Merge tag 'core_urgent_for_v7.2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull rseq fix from Borislav Petkov: - Prevent a lockup when rseq grants a timeslice extension * tag 'core_urgent_for_v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rseq: Prevent hard lockup on granted time slice extension
2026-08-16wifi: mt76: mt7921: refactor regd update to fix recursive mutex deadlockCharlie-cy Wu
Split mt7921_mcu_regd_update() into two functions to prevent recursive mutex acquisition. Introduce __mt7921_mcu_regd_update() as the internal implementation that assumes the mutex is already held by the caller, while mt7921_mcu_regd_update() remains as the external interface that handles mutex acquisition and release. This fixes a deadlock issue when mt7921_regd_set_6ghz_power_type() is called with the device mutex already held. Without this change, calling mt7921_mcu_regd_update() would attempt to acquire the same mutex again, causing a recursive lock deadlock. The __mt7921_mcu_regd_update() function can be safely called when the caller has already acquired the device mutex, avoiding the deadlock while maintaining proper synchronization for regulatory domain updates. Fixes: dc2608cf5224 ("wifi: mt76: mt7921: refactor regulatory notifier flow") Signed-off-by: Charlie-cy Wu <Charlie-cy.Wu@mediatek.com> Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com> Tested-by: Devin Wittmayer <lucid_duck@justthetip.ca> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-08-16Revert "i2c: designware: defer probe if child GpioInt controllers are not bound"Linus Torvalds
This reverts commit 0a4bb2abc3e56d7be6e69b050c88ba52c87e22bf. This was reported to break the touchpad on at least some Thinkpads, and while the revert has hit the i2c tree, it hasn't hit mine. So I'm reverting it directly just to have this resolved for the imminent 7.2 release. Reported-by: Thorsten Leemhuis <linux@leemhuis.info> Link: https://lore.kernel.org/all/b4a4eadb-282f-464c-843a-19d415a34d0c@leemhuis.info/ Cc: Mario Limonciello <mario.limonciello@amd.com> CC: Hardik Prakash <hardikprakash.official@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-08-16Merge tag 'perf_urgent_for_v7.2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Prevent the use of exited events as group leaders - Avoid use-after-free of an event's group leader by promoting detached sibling events to standalone entities and correct related accounting and state transitions * tag 'perf_urgent_for_v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Fix group leader use-after-free after sibling detach perf: Reject exited events as group leaders
2026-08-16Merge tag 'x86_urgent_for_v7.2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Borislav Petkov: - Add a proper kernel cmdline option to control the TLB invalidation method on x86 prompted mainly by a recent finding on AMD related to INVLPGB/TYLBSYNC invalidations. Having the command line option is simply another way to alleviate the situation short-term * tag 'x86_urgent_for_v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/CPU: Add a tlbi= cmdline switch
2026-08-16Merge tag 'pinctrl-qcom-updates-for-v7.3-rc1' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel Qualcomm pinctrl updates for v7.3-rc1 New drivers: - add pinctrl drivers for Maili TLMM and Elize LPASS LPI TLMM controllers Driver updates: - acknowledge interrupts for the PDC interrupt controller in pinctrl-msm - implement irq_get/set_irqchip_state() for pinctrl-msm - add support for a new model to Qualcomm pinctrl-spmi-gpio - drop some dead code from qcom pinctrl modules Devicetree bindings: - document new TLMM controllers and the new model for the SPMI GPIO Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-16Merge tag 'pinctrl-qcom-fixes-for-v7.2' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel Qualcomm pin control fixes for v7.2 - fix intr_target_width for summary interrupt routing in pinctrl-shikra Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-16parisc: Fix alignment of asm statements in head.SHelge Deller
All assembler statements need to be 4-byte aligned. Prevent a possible misalignment if someone changes the preceeding string and it's length is then suddenly not a multiple of 4 any longer. Cc: stable@vger.kernel.org Signed-off-by: Helge Deller <deller@gmx.de>
2026-08-16Merge tag 'block-7.2-20260815' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux Pull block fix from Jens Axboe: "A single fix for a regression in this cycle, where drbd would leak shared secrets over netlink. This restores the behavior to match what we had before" * tag 'block-7.2-20260815' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux: drbd: don't leak the shared secret to unprivileged netlink dumps
2026-08-16alpha: read $gp and $sp explicitly for clangMatt Turner
clang honors a local `register unsigned long x __asm__("$N")` variable only where it appears as an inline-asm operand; merely reading it does not produce the contents of that register. So trap_init() passed an undefined global pointer to PAL_wrkgp, and load_PCB() stored an undefined stack pointer into the PCB that swpctx then loaded. Either one wedges an early boot. Read the registers explicitly instead: an inline mov for $gp in trap_init(), and the file-scope current_stack_pointer for $sp in load_PCB(). A file-scope register-asm variable is the form clang does support. Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk> Reviewed-by: Magnus Lindholm <linmag7@gmail.com> Tested-by: Magnus Lindholm <linmag7@gmail.com> Link: https://lore.kernel.org/r/20260803-alpha-clang-v1-2-1c4ba5ba7a64@gmail.com Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
2026-08-16Merge tag 'io_uring-7.2-20260815' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux Pull io_uring fix from Jens Axboe: "Just a single fix for a potential issue on 32-bit x86 with PAE" * tag 'io_uring-7.2-20260815' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux: io_uring/rsrc: reject overflowing regvec bvec byte counts
2026-08-15apparmor: fix deadlock in complain-mode change_hatJohn Johansen
The use of change_hat when in complain mode can cause a deadlock when the hat doesn't exist and a new learning profile is created for the missing profile. This is because change_hat() has taken the lock to search the hat list and creating the new learning profile needs to take the lock to add it to the list. From the bug report: Originally found in 7.0.0 in LTS ubuntu 26.04 with pam_apparmor + su in complain mode set to change hats. Then verified in newest available vanilla kernel I've compiled to see if still present: 7.2-rc7 vanilla -> affected checked also some other kernels: 6.18.44 vanilla -> affected 6.12.95 with debian patches -> unaffected On systems without bug (for example 6.12.95 debian) it just prints: aa_change_hat rc=0 On systems with bug, the executable always hangs, prints nothing and becomes unkillable. (And once stuck this way, it will cause any further hat changes to also cause the changing process to get stuck) Then in syslog you can find hint about cause: kernel: INFO: task hat:3409 blocked for more than 483 seconds. kernel: Not tainted 7.2.0-rc7 #1 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kernel: task:hat state:D stack:0 pid:3409 tgid:3409 ppid:2605 task_flags:0x400000 flags:0x00080800 kernel: Call Trace: kernel: <TASK> kernel: __schedule+0x48f/0xfe0 kernel: schedule+0x27/0xa0 kernel: schedule_preempt_disabled+0x15/0x30 kernel: __mutex_lock.constprop.0+0x569/0xa10 kernel: aa_new_learning_profile+0x15f/0x210 kernel: build_change_hat+0x19f/0x3b0 kernel: change_hat.isra.0+0x5dd/0xd60 kernel: aa_change_hat+0x2f3/0x710 kernel: aa_setprocattr_changehat+0x121/0x1f0 kernel: do_setattr+0x28c/0x340 kernel: apparmor_setselfattr+0x20/0x50 kernel: security_setselfattr+0xf6/0x110 kernel: __x64_sys_lsm_set_self_attr+0x53/0x90 kernel: do_syscall_64+0xdd/0x5e0 kernel: ? __mod_memcg_lruvec_state+0xfd/0x260 kernel: ? lruvec_stat_mod_folio+0x8d/0xd0 kernel: ? __folio_mod_stat+0x2d/0x90 kernel: ? map_anon_folio_pte_nopf+0xd1/0x1f0 kernel: ? do_anonymous_page+0x184/0xa10 kernel: ? __handle_mm_fault+0x805/0x870 kernel: ? count_memcg_events+0xef/0x230 kernel: ? handle_mm_fault+0x1f0/0x2f0 kernel: ? do_user_addr_fault+0x2bb/0x7b0 kernel: ? do_syscall_64+0x94/0x5e0 kernel: ? exc_page_fault+0x75/0x160 kernel: entry_SYSCALL_64_after_hwframe+0x76/0x7e kernel: RIP: 0033:0x7f815e134c8d kernel: RSP: 002b:00007fff6df94ea8 EFLAGS: 00000246 ORIG_RAX: 00000000000001cc kernel: RAX: ffffffffffffffda RBX: 0000556d8c81d040 RCX: 00007f815e134c8d kernel: RDX: 0000000000000046 RSI: 0000556d8c81d040 RDI: 0000000000000064 kernel: RBP: 00007fff6df94ef0 R08: 00007f815e212ac8 R09: 000000000000000c kernel: R10: 0000000000000000 R11: 0000000000000246 R12: 0000556d8c81d010 kernel: R13: 0000000000000026 R14: 0000000000000046 R15: 0000000000000064 kernel: </TASK> kernel: INFO: task hat:3409 is blocked on a mutex likely owned by task hat:3409. To fix the issue, lift the locking out of the core of aa_new_learning_profile(), introduce a wrapper function that takes the lock where needed, and have build_change_hat() call the core function that no longer takes the lock. In addition fix 4 other issues introduced by commit 32e92764d6f8d ("apparmor: grab ns lock and refresh when looking up changehat child profiles") - aa_get_profile_rcu() was replaced-by: aa_get_profile without the accompanying rcu_dereference_protected() - an extra aa_get_label(label) was introduced at the start of change_hat() without an accompanying aa_put_label() causing a reference count leak. - a reference count leak was introduced in the label_is_stale(label) case, where the newest profile would be leaked instead of the label passed to the function. - a potential UAF when the lookup walks up the tree with new_ns != ns the new label reference is put, and then used for the next lookup. The mutex_lock, will block replacement, and removal in the locked ns. However there are two cases where putting the reference can result in the label being freed even with the lock held. 1. the label does not have a list reference (possible for temporary or special profiles) in which case the put can trigger the cleanup. 2. the new label reference is in a different namespace, which does not have a lock held on it. This extends case 1 to also include replacement, and removal that could be occurring in the namespace new is in. Reported-by: Martin Petricek <mp@petricek.net> Link: https://lists.ubuntu.com/archives/apparmor/2026-August/014907.html Fixes: 32e92764d6f8d ("apparmor: grab ns lock and refresh when looking up changehat child profiles") Signed-off-by: John Johansen <john.johansen@canonical.com>
2026-08-15selftests/mm: thuge-gen: fix test_shmget() for PAGE_SIZE checkMike Rapoport (Microsoft)
Commit 49a4e7186b08 ("selftests/mm: thuge-gen: add setup of HugeTLB pages") changed thuge-gen test to use common functions for reading hugetlb attributes from sysfs, but it missed that the original read_free() function special cased PAGE_SIZE tests. For PAGE_SIZE tests, failure to read sysfs was ignored and read_free() returned 0. This allowed test_shmget() to essentially skip the check of how many huge pages was consumed when it ran with PAGE_SIZE. Commit 3199b0c09efa ("selftests/mm: fix read_file() return value check") fixed checks for read_file() return value and this exposed the issue in test_shmget() that checks the number of free hugetlb pages even for PAGE_SIZE test, tries to access /sys/kernel/mm/hugepages/hugepages-<PAGE_SIZE>/free_hugepages and obviously fails there. Gate the checks for free huge pages on size != getpagesize() and initialize before and after variables to values matching PAGE_SIZE test. Link: https://lore.kernel.org/20260812-selftests-thuge-gen-fix-v2-1-9adaa693e73b@kernel.org Fixes: 49a4e7186b08 ("selftests/mm: thuge-gen: add setup of HugeTLB pages") Acked-by: David Hildenbrand (Arm) <david@kernel.org> Reviewed-by: Sarthak Sharma <sarthak.sharma@arm.com> Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Liam R. Howlett <liam@infradead.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-08-15sched_ext: Drop the dead SCX_DEQ_CORE_SCHED_EXEC test in dequeue_task_scx()Tejun Heo
dequeue_task_scx() masks SCX_DEQ_CORE_SCHED_EXEC out of the SCX_DEQ_SCHED_CHANGE decision, but the test can never fire: the incoming flags are an int of generic DEQUEUE_* bits while the flag is bit 32, and the core-sched execute path never goes through class dequeue anyway - set_next_task_scx() calls ops_dequeue() with the flag directly. The test was live when the SCX_DEQ_SCHED_CHANGE computation sat in ops_dequeue() and became dead when 03f5304aad0f ("sched_ext: Pass full dequeue flags to ops.quiescent()") moved the computation here. Drop it. Signed-off-by: Tejun Heo <tj@kernel.org>
2026-08-15sched_ext: Make core-sched task ordering hierarchy-awareTejun Heo
With sub-schedulers, tasks of different schedulers routinely share rqs and SMT siblings, but scx_prio_less() consults ops.core_sched_before() only when both tasks belong to the same scheduler. Every pair spanning two schedulers falls back to the default ordering, so no scheduler can express ordering across a scheduler boundary, including a root over its sub-schedulers' tasks. Order a pair spanning schedulers by the nearest common ancestor that implements ops.core_sched_before(): both tasks are in its subtree, making this the one op where a scheduler is called on tasks it delegated to its sub-schedulers and may not be scheduling anymore. Same-scheduler pairs keep using the owning scheduler's op so a parent never orders inside a subtree it delegated. The op is skipped when the deciding scheduler is bypassing on either task's CPU. Update scx_qmap to fall back to the kernel's default ordering when handed a delegated task it has no task_ctx for. Signed-off-by: Tejun Heo <tj@kernel.org>