| Age | Commit message (Collapse) | Author |
|
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni:
"Including fixes from WiFi, Bluetooth and CAN.
Current release - regressions:
- eth: mlx5e: TC, fix a NULL pointer write in the peer flow error path
Current release - new code bugs:
- xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
- eth: b53: use the correct override register 2 Gbps bit
Previous releases - regressions:
- core:
- do not run out of frags in alloc_skb_with_frags()
- gso: cow head on tcp fraglist fallback to skb_segment
- ipv6:
- honor suppress_prefixlength in fib6_lookup()
- mcast: do not pass uninitialized bytes to dev_mc_add()
- tcp:
- don't clear saddr before ->put_port().
- initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check()
- mptcp: fix dummy mapping of overlapping segments
- bluetooth:
- fix use-after-free in mgmt_powering_down()
- fix NULL pointer dereference on failed init
- wifi:
- iwlwifi: fix FW crashes on old devices and with 320 MHz channels
- ath10k: revert "stop unanswered temperature reads"
- rtw89: fix connection drop on RTL8851BE
- eth:
- gve: fix checksum state of HW-GRO packets
- mana: set a non-zero minimum interrupt moderation, fix TX timeouts
- brcm: fix link-local detection with a prepended tag
Previous releases - always broken:
- core:
- initialize sk_peer_lock in cloned sockets
- release netpoll dev_lock when NETDEV_PRE_UP vetoes an open
- gso: fall back to skb_segment when fraglist cannot satisfy checksum
- tcp: fix negative sk_forward_alloc after MSG_ZEROCOPY append
- udp: only quit inuse scan early on identical SO_REUSEPORT sockets
- ipv4: fix conntrack defrag forwarding after ip_frag_reinit()
- vsock/bpf: release sock lock while waiting for data in recvmsg,
fix deadlock
- mptcp: a bunch of fixes for send stalls after fallback and TFO
- can: avoid RTNL stalls in CAN_RAW, CAN_ISOTP and CAN_BCM
- eth:
- tun: bound the NAPI receive queue
- tg3: fix heap overflow in unbuffered NVRAM write path
- mlx5: DR, fix out-of-bounds write when sync to HW fails
- ionic: fix TX stalls on TSO skbs larger than the TX ring
- bcm4908: a bunch of TX/RX ring fixes
Misc:
- add Willem de Bruijn to networking maintainers"
* tag 'net-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (152 commits)
udp: only quit inuse scan early on identical SO_REUSEPORT sockets
net: dsa: tag_brcm: fix link-local detection with a prepended tag
tg3: Fix heap overflow in unbuffered NVRAM write path
tg3: Skip management FW version when APE firmware is not ready
tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported
selftests: tls: add a poll test for a queued KeyUpdate
tls: don't hide a queued KeyUpdate from poll()
xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners
tcp: fix negative sk_forward_alloc after MSG_ZEROCOPY append
tcp: Don't clear saddr before ->put_port().
vhost/net: Fix receive queue test in busy poll
ipv6: mcast: do not pass uninitialized bytes to dev_mc_add()
tipc: restore write readiness when a socket's group goes away
mptcp: gate diag sequence counters on CAP_NET_ADMIN
net: dsa: felix: fix NULL pointer dereference in felix_port_enable()
selftests: netfilter: cover IPv6 FIB prefix suppression
ipv6: Honor suppress_prefixlength in fib6_lookup()
ptp: vmclock: keep the device state until the last file is closed
tun: bound the NAPI receive queue
...
|
|
Check that poll() reports a read event when a recv() for data has
decrypted and queued a KeyUpdate. Once the KeyUpdate has been read,
check that poll() doesn't report a record sent with the new key.
Signed-off-by: Felipe Pereira Stival <v0idpwn@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20261118-v0idpwn-tls-poll-parked-keyupdate-v1-2-8e25101e7be6@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext
Pull sched_ext fixes from Tejun Heo:
- Scheduler enable and disable could race with tasks changing class: on
enable, a task could switch to sched_ext before the scheduler core
started picking sched_ext tasks and be left runnable while its CPU
went idle. On disable, an RT task could starve the tasks falling back
to the fair class and stall the disable itself.
- BPF schedulers failed to load on architectures whose BPF JIT doesn't
support private stacks, such as riscv64. Only sub-schedulers need
them and are now refused there instead.
- The debug dump and CPU ID layout callbacks could call kfuncs that
move tasks around. They are now rejected at load time.
- Smaller fixes: a task's first enqueue after fork didn't tell the BPF
scheduler that CPU selection had already run, and two kfuncs raised a
false RCU lockdep warning in BPF timer callbacks.
* tag 'sched_ext-for-7.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
sched_ext: Attach fair_server before tasks fall back to fair on disable
selftests/sched_ext: Add unlocked_kfunc test
sched_ext: Don't allow unlocked kfuncs from ops.dump() and ops.init_cids()
sched_ext: Don't request private stacks the JIT can't provide
sched_ext: Fix suspicious RCU usage in KF_RCU_PROTECTED kfuncs
sched/core: Pass ENQUEUE_RQ_SELECTED on initial enqueue
sched_ext: Don't route tasks to SCX before __scx_enabled is fully patched
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull bootconfig fixes from Masami Hiramatsu:
- bootconfig: Exclude alignment padding from bootconfig max size
Separate the padded trailer size limit from XBC_DATA_MAX and strip up
to three trailing NUL alignment bytes before xbc_init() so valid
max-size configs are not rejected depending on initrd alignment
- bootconfig: Free the initrd memory used by bootconfig
Save the original initrd_end before trimming the bootconfig and restore
it when freeing initrd memory so pages previously occupied by bootconfig
data are not leaked
- bootconfig: Parser fixes and tests according to LEAN check
- Fix xbc_verify_tree() to check subkeys of valued keys
Use xbc_node_get_subkey() when descending so subkeys under mixed
value+subkey nodes cannot bypass XBC_DEPTH_MAX and XBC_KEYLEN_MAX
- Fix xbc_node_compose_key_after() for value nodes
Walk parent pointers across chained array value nodes before
checking @root so composed keys exclude array values and
NUL-terminate @buf
- Avoid out-of-bounds pointer arithmetic in xbc_snprint_cmdline_filter()
Pass NULL to snprintf() when len >= size so buf + len is not
formed past the buffer end on overflow
- Add tests for unclosed brace position and mixed-kv limits
Expand test-bootconfig.sh to cover unclosed brace error positions
and mixed value+subkey depth and key-length limits
- tools/bootconfig: Use registered global tracing parameter names
Update boottime-trace.rst and ftrace2bconf.sh to use the registered
global tracing parameter names, while keeping fallback support in
bconf2ftrace.sh for existing configs
- tools/bootconfig: Fix read/write error handling in bootconfig tool
- Reject short reads of configuration data in load_xbc_fd() and
free the allocated buffer on failure so partial reads are never
parsed or checksummed
- Check write() return values for negative errors before comparing
against unsigned size_t counts so initrd append failures are
reported
* tag 'bootconfig-fixes-v7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tools/bootconfig: Report initrd append failures
tools/bootconfig: Reject short reads of configuration data
tools/bootconfig: Use the registered global tracing parameter names
tools/bootconfig: Add tests for unclosed brace position and mixed-kv limits
bootconfig: Avoid out-of-bounds pointer arithmetic in xbc_snprint_cmdline_filter()
bootconfig: Fix xbc_node_compose_key_after() for value nodes
bootconfig: Fix xbc_verify_tree() to check subkeys of valued keys
bootconfig: Free the initrd memory used by bootconfig
bootconfig: Exclude alignment padding from bootconfig max size
|
|
Extend nft_fib.sh using its existing namespaces and counter helper to
check that suppress_prefixlength 0 suppresses a default route while
retaining a more-specific route. Check that blackhole, unreachable and
prohibit routes remain terminal despite a usable route in a later table.
Include a blackhole nexthop object to distinguish result reject flags
from flags on the FIB entry.
Require a positive counter for the expected nftables FIB result. Compare
it with the output device or rejection error from an ordinary lookup.
Label ruleset-load failures and skip the affected checks when IPv6 prefix
suppression or nexthop objects are unavailable.
Run these checks after the existing default-table tests so that adding
policy rules does not remove coverage of the path without custom IPv6
rules. The router's logging RPF rules have already been removed by then,
allowing neighbour discovery during intentionally different reverse-route
states.
Signed-off-by: Leonard Lausen <leonard@lausen.nl>
Link: https://patch.msgid.link/20261117110813.9894-4-leonard@lausen.nl
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
The signed return value of write() is compared against a size_t.
A negative return becomes an unsigned value and bypasses the error
path, so applying a bootconfig can claim success without appending
it. Check for a negative return before comparing the byte count.
Link: https://lore.kernel.org/all/20261120061917.98169-1-zhujun2@cmss.chinamobile.com/
Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
Cc: stable@vger.kernel.org
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
|
|
load_xbc_fd() places the terminator at the requested size even when
read() returns less. Its initrd caller then computes a checksum over
bytes that were never read, while the plain file callers can parse a
partial configuration. Reject a short read and release the allocated
buffer on both read failure paths.
Link: https://lore.kernel.org/all/20261120061912.98156-1-zhujun2@cmss.chinamobile.com/
Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
Cc: stable@vger.kernel.org
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
|
|
Add the unlocked_kfunc test to verify verifier-time restrictions on the
SCX_KF_ALLOW_UNLOCKED kfuncs.
The valid cpu-form and cid-form schedulers verify that ops.init() and
ops.exit() can call scx_bpf_create_dsq(), scx_bpf_dsq_move(),
scx_bpf_dsq_reenq_task(), and scx_bpf_select_cpu_dfl(). They also verify
that ops.dump() can call scx_bpf_dump() and that ops.init_cids() can
call scx_bpf_cid_override().
The two negative schedulers verify that the verifier rejects
scx_bpf_dsq_move() from ops.dump() and scx_bpf_create_dsq() from
ops.init_cids() with -EACCES.
Signed-off-by: Kuba Piecuch <jpiecuch@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
|
|
Pull kvm fixes from Paolo Bonzini:
"A large set of fixes, mostly for Arm but almost all architectures
are represented.
arm64 MMU fixes:
- Correctly sanitise the TCR_EL2 register
- Stop advertising LPA2 to NV guest when it isn't supported
- Correctly convert EH2==0's view of TCR_EL2 into the E2H==1 format
- Make sure an EL2 mapping is immediately visible to the hypervisor
code, as we don't necessarily require ETS
- Address a horrible situation where a guest can livelock when trying
to solve a permission fault whilst the underlying S2 PTs have AF=0
- Correctly wipe MTE tags for large mappings instead of just the head
page, providing a convenient helper for this
- Fix dirty logging detection in ring-only mode
- Use ATS1A whenever FEAT_S1PIE is present
- Fix arbitrary truncation to 32bit when dealing with pool size
- Correctly order page pin refconting
- Prevent a HYP block mapping from being replaced with a table
- Fix NV Range invalidation by extending the boundaries to the next
block mapping
- Make sure the correct hw_mmu gets picked on the first run, should
userspace restore a nested context between init and the first
vcpu_load()
- Reject TLBI IPAS2E1 that fall outside of the S2 range
arm64 system register fixes:
- Correctly forward POE/PIE/TVAL EL2 register traps
- Add a sanity check for missing trap forwarding
- Correctly hide generic PAuth for pKVM protected guests when the
feature PAuth has been exluced from the feature set
- Make sure that HCR_EL2.NV1 is always RES0
arm64 VGIC fixes:
- Fix a bunch of low-impact issues with GICv4, avoiding leaks on
unlikely failure paths
- Use a separate lockdep class for vPE doorbells, and guarantee that
they are never threaded
- Avoid spurious allocation of VPEs when userspace decided not to
expose nASSGIcap
- Fix spurious preservation of the pending state after DISCARD and
CLEAR ITS commands
- Make sure GITS_CTLR.Enabled is updated under the its_lock
- Serialise vgic CTRL_INIT against vCPU creation
- Make the forwarding of LPIs tobust against LPIs being disabled on
the target redistributor
arm64 pKVM fixes:
- Fix the reset of GICv3 LRs for pKVM, de-uglifying the PM paths
whilst at it
- Fix PMU handling for both protected and non-protected guests,
fixing the synchronisation of kvm_host_data in the process
- Correctly invalidate TLBs and I-cache when multiplexing multiple
vcpus of the same VM on a single physical CPU
arm64 feature visibility fixes:
- Correctly handle ACCDATA_EL1 being exposed to guests, plugging a
potential communication channel between guests
Other arm64 fixes:
- Flag Apple M3, M4 and M6 CPUs as having a broken vgic and a wonky
PMUv3 emulation
- Correctly handle 64bit offsets into an MMIO region from userspace
- Ensure that a vcpu is loaded when injecting an event
- Correctly clear the vcpu feature set on init failure
- Clear PSTATE.TCO on exit from the guest when MTE is enabled for the
kernel
- Let the L0 hypervisor always deal with FEAT_MOPS A/B nonsense when
taking such exception, instead of potentially forwarding it
- Add a "maintainer profile" for KVM/arm64
- Add testing for the MOVI and MOVALL commands
PPC:
- Implement kvm_arch_flush_shadow_{all,memslot}() for PPC. They're
not meant to be optional!
RISC-V:
- Validate AIA MMIO address ranges before AIA is initialized
- Disallow GPA-width changes after AIA is initialized
- Fix double free of the split page cache
- Do not touch the envcfg CSRs on the SiFive P550, as it is based on
the 1.11 privileged architecture spec
- Set Accessed bit in dirty-log write fault fast-path
- Validate PMU counter info using available counters
- Fix G-stage page table memory leak on VM destroy
s390:
- Additional memory management related fixes
- Improve robustness of the Arm code extraction script
- Fixes for the Arm layer
- Fix ESSA instruction handling in migration mode
- Fix crypto instruction no-hook handling
- Fix selftest for uvdevice
x86:
- Do not confuse the GPA of a guest paging structure with the GPA of
the access, if a nested page fault occurs while the CPU is walking
the guests's page tables
- Do not attempt emulation if a nested page fault occurs on encrypted
guest paging structures
- Mitigate a class of (x86) bugs where KVM can read/write guest
(userspace) memory using the wrong mm, i.e. using the wrong user
page tables
- Don't force a full nested VMX VM-Exit when destroying a vCPU, as
processing the MSR load/store lists and writing back the shadow
vmcs12 is wildly wrong when VM is dying
- Clear only the VMCB save area on an intercepted SHUTDOWN on SVM,
partly to avoid unnecessary churn, but mostly to prevent KVM from
clobbering the PML index
- Update the tracked pCPU on task migration for both vmcb01 and
vmcb02 to fix an edge case where KVM can use a stale ASID across
pCPUs
- Clear nVMX's smm.guest_mode when freeing nested state, and if a RSM
to L2 ultimately fails (and queues a TRIPLE_FAULT to L1)
Generic:
- Rework the single-vCPU kick logic to fix a bug where KVM would fail
to wait for a target vCPU to respond if another, non-waiting kick
is in flight
Selftests:
- Provide empty installation rules for architectures that aren't
supported by KVM selftests to fix build issues in CI environments
- Fix KVM selftests' rules for generating arm64's sysreg headers so
that the headers are properly (re)generated on incremental builds"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (104 commits)
KVM: x86: Don't save the GPA of a fault on the guest's page tables
KVM: SEV: never emulate after #NPF on paging structures
KVM: PPC: implement .flush_memslot for BookE and Book3S-PR
KVM: PPC: remove unnecessary #ifdef
KVM: arm64: nv: Ignore TLBI IPAS2E1 above the IPA limit
KVM: arm64: nv: Fix NULL dereference in kvm_pmu_nested_transition()
KVM: arm64: Load the vcpu in KVM_SET_VCPU_EVENTS
KVM: arm64: selftests: Verify HCR_EL2.NV1 is RES0 when E2H0 is NI_NV1
KVM: arm64: Force HCR_EL2.NV1 to RES0 unconditionally
KVM: arm64: Hide generic ptrauth from protected VMs without ptrauth
KVM: arm64: nv: Report EL2 registers with no trap forwarding
KVM: arm64: nv: Forward CNTP_TVAL_EL02 and CNTV_TVAL_EL02 traps
KVM: arm64: nv: Forward PIR_EL2, PIRE0_EL2 and POR_EL2 traps
RISC-V: KVM: Fix G-stage page table memory leak on VM destroy
RISC-V: KVM: Validate PMU counter info using available counters
KVM: riscv: Set Accessed bit in dirty-log write fault fast path
RISC-V: KVM: Do not touch the envcfg CSRs on the SiFive P550
RISC-V: KVM: Fix double free of the split page cache
RISC-V: KVM: Disallow GPA-width changes after AIA init
RISC-V: KVM: Validate AIA MMIO address ranges
...
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf tools fixes from Arnaldo Carvalho de Melo:
- perf record: skip affinity for per-thread mmap buffers and reject CPU
indices at the mask size, avoiding out-of-bounds bitmap accesses.
- perf test: use software events for system-wide tests, mark the LBR
test exclusive, and fix probe_vfs_getname debuginfo detection via a
dry run.
- perf build: add -lzstd to the libbfd feature fallback for static
binutils, and pass OUTPUT explicitly when building internal
libraries.
- perf trace beauty: split the KVM ioctl table by direction so read and
write ioctls sharing a number no longer conflict at build time.
- perf kvm: fix arm64 VM-exit duration accounting by pairing kvm_exit
with the following kvm_entry as the end event.
- perf hist: use each branch's own cycle count for the sample weight
instead of the first branch's, fixing multi-entry branch stacks.
- perf jevents: don't encode MSRs with no value, avoiding unset ldlat
values in the affected Intel latency events.
- perf vendor events arm64 AmpereOneX: deprecate the old event name so
scripts using it keep working while the renamed event is listed.
- perf intel-bts and intel-pt: free the old snapshot reference array
when it grows past sixteen mappings, avoiding a leak.
- perf timechart and treport: initialize inherited attributes in their
constructors, avoiding pylint warnings without Textual.
- perf tools: fix sync-headers generated commit messages to use longer
SHAs and drop hunk headers that checkpatch mistakes for diff content.
- Sync the tools/ copies of gfp_types.h, gfp.h, KVM, sound/asound.h,
msr-index.h, cpufeatures.h and if_addr.h with the kernel sources.
* tag 'perf-tools-fixes-for-v7.4-1-2026-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: (23 commits)
perf record: Skip affinity for per-thread mmap buffers
perf jevents: Don't encode MSRs with no value
perf record: Reject CPU indices equal to the mask size
perf test: Don't starve per-process tests with system-wide events
perf test probe_vfs_getname: Fix missing debuginfo detection
perf build: Add explicitly sequenced -lzstd to libbfd feature fallback
tools build: Add explicitly sequenced -lzstd to libbfd feature fallback
perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT
perf hist: Fix branch_info index for sample weight
perf timechart: Initialize Textual attributes in constructors
perf treport: Initialize the subtitle in the constructor
perf intel-bts: Free the old snapshot reference array after growing it
perf intel-pt: Free the old snapshot reference array after growing it
perf kvm: Fix arm64 VM-exit duration accounting
perf build: Override OUTPUT when building internal libraries
perf tools: Fix the sync-headers generated commit messages
tools headers: Sync linux/gfp_types.h with the kernel sources
tools headers: Sync KVM headers with the kernel sources
perf trace beauty: Split the KVM ioctl table by direction
tools headers: Sync UAPI sound/asound.h with the kernel sources
...
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux
Pull Rust fixes from Miguel Ojeda:
"Toolchain and infrastructure:
- Disable function merging in all cases to fix broken MODVERSIONS
information with gendwarfksyms, wrong backtraces and possibly
issues with pahole/BTF due to lost debug information.
- x86: emit the expected 'cs' prefix for RETPOLINE builds by passing
the '-Zindirect-branch-cs-prefix' flag we added to 'rustc', which
fixes boot failures (with 'spectre_v2=retpoline,lfence') and code
corruption (with paranoid FineIBT).
- Fix objtool warnings for the upcoming Rust 1.101.0 (expected
2026-12-24) by adding more 'noreturn' functions.
'kernel' crate:
- 'str' module: fix soundness issue in 'Formatter::new()' by tying
the returned formatter to the lifetime of its backing buffer.
- 'iov' module: fix soundness issue in 'copy_from_iter_raw()' by
tying the returned slice to the lifetime of the output buffer.
I suggested upstream Rust to introduce a lint for this case of the
lifetime elision rule, to avoid repeating this sort of mistake"
* tag 'rust-fixes-7.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux:
kbuild: rust: disable function merging unconditionally
rust: str: tie Formatter to its backing buffer
rust: iov: fix return lifetime of `copy_from_iter_raw()`
x86/rust: use `-Zindirect-branch-cs-prefix` for RETPOLINE builds
objtool/rust: add more `noreturn` Rust functions for Rust 1.101.0
|
|
The boot-time tracing guide lists four kernel.* keys that do not match
the parameters registered by the tracing code. For example,
ftrace2bconf.sh emits kernel.fgraph_max_depth, which bootconfig passes
as fgraph_max_depth on the kernel command line. The function-graph
tracer registers ftrace_graph_max_depth.
Use the registered names in the guide and the exporter. Teach
bconf2ftrace.sh to read those names, with the previous script keys as
fallbacks so existing replay configurations still work.
Link: https://lore.kernel.org/all/fecf6e33d4f7e2ddf031526e7a1abef27e28f754.1795307698.git.edumucelli@gmail.com/
Fixes: 47781947947a ("Documentation: tracing: Add boot-time tracing document")
Fixes: 7e66ef0046cc ("tools/bootconfig: Add a script to generate ftrace shell-command from bootconfig")
Fixes: 2b86062a34a8 ("tools/bootconfig: Add a script to generates bootconfig from ftrace")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
|
|
Add regression test cases to test-bootconfig.sh for:
1. Unclosed brace error position reporting in xbc_verify_tree()
(verifying both samples/bad-tree.bconf and a multi-block config).
2. XBC_DEPTH_MAX (16) and XBC_KEYLEN_MAX (256) enforcement on subkeys
under a key node that also has a value (mixed value+subkey).
Link: https://lore.kernel.org/all/179530931973.109991.15787416583892751589.stgit@devnote2/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
|
|
When attaching a bootconfig to an initrd image, apply_xbc() appends 0-3
null padding bytes to align the total image size to 4 bytes and includes
those padding bytes in the footer size field. As documented in
Documentation/admin-guide/bootconfig.rst, the maximum bootconfig size
(XBC_DATA_MAX, 32767 bytes including the terminal null) is not supposed
to include these padding null characters.
However, both load_xbc_from_initrd() in tools/bootconfig and
get_boot_config_from_initrd() / xbc_init() in the kernel check the raw
footer size directly against XBC_DATA_MAX. As a result, a valid
32766-byte config (size = 32767 with the terminal null) gets a footer
size of 32768..32770 when alignment padding is added, and is rejected
with "bootconfig size is too big" depending on the initrd size.
Define XBC_DATA_MAX_PADDED (XBC_DATA_MAX + BOOTCONFIG_ALIGN - 1) for the
raw trailer size check, and add xbc_exclude_padding() to strip up to
BOOTCONFIG_ALIGN - 1 trailing null padding bytes (keeping the terminal
null byte) before checking the unpadded bootconfig size against
XBC_DATA_MAX and passing it to xbc_init(). Keep using the raw footer
size when truncating or trimming the initrd so that both the bootconfig
and its alignment padding are removed.
Also expand test-bootconfig.sh to verify applying, reading back, and
deleting a maximum-size bootconfig across all 4 alignment paddings.
Link: https://lore.kernel.org/all/179495925054.237695.2777053796977822521.stgit@devnote2/
Fixes: e1cef2d4c379 ("tools/bootconfig: Align the bootconfig applied initrd image size to 4")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux
Pull Landlock fixes from Mickaël Salaün:
- prevent composed rulesets from denying link and rename operations
that each ruleset allows separately;
- close capability-mediation gaps for low-address mappings, inheritable
capabilities, the admin memory reserve, and PR_SET_SECUREBITS, so LSM
capability denials apply consistently;
- distinguish namespace creation from entry in denial records and
expose the checked capability context to BPF tracepoint consumers, so
they can interpret denials correctly.
* tag 'landlock-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux:
landlock: Add missing EINVAL case in the doc for landlock_add_rule
clang-format: Fix formatting of guard()
landlock: Document namespace denial operations
selftests/landlock: Test namespace denial operations
landlock: Add capability objects to denial tracing
landlock: Distinguish namespace creation and entry denials
selftests/landlock: Test PR_SET_SECUREBITS mediation
capabilities: Check PR_SET_SECUREBITS with ns_capable()
landlock: Fix capability restriction documentation
selftests/landlock: Test capability checks outside the capable hook
landlock: Mediate CAP_SYS_ADMIN for the admin memory reserve
landlock: Mediate CAP_SETPCAP for inheritable capabilities
landlock: Mediate CAP_SYS_RAWIO for mappings below mmap_min_addr
landlock: Factor out capability denial checks
landlock: Clarify implicit handling of LANDLOCK_ACCESS_FS_REFER
landlock: Simplify landlock_get_fs_access_mask()
selftests/landlock: Test that layering does not break refer
landlock: Add KUnit test for landlock_get_fs_access_mask()
landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER
|
|
Cover SO_PEERPIDFD and SO_PEERPIDFD_THREAD with an optlen of 0 to 3:
- getsockopt() fails with EINVAL
- optlen and the buffer stay untouched
- no pidfd is installed in the file descriptor table
Check that a full-sized buffer still gets a pidfd.
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Reviewed-by: Alexander Mikhalitsyn <alex@amutable.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261117-work-net-peerpidfd_short_optlen-v1-2-a93f56288501@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
Read timestamping statistics before and after ifdown, to catch drivers
that crash while the interface is down. Counters must not go backwards
across ifdown; the test does not send timestamped traffic, so a reset
is only caught if the counters were already nonzero.
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Link: https://patch.msgid.link/20261117215416.1901246-6-dimitri.daskalakis1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
Pull bpf fixes from Alexei Starovoitov:
"Mostly sockmap fixes as promised, plus uprobe ctx rewrite via bpf and
cgroup-bpf fixes.
- Reject writable map iterators on read-only maps (Adethya
Srinivasan)
- Various sockmap fixes (Alexei Starovoitov):
- Clear the redirect target before the sk_msg prog runs
- Check that the redirected message is the cork
- Leave sk_stream_wait_memory() once the socket is dead
- Keep the rest of the cork after a redirect
- Don't let an SK_PASS verdict cover the next message
- Subtract all dropped bytes from the return value of sendmsg()
- Clear the end mark of elements added by bpf_msg_push_data() and
bpf_msg_pop_data()
- Fix ring capacity invariant break in bpf_msg_push_data() (Bo Cao)
- Report RCU-tasks quiescent states in do_check() to fix rcu_tasks
stalls during a long verification (Breno Leitao)
- Various sockmap fixes (Chris Mason):
- Give no progs to a TCP listener
- Check the target of an egress redirect before each send
- Check the TCP state in recvmsg()
- Reset the copy position when corking
- Don't copy 0 bytes into a full cork
- Use a dedicated workqueue for freeing BPF programs to fix a
deadlock between pack_mutex waiters and the vmalloc purge work
(Emil Tsalapatis)
- Fix verifier model mismatch on a narrow read of
__sk_buff.remote_port (Henry Martin)
- Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate selftest
(Jiayuan Chen)
- Restrict uprobe ctx writes to the registers that ptrace can set
(Jiri Olsa)
- Various sockmap fixes (Josef Bacik):
- Write sg.start when recvmsg() faults
- Don't let an SK_DROP verdict stick
- Clear the resume state of a stopped psock
- Various fixes (Michal Luczaj):
- Fix "unresolved symbol tcp_request_sock" build error with
CONFIG_INET=n
- Restrict iter-context sockmap updates to iter/sockmap
- Restrict bpf_sock_destroy() to iter/{tcp,udp}
- Mark bpf_iter__sockmap::sk as PTR_TRUSTED
- Mark backing_file_alloc/free LSM hooks as untrusted (Sergei
Nizovtsev)
- Various cgroup-bpf fixes (Shakeel Butt):
- Don't read freed effective arrays in BPF_PROG_QUERY
- Don't attach to a removed cgroup
- Protect cgroup_bpf state with its own mutex, so that queries
and the release work don't wait for cgroup_mutex
- Don't lose errors in effective BPF_LSM_CGROUP queries
- Check variable-offset accesses against special fields (Shihuang
Liu)"
* tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: (38 commits)
selftests/bpf: Test which ctx registers a uprobe prog can write
bpf: Restrict uprobe ctx writes to the registers ptrace can set
selftests/bpf: Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate
bpf, cgroup: Don't lose errors in effective BPF_LSM_CGROUP queries
bpf, cgroup: Protect cgroup_bpf state with its own mutex
bpf, cgroup: Don't attach to a removed cgroup
bpf, cgroup: Don't read freed effective arrays in BPF_PROG_QUERY
bpf: Fix verifier model mismatch on __sk_buff.remote_port narrow read
bpf: Fix "unresolved symbol tcp_request_sock" build error
selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative test
bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTED
bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp}
bpf, docs: Document BPF_ITER_NOSLEEP
selftests/bpf: Add negative test for sockmap update from non-sockmap iter
bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap
selftests/bpf: Remove sockmap update from bpf_iter_unix
bpf, lsm: Mark backing_file_alloc/free LSM hooks as untrusted
bpf: Report RCU-tasks quiescent states in do_check()
bpf: Check variable-offset accesses against special fields
bpf: Use dedicated workqueue for freeing BPF programs
...
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
Pull fuse fixes from Miklos Szeredi:
- Fix bugs reported by Sashiko
- Fix a couple of issues introduced in this cycle
- Misc bug fixes
* tag 'fuse-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
fuse: limit name size in listxattr
fuse: clear the old EOF tail before writeback-cache writes
fuse: fix UBSAN warning in fuse_iomap_writeback_range()
fuse: skip dcache instantiation for readdirplus names with embedded NUL
fuse: preserve ENOTCONN after failed initialization and disconnect
fuse: set dentry epoch before making the dentry visible
fuse: advertise support for DAX mappings
fuse: don't mark inode DAX without CONFIG_FS_DAX
fuse: don't pass a NULL inode to fuse_inode_backing() on release
virtiofs: zero the reply region of the argument buffer
virtiofs: disable request timeout
virtiofs: fix use-after-free of fs->tag on device removal
fuse: derive short read EOF from the request offset
selftests/fuse: test post-EOF page zeroing on copy_file_range()
fuse: zero the partial EOF page in copy_file_range()
fuse: fix possible UAF in fuse_direntplus_link()
fuse: Use d_alloc_trylock() in fuse_direntplus_link()
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
Pull cxl fixes from Dave Jiang:
"A small collection of CXL fixes"
* tag 'cxl-fixes-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
cxl/port: Fix endpoint RAS error unmasking
cxl/test: Free the decoder registry when cxl_test_init() fails
cxl/region: Reject a repeat write of an endpoint decoder to targetN
cxl/region: Restore a target's position from its slot after sorting
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski:
"GPIO core fixes:
- delay freeing the line state workqueue to device release and
fix a UAF bug
- fix races in access to the flags field of GPIO descriptors
- clear the debounce period field of struct gpio_desc before
clearing the "requested" flag
- propagate -ENOTSUPP from .set_config() in gpio-shared-proxy
GPIO driver fixes:
- check the return value of clk_prepare in gpio-omap
- reject bulk-in endpoints smaller than 3 bytes in gpio-mpsse
- validate the pin index of interrupt events in gpio-ljca
- disable interrupts around the chip lock in direction callbacks
in gpio-mlxbf2
- fix line name handling in gpio-virtio
Other:
- do not clobber errno on read() errors in gpio-watch user-space
tool"
* tag 'gpio-fixes-for-v7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: shared-proxy: propagate -ENOTSUPP from .set_config()
gpio: omap: handle debounce clock preparation failure
gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes
gpio: ljca: Validate the pin index of interrupt events
gpiolib: keep the line state workqueue alive until device release
gpio: mlxbf2: Disable interrupts around the chip lock in direction ops
gpio: virtio: compute the line names size in a size_t
gpio: virtio: bound the line names block by its configured size
tools: gpio: gpio-watch: do not clobber errno on read error
gpio: cdev: don't overwrite the whole flags field when configuring lines
gpiolib: don't overwrite the entire flags field in gpiod_free_commit()
gpiolib: clear debounce period before the "requested" flag
gpio: shared: use atomic set_bit() for descriptor flags
gpiolib: don't overwrite the entire flags field in gpiod_get_direction()
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 7.4, take #3
* MMU fixes:
- Fix arbitrary truncation to 32bit when dealing with pool size
- Correctly order page pin refconting
- Prevent a HYP block mapping from being replaced with a table
- Fix NV Range invalidation by extending the boundaries to the
next block mapping
- Make sure the correct hw_mmu gets picked on the first run,
should userspace restore a nested context between init and
the first vcpu_load().
- Reject TLBI IPAS2E1 that fall outside of the S2 range
* System register fixes:
- Correctly forward POE/PIE/TVAL EL2 register traps
- Add a sanity check for missing trap forwarding
- Correctly hide generic PAuth for pKVM protected guests when
the feature PAuth has been exluced from the feature set
- Make sure that HCR_EL2.NV1 is always RES0
* Misc fixes:
- Flag Apple M3, M4 and M6 CPUs as having a broken vgic and
a wonky PMUv3 emulation.
- Correctly handle 64bit offsets into an MMIO region from
userspace
- Ensure that a vcpu is loaded when injecting an event
|
|
KVM fixes for 7.4-rcN
- Mitigate a class of (x86) bugs where KVM can read/write guest (userspace)
memory using the wrong mm, i.e. using the wrong user page tables.
- Don't force a full nested VMX VM-Exit when destroying a vCPU, as processing
the MSR load/store lists and writing back the shadow vmcs12 is wildly wrong
when VM is dying.
- Implement "flush shadow all" on KVM PPC to ensure KVM's mappings are torn
down when the VM and/or owning process is dying.
- Provide empty installation rules for architectures that aren't supported by
KVM selftests to fix build issues in CI environments.
- Fix KVM selftests' rules for generating arm64's sysreg headers so that the
headers are properly (re)generated on incremental builds.
- Clear only the VMCB save area on an intercepted SHUTDOWN on SVM, partly to
avoid unnecessary churn, but mostly to prevent KVM from clobbering the PML
index.
- Update the tracked pCPU on task migration for both vmcb01 and vmcb02 to fix
an edge case where KVM can use a stale ASID across pCPUs.
- Rework the single-vCPU kick logic to fix a bug where KVM would fail to wait
for a target vCPU to respond if another in-flight, non-waiting kick changed
the vCPU's mode to EXITING_GUEST_MODE.
- Clear nVMX's smm.guest_most when freeing nested state, and if a RSM to L2
ultimately fails (and queues a TRIPLE_FAULT to L1).
|
|
A uprobe program can write only the pt_regs fields that ptrace can set
to any value. Add verifier tests for x86-64, arm64 and riscv:
- writes to the general registers, the stack pointer and the
instruction pointer load
- writes to cs, ss, flags and orig_ax on x86-64, to pstate and
orig_x0 on arm64, and to status, badaddr and cause on riscv fail
with "invalid bpf_context access"
- a 4-byte write to the low half of a read-only field fails too
- reading a read-only field still works
- on x86-64, a kprobe program that writes ctx->flags fails to load
Other arches get one test that just loads.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261118084451.12590-3-jolsa@kernel.org
|
|
bpf-gcc fails to load test_trace_iter_unix:
Error: #766/6 verifier_sockmap_mutate/test_trace_iter_unix
libbpf: elf: skipping section(3) .data (size 0)
libbpf: elf: skipping unrecognized data section(18) .comment
run_subtest:PASS:obj_open_mem 0 nsec
libbpf: prog 'test_trace_iter_unix': relo #0: insn #0 (LDX/ST/STX) accesses field incorrectly. ...
libbpf: prog 'test_trace_iter_unix': BPF program load failed: -EINVAL
libbpf: prog 'test_trace_iter_unix': failed to load: -EINVAL
libbpf: failed to load object 'verifier_sockmap_mutate'
run_subtest:PASS:unexpected_load_success 0 nsec
validate_msgs:FAIL:1014 expect_msg
VERIFIER LOG:
=============
0: R1=ctx() R10=fp0
; @ verifier_sockmap_mutate.c:124
0: <invalid CO-RE relocation>
failed to resolve CO-RE relocation <byte_off> [4] struct bpf_iter__unix (0:0 @ offset 0)
processed 1 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
=============
EXPECTED SUBSTR: 'cannot update sockmap in this context'
GCC only applies preserve_access_index to types that carry the attribute
themselves. The anonymous union holding the sock pointer doesn't, so the
CO-RE access stops at the union ("0:0") instead of reaching the pointer
("0:0:0"), and libbpf rejects the relocation.
Fixes: e16c83fa764f ("selftests/bpf: Add negative test for sockmap update from non-sockmap iter")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://patch.msgid.link/20261117122417.340562-1-jiayuan.chen@linux.dev
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 7.4, take #2
* MMU fixes:
- Correctly sanitise the TCR_EL2 register
- Stop advertising LPA2 to NV guest when it isn't supported
- Correctly convert EH2==0's view of TCR_EL2 into the E2H==1 format
- Make sure an EL2 mapping is immediately visible to the hypervisor
code, as we don't necessarily require ETS
- Address a horrible situation where a guest can livelock when
trying to solve a permission fault whilst the underlying S2 PTs
have AF=0
- Correctly wipe MTE tags for large mappings instead of just the
head page, providing a convenient helper for this
- Fix dirty logging detection in ring-only mode
- Use ATS1A whenever FEAT_S1PIE is present
* VGIC fixes:
- Fix a bunch of low-impact issues with GICv4, avoiding leaks on
unlikely failure paths
- Use a separate lockdep class for vPE doorbells, and guarantee that
they are never threaded
- Avoid spurious allocation of VPEs when userspace decided not to
expose nASSGIcap
- Fix spurious preservation of the pending state after DISCARD
and CLEAR ITS commands
- Make sure GITS_CTLR.Enabled is updated under the its_lock
- Serialise vgic CTRL_INIT against vCPU creation
- Make the forwarding of LPIs tobust against LPIs being disabled
on the target redistributor
* pKVM fixes:
- Fix the reset of GICv3 LRs for pKVM, de-uglifying the PM paths
whilst at it
- Fix PMU handling for both protected and non-protected guests,
fixing the synchronisation of kvm_host_data in the process
- Correctly invalidate TLBs and I-cache when multiplexing multiple
vcpus of the same VM on a single physical CPU
* Feature visibility fixes:
- Correctly handle ACCDATA_EL1 being exposed to guests, plugging a
potential communication channel between guests.
* Misc fixes:
- Correctly clear the vcpu feature set on init failure
- Clear PSTATE.TCO on exit from the guest when MTE is enabled
for the kernel
- Let the L0 hypervisor always deal with FEAT_MOPS A/B nonsense when
taking such exception, instead of potentially forwarding it
- Add a "maintainer profile" for KVM/arm64
- Add testing for the MOVI and MOVALL commands
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
KVM: s390: Fixes
- Fixes for the arm layer
- sashiko: https://sashiko.dev/#/patchset/20261103-s390_arm64_kvm_fixups-v1-0-21c36fedd878%40linux.ibm.com
- Fix ESSA instruction handling in migration mode
- sashiko: https://sashiko.dev/#/patchset/20261015104822.77062-1-ggala%40linux.ibm.com
- Fix crypto instruction no-hook handling
- https://sashiko.dev/#/patchset/20261020082534.481867-1-ggala%40linux.ibm.com
- Fix selftest for uvdevice
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni:
"Including fixes from netfilter and Bluetooth.
Current release - regressions:
- ipvs: honor the overload state and do not enter it forever
Previous releases - regressions:
- core:
- prevent receive header offset overflow during decapsulation
- avoid truncated transport header offsets
- tcp:
- fix NULL pointer dereference when restarting a fast open listener
- fix the SO_REUSEPORT bind cache admitting a conflicting socket
- sctp: do not free a new asoc peeled off while sendmsg slept
- bridge: fix skb leak of reinjected link-local frames
- bluetooth:
- L2CAP: clear the SDU before the receive callback
- vhci: serialize packet reception with device creation
- ipvs:
- avoid stack overflow from recursive connection expiration
- fix problems during connection deletion
- eth:
- virtio_net: check RX buffer length before DMA sync
- gve: fix RX page refcount overflow from INT_MAX pagecnt_bias
Previous releases - always broken:
- core: make room for the tunnel header in skb_segment_list()
- eth:
- i40e: fix freeing of TX rings on RX allocation failure
- stmmac: fix VXLAN over IPv6 with zero UDP checksum"
* tag 'net-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (117 commits)
net: prevent receive header offset overflow during decapsulation
tcp: bound the rto_min of a route in tcp_rto_min()
tcp: clamp the samples in tcp_rcv_rtt_update()
tcp: reject RTT samples from TSecr above 120 s
tcp: clamp RTT samples in tcp_rtt_estimator()
tcp: don't let __tcp_set_rto() return 0
net: make room for the tunnel header in skb_segment_list()
udp: use skb_set_transport_header_careful() in __udp6_lib_err_encap()
sctp: use skb_set_transport_header_careful() in sctp_v6_err()
net: openvswitch: use skb_set_transport_header_careful() in parse_ipv6hdr()
ipv6: mcast: use skb_set_transport_header_careful() in ipv6_mc_check_exthdrs()
ipv6: gro: limit the number of extension headers
net: stmmac: dwmac1000: stop hardware from dropping checksum-error packets
net: stmmac: dwmac1000: don't discard frames with only a checksum error
net: stmmac: honour Rx checksum errors in the AF_XDP zero-copy path
veth: wake the peer txq when deleting NAPI
veth: wake a stopped peer txq beyond real_num_tx_queues
iavf: add missing PTP adjustment callbacks
iavf: fix ASQ command buffer leak on init failure
iavf: fix QoS capabilities memory leak
...
|
|
* kvm-arm64/sysreg-fixes-7.4-2:
: \
: System register fixes for 7.4
:
: - Correctly forward POE/PIE/TVAL EL2 register traps
:
: - Add a sanity check for missing trap forwarding
:
: - Correctly hide generic PAuth for pKVM protected guests when
: the feature PAuth has been exluced from the feature set
:
: - Make sure that HCR_EL2.NV1 is always RES0
: /
KVM: arm64: selftests: Verify HCR_EL2.NV1 is RES0 when E2H0 is NI_NV1
KVM: arm64: Force HCR_EL2.NV1 to RES0 unconditionally
KVM: arm64: Hide generic ptrauth from protected VMs without ptrauth
KVM: arm64: nv: Report EL2 registers with no trap forwarding
KVM: arm64: nv: Forward CNTP_TVAL_EL02 and CNTV_TVAL_EL02 traps
KVM: arm64: nv: Forward PIR_EL2, PIRE0_EL2 and POR_EL2 traps
Signed-off-by: Marc Zyngier <maz@kernel.org>
|
|
The namespace trace tests cover creation and entry denials, but only
creation exercises the quiet path. This leaves the new ENTER request
tag untested through quiet selection and trace dispatch when audit
logging is suppressed.
Add the missing quiet setns(2) case. Together with the existing cases,
this exercises all four combinations of CREATE and ENTER with logged and
quieted denials, including each exact namespace_op value.
Test coverage for security/landlock is 91.6% of 2894 lines according to
LLVM 23.
Cc: Günther Noack <gnoack@google.com>
Link: https://patch.msgid.link/20261118163254.2554413-4-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
|
|
Landlock reports denied namespace creation and entry with the same
internal request type. Before commit 08471914d6bb ("ns: allocate the
namespace id before the namespace_init hook"), denied creation carried
ID zero and could be distinguished from entry by ID alone. That commit
moved ID allocation before namespace_init(), so creation now carries the
ID of an unreachable new namespace while entry carries the existing
target ID. Namespace IDs are object context, not operation
discriminators.
Split the request type into creation and entry. Keep the two namespace
values together before capability; this renumbers the unreleased
capability request in raw and typed trace context. Report
namespace_op=create or namespace_op=enter immediately after blockers in
namespace audit records and trace event text. Placing the operation
before namespace_type and namespace_id lets consumers establish the
semantics before interpreting the following namespace context,
especially whether namespace_id is the creation-time value or identifies
an existing entry target.
Keep namespace.use as the policy blocker: the new value only describes
the semantic hook context and does not add a policy control.
Cc: Günther Noack <gnoack@google.com>
Fixes: 15dd86021b57 ("landlock: Enforce namespace use restrictions")
Link: https://patch.msgid.link/20261118163254.2554413-2-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
|
|
Test that Landlock denies and logs a privileged PR_SET_SECUREBITS
change, now that the previous commit routes its CAP_SETPCAP check
through the capable hooks, and that an unprivileged change still
succeeds. The domain deallocation record must then report exactly one
denial, which proves that the unprivileged change was not denied,
without relying on a no-record timeout.
The check-exec selftests already cover commoncap's securebits semantics.
Without the previous commit, this test fails.
Cc: Christian Brauner <brauner@kernel.org>
Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <serge@hallyn.com>
Link: https://patch.msgid.link/20261118145431.2551578-3-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
|
|
Test the commoncap checks that the previous commits make Landlock
restrict: mapping below vm.mmap_min_addr (CAP_SYS_RAWIO) and adding
inheritable capabilities (CAP_SETPCAP). Each test checks that the
operation needs the capability, then runs it with the capability in four
variants: unsandboxed, denied, allowed and unhandled. The mmap_addr
tests skip if the architecture rejects the low page before the hook
(e.g. 32-bit ARM).
Audit tests check that these denials are logged, and that the admin
reserve check and allowed uses are not. The admin reserve has no
functional test because it depends on vm.overcommit_memory=2, a
system-wide setting.
Add CAP_SETPCAP and CAP_SYS_RAWIO to the capabilities that the tests may
raise.
Without the mmap_addr and capset fixes, their denied variants and the
denial audit test fail.
Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Serge Hallyn <serge@hallyn.com>
Acked-by: Serge Hallyn (AMD) <sergeh@kernel.org>
Link: https://patch.msgid.link/20261118145217.2551053-6-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
|
|
In a VHE-only EL2 guest (KVM_ARM_VCPU_HAS_EL2 without
KVM_ARM_VCPU_HAS_EL2_E2H0), KVM advertises ID_AA64MMFR4_EL1.E2H0 as
NI_NV1, making HCR_EL2.E2H RES1 and HCR_EL2.NV1 RES0.
Extend hello_el2 to attempt clearing HCR_EL2.E2H and setting HCR_EL2.NV1
from userspace via KVM_SET_ONE_REG, verifying that HCR_EL2.E2H remains
RES1 and HCR_EL2.NV1 is masked to RES0. Add a comment explaining why the
check is performed from userspace rather than inside the guest.
Signed-off-by: Colton Lewis <coltonlewis@google.com>
Link: https://patch.msgid.link/20261118203625.743428-3-coltonlewis@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull MM fixes from Andrew Morton:
- "maple_tree fixes for 7.3" (Liam R. Howlett):
Fix an RCU reader NULL dereference when the tree is emptied during a
walk, including /proc/PID/maps racing with munmap(). Add tests and
make debug WARN and BUG checks report failures properly
- "mm/kasan: Detect double-free involving kfree_rcu_sheaf()" (Kuniyuki
Iwashima):
Detect double-free when an object enters an RCU sheaf. KASAN could
previously miss it until the object was reused, leading to a later
free of a live object. Add KUnit tests for the different free orders
- "mm: Fix page-table teardown during memory hot-remove" (Muchun Song):
Balance page-table constructors and destructors when hot-remove frees
tables on x86-64, RISC-V and arm64. This fixes NR_PAGETABLE
accounting for tables with and without constructors
- "mm/damon: fix watermark state, kunit pid leak and selftest fake
pass" (SJ Park):
Recompute watermark wait state when DAMON schemes are removed, so
kdamond resumes monitoring. Fix a pid reference leak in KUnit and a
selftest that reports a skipped run as a pass
- An XArray iterator could step backwards when a large page-cache entry
was split, sending filemap_map_pages() outside the PTE page it
locked. The XArray correction and a filemap bound check prevent
out-of-bounds accesses and use-after-free. Another XArray fix
prevents lockless walkers from following a parent pointer into a
freed node
- Userfaultfd now validates the whole write-protection range before
changing any VMA, avoiding partial unprotect without waking blocked
faults. Failed unmaps now abort queued UFFD_EVENT_UNMAPs; previously
they could report a nonexistent unmap, leak the userfaultfd context
and leave later operations returning -EAGAIN. A fork fix clears stale
uffd PTE bits if the new context is released before its event is
read
- Moving the hugetlbfs inode trace event before RCU freeing avoids a
use-after-free of its superblock. Shmem swapin no longer retries
forever on reused swap slots containing a mismatched large swap-cache
folio. Swapoff also avoids a cluster-list loop that can soft-lock
reclaim and leave swapoff hung
- Weighted interleave recalculation now uses one node set throughout,
avoiding a divide-by-zero during memory hotplug. Hwpoison holds the
folio lock when inspecting its mapping and no longer leaks a folio
reference; it also updates poison statistics before notifying
rasdaemon through a trace event
- Cross-node migration now moves NR_FILE_THPS and NR_KERNEL_FILE_PAGES
with page-cache folios, preventing per-node and memcg-node accounting
from retaining stale counts or underflowing after the folios are
freed
* tag 'mm-hotfixes-stable-2026-11-17-19-55' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (27 commits)
xarray: fix index jumping backwards in xas_find()
userfaultfd: validate the whole range before changing write protection
maple_tree: update internal warning and bug_on code
maple_tree: test emptying tree while RCU reading
maple_tree: fix rcu reader NULL dereference after the tree is emptied
mm/vma: read anon_vma carefully in validate_mm()
hugetlbfs: move hugetlbfs_free_inode tracepoint to ->destroy_inode()
selftests/damon/sysfs_memcg_path_leak: define ksft_skip
mm/damon/tests/sysfs-kunit: fix leaked pid reference in add_targets test
mm/damon/core: reset watermark wait state on each iteration
mm/filemap: stop fault-around when the walk steps back
mm: memory-failure: update statistics before emitting the trace event
mm/vma: undo userfaultfd unmap preparation when unmapping fails
userfaultfd: clear uffd state in child PTEs if uffd is released during fork
mm/memory-failure: fix folio refcount leak and min_order_for_split() locking
mm/shmem: fix swapin livelock on a mismatched large swap cache folio
mm/mempolicy: use one node set for interleave weights
xarray: clear the new head's parent before freeing the old head
arm64/mm: fix destructor for unconstructed hotplug page tables
riscv/mm: fix missing destructor for hotplug PUD tables
...
|
|
Add dgram_disconnect_fdinfo in scm_rights.c verifying that scm_fds in
/proc/self/fdinfo/<fd> returns to 0 when a connected SOCK_DGRAM socket
with queued SCM_RIGHTS datagrams disconnects via connect(AF_UNSPEC) or
observes a dead peer in send().
Signed-off-by: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261114162632.16346-3-sidchintamaneni@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Madhavan Srinivasan:
- Handle of_property_count_u32_elems() error in parse_thread_groups()
- Defer Nemo IRQ initialization
- disable watchdog when watchdog_thresh=0
- Reserve a PLT entry for ftrace_regs_caller
- powerpc KVM fixes
- misc fixes and cleanups
Thanks to Amit Machhiwal, Bradley Morgan, Christian Zigotzky, Christophe
Leroy, Gautam Menghani, Jiale Yao, Luiz Capitulino, Michael Ellerman,
Mohammad Shahid, Nathan Chancellor, Ritesh Harjani, Sasha Levin,
Shrikanth Hegde, and Timothy Pearson
* tag 'powerpc-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/perf/vpa-dtl: use GFP_ATOMIC for DTL buffer allocation
powerpc32/modules: Reserve a PLT entry for ftrace_regs_caller
powerpc/watchdog: disable watchdog when watchdog_thresh=0
selftests/powerpc: override EMIT_TESTS instead of the emit_tests rule
powerpc/smp: Handle of_property_count_u32_elems() error in parse_thread_groups()
powerpc/pasemi: Defer Nemo IRQ initialization
KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit
KVM: PPC: Book3S HV: Take SRCU read lock around kvmppc_h_page_init() call
KVM: PPC: Book3S HV: XICS: Avoid NULL ptr deref in kvmppc_xive_cleanup_vcpu()
KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work
KVM: PPC: Book3S HV: Ensure that calls to idr_alloc are synchronized
KVM: PPC: Book3S HV: Disable preemption around host-side HPT lock users
powerpc/eeh: NUL-terminate force recovery input
|
|
Decoder registry entries persist across mock device removal to support
topology replay. Sashiko review found that if cxl_test_init() fails after
decoders are enumerated, the entries leak because cxl_test_exit() is never
called.
Free the registry entries and destroy the xarray during error unwind.
Fixes: f3b1d2260703 ("tools/testing/cxl: Enable replay of user regions as auto regions")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Link: https://patch.msgid.link/20261106222240.958402-1-alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
|
|
gpio-watch reads line change events from a gpiochip character device
and reports a read() error or short read with perror(), which prints
strerror(errno). If read() fails, say with EINTR, the inner
if (rd != sizeof(chg))
errno = EIO;
replaces the real errno with EIO, so the message always reports
"Input/output error" instead of the actual cause.
Only synthesize EIO for short reads (rd >= 0), keeping the errno
that read() set when it failed.
Fixes: 33f0c47b8fb4 ("tools: gpio: implement gpio-watch")
Signed-off-by: Gu Bin <gubin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261113035723.2215-1-gubin@cmss.chinamobile.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
|
|
Starting with Rust 1.101.0 (expected 2026-12-24), `objtool` may report:
rust/kernel.o: warning: objtool: _R..._6kernel3pci2ioINtB7_6DeviceNtNtB9_6device5BoundE8cfg_size()
falls through to next function _R..._6kernel3oppNtB5_3OPP18from_raw_opp_owned()
(and others) due to calls to the `noreturn` symbol:
core::panicking::unreachable_default_msg
Rust now outlines the constant messages of the panicking macros [1],
thus `unreachable!()` (i.e. without arguments) calls that new function
instead of `core::panicking::panic`, which is already in the list.
The same change introduced the equivalent `noreturn` functions for
`panic!()`, `todo!()` and `unimplemented!()`, which lead to the same
warning when those are used:
core::panicking::panic_default_msg
core::panicking::todo_default_msg
core::panicking::unimplemented_default_msg
Thus add the mangled ones to the list so that `objtool` knows they are
actually `noreturn`.
See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
for more details.
Cc: stable@vger.kernel.org # 6.12.x (Rust is pinned in older LTSs)
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://github.com/rust-lang/rust/pull/163766 [1]
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20261114001708.80599-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
Add a test for the bug fixed by "tcp: Fix the SO_REUSEPORT bind cache
admitting a conflicting socket". With a 0.0.0.0 listener on the port, a
v6only [::] SO_REUSEPORT socket fills the bind cache, and a dual-stack
[::] SO_REUSEPORT socket must then fail to bind with EADDRINUSE.
Without the fix:
# RUN global.reuseport_v6only_cache ...
# bind_wildcard.c:860:reuseport_v6only_cache:Expected ret (0) == -1 (-1)
# reuseport_v6only_cache: Test terminated by assertion
# FAIL global.reuseport_v6only_cache
not ok 1 global.reuseport_v6only_cache
With it:
# RUN global.reuseport_v6only_cache ...
# OK global.reuseport_v6only_cache
ok 1 global.reuseport_v6only_cache
Signed-off-by: Juan Agustin Niccolini <juanagusnicco@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261111174704.24312-3-juanagusnicco@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
The LANDLOCK_ACCESS_FS_REFER right is handled implicitly in a ruleset,
but only if any other filesystem access right is declared as handled
in the given ruleset.
The old documentation was still a remnant from the times when
filesystem access rights were the only access rights that existed in
Landlock, but it became misleading when we introduced additional types
of access rights.
Fixes: fff69fb03dde ("landlock: Support network rules with TCP bind and connect")
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://patch.msgid.link/20261113-b4-landlock-refer-nonfs-layer-v3-5-02d7e42bcdfd@gmail.com
[mic: Reword _LANDLOCK_ACCESS_FS_INITIALLY_DENIED comment, fix comment
wrapping, and include erratum 5 in userspace-api/landlock.rst]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
|
|
Regression test to exercise that layered Landlock domains do not
accidentally deny the LANDLOCK_ACCESS_FS_REFER access right. This
used to be the case when layering a non-filesystem ruleset with a
filesystem-enforcing ruleset. In that case, REFER operations that
would have been allowed for the individual rulesets would get denied
when layering the same rulesets.
Link: https://github.com/landlock-lsm/linux/issues/67
Link: https://github.com/landlock-lsm/go-landlock/issues/66
Fixes: fff69fb03dde ("landlock: Support network rules with TCP bind and connect")
Cc: stable@vger.kernel.org
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://patch.msgid.link/20261113-b4-landlock-refer-nonfs-layer-v3-3-02d7e42bcdfd@gmail.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fixes from Tejun Heo:
- A file notification racing the file's removal could re-arm the
notification timer after it was shut down, corrupting the timer wheel
or firing on freed memory.
- The v1 freezer could leave an exiting task frozen forever after its
cgroup was thawed or removed.
- With memcg built without the block cgroup controller, memcg reclaim
waited on writeback and could deadlock against a filesystem freeze.
memcg now selects the controller.
- cpuset partition state could go wrong when CPUs move between nested
partitions or go offline: isolated CPUs leaked or went missing,
invalid partitions kept exclusive CPUs or came back with no usable
CPU, and expanding a remote partition could fail. Separately, a
forked child could inherit a corrupted memory node mask.
* tag 'cgroup-for-7.4-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
cgroup/cpuset: Don't revive invalid partition without active CPU on hotplug
cgroup/cpuset: Remove redundant WARN_ON_ONCE() in remote_cpus_update()
memcg: make MEMCG select BLK_CGROUP
cpuset: generalize the validate_partition() interface
cpuset: settle isolation state when CPUs are given back to parent
cgroup/cpuset: Correctly set isolated_cpus when switching partition state
cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork()
selftests/cgroup: Fix "test_cpuset_prs.sh -v" failures
cpuset: add early empty cpumask check in partition_xcpus_add/del
cgroup/cpuset: Reset partition data when an invalid partition stays invalid
cgroup/freezer: Fix exiting tasks left frozen forever after rmdir
cgroup/freezer: walk exiting tasks in the v1 freezer
cgroup: arm the notify timer only while the file exists
cgroup/cpuset: Do housekeeping check when isolated child with root parent may get more xcpus
cgroup/cpuset: Recompute effective cpumask in update_cpumasks_hier() after calling update_parent_effective_cpumask()
cgroup/cpuset: Fix incorrect CPU accounting with parent's effective_xcpus expansion
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Ingo Molnar::
- Add VDSO_UNALIGNED_PACKED config option for targets without efficient
unaligned memory accesses (such as ARMv5), and turn it on for
!CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS platforms.
Propagate these changes into tooling headers as well (Ian Rogers)
- Read getboottime64() offsets under the tk_core.seq sequence counter
(Hungyu Lin)
- Keep tsacct task begin times stable across suspend (Hungyu Lin)
- Reject cross timestamps for invalid AUX clocks (Avi Weiss)
- Refresh auxiliary timekeeper base before offset validation (Avi
Weiss)
* tag 'timers-urgent-2026-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timekeeping: Refresh auxiliary base before offset validation
timekeeping: Reject cross timestamps for invalid AUX clocks
tsacct: Keep task begin times stable across suspend
timekeeping: Read getboottime64() offsets under the sequence counter
tools headers: Update the vdso/unaligned.h copy with the kernel sources
vdso: Add VDSO_UNALIGNED_PACKED config option
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull bootconfig fixes from Masami Hiramatsu:
- bootconfig: Allow keys with the maximum supported depth
Check the array capacity before storing the next key component in
xbc_node_compose_key_after() so keys at XBC_DEPTH_MAX (16) are
composed instead of failing with -ERANGE when listing keys or
creating /proc/bootconfig.
- bootconfig: Trim unquoted values at end of file
Trim trailing whitespace from unquoted values in __xbc_parse_value()
after scanning finishes so values at end of input without a trailing
newline do not retain extra whitespace.
- tools/bootconfig: Close only opened braces in compact output
Check key children while skipping value nodes when backtracking in
xbc_show_compact_tree() so a brace is not closed when a single subkey
under a valued key was printed in dotted notation.
- tools/bootconfig: Test listing keys at the maximum depth
Add regression tests verifying that a 16-component key can be
attached and listed in full while a 17-component key is rejected.
* tag 'bootconfig-fixes-v7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
bootconfig: Trim unquoted values at end of file
tools/bootconfig: Close only opened braces in compact output
tools/bootconfig: Test listing keys at the maximum depth
bootconfig: Allow keys with the maximum supported depth
|
|
bpf_sock_destroy() is restricted to socket-locked iters, TCP and UDP.
Fail attempting it from iter/sockmap.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261107-sockmap-update-limit-iter-v3-7-7c0bad1ad036@rbox.co
|
|
Iterator-context sockmap updates are now restricted to iter/sockmap. Add a
test that attempts an update from iter/unix and expects it to fail.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261107-sockmap-update-limit-iter-v3-3-7c0bad1ad036@rbox.co
|
|
BPF iterator programs that can update sockmaps will be limited to
iter/sockmap. Remove the update from the unix selftest.
This reverts commit 997b8483d44c ("selftests/bpf: Extend bpf_iter_unix to
attempt deadlocking").
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20261107-sockmap-update-limit-iter-v3-1-7c0bad1ad036@rbox.co
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs
Pull overlayfs fixes from Amir Goldstein:
- Fixes for data-only layers (composefs), some for regressions from
v6.16, which relaxed the requirements for redirects to data-only
layers
- Fix a use-after-free in lookup of a hardlink with a FUSE upper,
reported by Sashiko
- Fix a mount failure right after unmount of an overlay with the same
upperdir
- Reject lower layers on the same fs with different idmaps, which could
decode file handles through the wrong layer
- Minor fixes for a memory leak, an error message and readdir d_ino
* tag 'ovl-fixes-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs:
selftests: overlayfs: reject different lower idmaps on same fs
ovl: reject different lower idmaps on the same fs
ovl: bump the impure dir version when linking a file with origin
ovl: return EIO if the lowerdata is missing
ovl: follow lower to lowerdata redirects from any lower layer
ovl: report the requested redirect_dir mode in conflicting options
ovl: do not allow nfs_export with data-only layers
ovl: do not check the deferred lowerdata redirect on index lookup
ovl: fix leak of lowerdata redirect on ovl_get_inode() failure
ovl: do not always clear absolute_redirect
ovl: release the upperdir/workdir in-use locks before the umount sync
ovl: do not read the flags of a put upper dentry in lookup
|