5.15.209-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainercover 5.15.209-rc1 review
This is the start of the stable review cycle for the 5.15.209 release. There are 776 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 01 Jun 2026 16:01:37 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.209-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.15.209-rc1
Aditya Garg <[email protected]>
net: mana: validate rx_req_idx to prevent out-of-bounds array access
Bartosz Golaszewski <[email protected]>
gpio: cdev: check if uAPI v2 config attributes are correctly zeroed
Andy Shevchenko <[email protected]>
gpiolib: cdev: use !mem_is_zero() instead of memchr_inv(s, 0, n)
Jani Nikula <[email protected]>
string: add mem_is_zero() helper to check if memory area is all zeros
Rosen Penev <[email protected]>
net: ag71xx: check error for platform_get_irq
David Carlier <[email protected]>
tracing: Avoid NULL return from hist_field_name() on truncation
Ido Schimmel <[email protected]>
bridge: mcast: Fix a possible use-after-free when removing a bridge port
Petr Machata <[email protected]>
net: bridge: Flush multicast groups when snooping is disabled
Guangshuo Li <[email protected]>
RDMA/rtrs: Fix use-after-free in path file creation cleanup
Rafael J. Wysocki <[email protected]>
platform/x86: intel-vbtn: Check ACPI_HANDLE() against NULL
Rafael J. Wysocki <[email protected]>
platform/x86: intel-hid: Check ACPI_HANDLE() against NULL
Rafael J. Wysocki <[email protected]>
platform/x86: hp_accel: Check ACPI_COMPANION() against NULL
Rafael J. Wysocki <[email protected]>
platform/x86: adv_swbutton: Check ACPI_HANDLE() against NULL
Erni Sri Satya Vennela <[email protected]>
net: mana: Fix TOCTOU double-fetch of hwc_msg_id from DMA buffer
Daniel Golle <[email protected]>
net: dsa: mt7530: preserve VLAN tags on trapped link-local frames
Arınç ÜNAL <[email protected]>
net: dsa: mt7530: rename mt753x_bpdu_port_fw enum to mt753x_to_cpu_fw
Daniel Golle <[email protected]>
net: dsa: mt7530: fix FDB entries not aging out with short timeout
Daniel Golle <[email protected]>
net: dsa: mt7530: sync driver-specific behavior of MT7531 variants
Dmitry Baryshkov <[email protected]>
drm/msm/snapshot: fix dumping of the unaligned regions
Jakub Kicinski <[email protected]>
net: tls: prevent chain-after-chain in plain text SG
Jakub Kicinski <[email protected]>
net: tls: fix off-by-one in sg_chain entry count for wrapped sk_msg ring
Mikko Perttunen <[email protected]>
drm/msm: Fix iommu_map_sgtable() return value check and avoid WARN
Chenguang Zhao <[email protected]>
ethtool: fix ethnl_bitmap32_not_zero() bit interval semantics
Lukas Bulwahn <[email protected]>
HID: quirks: really enable the intended work around for appledisplay
Nicolas Escande <[email protected]>
wifi: ath11k: fix error path leaks in some WMI WOW calls
Ethan Nelson-Moore <[email protected]>
net: ethernet: cs89x0: remove stale CONFIG_MACH_MX31ADS reference
Linus Walleij <[email protected]>
net: ethernet: cortina: Carry over frag counter
Andreas Haarmann-Thiemann <[email protected]>
net: ethernet: cortina: Drop half-assembled SKB
Linus Walleij <[email protected]>
net: ethernet: cortina: Make RX SKB per-port
Rosen Penev <[email protected]>
irqchip/ath79-cpu: Remove unused function
Gabor Juhos <[email protected]>
phy: marvell: mvebu-a3700-utmi: fix incorrect USB2_PHY_CTRL register access
Bart Van Assche <[email protected]>
ice: fix locking in ice_dcb_rebuild()
Kuniyuki Iwashima <[email protected]>
tcp: Fix imbalanced icsk_accept_queue count.
Florian Westphal <[email protected]>
netfilter: bridge: eb_tables: close module init race
Florian Westphal <[email protected]>
netfilter: ebtables: close dangling table module init race
Florian Westphal <[email protected]>
netfilter: ebtables: move to two-stage removal scheme
Florian Westphal <[email protected]>
netfilter: x_tables: add and use xtables_unregister_table_exit
Florian Westphal <[email protected]>
netfilter: x_tables: add and use xt_unregister_table_pre_exit
Pablo Neira Ayuso <[email protected]>
netfilter: Exclude LEGACY TABLES on PREEMPT_RT.
Breno Leitao <[email protected]>
netfilter: Make legacy configs user selectable
Kuniyuki Iwashima <[email protected]>
netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c
Florian Westphal <[email protected]>
netfilter: xtables: fix up kconfig dependencies
Florian Westphal <[email protected]>
netfilter: ebtables: allow xtables-nft only builds
Florian Westphal <[email protected]>
netfilter: xtables: allow xtables-nft only builds
Florian Westphal <[email protected]>
netfilter: arptables: allow xtables-nft only builds
Florian Westphal <[email protected]>
netfilter: arp_tables: allow use of arpt_do_table as hookfn
Florian Westphal <[email protected]>
netfilter: x_tables: unregister the templates first
Guenter Roeck <[email protected]>
ARM: integrator: Fix early initialization
David Gow <[email protected]>
kunit: config: KUNIT_DEBUGFS should depend on DEBUG_FS
David Gow <[email protected]>
kunit: config: Enable KUNIT_DEBUGFS by default
Sudeep Holla <[email protected]>
firmware: arm_ffa: Skip free_pages on RX buffer alloc failure
Sudeep Holla <[email protected]>
firmware: arm_ffa: Check for NULL FF-A ID table while driver registration
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) reject short block-read responses in the GPIO accessors
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) register the nvmem device after pmbus_do_probe()
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) register the gpio_chip after pmbus_do_probe()
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) don't clobber GPIO bits before PDIO read in get_multiple
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) cap PDIO scan in get_multiple at ADM1266_PDIO_NR
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) bounce blackbox records through a protocol-sized buffer
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) include PEC byte in pmbus_block_xfer read buffer
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) reject implausible blackbox record_count
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) seed timestamp from the real-time clock
Sven Eckelmann <[email protected]>
batman-adv: tt: fix negative tt_buff_len
Sven Eckelmann <[email protected]>
batman-adv: tt: fix negative last_changeset_len
Sven Eckelmann <[email protected]>
batman-adv: tp_meter: avoid use of uninit sender vars
Sven Eckelmann <[email protected]>
batman-adv: bla: fix report_work leak on backbone_gw purge
Sven Eckelmann <[email protected]>
batman-adv: frag: disallow unicast fragment in fragment
Luxiao Xu <[email protected]>
batman-adv: fix tp_meter counter underflow during shutdown
Ruide Cao <[email protected]>
batman-adv: fix fragment reassembly length accounting
Sven Eckelmann <[email protected]>
batman-adv: dat: handle forward allocation error
Ruijie Li <[email protected]>
batman-adv: clear current gateway during teardown
Sven Eckelmann <[email protected]>
batman-adv: mcast: fix use-after-free in orig_node RCU release
Harry Wentland <[email protected]>
drm/amd/display: Validate payload length and link_index in dc_process_dmub_aux_transfer_async
Harry Wentland <[email protected]>
drm/amd/display: Fix integer overflow in bios_get_image()
Osama Abdelkader <[email protected]>
drm/bridge: megachips: remove bridge when irq request fails
Julien Chauveau <[email protected]>
drm/bridge: it66121: acquire reset GPIO in probe
Bartosz Golaszewski <[email protected]>
device property: set fwnode->secondary to NULL in fwnode_init()
Michael Bommarito <[email protected]>
RDMA/siw: Reject MPA FPDU length underflow before signed receive math
Johan Hovold <[email protected]>
spi: ti-qspi: fix use-after-free after DMA setup failure
Johan Hovold <[email protected]>
spi: sprd: fix error pointer deref after DMA setup failure
Michael Bommarito <[email protected]>
scsi: isci: Fix use-after-free in device removal path
Masami Hiramatsu (Google) <[email protected]>
tracing: Do not call map->ops->elt_free() if elt_alloc() fails
John Walker <[email protected]>
wifi: cfg80211: advance loop vars in cfg80211_merge_profile()
Michael Bommarito <[email protected]>
ixgbevf: fix use-after-free in VEPA multicast source pruning
Michael Bommarito <[email protected]>
ipv4: raw: reject IP_HDRINCL packets with ihl < 5
Kyle Farnung <[email protected]>
wifi: ath11k: clear shared SRNG pointer state on restart
Minh Nguyen <[email protected]>
vsock/vmci: fix UAF when peer resets connection during handshake
Steven Rostedt <[email protected]>
ring-buffer: Fix reporting of missed events in iterator
Nan Li <[email protected]>
netfilter: ipset: stop hash:* range iteration at end
Haoze Xie <[email protected]>
netfilter: nf_queue: hold bridge skb->dev while queued
Zhengchuan Liang <[email protected]>
netfilter: ip6t_hbh: reject oversized option lists
Nicolai Buchwitz <[email protected]>
net: bcmgenet: keep RBUF EEE/PM disabled
Zijing Yin <[email protected]>
phonet/pep: disable BH around forwarded sk_receive_skb()
Mingyu Wang <[email protected]>
Bluetooth: hci_uart: fix UAFs and race conditions in close and init paths
Jann Horn <[email protected]>
Bluetooth: bnep: Fix UAF read of dev->name
Abdun Nihaal <[email protected]>
net: wwan: iosm: fix potential memory leaks in ipc_imem_init()
Takashi Iwai <[email protected]>
ALSA: asihpi: Fix potential OOB array access at reading cache
Cássio Gabriel <[email protected]>
ALSA: ua101: Reject too-short USB descriptors
Abdurrahman Hussain <[email protected]>
hwmon: (pmbus/adm1266) widen blackbox-info buffer to I2C_SMBUS_BLOCK_MAX
Greg Kroah-Hartman <[email protected]>
sysfs: don't remove existing directory on update failure
Adrian Hunter <[email protected]>
i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue
Asim Viladi Oglu Manizada <[email protected]>
smb: client: reject userspace cifs.spnego descriptions
Sasha Levin <[email protected]>
Revert "s390/cio: Fix device lifecycle handling in css_alloc_subchannel()"
Sean Christopherson <[email protected]>
KVM: x86: Acquire SRCU in KVM_GET_MP_STATE to protect guest memory accesses
Deepanshu Kartikey <[email protected]>
wifi: mac80211: check tdls flag in ieee80211_tdls_oper
Vladimir Oltean <[email protected]>
net: dsa: sja1105: fix kasan out-of-bounds warning in sja1105_table_delete_entry()
Sasha Levin <[email protected]>
Revert "x86/vdso: Fix output operand size of RDPID"
Pengpeng Hou <[email protected]>
s390/debug: Reject zero-length input before trimming a newline
Pavel Begunkov <[email protected]>
io_uring: prevent opcode speculation
Allison Henderson <[email protected]>
net/rds: reset op_nents when zerocopy page pin fails
Nicholas Carlini <[email protected]>
io-wq: check that the predecessor is hashed in io_wq_remove_pending()
Johan Hovold <[email protected]>
drm/gma500/oaktrail_hdmi: fix i2c adapter leak on setup
Gyeyoung Baek <[email protected]>
drm/panfrost: Fix wait_bo ioctl leaking positive return from dma_resv_wait_timeout()
Sebastian Brzezinka <[email protected]>
drm/i915: skip __i915_request_skip() for already signaled requests
Naval Alcalá <[email protected]>
iommu/vt-d: Disable DMAR for Intel Q35 IGFX
Raphael Zimmer <[email protected]>
libceph: handle rbtree insertion error in decode_choose_args()
Raphael Zimmer <[email protected]>
libceph: Fix potential out-of-bounds access in crush_decode()
Raphael Zimmer <[email protected]>
libceph: Fix potential null-ptr-deref in decode_choose_args()
Raphael Zimmer <[email protected]>
libceph: Fix potential out-of-bounds access in osdmap_decode()
Ma Ke <[email protected]>
powerpc/warp: Fix error handling in pika_dtm_thread
Viacheslav Dubeyko <[email protected]>
ceph: fix a buffer leak in __ceph_setxattr()
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Bound MIDI endpoint descriptor scans
Chaitanya Kumar Borah <[email protected]>
drm/i915/dp: Fix VSC dynamic range signaling for RGB formats
Qiang Ma <[email protected]>
KVM: x86: Fix Xen hypercall tracepoint argument assignment
Aaron Sacks <[email protected]>
KVM: Reject wrapped offset in kvm_reset_dirty_gfn()
Sergio Correia <[email protected]>
audit: enforce AUDIT_LOCKED for AUDIT_TRIM and AUDIT_MAKE_EQUIV
Zoran Ilievski <[email protected]>
net: atlantic: preserve PCI wake-from-D3 on shutdown when WOL enabled
Li Xiasong <[email protected]>
netfilter: nft_ct: fix missing expect put in obj eval
Sergio Correia <[email protected]>
audit: fix incorrect inheritable capability in CAPSET records
Matt Vollrath <[email protected]>
i40e: Cleanup PTP pins on probe failure
Herbert Xu <[email protected]>
crypto: af_alg - Cap AEAD AD length to 0x80000000
Eric Dumazet <[email protected]>
net/sched: sch_pie: annotate more data-races in pie_dump_stats()
Qingqing Yang <[email protected]>
flow_dissector: Do not count vlan tags inside tunnel payload
Qingfang Deng <[email protected]>
flow_dissector: do not dissect PPPoE PFC frames
Trond Myklebust <[email protected]>
SUNRPC: Do not dereference non-socket transports in sysfs
Anna Schumaker <[email protected]>
SUNRPC: Check if the xprt is connected before handling sysfs reads
Filipe Manana <[email protected]>
btrfs: tracepoints: fix sleep while in atomic context in btrfs_sync_file()
Timur Kristóf <[email protected]>
drm/amd/display: Read EDID from VBIOS embedded panel info
Timur Kristóf <[email protected]>
drm/amd/display: Allow DCE link encoder without AUX registers
wangdicheng <[email protected]>
ALSA: hda/conexant: Fix missing error check for jack detection
wangdicheng <[email protected]>
ALSA: hda/conexant: Renaming the codec with device ID 0x1f86 and 0x1f87
Oldherl Oh <[email protected]>
ALSA: hda/conexant: fix some typos
bo liu <[email protected]>
ALSA: hda/conexant: add a new hda codec SN6140
Eric Dumazet <[email protected]>
net/sched: sch_cake: annotate data-races in cake_dump_stats() (V)
Weiming Shi <[email protected]>
bareudp: fix NULL pointer dereference in bareudp_fill_metadata_dst()
Beniamino Galvani <[email protected]>
ipv6: rename and move ip6_dst_lookup_tunnel()
Beniamino Galvani <[email protected]>
ipv4: add new arguments to udp_tunnel_dst_lookup()
Beniamino Galvani <[email protected]>
ipv4: remove "proto" argument from udp_tunnel_dst_lookup()
Beniamino Galvani <[email protected]>
ipv4: rename and move ip_route_output_tunnel()
Xin Long <[email protected]>
sctp: discard stale INIT after handshake completion
Xin Long <[email protected]>
netfilter: skip recording stale or retransmitted INIT
Christian A. Ehrhardt <[email protected]>
ASoC: codecs: ab8500: Fix casting of private data
Heiko Schocher <[email protected]>
net: phy: dp83869: fix setting CLK_O_SEL field.
Paul Geurts <[email protected]>
NFC: trf7970a: Ignore antenna noise when checking for RF field
Morduan Zang <[email protected]>
net: usb: rtl8150: free skb on usb_submit_urb() failure in xmit
Zhan Jun <[email protected]>
net: usb: rtl8150: fix use-after-free in rtl8150_start_xmit()
Ido Schimmel <[email protected]>
vrf: Fix a potential NPD when removing a port from a VRF
Eric Dumazet <[email protected]>
net/sched: sch_fq_pie: annotate data-races in fq_pie_dump_stats()
Eric Dumazet <[email protected]>
net/sched: sch_choke: annotate data-races in choke_dump_stats()
Zhengchao Shao <[email protected]>
net: sched: choke: remove unused variables in struct choke_sched_data
Stephen Hemminger <[email protected]>
net/sched: netem: validate slot configuration
Stephen Hemminger <[email protected]>
net/sched: netem: fix queue limit check to include reordered packets
Stephen Hemminger <[email protected]>
net/sched: netem: fix probability gaps in 4-state loss model
Harshit Mogalapalli <[email protected]>
net: sched: sch_netem: Refactor code in 4-state loss generator
Nikola Z. Ivanov <[email protected]>
netdevsim: zero initialize struct iphdr in dummy sk_buff
Daan De Meyer <[email protected]>
cdrom, scsi: sr: propagate read-only status to block layer via set_disk_ro()
Enze Li <[email protected]>
scsi: sr: Add memory allocation failure handling for get_capabilities()
Florian Westphal <[email protected]>
netfilter: nf_conntrack_sip: don't use simple_strtoul
Jiexun Wang <[email protected]>
netfilter: xt_policy: fix strict mode inbound policy matching
Timur Kristóf <[email protected]>
drm/amdgpu/gfx6: Support harvested SI chips with disabled TCCs (v2)
Timur Kristóf <[email protected]>
drm/amdgpu/uvd3.1: Don't validate the firmware when already validated
Alexandre Demers <[email protected]>
drm/amdgpu: fix spelling typos
Pablo Neira Ayuso <[email protected]>
netfilter: arp_tables: fix IEEE1394 ARP payload parsing
Breno Leitao <[email protected]>
tracing: branch: Fix inverted check on stat tracer registration
Mark Harmstone <[email protected]>
btrfs: fix double-decrement of bytes_may_use in submit_one_async_extent()
Wolfram Sang <[email protected]>
mailbox: mailbox-test: make data_ready a per-instance variable
Wolfram Sang <[email protected]>
mailbox: mailbox-test: initialize struct earlier
Wolfram Sang <[email protected]>
mailbox: mailbox-test: don't free the reused channel
Wolfram Sang <[email protected]>
mailbox: add sanity check for channel array
cuitao <[email protected]>
cgroup/rdma: fix integer overflow in rdmacg_try_charge()
Wolfram Sang <[email protected]>
mailbox: mailbox-test: free channels on probe error
Yuho Choi <[email protected]>
fbdev: offb: fix PCI device reference leak on probe failure
Anthony Pighin (Nokia) <[email protected]>
rtc: abx80x: Disable alarm feature if no interrupt attached
Bae Yeonju <[email protected]>
fs/adfs: validate nzones in adfs_validate_bblk()
Kohei Enju <[email protected]>
vhost_net: fix sleeping with preempt-disabled in vhost_net_busy_poll()
Lee Jones <[email protected]>
tipc: fix double-free in tipc_buf_append()
Alexey Kodanev <[email protected]>
nfp: fix swapped arguments in nfp_encode_basic_qdr() calls
Eric Dumazet <[email protected]>
net/sched: sch_sfb: annotate data-races in sfb_dump_stats()
Eric Dumazet <[email protected]>
net/sched: sch_red: annotate data-races in red_dump_stats()
Zhengchao Shao <[email protected]>
net: sched: gred/red: remove unused variables in struct red_stats
Eric Dumazet <[email protected]>
net/sched: sch_fq_codel: remove data-races from fq_codel_dump_stats()
Eric Dumazet <[email protected]>
net/sched: sch_pie: annotate data-races in pie_dump_stats()
Eric Dumazet <[email protected]>
net_sched: sch_hhf: annotate data-races in hhf_dump_stats()
Michael Bommarito <[email protected]>
net/rds: zero per-item info buffer before handing it to visitors
Hyunwoo Kim <[email protected]>
ksmbd: scope conn->binding slowpath to bound sessions only
DaeMyung Kang <[email protected]>
ksmbd: destroy tree_conn_ida in ksmbd_session_destroy()
Jun Yan <[email protected]>
arm64: dts: meson-gxl-p230: fix ethernet PHY interrupt number
Weiming Shi <[email protected]>
slip: bound decode() reads against the compressed packet length
Weiming Shi <[email protected]>
slip: reject VJ receive packets on instances with no rstate array
Fernando Fernandez Mancera <[email protected]>
netfilter: nfnetlink_osf: fix potential NULL dereference in ttl check
Fernando Fernandez Mancera <[email protected]>
netfilter: nfnetlink_osf: fix out-of-bounds read on option matching
Yingnan Zhang <[email protected]>
ipvs: fix MTU check for GSO packets in tunnel mode
Pablo Neira Ayuso <[email protected]>
netfilter: xtables: restrict several matches to inet family
Florian Westphal <[email protected]>
netfilter: conntrack: remove sprintf usage
Xiang Mei <[email protected]>
netfilter: nfnetlink_osf: fix divide-by-zero in OSF_WSS_MODULO
Pablo Neira Ayuso <[email protected]>
netfilter: nft_osf: restrict it to ipv4
Weiming Shi <[email protected]>
openvswitch: cap upcall PID array size and pre-size vport replies
Qingfang Deng <[email protected]>
pppoe: drop PFC frames
Wojciech Drewek <[email protected]>
flow_dissector: Add PPPoE dissectors
Boris Sukholitko <[email protected]>
flow_dissector: Add number of vlan tags dissector
Boris Sukholitko <[email protected]>
dissector: do not set invalid PPP protocol
Michael Bommarito <[email protected]>
sctp: fix OOB write to userspace in sctp_getsockopt_peer_auth_chunks
Eric Dumazet <[email protected]>
ipv6: fix possible UAF in icmpv6_rcv()
Matt Vollrath <[email protected]>
e1000e: Unroll PTP in probe error handling
Kohei Enju <[email protected]>
i40e: don't advertise IFF_SUPP_NOFCS
Eric Dumazet <[email protected]>
tcp: annotate data-races around (tp->write_seq - tp->snd_nxt)
Vinicius Costa Gomes <[email protected]>
net/sched: taprio: fix use-after-free in advance_sched() on schedule switch
Vladimir Oltean <[email protected]>
net/sched: taprio: rename close_time to end_time
Vladimir Oltean <[email protected]>
net/sched: taprio: refactor one skb dequeue from TXQ to separate function
Vladimir Oltean <[email protected]>
net/sched: taprio: continue with other TXQs if one dequeue() failed
Vladimir Oltean <[email protected]>
net/sched: taprio: replace safety precautions with comments
Vladimir Oltean <[email protected]>
net/sched: taprio: stop going through private ops for dequeue and peek
Jiayuan Chen <[email protected]>
nexthop: fix IPv6 route referencing IPv4 nexthop
Dudu Lu <[email protected]>
net/sched: sch_cake: fix NAT destination port not being updated in cake_update_flowkeys
René Rebe <[email protected]>
PCMCIA: Fix garbled log messages for KERN_CONT
Paul Moses <[email protected]>
crypto: ccp - copy IV using skcipher ivsize
T Pratham <[email protected]>
crypto: sa2ul - Fix AEAD fallback algorithm names
Geert Uytterhoeven <[email protected]>
lib/hexdump: print_hex_dump_bytes() calls print_hex_dump_debug()
Konrad Dybcio <[email protected]>
clk: qcom: dispcc-sc7180: Add missing MDSS resets
Konrad Dybcio <[email protected]>
dt-bindings: clock: qcom,dispcc-sc7180: Define MDSS resets
Geert Uytterhoeven <[email protected]>
clk: xgene: Fix mapping leak in xgene_pllclk_init()
Arnd Bergmann <[email protected]>
clk: qoriq: avoid format string warning
Sebastian Krzyszkowiak <[email protected]>
clk: imx8mq: Correct the CSI PHY sels
Felix Gu <[email protected]>
clk: imx: imx6q: Fix device node reference leak in of_assigned_ldb_sels()
Felix Gu <[email protected]>
clk: imx: imx6q: Fix device node reference leak in pll6_bypassed()
Val Packett <[email protected]>
clk: qcom: dispcc-sm8250: Enable parents for pixel clocks
Val Packett <[email protected]>
clk: qcom: dispcc-sm8250: Use shared ops on the mdss vsync clk
Val Packett <[email protected]>
clk: qcom: gcc-sc8180x: Use retention for PCIe power domains
Val Packett <[email protected]>
clk: qcom: gcc-sc8180x: Use retention for USB power domains
Val Packett <[email protected]>
clk: qcom: gcc-sc8180x: Add missing GDSCs
Val Packett <[email protected]>
dt-bindings: clock: qcom,gcc-sc8180x: Add missing GDSCs
Junrui Luo <[email protected]>
scsi: target: core: Fix integer overflow in UNMAP bounds check
Yang Erkun <[email protected]>
scsi: sg: Resolve soft lockup issue when opening /dev/sgX
Florian Westphal <[email protected]>
RDMA/core: Prefer NLA_NUL_STRING
Pengpeng Hou <[email protected]>
platform/x86: dell-wmi-sysman: bound enumeration string aggregation
Fedor Pchelkin <[email protected]>
platform/x86: dell_rbu: avoid uninit value usage in packet_size_write()
Pengpeng Hou <[email protected]>
fs/ntfs3: terminate the cached volume label after UTF-8 conversion
Andy Shevchenko <[email protected]>
nfs/blocklayout: Fix compilation error (make W=1) in bl_write_pagelist()
Abdun Nihaal <[email protected]>
mfd: mc13xxx-core: Fix memory leak in mc13xxx_add_subdevice_pdata()
Rafael J. Wysocki <[email protected]>
platform/x86: panasonic-laptop: Fix OPTD notifier registration and cleanup
Randy Dunlap <[email protected]>
tty: hvc_iucv: fix off-by-one in number of supported devices
наб <[email protected]>
tty: hvc: remove HVC_IUCV_MAGIC
Chen Ni <[email protected]>
leds: lgm-sso: Remove duplicate assignments for priv->mmap
Rafael J. Wysocki <[email protected]>
platform/surface: surfacepro3_button: Drop wakeup source on remove
Chen Ni <[email protected]>
backlight: sky81452-backlight: Check return value of devm_gpiod_get_optional() in sky81452_bl_parse_dt()
Nuno Sa <[email protected]>
dev_printk: add new dev_err_probe() helpers
Andy Shevchenko <[email protected]>
driver core: Move dev_err_probe() to where it belogs
Greg Kroah-Hartman <[email protected]>
driver core: device.h: remove extern from function prototypes
Billy Tsai <[email protected]>
i3c: mipi-i3c-hci: fix IBI payload length calculation for final status
Arnaldo Carvalho de Melo <[email protected]>
perf util: Kill die() prototype, dead for a long time
Leo Yan <[email protected]>
perf expr: Return -EINVAL for syntax error in expr__find_ids()
Yu-Chun Lin <[email protected]>
pinctrl: abx500: Fix type of 'argument' variable
Mike Leach <[email protected]>
perf: tools: cs-etm: Fix print issue for Coresight debug in ETE/TRBE trace
Ian Rogers <[email protected]>
perf branch: Avoid incrementing NULL
Ethan Tidmore <[email protected]>
pinctrl: pinctrl-pic32: Fix resource leak
Oliver Neukum <[email protected]>
HID: usbhid: fix deadlock in hid_post_reset()
Richard Genoud <[email protected]>
mtd: rawnand: sunxi: fix sunxi_nfc_hw_ecc_read_extra_oob
Cosmin Tanislav <[email protected]>
mtd: parsers: ofpart: call of_node_get() for dedicated subpartitions
Cosmin Tanislav <[email protected]>
mtd: parsers: ofpart: call of_node_put() only in ofpart_fail path
Shiji Yang <[email protected]>
mtd: spi-nor: swp: check SR_TB flag when getting tb_mask
Haibo Chen <[email protected]>
mtd: spi-nor: core: correct the op.dummy.nbytes when check read operations
Chen Ni <[email protected]>
mtd: physmap_of_gemini: Fix disabled pinctrl state check
Denis Benato <[email protected]>
HID: asus: do not abort probe when not necessary
Denis Benato <[email protected]>
HID: asus: make asus_resume adhere to linux kernel coding standards
Daniel Hodges <[email protected]>
ima: check return value of crypto_shash_final() in boot aggregate
Pengpeng Hou <[email protected]>
tracing: Rebuild full_name on each hist_field_name() call
Frank Li <[email protected]>
dmaengine: mxs-dma: Fix missing return value from of_dma_controller_register()
Khairul Anuar Romli <[email protected]>
dmaengine: dw-axi-dmac: Remove unnecessary return statement from void function
ZhengYuan Huang <[email protected]>
ocfs2: validate group add input before caching
ZhengYuan Huang <[email protected]>
ocfs2: validate bg_bits during freefrag scan
ZhengYuan Huang <[email protected]>
ocfs2: fix listxattr handling when the buffer is full
Alok Tiwari <[email protected]>
soc: qcom: aoss: compare against normalized cooling state
Junrui Luo <[email protected]>
ocfs2/dlm: fix off-by-one in dlm_match_regions() region comparison
Junrui Luo <[email protected]>
ocfs2/dlm: validate qr_numregions in dlm_match_regions()
Michal Grzedzicki <[email protected]>
unshare: fix nsproxy leak in ksys_unshare() on set_cred_ucounts() failure
David Heidelberg <[email protected]>
arm64: dts: qcom: sdm845-xiaomi-beryllium: Mark l1a regulator as powered during boot
Dmitry Baryshkov <[email protected]>
soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available
Dmitry Baryshkov <[email protected]>
soc: qcom: ocmem: register reasons for probe deferrals
Krzysztof Kozlowski <[email protected]>
soc: qcom: ocmem: use scoped device node handling to simplify error paths
Mikko Perttunen <[email protected]>
memory: tegra30-emc: Fix dll_change check
Mikko Perttunen <[email protected]>
memory: tegra124-emc: Fix dll_change check
Rafał Miłecki <[email protected]>
ARM: dts: mediatek: mt7623: fix efuse fallback compatible
Joshua Klinesmith <[email protected]>
ksmbd: fix use-after-free from async crypto on Qualcomm crypto engine
Thomas Huth <[email protected]>
efi/capsule-loader: fix incorrect sizeof in phys array reallocation
Andreas Gruenbacher <[email protected]>
gfs2: prevent NULL pointer dereference during unmount
Andreas Gruenbacher <[email protected]>
gfs2: add some missing log locking
Jan Kara <[email protected]>
quota: Fix race of dquot_scan_active() with quota deactivation
Ricardo B. Marlière <[email protected]>
ktest: Run POST_KTEST hooks on failure and cancellation
Ricardo B. Marlière <[email protected]>
ktest: Honor empty per-test option overrides
Ricardo B. Marlière <[email protected]>
ktest: Avoid undef warning when WARNINGS_FILE is unset
Cássio Gabriel <[email protected]>
ALSA: sc6000: Keep the programmed board state in card-private data
Takashi Iwai <[email protected]>
ALSA: sc6000: Use standard print API
Vidya Sagar <[email protected]>
PCI: tegra194: Disable direct speed change for Endpoint mode
Vidya Sagar <[email protected]>
PCI: tegra194: Use devm_gpiod_get_optional() to parse "nvidia,refclk-select"
Manikanta Maddireddy <[email protected]>
PCI: tegra194: Disable LTSSM after transition to Detect on surprise link down
Manikanta Maddireddy <[email protected]>
PCI: tegra194: Increase LTSSM poll time on surprise link down
Vidya Sagar <[email protected]>
PCI: tegra194: Fix polling delay for L2 state
Frank Li <[email protected]>
PCI: Add PCIE_PME_TO_L2_TIMEOUT_US L2 ready timeout value
Waiman Long <[email protected]>
selftest: memcg: skip memcg_sock test if address family not supported
Jane Chu <[email protected]>
Documentation: fix a hugetlbfs reservation statement
Gerd Bayer <[email protected]>
PCI: Enable AtomicOps only if Root Port supports them
Shengjiu Wang <[email protected]>
ASoC: fsl_easrc: Change the type for iec958 channel status controls
Shengjiu Wang <[email protected]>
ASoC: fsl_easrc: Fix value type in fsl_easrc_iec958_get_bits()
Shengjiu Wang <[email protected]>
ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits()
Shengjiu Wang <[email protected]>
ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_mode_put()
Shengjiu Wang <[email protected]>
ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_arc_mode_put()
Felix Gu <[email protected]>
pmdomain: imx: scu-pd: Fix device_node reference leak during ->probe()
Felix Gu <[email protected]>
pmdomain: ti: omap_prm: Fix a reference leak on device node
Akhil P Oommen <[email protected]>
drm/msm/a6xx: Use barriers while updating HFI Q headers
Rob Clark <[email protected]>
drm/msm/a6xx: Fix HLSQ register dumping
Lei Huang <[email protected]>
ALSA: hda/realtek: fix code style (ERROR: else should follow close brace '}')
Luke D. Jones <[email protected]>
ALSA: hda/realtek: Whitespace fix
Timur Kristóf <[email protected]>
drm/amd/pm/smu7: Add SCLK cap for quirky Hawaii board
Timur Kristóf <[email protected]>
drm/amd/pm/ci: Fill DW8 fields from SMC
Timur Kristóf <[email protected]>
drm/amd/pm/ci: Clear EnabledForActivity field for memory levels
Timur Kristóf <[email protected]>
drm/amd/pm/ci: Fix powertune defaults for Hawaii 0x67B0
Timur Kristóf <[email protected]>
drm/amd/pm/smu7: Fix SMU7 voltage dependency on display clock
Timur Kristóf <[email protected]>
drm/amd/pm/ci: Disable MCLK DPM on problematic CI ASICs
Timur Kristóf <[email protected]>
drm/amd/pm/ci: Use highest MCLK on CI when MCLK DPM is disabled
Cássio Gabriel <[email protected]>
ALSA: core: Validate compress device numbers without dynamic minors
Sebastian Reichel <[email protected]>
drm/panel: simple: Correct G190EAN01 prepare timing
Alexander Koskovich <[email protected]>
drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0
Pei Xiao <[email protected]>
spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo
Andy Shevchenko <[email protected]>
fbdev: matroxfb: Mark variable with __maybe_unused to avoid W=1 build break
Guillaume Gonnet <[email protected]>
dm init: ensure device probing has finished in dm-mod.waitfor=
Ethan Tidmore <[email protected]>
drm/sun4i: Fix resource leaks
Felix Gu <[email protected]>
spi: fsl-qspi: Use reinit_completion() for repeated operations
Junrui Luo <[email protected]>
dm log: fix out-of-bounds write due to region_count overflow
Ming-Hung Tsai <[email protected]>
dm cache metadata: fix memory leak on metadata abort retry
Ming-Hung Tsai <[email protected]>
dm cache: fix dirty mapping checking in passthrough mode switching
Ming-Hung Tsai <[email protected]>
dm cache: support shrinking the origin device
Ming-Hung Tsai <[email protected]>
dm cache: fix concurrent write failure in passthrough mode
Ming-Hung Tsai <[email protected]>
dm cache policy smq: fix missing locks in invalidating cache blocks
Ming-Hung Tsai <[email protected]>
dm cache: fix write path cache coherency in passthrough mode
Ming-Hung Tsai <[email protected]>
dm cache: fix null-deref with concurrent writes in passthrough mode
Sander Vanheule <[email protected]>
ASoC: sti: use managed regmap_field allocations
Sander Vanheule <[email protected]>
ASoC: sti: Return errors from regmap_field_alloc()
Alexander Konyukhov <[email protected]>
drm/komeda: fix integer overflow in AFBC framebuffer size check
Jiayuan Chen <[email protected]>
net, bpf: fix null-ptr-deref in xdp_master_redirect() for down master
Xin Long <[email protected]>
sctp: fix missing encap_port propagation for GSO fragments
Maxime Chevallier <[email protected]>
net: phy: qcom: at803x: Use the correct bit to disable extended next page
Dudu Lu <[email protected]>
Bluetooth: l2cap: Add missing chan lock in l2cap_ecred_reconf_rsp
Pauli Virtanen <[email protected]>
Bluetooth: fix locking in hci_conn_request_evt() with HCI_PROTO_DEFER
Jonathan Rissanen <[email protected]>
Bluetooth: hci_ldisc: Clear HCI_UART_PROTO_INIT on error
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix printing wrong information if SDU length exceeds MTU
Sun Jian <[email protected]>
bpf: reject short IPv4/IPv6 inputs in bpf_prog_test_run_skb
Taegu Ha <[email protected]>
ppp: require CAP_NET_ADMIN in target netns for unattached ioctls
Greg Jumper <[email protected]>
net/rds: Restrict use of RDS/IB to the initial network namespace
Håkon Bugge <[email protected]>
net/rds: Optimize rds_ib_laddr_check
Jamal Hadi Salim <[email protected]>
net/sched: act_ct: Only release RCU read lock after ct_ft
Mashiro Chen <[email protected]>
net: hamradio: 6pack: fix uninit-value in sixpack_receive_buf
Jiri Slaby (SUSE) <[email protected]>
6pack: propagage new tty types
Florian Westphal <[email protected]>
netfilter: nft_fwd_netdev: check ttl/hl before forwarding
Florian Westphal <[email protected]>
netfilter: xt_socket: enable defrag after all other checks
Justin Chen <[email protected]>
net: bcmgenet: fix off-by-one in bcmgenet_put_txcb
Weiming Shi <[email protected]>
bpf: reject negative CO-RE accessor indices in bpf_core_parse_spec()
Jiayuan Chen <[email protected]>
bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks
Frederick Lawler <[email protected]>
bpf-lsm: Make bpf_lsm_userns_create() sleepable
Ethan Tidmore <[email protected]>
wifi: brcmfmac: Fix error pointer dereference
Weiming Shi <[email protected]>
bpf: fix end-of-list detection in cgroup_storage_get_next_key()
Eric Dumazet <[email protected]>
macvlan: annotate data-races around port->bc_queue_len_used
Sourabh Jain <[email protected]>
powerpc/crash: fix backup region offset update to elfcorehdr
Chih Kai Hsu <[email protected]>
r8152: fix incorrect register write to USB_UPHY_XTAL
David Carlier <[email protected]>
bpf: Use RCU-safe iteration in dev_map_redirect_multi() SKB path
Thorsten Blum <[email protected]>
bpf, devmap: Remove unnecessary if check in for loop
Petr Pavlu <[email protected]>
module: Fix freeing of charp module parameters when CONFIG_SYSFS=n
Petr Pavlu <[email protected]>
params: Replace __modinit with __init_or_module
Shyam Saini <[email protected]>
kernel: globalize lookup_or_create_module_kobject()
Shyam Saini <[email protected]>
kernel: param: rename locate_module_kobject
Cai Xinchen <[email protected]>
dpaa2: compile dpaa2 even CONFIG_FSL_DPAA2_ETH=n
Cai Xinchen <[email protected]>
dpaa2: add independent dependencies for FSL_DPAA2_SWITCH
Duoming Zhou <[email protected]>
wifi: rtlwifi: pci: fix possible use-after-free caused by unfinished irq_prepare_bcn_tasklet
Zilin Guan <[email protected]>
wifi: mwifiex: Fix memory leak in mwifiex_11n_aggregate_pkt()
Mario Limonciello (AMD) <[email protected]>
firmware: dmi: Correct an indexing error in dmi.h
Bart Van Assche <[email protected]>
locking: Fix rwlock support in <linux/spinlock_up.h>
Brian Masney <[email protected]>
irqchip/irq-pic32-evic: Address warning related to wrong printf() formatter
Gui-Dong Han <[email protected]>
debugfs: check for NULL pointer in debugfs_create_str()
Gopi Krishna Menon <[email protected]>
thermal/drivers/spear: Fix error condition for reading st,thermal-flags
Danilo Krummrich <[email protected]>
devres: fix missing node debug info in devm_krealloc()
Cole Leavitt <[email protected]>
pstore/ram: fix resource leak when ioremap() fails
Deepanshu Kartikey <[email protected]>
nilfs2: reject zero bd_oblocknr in nilfs_ioctl_mark_blocks_dirty()
Bart Van Assche <[email protected]>
drbd: Balance RCU calls in drbd_adm_dump_devices()
HyungJung Joo <[email protected]>
fs/omfs: reject s_sys_blocksize smaller than OMFS_DIR_START
Mingzhe Zou <[email protected]>
bcache: fix uninitialized closure object
Benjamin Cheng <[email protected]>
drm/amdgpu/vcn3: Avoid overflow on msg bound check
Dudu Lu <[email protected]>
vsock/virtio: fix accept queue count leak on transport mismatch
Norbert Szetei <[email protected]>
vsock: fix buffer size clamping order
Siwei Zhang <[email protected]>
Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_get_sndtimeo_cb()
Sven Eckelmann <[email protected]>
batman-adv: bla: put backbone reference on failed claim hash insert
Sven Eckelmann <[email protected]>
batman-adv: bla: only purge non-released claims
Sven Eckelmann <[email protected]>
batman-adv: bla: prevent use-after-free when deleting claims
Jiexun Wang <[email protected]>
batman-adv: stop caching unowned originator pointers in BAT IV
Jiexun Wang <[email protected]>
batman-adv: reject new tp_meter sessions during teardown
Lyes Bourennani <[email protected]>
batman-adv: fix integer overflow on buff_pos
Ben Morris <[email protected]>
sctp: revalidate list cursor after sctp_sendmsg_to_asoc() in SCTP_SENDALL
Alex Deucher <[email protected]>
drm/amdgpu/pm: align Hawaii mclk workaround with radeon
Alex Deucher <[email protected]>
drm/amdgpu/pm: add missing revision check for CI
John B. Moore <[email protected]>
drm/amdgpu/sdma4: replace BUG_ON with WARN_ON in fence emission
John B. Moore <[email protected]>
drm/amdgpu/gfx9: drop unnecessary 64-bit fence flag check in KIQ
Alex Deucher <[email protected]>
drm/radeon: add missing revision check for CI
Alysa Liu <[email protected]>
drm/amdkfd: validate SVM ioctl nattr against buffer size
Ashutosh Desai <[email protected]>
drm/gem: Fix inconsistent plane dimension calculation in drm_gem_fb_init_with_funcs()
Benjamin Cheng <[email protected]>
drm/amdgpu/vcn3: Prevent OOB reads when parsing dec msg
Johan Hovold <[email protected]>
spi: mpc52xx: fix use-after-free on unbind
Johan Hovold <[email protected]>
spi: orion: fix clock imbalance on registration failure
Johan Hovold <[email protected]>
spi: imx: fix runtime pm leak on probe deferral
Johan Hovold <[email protected]>
spi: mtk-nor: fix controller deregistration
Wenmeng Liu <[email protected]>
media: i2c: imx412: Assert reset GPIO during probe
Sergey Shtylyov <[email protected]>
media: dib8000: avoid division by 0 in dib8000_set_dds()
Johan Hovold <[email protected]>
regulator: bd9571mwv: fix OF node reference imbalance
Johan Hovold <[email protected]>
regulator: act8945a: fix OF node reference imbalance
Oliver Neukum <[email protected]>
media: rc: streamzap: Error handling in probe
Oliver Neukum <[email protected]>
media: rc: xbox_remote: heed DMA restrictions
Johan Hovold <[email protected]>
regulator: max77650: fix OF node reference imbalance
Sakari Ailus <[email protected]>
staging: media: atomisp: Disallow all private IOCTLs
Alexander Koskovich <[email protected]>
media: i2c: ov8856: free control handler on error in ov8856_init_controls()
Ricardo Ribalda <[email protected]>
media: uvcvideo: Enable VB2_DMABUF for metadata stream
Krishna Chomal <[email protected]>
platform/x86: hp-wmi: Ignore backlight and FnLock events
Gang Yan <[email protected]>
mptcp: fix scheduling with atomic in timestamp sockopt
Gang Yan <[email protected]>
mptcp: sockopt: set timestamp flags on subflow socket, not msk
Shardul Bankar <[email protected]>
mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure
Shardul Bankar <[email protected]>
mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
Jason Gunthorpe <[email protected]>
RDMA/vmw_pvrdma: Fix double free on pvrdma_alloc_ucontext() error path
Michael Bommarito <[email protected]>
RDMA/rxe: Reject unknown opcodes before ICRC processing
Jason Gunthorpe <[email protected]>
RDMA/ocrdma: Don't NULL deref uctx on errors in ocrdma_copy_pd_uresp()
Jason Gunthorpe <[email protected]>
RDMA/mlx4: Fix resource leak on error in mlx4_ib_create_srq()
André Draszik <[email protected]>
power: supply: max17042: avoid overflow when determining health
Lukas Wunner <[email protected]>
PCI/AER: Stop ruling out unbound devices as error source
Shuai Xue <[email protected]>
PCI/AER: Clear only error bits in PCIe Device Status
Vasily Gorbik <[email protected]>
s390/debug: Reject zero-length input in debug_input_flush_fn()
Jason Gunthorpe <[email protected]>
RDMA/hns: Fix unlocked call to hns_roce_qp_remove()
Chaitanya Kulkarni <[email protected]>
nvmet: avoid recursive nvmet-wq flush in nvmet_ctrl_free
Junrui Luo <[email protected]>
md/raid10: fix divide-by-zero in setup_geo() with zero far_copies
Raphael Zimmer <[email protected]>
libceph: Fix slab-out-of-bounds access in auth message processing
Michael Bommarito <[email protected]>
isofs: validate block number from NFS file handle in isofs_export_iget
Michael Bommarito <[email protected]>
isofs: validate Rock Ridge CE continuation extent against volume size
Eric Biggers <[email protected]>
dm-verity-fec: correctly reject too-small hash devices
Eric Biggers <[email protected]>
dm-verity-fec: correctly reject too-small FEC devices
Mikulas Patocka <[email protected]>
dm: fix a buffer overflow in ioctl processing
Mikulas Patocka <[email protected]>
dm: don't report warning when doing deferred remove
Mikulas Patocka <[email protected]>
dm-thin: fix metadata refcount underflow
Cássio Gabriel <[email protected]>
ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error
Joseph Salisbury <[email protected]>
ASoC: fsl_easrc: fix comment typo
Shrikanth Hegde <[email protected]>
cpuidle: powerpc: avoid double clear when breaking snooze
Johan Hovold <[email protected]>
spi: topcliff-pch: fix use-after-free on unbind
Thorsten Blum <[email protected]>
thermal/drivers/sprd: Fix raw temperature clamping in sprd_thm_rawdata_to_temp
Thorsten Blum <[email protected]>
thermal/drivers/sprd: Fix temperature clamping in sprd_thm_temp_to_rawdata
Michael Bommarito <[email protected]>
udf: reject descriptors with oversized CRC length
Mingming Cao <[email protected]>
ibmveth: Disable GSO for packets with small MSS
Hamza Mahfooz <[email protected]>
hv_sock: fix ARM64 support
Xu Yang <[email protected]>
extcon: ptn5150: handle pending IRQ events during system resume
Myeonghun Pak <[email protected]>
hwmon: (corsair-psu) Close HID device on probe errors
Sanman Pradhan <[email protected]>
hwmon: (ltc2992) Fix u32 overflow in power read path
Sanman Pradhan <[email protected]>
hwmon: (ltc2992) Clamp threshold writes to hardware range
Hongling Zeng <[email protected]>
parisc: Fix IRQ leak in LASI driver
Nan Li <[email protected]>
net/rds: handle zerocopy send cleanup before the message is queued
Maoyi Xie <[email protected]>
ip6_gre: Use cached t->net in ip6erspan_changelink().
SeungJu Cheon <[email protected]>
sound: ua101: fix division by zero at probe
Kai Zen <[email protected]>
net: rtnetlink: zero ifla_vf_broadcast to avoid stack infoleak in rtnl_fill_vfinfo
Miklos Szeredi <[email protected]>
fanotify: fix false positive on permission events
Johan Hovold <[email protected]>
spi: zynqmp-gqspi: fix controller deregistration
Siwei Zhang <[email protected]>
Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_state_change_cb()
Siwei Zhang <[email protected]>
Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_new_connection_cb()
Michael Bommarito <[email protected]>
Bluetooth: virtio_bt: validate rx pkt_type header length
Michael Bommarito <[email protected]>
Bluetooth: virtio_bt: clamp rx length before skb_put
Yilin Zhu <[email protected]>
ipv6: xfrm6: release dst on error in xfrm6_rcv_encap()
Ruijie Li <[email protected]>
xfrm: provide message size for XFRM_MSG_MAPPING
Cássio Gabriel <[email protected]>
ALSA: firewire-tascam: Do not drop unread control events
Felix Gu <[email protected]>
usb: ulpi: fix memory leak on ulpi_register() error paths
Fabio Porcedda <[email protected]>
USB: serial: option: add Telit Cinterion LE910Cx compositions
Aaro Koskinen <[email protected]>
USB: omap_udc: DMA: Don't enable burst 4 mode
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Fix UAC3 cluster descriptor size check
Takashi Iwai <[email protected]>
ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3()
Greg Kroah-Hartman <[email protected]>
usb: usblp: fix uninitialized heap leak via LPGETSTATUS ioctl
Greg Kroah-Hartman <[email protected]>
usb: usblp: fix heap leak in IEEE 1284 device ID via short response
Tristan Madani <[email protected]>
wifi: b43: enforce bounds check on firmware key index in b43_rx()
Jiri Slaby (SUSE) <[email protected]>
wifi: ath5k: do not access array OOB
Jeongjun Park <[email protected]>
wifi: rsi: fix kthread lifetime race between self-exit and external-stop
Tristan Madani <[email protected]>
wifi: b43legacy: enforce bounds check on firmware key index in RX path
Corey Minyard <[email protected]>
ipmi:ssif: NULL thread on error
Corey Minyard <[email protected]>
ipmi:ssif: Remove unnecessary indention
Corey Minyard <[email protected]>
ipmi:ssif: Clean up kthread on errors
Corey Minyard <[email protected]>
ipmi:ssif: Fix a shutdown race
Jamal Hadi Salim <[email protected]>
net/sched: sch_red: Replace direct dequeue call with peek and qdisc_dequeue_peeked
Dipendra Khadka <[email protected]>
octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c
Florian Fainelli <[email protected]>
um: virt-pci: Fix build failure
Felix Gu <[email protected]>
spi: meson-spicc: Fix double-put in remove path
Hyunwoo Kim <[email protected]>
ksmbd: do not expire session on binding failure
Johan Hovold <[email protected]>
spi: rockchip: fix controller deregistration
Shivam Kalra <[email protected]>
ACPI: video: force native backlight on HP OMEN 16 (8A44)
Jinjie Ruan <[email protected]>
ACPI: CPPC: Fix related_cpus inconsistency during CPU hotplug
Guangshuo Li <[email protected]>
ACPI: scan: Use acpi_dev_put() in object add error paths
Rajat Gupta <[email protected]>
fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free
Corey Minyard <[email protected]>
ipmi:si: Return state to normal if message allocation fails
Corey Minyard <[email protected]>
ipmi: Check event message buffer response for bad data
Corey Minyard <[email protected]>
ipmi: Add limits to event and receive message requests
Greg Kroah-Hartman <[email protected]>
scsi: target: configfs: Bound snprintf() return in tg_pt_gp_members_show()
Kai Ma <[email protected]>
netfilter: reject zero shift in nft_bitwise
Andrea Mayer <[email protected]>
net: ipv6: fix NOREF dst use in seg6 and rpl lwtunnels
Deepanshu Kartikey <[email protected]>
ALSA: caiaq: fix usb_dev refcount leak on probe failure
Arjan van de Ven <[email protected]>
drm/amdgpu: fix zero-size GDS range init on RDNA4
Greg Kroah-Hartman <[email protected]>
ipv6: rpl: reserve mac_len headroom when recompressed SRH grows
Takashi Iwai <[email protected]>
ALSA: caiaq: Don't abort when no input device is available
Takashi Iwai <[email protected]>
ALSA: caiaq: Fix potentially leftover ep1_in_urb at error path
Douglas Anderson <[email protected]>
driver core: Add kernel-doc for DEV_FLAG_COUNT enum value
Yucheng Lu <[email protected]>
crypto: authencesn - reject short ahash digests during instance creation
Andrea Mayer <[email protected]>
seg6: fix seg6 lwtunnel output redirect for L2 reduced encap mode
Tobias Gaertner <[email protected]>
ntfs3: fix integer overflow in run_unpack() volume boundary check
Tobias Gaertner <[email protected]>
ntfs3: add buffer boundary checks to run_unpack()
Steven Rostedt <[email protected]>
ktest: Fix the month in the name of the failure directory
Chen Zhao <[email protected]>
IB/core: Fix zero dmac race in neighbor resolution
Junrui Luo <[email protected]>
dm mirror: fix integer overflow in create_dirty_log()
Thorsten Blum <[email protected]>
crypto: atmel-tdes - fix DMA sync direction
Haoxiang Li <[email protected]>
crypto: ccree - fix a memory leak in cc_mac_digest()
Thomas Fourier <[email protected]>
crypto: hisilicon - Fix dma_unmap_single() direction
Thorsten Blum <[email protected]>
crypto: atmel-ecc - Release client on allocation failure
Thorsten Blum <[email protected]>
crypto: atmel-aes - Fix 3-page memory leak in atmel_aes_buff_cleanup
Eric Biggers <[email protected]>
crypto: arm64/aes - Fix 32-bit aes_mac_update() arg treated as 64-bit
Yiyang Chen <[email protected]>
taskstats: set version in TGID exit notifications
Zhenzhong Wu <[email protected]>
tcp: call sk_data_ready() after listener migration
Chia-Ming Chang <[email protected]>
inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails
Junrui Luo <[email protected]>
md/raid5: validate payload size before accessing journal metadata
Chia-Ming Chang <[email protected]>
md/raid5: fix soft lockup in retry_aligned_read()
Sohei Koyama <[email protected]>
ext4: fix missing brelse() in ext4_xattr_inode_dec_ref_all()
James Kim <[email protected]>
mtd: docg3: fix use-after-free in docg3_release()
Uwe Kleine-König <[email protected]>
mtd: docg3: Convert to platform remove callback returning void
Jens Axboe <[email protected]>
io_uring/poll: fix backport of io_poll_add() changes
Jens Axboe <[email protected]>
io_uring/poll: fix EPOLL_URING_WAKE sometimes not being honored
Yosry Ahmed <[email protected]>
KVM: nSVM: Add missing consistency check for nCR3 validity
Yosry Ahmed <[email protected]>
KVM: nSVM: Clear GIF on nested #VMEXIT(INVALID)
Yosry Ahmed <[email protected]>
KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN
Yosry Ahmed <[email protected]>
KVM: nSVM: Ensure AVIC is inhibited when restoring a vCPU to guest mode
Sean Christopherson <[email protected]>
KVM: SVM: Explicitly mark vmcb01 dirty after modifying VMCB intercepts
Kevin Cheng <[email protected]>
KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0
Yosry Ahmed <[email protected]>
KVM: nSVM: Sync interrupt shadow to cached vmcb12 after VMRUN of L2
Yosry Ahmed <[email protected]>
KVM: nSVM: Sync NextRIP to cached vmcb12 after VMRUN of L2
Yosry Ahmed <[email protected]>
KVM: nSVM: Mark all of vmcb02 dirty when restoring nested state
Denis M. Karpov <[email protected]>
userfaultfd: allow registration of ranges below mmap_min_addr
Johan Hovold <[email protected]>
rtc: ntxec: fix OF node reference imbalance
Jacqueline Wong <[email protected]>
tpm: tpm_tis: add error logging for data transfer
Bin Liu <[email protected]>
mmc: block: use single block write in retry
Krzysztof Kozlowski <[email protected]>
power: supply: axp288_charger: Do not cancel work before initializing it
Arnd Bergmann <[email protected]>
tpm: avoid -Wunused-but-set-variable
Raphael Zimmer <[email protected]>
libceph: Prevent potential null-ptr-deref in ceph_handle_auth_reply()
Ruide Cao <[email protected]>
ipv4: icmp: validate reply type before using icmp_pointers
hkbinbin <[email protected]>
RDMA/rxe: Validate pad and ICRC before payload_size() in rxe_rcv
Luca Ceresoli <[email protected]>
drm/arcpgu: fix device node leak
Ruijie Li <[email protected]>
net/smc: avoid early lgr access in smc_clc_wait_msg
Ao Zhou <[email protected]>
net: rds: fix MR cleanup on copy error
Jonathan Santos <[email protected]>
iio: adc: ad7768-1: fix one-shot mode data acquisition
Cássio Gabriel <[email protected]>
ALSA: 6fire: Fix input volume change detection
Takashi Iwai <[email protected]>
ALSA: caiaq: Handle probe errors properly
Cássio Gabriel <[email protected]>
ALSA: caiaq: Fix control_put() result and cache rollback
Simon Liebold <[email protected]>
selftests/mqueue: Fix incorrectly named file
Helge Deller <[email protected]>
parisc: _llseek syscall is only available for 32-bit userspace
Robert Beckett <[email protected]>
nvme-pci: add NVME_QUIRK_DISABLE_WRITE_ZEROES for Kingston OM3SGP4
Josh Hunt <[email protected]>
md/raid10: fix deadlock with check operation and nowait requests
Cássio Gabriel <[email protected]>
ALSA: seq_oss: return full count for successful SEQ_FULLSIZE writes
Harin Lee <[email protected]>
ALSA: ctxfi: Add fallback to default RSR for S/PDIF
Cássio Gabriel <[email protected]>
ALSA: aoa: i2sbus: fix OF node lifetime handling
Vasiliy Kovalev <[email protected]>
ext2: reject inodes with zero i_nlink and valid mode in ext2_iget()
Manivannan Sadhasivam <[email protected]>
net: qrtr: ns: Fix use-after-free in driver remove()
Chen Ni <[email protected]>
media: i2c: imx219: Check return value of devm_gpiod_get_optional() in imx219_probe()
Josh Law <[email protected]>
lib/ts_kmp: fix integer overflow in pattern length calculation
Rong Zhang <[email protected]>
Revert "ALSA: usb: Increase volume range that triggers a warning"
Koichiro Den <[email protected]>
PCI: endpoint: pci-epf-ntb: Remove duplicate resource teardown
Luxiao Xu <[email protected]>
net: strparser: fix skb_head leak in strp_abort_strp()
Zhengchuan Liang <[email protected]>
net: caif: clear client service pointer on teardown
Ziqing Chen <[email protected]>
ALSA: control: Validate buf_len before strnlen() in snd_ctl_elem_init_enum_names()
Herbert Xu <[email protected]>
crypto: pcrypt - Fix handling of MAY_BACKLOG requests
Michael Bommarito <[email protected]>
um: drivers: call kernel_strrchr() explicitly in cow_user.c
Douglas Anderson <[email protected]>
driver core: Don't let a device probe until it's ready
Herbert Xu <[email protected]>
padata: Remove comment for reorder_work
Herbert Xu <[email protected]>
padata: Fix pd UAF once and for all
Heming Zhao <[email protected]>
ocfs2: split transactions in dio completion to avoid credit exhaustion
Douglas Anderson <[email protected]>
device property: Make modifications of fwnode "flags" thread safe
André Draszik <[email protected]>
scsi: ufs: core: Fix use-after free in init error and remove paths
Thomas Zimmermann <[email protected]>
firmware: google: framebuffer: Do not mark framebuffer as busy
Tyllis Xu <[email protected]>
ibmasm: fix heap over-read in ibmasm_send_i2o_message()
Tyllis Xu <[email protected]>
ibmasm: fix OOB reads in command_file_write due to missing size checks
Tyllis Xu <[email protected]>
misc: ibmasm: fix OOB MMIO read in ibmasm_handle_mouse_interrupt()
Greg Kroah-Hartman <[email protected]>
drm/nouveau: fix u32 overflow in pushbuf reloc bounds check
Takashi Iwai <[email protected]>
ALSA: usb-audio: Evaluate packsize caps at the right place
Michal Pecio <[email protected]>
usb: xhci: Make usb_host_endpoint.hcpriv survive endpoint_disable()
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Fix Audio Advantage Micro II SPDIF switch
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Avoid false E-MU sample-rate notifications
Cássio Gabriel <[email protected]>
ALSA: usb-audio: stop parsing UAC2 rates at MAX_NR_RATES
Jeongjun Park <[email protected]>
ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
Daniel Starke <[email protected]>
tty: n_gsm: fix flow control handling in tx path
Anderson Nascimento <[email protected]>
rxrpc: Fix missing validation of ticket length in non-XDR key preparsing
Sean Christopherson <[email protected]>
crypto: ccp: Don't attempt to copy ID to userspace if PSP command failed
Sean Christopherson <[email protected]>
crypto: ccp: Don't attempt to copy PDH cert to userspace if PSP command failed
Sean Christopherson <[email protected]>
crypto: ccp: Don't attempt to copy CSR to userspace if PSP command failed
Berk Cem Goksel <[email protected]>
ALSA: caiaq: take a reference on the USB device in create_card()
Cryolitia PukNgae <[email protected]>
ALSA: usb-audio: apply quirk for MOONDROP JU Jiu
Darrick J. Wong <[email protected]>
fuse: quiet down complaints in fuse_conn_limit_write
Samuel Page <[email protected]>
fuse: reject oversized dirents in page cache
Greg Kroah-Hartman <[email protected]>
fs/ntfs3: validate rec->used in journal-replay file record check
Vasant Karasulli <[email protected]>
iommu: fix a reference count leak in iommu_sva_bind_device()
David Howells <[email protected]>
rxrpc: Fix anonymous key handling
Wang Jie <[email protected]>
rxrpc: only handle RESPONSE during service challenge
Namjae Jeon <[email protected]>
ksmbd: unset conn->binding on failed binding request
Nathan Chancellor <[email protected]>
scripts/dtc: Remove unused dts_version in dtc-lexer.l
Guocai He <[email protected]>
Revert "wifi: cfg80211: stop NAN and P2P in cfg80211_leave"
David Gow <[email protected]>
drivers: base: Free devm resources when unregistering a device
Miquel Sabaté Solà <[email protected]>
cpufreq: Avoid a bad reference count on CPU node
Jakub Kicinski <[email protected]>
net: clear the dst when changing skb protocol
Thomas Weißschuh <[email protected]>
fbdev: efifb: Register sysfs groups through driver core
Yu Kuai <[email protected]>
md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime
Guangshuo Li <[email protected]>
cpufreq: governor: fix double free in cpufreq_dbs_governor_init() error path
Liao Chang <[email protected]>
cpufreq: governor: Free dbs_data directly when gov->init() fails
David Howells <[email protected]>
rxrpc: Fix recvmsg() unconditional requeue
Konstantin Komarov <[email protected]>
fs/ntfs3: Add more attributes checks in mi_enum_attr()
Filipe Manana <[email protected]>
btrfs: lock the inode in shared mode before starting fiemap
Oleksij Rempel <[email protected]>
net: usb: lan78xx: Fix double free issue with interrupt buffer allocation
NeilBrown <[email protected]>
SUNRPC: lock against ->sock changing during sysfs read
Chao Yu <[email protected]>
f2fs: fix to trigger foreground gc during f2fs_map_blocks() in lfs mode
Lin Ma <[email protected]>
vdpa: Add max vqp attr to vdpa_nl_policy for nlattr length check
Marc Kleine-Budde <[email protected]>
can: gs_usb: gs_usb_xmit_callback(): fix handling of failed transmitted URBs
Luiz Augusto von Dentz <[email protected]>
Bluetooth: af_bluetooth: Fix deadlock
Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: fix odr switch when turning buffer off
Dawid Osuchowski <[email protected]>
ice: Add netif_device_attach/detach into PF reset flow
Takashi Iwai <[email protected]>
ALSA: usb-audio: Kill timer properly at removal
Kees Cook <[email protected]>
pstore: inode: Only d_invalidate() is needed
Chao Yu <[email protected]>
f2fs: fix to wait on block writeback for post_read case
Russell King (Oracle) <[email protected]>
net: stmmac: fix TSO DMA API usage causing oops
Daniel Wagner <[email protected]>
nvmet: always initialize cqe.result
Lang Yu <[email protected]>
drm/amdgpu: unmap and remove csa_va properly
Zilin Guan <[email protected]>
binfmt_misc: restore write access before closing files opened by open_exec()
Andreas Gruenbacher <[email protected]>
gfs2: No more self recovery
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Do mark_chain_precision for ARG_CONST_ALLOC_SIZE_OR_ZERO
Alexander Aring <[email protected]>
dlm: fix possible lkb_resource null dereference
Kuniyuki Iwashima <[email protected]>
Bluetooth: hci_core: Fix use-after-free in vhci_flush()
Joonwon Kang <[email protected]>
mailbox: Prevent out-of-bounds access in of_mbox_index_xlate()
Qu Wenruo <[email protected]>
btrfs: do not strictly require dirty metadata threshold for metadata writepages
Qu Wenruo <[email protected]>
btrfs: send: check for inline extents in range_is_hole_in_parent()
Oleg Nesterov <[email protected]>
x86/uprobes: Fix XOL allocation failure for 32-bit tasks
Khairul Anuar Romli <[email protected]>
spi: cadence-quadspi: Implement refcount to handle unbind during busy
Alexander Aring <[email protected]>
fs: dlm: fix use after free in midcomms commit
Guodong Xu <[email protected]>
dmaengine: mmp_pdma: Fix race condition in mmp_pdma_residue()
Eric Dumazet <[email protected]>
net/sched: cls_u32: use skb_header_pointer_careful()
Eric Dumazet <[email protected]>
net: add skb_header_pointer_careful() helper
Mikulas Patocka <[email protected]>
dm-verity: disable recursive forward error correction
Keith Busch <[email protected]>
blk-mq: use quiesced elevator switch when reinitializing queues
Johannes Berg <[email protected]>
wifi: iwlwifi: read txq->read_ptr under lock
Ye Bin <[email protected]>
f2fs: fix null-ptr-deref in f2fs_submit_page_bio()
Heiko Carstens <[email protected]>
s390/xor: Fix xor_xc_2() inline assembly constraints
Takashi Iwai <[email protected]>
ALSA: control: Avoid WARN() for symlink errors
Jaskaran Singh <[email protected]>
nvme: nvme-fc: Ensure ->ioerr_work is cancelled in nvme_fc_delete_ctrl()
Jaskaran Singh <[email protected]>
Revert "nvme: nvme-fc: Ensure ->ioerr_work is cancelled in nvme_fc_delete_ctrl()"
Wang Yufen <[email protected]>
netdevsim: Fix memory leak of nsim_dev->fa_cookie
Daniel Starke <[email protected]>
tty: n_gsm: fix deadlock and link starvation in outgoing data path
Li Xiasong <[email protected]>
MPTCP: fix lock class name family in pm_nl_create_listen_socket
Breno Leitao <[email protected]>
mm: blk-cgroup: fix use-after-free in cgwb_release_workfn()
Joseph Qi <[email protected]>
ocfs2: fix possible deadlock between unlink and dio_end_io_write
hongnanli <[email protected]>
fs/ocfs2: fix comments mentioning i_mutex
Yuqi Xu <[email protected]>
rxrpc: reject undecryptable rxkad response tickets
David Howells <[email protected]>
rxrpc: Fix call removal to use RCU safe deletion
David Howells <[email protected]>
rxrpc: Fix key quota calculation for multitoken keys
Yasuaki Torimaru <[email protected]>
xfrm: clear trailing padding in build_polexpire()
Joseph Qi <[email protected]>
ocfs2: fix out-of-bounds write in ocfs2_write_end_inline
Deepanshu Kartikey <[email protected]>
ocfs2: validate inline data i_size during inode read
Dmitry Antipov <[email protected]>
ocfs2: add inline inode consistency check to ocfs2_validate_inode_block()
Sebastian Krzyszkowiak <[email protected]>
arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V
Sebastian Krzyszkowiak <[email protected]>
Revert "arm64: dts: imx8mq-librem5: Set the DVS voltages lower"
Sebastian Krzyszkowiak <[email protected]>
arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage to 0.81V
Sebastian Krzyszkowiak <[email protected]>
arm64: dts: imx8mq-librem5: Set the DVS voltages lower
Hari Bathini <[email protected]>
powerpc64/bpf: do not increment tailcall count when prog is NULL
Florian Westphal <[email protected]>
netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR
Håkon Bugge <[email protected]>
PCI/ACPI: Restrict program_hpx_type2() to AER bits
Felix Fietkau <[email protected]>
wifi: mac80211: always free skb on ieee80211_tx_prepare_skb() failure
Andrew Price <[email protected]>
gfs2: Validate i_depth for exhash directories
Andrew Price <[email protected]>
gfs2: Improve gfs2_consist_inode() usage
Minhong He <[email protected]>
ipv6: add NULL checks for idev in SRv6 paths
Sasha Levin <[email protected]>
Revert "net: ixp4xx_eth: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()"
Sasha Levin <[email protected]>
Revert "net: ethernet: xscale: Check for PTP support properly"
Koichiro Den <[email protected]>
PCI: endpoint: pci-epf-vntb: Remove duplicate resource teardown
Cezar Bulinaru <[email protected]>
net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null
Jeongjun Park <[email protected]>
media: hackrf: fix to not free memory after the device is registered in hackrf_probe()
Abd-Alrhman Masalkhi <[email protected]>
media: vidtv: fix pass-by-value structs causing MSAN warnings
Deepanshu Kartikey <[email protected]>
nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map
Jeongjun Park <[email protected]>
media: as102: fix to not free memory after the device is registered in as102_usb_probe()
Mingzhe Zou <[email protected]>
bcache: fix cached_dev.sb_bio use-after-free and crash
Berk Cem Goksel <[email protected]>
ALSA: 6fire: fix use-after-free on disconnect
Abhishek Kumar <[email protected]>
media: em28xx: fix use-after-free in em28xx_v4l2_open()
Ruslan Valiyev <[email protected]>
media: vidtv: fix nfeeds state corruption on start_streaming failure
Ritesh Harjani (IBM) <[email protected]>
mm/kasan: fix double free for kasan pXds
Sean Christopherson <[email protected]>
KVM: x86: Use scratch field in MMIO fragment to hold small write values
Sasha Levin <[email protected]>
checkpatch: add support for Assisted-by tag
Pengpeng Hou <[email protected]>
rxrpc: proc: size address buffers for %pISpc output
Pablo Neira Ayuso <[email protected]>
nf_tables: nft_dynset: fix possible stateful expression memleak in error path
Paulo Alcantara <[email protected]>
smb: client: fix potential UAF in smb2_is_valid_oplock_break()
Krzysztof Kozlowski <[email protected]>
fsl-mc: Use driver_set_override() instead of open-coding
Sean Christopherson <[email protected]>
KVM: SEV: Drop WARN on large size for KVM_MEMORY_ENCRYPT_REG_REGION
ZhengYuan Huang <[email protected]>
ocfs2: handle invalid dinode in ocfs2_group_extend
Tejas Bharambe <[email protected]>
ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY
Ruslan Valiyev <[email protected]>
media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections
Harin Lee <[email protected]>
ALSA: ctxfi: Limit PTP to a single page
Fabio Porcedda <[email protected]>
USB: serial: option: add Telit Cinterion FN990A MBIM composition
Junrui Luo <[email protected]>
staging: sm750fb: fix division by zero in ps_to_hz()
Greg Kroah-Hartman <[email protected]>
fbdev: udlfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
Daniel Brát <[email protected]>
usb: storage: Expand range of matched versions for VL817 quirks entry
Nathan Rebello <[email protected]>
usbip: validate number_of_packets in usbip_pack_ret_submit()
Greg Kroah-Hartman <[email protected]>
usb: gadget: renesas_usb3: validate endpoint index in standard request handlers
Greg Kroah-Hartman <[email protected]>
usb: gadget: f_phonet: fix skb frags[] overflow in pn_rx_complete()
Greg Kroah-Hartman <[email protected]>
usb: gadget: f_ncm: validate minimum block_len in ncm_unwrap_ntb()
Greg Kroah-Hartman <[email protected]>
fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
Greg Kroah-Hartman <[email protected]>
ALSA: fireworks: bound device-supplied status before string array lookup
Greg Kroah-Hartman <[email protected]>
NFC: digital: Bounds check NFC-A cascade depth in SDD response handler
Greg Kroah-Hartman <[email protected]>
net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete()
Greg Kroah-Hartman <[email protected]>
HID: core: clamp report_size in s32ton() to avoid undefined shift
Greg Kroah-Hartman <[email protected]>
HID: alps: fix NULL pointer dereference in alps_raw_event()
Lin YuChen <[email protected]>
staging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()
Greg Kroah-Hartman <[email protected]>
i2c: s3c24xx: check the size of the SMBUS message before using it
Samuel Page <[email protected]>
can: raw: fix ro->uniq use-after-free in raw_rcv()
Junxi Qian <[email protected]>
nfc: llcp: add missing return after LLCP_CLOSED checks
Haoze Xie <[email protected]>
batman-adv: hold claim backbone gateways by reference
Geoffrey D. Bennett <[email protected]>
ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices
Jussi Laako <[email protected]>
ALSA: usb-audio: Update for native DSD support quirks
Geoffrey D. Bennett <[email protected]>
ALSA: usb-audio: Improve Focusrite sample rate filtering
Maciej W. Rozycki <[email protected]>
MIPS: mm: Rewrite TLB uniquification for the hidden bit feature
Maciej W. Rozycki <[email protected]>
MIPS: mm: Suppress TLB uniquification on EHINV hardware
Maciej W. Rozycki <[email protected]>
MIPS: Always record SEGBITS in cpu_data.vmbits
Stefan Wiehler <[email protected]>
mips: mm: Allocate tlb_vpn array atomically
Thomas Bogendoerfer <[email protected]>
MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow
Florian Westphal <[email protected]>
netfilter: conntrack: add missing netlink policy validations
Jamie Iles <[email protected]>
i3c: fix uninitialized variable use in i2c setup
Zide Chen <[email protected]>
perf/x86/intel/uncore: Skip discovery table for offline dies
Samasth Norway Ananda <[email protected]>
gpio: tegra: fix irq_release_resources calling enable instead of disable
Alice Mikityanska <[email protected]>
l2tp: Drop large packets with UDP encap
Jiexun Wang <[email protected]>
af_unix: read UNIX_DIAG_VFS data under unix_state_lock
Zhengchuan Liang <[email protected]>
netfilter: ip6t_eui64: reject invalid MAC header for all packets
Ren Wei <[email protected]>
netfilter: xt_multiport: validate range encoding in checkentry
Xiang Mei <[email protected]>
netfilter: nfnetlink_log: initialize nfgenmsg in NLMSG_DONE terminator
Greg Kroah-Hartman <[email protected]>
xfrm_user: fix info leak in build_mapping()
Steffen Klassert <[email protected]>
xfrm: Wait for RCU readers during policy netns exit
Maciej Fijalkowski <[email protected]>
xsk: tighten UMEM headroom validation to account for tailroom and min frame
Agalakov Daniil <[email protected]>
e1000: check return value of e1000_read_eeprom
Pengpeng Hou <[email protected]>
tracing/probe: reject non-closed empty immediate strings
Pengpeng Hou <[email protected]>
nfc: s3fwrn5: allocate rx skb before consuming bytes
Yiqi Sun <[email protected]>
ipv4: icmp: fix null-ptr-deref in icmp_build_probe()
Eric Dumazet <[email protected]>
net: lapbether: handle NETDEV_PRE_TYPE_CHANGE
Ruide Cao <[email protected]>
net: sched: act_csum: validate nested VLAN headers
Nicholas Carlini <[email protected]>
eventpoll: defer struct eventpoll free to RCU grace period
Paolo Abeni <[email protected]>
epoll: use refcount to reduce ep_mutex contention
Maíra Canal <[email protected]>
drm/vc4: Protect madv read in vc4_gem_object_mmap() with madv_lock
Maíra Canal <[email protected]>
drm/vc4: Fix a memory leak in hang state error path
Maíra Canal <[email protected]>
drm/vc4: Fix memory leak of BO array in hang state
Long Li <[email protected]>
PCI: hv: Set default NUMA node to 0 for devices without affinity info
Sebastian Krzyszkowiak <[email protected]>
arm64: dts: imx8mq: Set the correct gpu_ahb clock frequency
Potin Lai <[email protected]>
soc: aspeed: socinfo: Mask table entries for accurate SoC ID matching
Tomasz Merta <[email protected]>
ASoC: stm32_sai: fix incorrect BCLK polarity for DSP_A/B, LEFT_J
Pengpeng Hou <[email protected]>
wifi: brcmfmac: validate bsscfg indices in IF events
Arthur Husband <[email protected]>
ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585
Benoît Sevens <[email protected]>
HID: roccat: fix use-after-free in roccat_report_event
leo vriska <[email protected]>
HID: quirks: add HID_QUIRK_ALWAYS_POLL for 8BitDo Pro 3
Andy Shevchenko <[email protected]>
pinctrl: intel: Fix the revision for new features (1kOhm PD, HW debouncer)
Fredric Cover <[email protected]>
fs/smb/client: fix out-of-bounds read in cifs_sanitize_prepath
Phil Willoughby <[email protected]>
ALSA: usb-audio: Fix quirk flags for NeuralDSP Quad Cortex
Kuninori Morimoto <[email protected]>
ASoC: soc-core: call missing INIT_LIST_HEAD() for card_aux_list
Pengpeng Hou <[email protected]>
wifi: wl1251: validate packet IDs before indexing tx_frames
Florian Westphal <[email protected]>
netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry
César Montoya <[email protected]>
ALSA: hda/realtek: Add mute LED quirk for HP Pavilion 15-eg0xxx
Goldwyn Rodrigues <[email protected]>
btrfs: tracepoints: get correct superblock from dentry in event btrfs_sync_file()
Wenyuan Li <[email protected]>
can: mcp251x: add error handling for power enable in open and resume
Cássio Gabriel <[email protected]>
ASoC: SOF: topology: reject invalid vendor array size in token parser
Arnd Bergmann <[email protected]>
ALSA: asihpi: avoid write overflow check warning
-------------
Diffstat:
Documentation/vm/hugetlbfs_reserv.rst | 2 +-
Makefile | 4 +-
arch/arm/boot/dts/mt7623.dtsi | 2 +-
arch/arm/mach-integrator/integrator_cp.c | 13 +-
.../boot/dts/amlogic/meson-gxl-s905d-p230.dts | 3 +-
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 2 +-
arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 +-
.../boot/dts/qcom/sdm845-xiaomi-beryllium.dts | 1 +
arch/arm64/crypto/aes-modes.S | 4 +-
arch/mips/include/asm/cpu-features.h | 1 -
arch/mips/include/asm/cpu-info.h | 2 -
arch/mips/include/asm/mipsregs.h | 2 +
arch/mips/kernel/cpu-probe.c | 13 +-
arch/mips/kernel/cpu-r3k-probe.c | 2 +
arch/mips/mm/tlb-r4k.c | 299 ++++++++++++---
arch/parisc/kernel/syscalls/syscall.tbl | 2 +-
arch/powerpc/kexec/file_load_64.c | 2 +-
arch/powerpc/net/bpf_jit_comp64.c | 20 +-
arch/powerpc/platforms/44x/warp.c | 2 +
arch/s390/kernel/debug.c | 8 +
arch/s390/lib/xor.c | 4 +-
arch/um/drivers/cow_user.c | 8 +-
arch/um/drivers/virt-pci.c | 2 +-
arch/x86/events/intel/uncore_discovery.c | 2 +-
arch/x86/include/asm/segment.h | 8 +-
arch/x86/kernel/uprobes.c | 24 ++
arch/x86/kvm/svm/nested.c | 24 +-
arch/x86/kvm/svm/sev.c | 11 +-
arch/x86/kvm/svm/svm.c | 13 +
arch/x86/kvm/trace.h | 2 +-
arch/x86/kvm/x86.c | 18 +-
block/blk-mq.c | 6 +-
block/blk.h | 3 +-
block/elevator.c | 4 +-
crypto/af_alg.c | 2 +
crypto/authencesn.c | 5 +
crypto/pcrypt.c | 7 +-
drivers/acpi/cppc_acpi.c | 6 +-
drivers/acpi/power.c | 2 +-
drivers/acpi/scan.c | 2 +-
drivers/acpi/video_detect.c | 8 +
drivers/ata/ahci.c | 14 +
drivers/base/core.c | 39 +-
drivers/base/dd.c | 20 +
drivers/base/devres.c | 2 +
drivers/block/drbd/drbd_nl.c | 8 +-
drivers/bluetooth/hci_ldisc.c | 51 ++-
drivers/bluetooth/virtio_bt.c | 39 +-
drivers/bus/fsl-mc/fsl-mc-bus.c | 25 +-
drivers/cdrom/cdrom.c | 73 ++--
drivers/char/ipmi/ipmi_si_intf.c | 70 +++-
drivers/char/ipmi/ipmi_ssif.c | 74 +++-
drivers/char/tpm/tpm_tis_core.c | 4 +
drivers/clk/clk-qoriq.c | 17 +-
drivers/clk/clk-xgene.c | 2 +
drivers/clk/imx/clk-imx6q.c | 12 +-
drivers/clk/imx/clk-imx8mq.c | 4 +-
drivers/clk/qcom/dispcc-sc7180.c | 8 +
drivers/clk/qcom/dispcc-sm8250.c | 6 +-
drivers/clk/qcom/gcc-sc8180x.c | 64 +++-
drivers/cpufreq/cpufreq_governor.c | 10 +-
drivers/cpuidle/cpuidle-powernv.c | 5 +-
drivers/cpuidle/cpuidle-pseries.c | 5 +-
drivers/crypto/atmel-aes.c | 2 +-
drivers/crypto/atmel-ecc.c | 1 +
drivers/crypto/atmel-tdes.c | 8 +-
drivers/crypto/ccp/ccp-crypto-aes.c | 7 +-
drivers/crypto/ccp/sev-dev.c | 19 +-
drivers/crypto/ccree/cc_hash.c | 1 +
drivers/crypto/hisilicon/sec/sec_algs.c | 2 +-
drivers/crypto/sa2ul.c | 4 +-
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 -
drivers/dma/mmp_pdma.c | 6 +
drivers/dma/mxs-dma.c | 1 +
drivers/extcon/extcon-ptn5150.c | 14 +
drivers/firmware/arm_ffa/bus.c | 4 +-
drivers/firmware/arm_ffa/driver.c | 2 +-
drivers/firmware/efi/capsule-loader.c | 2 +-
drivers/firmware/google/framebuffer-coreboot.c | 2 +-
drivers/firmware/imx/scu-pd.c | 1 +
drivers/gpio/gpio-tegra.c | 2 +-
drivers/gpio/gpiolib-cdev.c | 21 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 38 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.h | 3 +
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 +
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 66 ++++
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 +-
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 16 +-
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 +-
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 2 +-
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 25 +-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 26 +-
drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 +
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c | 62 ++++
.../drm/amd/display/dc/bios/bios_parser_helper.c | 9 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +-
.../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 4 +-
.../amd/display/include/grph_object_ctrl_defs.h | 4 +
drivers/gpu/drm/amd/pm/inc/hwmgr.h | 1 +
drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c | 15 +
.../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 118 +++++-
.../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.h | 1 +
.../gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 28 +-
.../drm/arm/display/komeda/komeda_framebuffer.c | 6 +-
drivers/gpu/drm/bridge/ite-it66121.c | 5 +
.../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 16 +-
drivers/gpu/drm/drm_gem_framebuffer_helper.c | 4 +-
drivers/gpu/drm/gma500/oaktrail_hdmi.c | 1 +
drivers/gpu/drm/i915/display/intel_dp.c | 9 +-
drivers/gpu/drm/i915/gt/intel_reset.c | 3 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +-
drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 14 +-
drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 24 +-
drivers/gpu/drm/msm/dsi/dsi_cfg.c | 4 +-
drivers/gpu/drm/msm/dsi/dsi_cfg.h | 2 +-
drivers/gpu/drm/msm/msm_iommu.c | 5 +-
drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +-
drivers/gpu/drm/panel/panel-simple.c | 2 +-
drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +
drivers/gpu/drm/radeon/ci_dpm.c | 9 +-
drivers/gpu/drm/sun4i/sun4i_backend.c | 3 +-
drivers/gpu/drm/tiny/arcpgu.c | 3 +-
drivers/gpu/drm/vc4/vc4_bo.c | 3 +
drivers/gpu/drm/vc4/vc4_gem.c | 19 +-
drivers/hid/hid-alps.c | 3 +
drivers/hid/hid-asus.c | 28 +-
drivers/hid/hid-core.c | 3 +
drivers/hid/hid-ids.h | 3 +
drivers/hid/hid-quirks.c | 3 +-
drivers/hid/hid-roccat.c | 2 +
drivers/hid/usbhid/hid-core.c | 2 +-
drivers/hwmon/corsair-psu.c | 4 +-
drivers/hwmon/ltc2992.c | 41 ++-
drivers/hwmon/pmbus/adm1266.c | 32 +-
drivers/i2c/busses/i2c-s3c2410.c | 7 +-
drivers/i3c/master.c | 7 +-
drivers/i3c/master/mipi-i3c-hci/dma.c | 30 +-
drivers/iio/adc/ad7768-1.c | 9 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 3 +
drivers/infiniband/core/addr.c | 3 +
drivers/infiniband/core/iwpm_msg.c | 6 +-
drivers/infiniband/hw/hns/hns_roce_qp.c | 7 +
drivers/infiniband/hw/mlx4/srq.c | 4 +-
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 4 +-
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 2 +-
drivers/infiniband/sw/rxe/rxe_recv.c | 14 +-
drivers/infiniband/sw/siw/siw_qp_rx.c | 15 +
drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 2 +-
drivers/iommu/intel/iommu.c | 3 +
drivers/iommu/iommu.c | 6 +-
drivers/irqchip/irq-ath79-cpu.c | 7 -
drivers/irqchip/irq-pic32-evic.c | 2 +-
drivers/leds/blink/leds-lgm-sso.c | 2 -
drivers/mailbox/mailbox-test.c | 39 +-
drivers/mailbox/mailbox.c | 9 +-
drivers/md/bcache/super.c | 8 +
drivers/md/dm-cache-metadata.c | 24 +-
drivers/md/dm-cache-metadata.h | 5 -
drivers/md/dm-cache-policy-smq.c | 4 +
drivers/md/dm-cache-target.c | 111 ++++--
drivers/md/dm-init.c | 4 +-
drivers/md/dm-ioctl.c | 6 +-
drivers/md/dm-log.c | 6 +-
drivers/md/dm-raid1.c | 6 +-
drivers/md/dm-verity-fec.c | 12 +-
drivers/md/dm-verity-fec.h | 3 -
drivers/md/md-bitmap.c | 4 +
drivers/md/md.c | 4 +
drivers/md/persistent-data/dm-btree-remove.c | 8 +
drivers/md/raid10.c | 6 +-
drivers/md/raid5-cache.c | 48 ++-
drivers/md/raid5.c | 8 +-
drivers/media/dvb-frontends/dib8000.c | 4 +-
drivers/media/i2c/imx219.c | 3 +
drivers/media/i2c/imx412.c | 2 +-
drivers/media/i2c/ov8856.c | 10 +-
drivers/media/rc/streamzap.c | 12 +-
drivers/media/rc/xbox_remote.c | 9 +-
drivers/media/test-drivers/vidtv/vidtv_bridge.c | 4 +-
drivers/media/test-drivers/vidtv/vidtv_channel.c | 4 +
drivers/media/test-drivers/vidtv/vidtv_mux.c | 4 +-
drivers/media/test-drivers/vidtv/vidtv_ts.c | 48 +--
drivers/media/test-drivers/vidtv/vidtv_ts.h | 4 +-
drivers/media/usb/as102/as102_usb_drv.c | 2 +
drivers/media/usb/em28xx/em28xx-video.c | 14 +-
drivers/media/usb/hackrf/hackrf.c | 7 +-
drivers/media/usb/uvc/uvc_queue.c | 3 +-
drivers/memory/tegra/tegra124-emc.c | 2 +-
drivers/memory/tegra/tegra30-emc.c | 6 +-
drivers/mfd/mc13xxx-core.c | 2 +-
drivers/misc/ibmasm/ibmasmfs.c | 7 +
drivers/misc/ibmasm/lowlevel.c | 12 +-
drivers/misc/ibmasm/remote.c | 5 +
drivers/mmc/core/block.c | 12 +-
drivers/mmc/core/queue.h | 3 +
drivers/mtd/devices/docg3.c | 8 +-
drivers/mtd/maps/physmap-gemini.c | 2 +-
drivers/mtd/nand/raw/sunxi_nand.c | 6 +-
drivers/mtd/parsers/ofpart_core.c | 4 +-
drivers/mtd/spi-nor/core.c | 2 +-
drivers/mtd/spi-nor/swp.c | 4 +-
drivers/net/bareudp.c | 24 +-
drivers/net/can/spi/mcp251x.c | 29 +-
drivers/net/can/usb/gs_usb.c | 17 +-
drivers/net/dsa/mt7530.c | 85 ++---
drivers/net/dsa/mt7530.h | 70 ++--
drivers/net/dsa/sja1105/sja1105_static_config.c | 6 +-
.../net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 +-
drivers/net/ethernet/atheros/ag71xx.c | 3 +
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 15 +-
drivers/net/ethernet/cirrus/cs89x0.c | 2 -
drivers/net/ethernet/cortina/gemini.c | 21 +-
drivers/net/ethernet/freescale/Makefile | 3 +-
drivers/net/ethernet/freescale/dpaa2/Kconfig | 4 +
drivers/net/ethernet/ibm/ibmveth.c | 22 ++
drivers/net/ethernet/ibm/ibmveth.h | 1 +
drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 8 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 1 +
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 3 +-
drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 4 +-
drivers/net/ethernet/intel/ice/ice_main.c | 8 +
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 +
.../ethernet/marvell/octeontx2/nic/otx2_flows.c | 6 +
drivers/net/ethernet/microsoft/mana/hw_channel.c | 35 +-
.../ethernet/netronome/nfp/nfpcore/nfp_target.c | 17 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +-
drivers/net/ethernet/xscale/ixp4xx_eth.c | 60 +--
drivers/net/ethernet/xscale/ptp_ixp46x.c | 3 -
drivers/net/hamradio/6pack.c | 39 +-
drivers/net/macvlan.c | 8 +-
drivers/net/netdevsim/dev.c | 3 +-
drivers/net/phy/at803x.c | 2 +-
drivers/net/phy/dp83869.c | 13 +-
drivers/net/phy/mdio_bus.c | 4 +-
drivers/net/ppp/ppp_generic.c | 5 +-
drivers/net/ppp/pppoe.c | 8 +-
drivers/net/slip/slhc.c | 49 ++-
drivers/net/tap.c | 23 +-
drivers/net/usb/cdc-phonet.c | 7 +-
drivers/net/usb/lan78xx.c | 31 +-
drivers/net/usb/r8152.c | 2 +-
drivers/net/usb/rtl8150.c | 12 +-
drivers/net/vrf.c | 15 +-
drivers/net/wan/lapbether.c | 13 +-
drivers/net/wireless/ath/ath11k/hal.c | 14 +-
drivers/net/wireless/ath/ath11k/wmi.c | 19 +-
drivers/net/wireless/ath/ath5k/base.c | 3 +-
drivers/net/wireless/ath/ath9k/channel.c | 6 +-
drivers/net/wireless/broadcom/b43/xmit.c | 3 +-
drivers/net/wireless/broadcom/b43legacy/xmit.c | 3 +-
.../wireless/broadcom/brcm80211/brcmfmac/chip.c | 15 +
.../wireless/broadcom/brcm80211/brcmfmac/fweh.c | 5 +
drivers/net/wireless/intel/iwlwifi/queue/tx.c | 3 +-
drivers/net/wireless/mac80211_hwsim.c | 1 -
drivers/net/wireless/marvell/mwifiex/11n_aggr.c | 1 +
drivers/net/wireless/realtek/rtlwifi/pci.c | 1 +
drivers/net/wireless/rsi/rsi_common.h | 5 +-
drivers/net/wireless/ti/wl1251/tx.c | 8 +-
drivers/net/wwan/iosm/iosm_ipc_imem.c | 2 +
drivers/nfc/s3fwrn5/uart.c | 10 +-
drivers/nfc/trf7970a.c | 3 +-
drivers/nvme/host/fc.c | 2 +-
drivers/nvme/host/pci.c | 2 +
drivers/nvme/target/core.c | 3 +-
drivers/nvme/target/fabrics-cmd.c | 6 -
drivers/of/property.c | 2 +-
drivers/parisc/lasi.c | 12 +-
drivers/pci/controller/dwc/pcie-tegra194.c | 74 ++--
drivers/pci/controller/pci-hyperv.c | 8 +
drivers/pci/endpoint/functions/pci-epf-ntb.c | 56 +--
drivers/pci/endpoint/functions/pci-epf-vntb.c | 18 +-
drivers/pci/pci-acpi.c | 59 ++-
drivers/pci/pci.c | 48 ++-
drivers/pci/pci.h | 9 +
drivers/pci/pcie/aer.c | 5 -
drivers/pcmcia/rsrc_nonstatic.c | 6 +-
drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 5 +-
drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
drivers/pinctrl/nomadik/pinctrl-abx500.c | 2 +-
drivers/pinctrl/pinctrl-pic32.c | 20 +-
drivers/platform/surface/surfacepro3_button.c | 1 +
drivers/platform/x86/adv_swbutton.c | 6 +-
.../x86/dell/dell-wmi-sysman/enum-attributes.c | 34 +-
drivers/platform/x86/dell/dell_rbu.c | 6 +-
drivers/platform/x86/hp/hp-wmi.c | 5 +
drivers/platform/x86/hp/hp_accel.c | 3 +
drivers/platform/x86/intel/hid.c | 6 +-
drivers/platform/x86/intel/vbtn.c | 6 +-
drivers/platform/x86/panasonic-laptop.c | 5 +-
drivers/power/supply/axp288_charger.c | 19 +-
drivers/power/supply/max17042_battery.c | 2 +-
drivers/regulator/act8945a-regulator.c | 3 +-
drivers/regulator/bd9571mwv-regulator.c | 3 +-
drivers/regulator/max77650-regulator.c | 2 +-
drivers/rtc/rtc-abx80x.c | 2 +
drivers/rtc/rtc-ntxec.c | 2 +-
drivers/s390/cio/css.c | 2 +-
drivers/scsi/isci/host.c | 3 +
drivers/scsi/sg.c | 29 +-
drivers/scsi/sr.c | 25 +-
drivers/scsi/sr.h | 1 -
drivers/scsi/ufs/ufshcd-pci.c | 2 -
drivers/scsi/ufs/ufshcd-pltfrm.c | 25 +-
drivers/scsi/ufs/ufshcd.c | 31 +-
drivers/scsi/ufs/ufshcd.h | 1 -
drivers/soc/aspeed/aspeed-socinfo.c | 2 +-
drivers/soc/qcom/ocmem.c | 22 +-
drivers/soc/qcom/qcom_aoss.c | 2 +-
drivers/soc/ti/omap_prm.c | 1 +
drivers/spi/spi-cadence-quadspi.c | 34 ++
drivers/spi/spi-fsl-qspi.c | 3 +-
drivers/spi/spi-hisi-kunpeng.c | 12 +-
drivers/spi/spi-imx.c | 1 +
drivers/spi/spi-meson-spicc.c | 2 -
drivers/spi/spi-mpc52xx.c | 3 +-
drivers/spi/spi-mtk-nor.c | 4 +-
drivers/spi/spi-orion.c | 6 +
drivers/spi/spi-rockchip.c | 4 +-
drivers/spi/spi-sprd.c | 3 +-
drivers/spi/spi-ti-qspi.c | 1 +
drivers/spi/spi-topcliff-pch.c | 6 +-
drivers/spi/spi-zynqmp-gqspi.c | 4 +-
drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 4 +
drivers/staging/rtl8723bs/core/rtw_security.c | 2 +-
drivers/staging/sm750fb/sm750.c | 3 +
drivers/target/target_core_configfs.c | 2 +-
drivers/target/target_core_sbc.c | 3 +-
drivers/thermal/spear_thermal.c | 2 +-
drivers/thermal/sprd_thermal.c | 4 +-
drivers/tty/hvc/hvc_iucv.c | 11 +-
drivers/tty/n_gsm.c | 407 ++++++++++++++-------
drivers/usb/class/usblp.c | 3 +-
drivers/usb/common/ulpi.c | 5 +-
drivers/usb/gadget/function/f_ncm.c | 4 +-
drivers/usb/gadget/function/f_phonet.c | 9 +
drivers/usb/gadget/udc/omap_udc.c | 4 -
drivers/usb/gadget/udc/renesas_usb3.c | 7 +-
drivers/usb/host/xhci.c | 1 -
drivers/usb/serial/option.c | 6 +
drivers/usb/storage/unusual_devs.h | 7 +-
drivers/usb/usbip/usbip_common.c | 12 +
drivers/vdpa/vdpa.c | 1 +
drivers/vhost/net.c | 4 +-
drivers/video/backlight/sky81452-backlight.c | 3 +
drivers/video/fbdev/efifb.c | 11 +-
drivers/video/fbdev/matrox/g450_pll.c | 2 +-
drivers/video/fbdev/offb.c | 7 +-
drivers/video/fbdev/tdfxfb.c | 3 +
drivers/video/fbdev/udlfb.c | 34 +-
fs/adfs/super.c | 3 +
fs/binfmt_misc.c | 4 +-
fs/btrfs/disk-io.c | 23 --
fs/btrfs/extent_io.c | 5 +-
fs/btrfs/extent_io.h | 3 +-
fs/btrfs/inode.c | 2 +-
fs/btrfs/send.c | 4 +
fs/ceph/xattr.c | 1 +
fs/cifs/cifs_spnego.c | 16 +
fs/cifs/fs_context.c | 4 +
fs/cifs/smb2misc.c | 2 +
fs/debugfs/file.c | 5 +-
fs/dlm/lock.c | 5 +-
fs/dlm/midcomms.c | 7 +
fs/eventpoll.c | 201 ++++++----
fs/ext2/inode.c | 14 +-
fs/ext4/xattr.c | 4 +-
fs/f2fs/data.c | 13 +-
fs/f2fs/super.c | 8 +-
fs/fuse/control.c | 4 +-
fs/fuse/readdir.c | 4 +
fs/gfs2/dir.c | 37 +-
fs/gfs2/glops.c | 40 +-
fs/gfs2/log.c | 33 +-
fs/gfs2/util.c | 30 +-
fs/gfs2/xattr.c | 28 +-
fs/isofs/export.c | 2 +-
fs/isofs/rock.c | 9 +
fs/ksmbd/auth.c | 11 +-
fs/ksmbd/mgmt/user_session.c | 12 +-
fs/ksmbd/smb2pdu.c | 11 +-
fs/nfs/blocklayout/blocklayout.c | 4 +-
fs/nilfs2/dat.c | 3 +
fs/nilfs2/ioctl.c | 6 +
fs/notify/fsnotify.c | 2 +-
fs/notify/inotify/inotify_user.c | 1 +
fs/notify/mark.c | 18 +-
fs/ntfs3/fslog.c | 12 +-
fs/ntfs3/record.c | 63 +++-
fs/ntfs3/run.c | 18 +-
fs/ntfs3/super.c | 7 +-
fs/ocfs2/alloc.c | 2 +-
fs/ocfs2/aops.c | 75 ++--
fs/ocfs2/cluster/nodemanager.c | 2 +-
fs/ocfs2/dir.c | 4 +-
fs/ocfs2/dlm/dlmdomain.c | 10 +-
fs/ocfs2/file.c | 4 +-
fs/ocfs2/inode.c | 33 +-
fs/ocfs2/ioctl.c | 18 +-
fs/ocfs2/localalloc.c | 6 +-
fs/ocfs2/mmap.c | 7 +-
fs/ocfs2/namei.c | 2 +-
fs/ocfs2/ocfs2.h | 4 +-
fs/ocfs2/ocfs2_trace.h | 10 +-
fs/ocfs2/quota_global.c | 2 +-
fs/ocfs2/resize.c | 22 +-
fs/ocfs2/xattr.c | 6 +-
fs/omfs/inode.c | 6 +
fs/pstore/inode.c | 10 +-
fs/pstore/ram_core.c | 4 +
fs/quota/dquot.c | 38 +-
fs/sysfs/group.c | 2 +-
fs/udf/misc.c | 8 +-
fs/userfaultfd.c | 2 -
include/dt-bindings/clock/qcom,dispcc-sc7180.h | 7 +-
include/dt-bindings/clock/qcom,gcc-sc8180x.h | 5 +
include/linux/cdrom.h | 1 +
include/linux/cpufreq.h | 5 +-
include/linux/dev_printk.h | 10 +
include/linux/device.h | 48 ++-
include/linux/dmi.h | 5 +
include/linux/fsl/mc.h | 6 +-
include/linux/fsnotify_backend.h | 1 +
include/linux/fwnode.h | 41 ++-
include/linux/kvm_host.h | 3 +-
include/linux/module.h | 2 +
include/linux/moduleparam.h | 11 +-
include/linux/netfilter/x_tables.h | 3 +-
include/linux/netfilter_arp/arp_tables.h | 6 +-
include/linux/netfilter_ipv4/ip_tables.h | 1 -
include/linux/netfilter_ipv6/ip6_tables.h | 1 -
include/linux/padata.h | 4 -
include/linux/ppp_defs.h | 30 ++
include/linux/printk.h | 5 +-
include/linux/quotaops.h | 9 +-
include/linux/skbuff.h | 12 +
include/linux/spinlock_up.h | 20 +-
include/linux/string.h | 12 +
include/linux/sunrpc/xprt.h | 3 +
include/linux/sunrpc/xprtsock.h | 1 -
include/linux/tpm_eventlog.h | 9 +-
include/linux/uprobes.h | 1 +
include/linux/usb.h | 3 +-
include/net/bluetooth/hci_core.h | 2 +
include/net/flow_dissector.h | 22 ++
include/net/ipv6.h | 6 -
include/net/mac80211.h | 4 +
include/net/netfilter/nf_queue.h | 1 +
include/net/netfilter/nf_tables.h | 2 +
include/net/pie.h | 2 +-
include/net/red.h | 1 -
include/net/route.h | 6 -
include/net/udp_tunnel.h | 15 +
include/trace/events/btrfs.h | 9 +-
include/trace/events/rxrpc.h | 8 +
include/uapi/linux/mii.h | 3 +-
include/video/udlfb.h | 1 +
io_uring/io-wq.c | 3 +-
io_uring/io_uring.c | 37 +-
kernel/audit.c | 4 +
kernel/auditsc.c | 2 +-
kernel/bpf/bpf_lsm.c | 2 +-
kernel/bpf/devmap.c | 8 +-
kernel/bpf/local_storage.c | 2 +-
kernel/bpf/verifier.c | 3 +
kernel/cgroup/rdma.c | 2 +-
kernel/events/uprobes.c | 10 +-
kernel/fork.c | 11 +-
kernel/module.c | 4 +-
kernel/padata.c | 136 ++-----
kernel/params.c | 46 +--
kernel/taskstats.c | 1 +
kernel/trace/ring_buffer.c | 8 +-
kernel/trace/trace_branch.c | 8 +-
kernel/trace/trace_events_hist.c | 12 +-
kernel/trace/trace_probe.c | 2 +-
kernel/trace/tracing_map.c | 17 +-
lib/kunit/Kconfig | 5 +-
lib/ts_kmp.c | 18 +-
mm/backing-dev.c | 5 +-
mm/kasan/init.c | 8 +-
net/batman-adv/bat_iv_ogm.c | 85 +++--
net/batman-adv/bridge_loop_avoidance.c | 92 +++--
net/batman-adv/distributed-arp-table.c | 3 +
net/batman-adv/fragmentation.c | 58 ++-
net/batman-adv/gateway_client.c | 4 +
net/batman-adv/originator.c | 4 +-
net/batman-adv/tp_meter.c | 32 +-
net/batman-adv/types.h | 6 +-
net/bluetooth/af_bluetooth.c | 10 +-
net/bluetooth/bnep/core.c | 2 +-
net/bluetooth/hci_core.c | 34 +-
net/bluetooth/hci_event.c | 3 -
net/bluetooth/l2cap_core.c | 8 +-
net/bluetooth/l2cap_sock.c | 9 +
net/bpf/test_run.c | 20 +-
net/bridge/br_multicast.c | 27 +-
net/bridge/netfilter/Kconfig | 13 +
net/bridge/netfilter/Makefile | 2 +-
net/bridge/netfilter/ebtable_broute.c | 14 +-
net/bridge/netfilter/ebtable_filter.c | 14 +-
net/bridge/netfilter/ebtable_nat.c | 12 +-
net/bridge/netfilter/ebtables.c | 71 ++--
net/caif/cfsrvl.c | 14 +-
net/can/raw.c | 11 +-
net/ceph/auth.c | 4 +-
net/ceph/crush/crush.c | 6 +-
net/ceph/mon_client.c | 2 +
net/ceph/osdmap.c | 14 +-
net/core/filter.c | 17 +-
net/core/flow_dissector.c | 79 +++-
net/core/rtnetlink.c | 1 +
net/ethtool/bitset.c | 8 +-
net/ipv4/icmp.c | 12 +-
net/ipv4/inet_connection_sock.c | 5 +-
net/ipv4/netfilter/Kconfig | 59 ++-
net/ipv4/netfilter/Makefile | 2 +-
net/ipv4/netfilter/arp_tables.c | 43 ++-
net/ipv4/netfilter/arpt_mangle.c | 8 +
net/ipv4/netfilter/arptable_filter.c | 14 +-
net/ipv4/netfilter/ip_tables.c | 18 +-
net/ipv4/netfilter/iptable_filter.c | 4 +-
net/ipv4/netfilter/iptable_mangle.c | 4 +-
net/ipv4/netfilter/iptable_nat.c | 6 +-
net/ipv4/netfilter/iptable_raw.c | 4 +-
net/ipv4/netfilter/iptable_security.c | 4 +-
net/ipv4/nexthop.c | 4 +-
net/ipv4/raw.c | 2 +-
net/ipv4/route.c | 48 ---
net/ipv4/tcp.c | 3 +-
net/ipv4/udp_tunnel_core.c | 48 +++
net/ipv6/exthdrs.c | 13 +-
net/ipv6/icmp.c | 10 +-
net/ipv6/ip6_gre.c | 5 +-
net/ipv6/ip6_output.c | 68 ----
net/ipv6/ip6_udp_tunnel.c | 69 ++++
net/ipv6/netfilter/Kconfig | 30 +-
net/ipv6/netfilter/Makefile | 2 +-
net/ipv6/netfilter/ip6_tables.c | 18 +-
net/ipv6/netfilter/ip6t_eui64.c | 3 +-
net/ipv6/netfilter/ip6t_hbh.c | 4 +
net/ipv6/netfilter/ip6table_filter.c | 4 +-
net/ipv6/netfilter/ip6table_mangle.c | 4 +-
net/ipv6/netfilter/ip6table_nat.c | 6 +-
net/ipv6/netfilter/ip6table_raw.c | 4 +-
net/ipv6/netfilter/ip6table_security.c | 4 +-
net/ipv6/rpl_iptunnel.c | 9 +
net/ipv6/seg6_hmac.c | 2 +
net/ipv6/seg6_iptunnel.c | 12 +-
net/ipv6/xfrm6_protocol.c | 4 +-
net/l2tp/l2tp_core.c | 5 +
net/mac80211/tdls.c | 2 +-
net/mac80211/tx.c | 4 +-
net/mptcp/pm_netlink.c | 2 +-
net/mptcp/sockopt.c | 12 +-
net/mptcp/subflow.c | 4 +-
net/netfilter/Kconfig | 22 +-
net/netfilter/ipset/ip_set_hash_ipmark.c | 6 +-
net/netfilter/ipset/ip_set_hash_ipport.c | 5 +-
net/netfilter/ipset/ip_set_hash_ipportip.c | 5 +-
net/netfilter/ipset/ip_set_hash_ipportnet.c | 5 +-
net/netfilter/ipvs/ip_vs_xmit.c | 19 +-
net/netfilter/nf_conntrack_netlink.c | 2 +-
net/netfilter/nf_conntrack_proto_sctp.c | 13 +-
net/netfilter/nf_conntrack_sip.c | 152 ++++++--
net/netfilter/nf_nat_amanda.c | 2 +-
net/netfilter/nf_nat_sip.c | 34 +-
net/netfilter/nf_queue.c | 4 +-
net/netfilter/nf_tables_api.c | 4 +-
net/netfilter/nfnetlink_log.c | 8 +-
net/netfilter/nfnetlink_osf.c | 45 +--
net/netfilter/nfnetlink_queue.c | 2 +
net/netfilter/nft_bitwise.c | 3 +-
net/netfilter/nft_ct.c | 2 +
net/netfilter/nft_dynset.c | 10 +-
net/netfilter/nft_fwd_netdev.c | 10 +
net/netfilter/nft_osf.c | 6 +-
net/netfilter/nft_set_pipapo.c | 20 +-
net/netfilter/nft_set_pipapo_avx2.c | 20 +-
net/netfilter/x_tables.c | 116 +++++-
net/netfilter/xt_mac.c | 34 +-
net/netfilter/xt_multiport.c | 34 +-
net/netfilter/xt_owner.c | 37 +-
net/netfilter/xt_physdev.c | 29 +-
net/netfilter/xt_policy.c | 2 +-
net/netfilter/xt_realm.c | 2 +-
net/netfilter/xt_socket.c | 23 +-
net/nfc/digital_technology.c | 6 +
net/nfc/llcp_core.c | 2 +
net/openvswitch/datapath.c | 35 +-
net/openvswitch/vport.c | 3 +
net/phonet/pep.c | 19 +-
net/qrtr/ns.c | 11 +
net/rds/af_rds.c | 10 +-
net/rds/connection.c | 14 +
net/rds/ib.c | 24 +-
net/rds/ib.h | 1 +
net/rds/ib_rdma.c | 2 +-
net/rds/message.c | 21 +-
net/rds/rdma.c | 4 -
net/rxrpc/call_object.c | 22 +-
net/rxrpc/conn_event.c | 17 +-
net/rxrpc/key.c | 9 +-
net/rxrpc/proc.c | 26 +-
net/rxrpc/recvmsg.c | 22 +-
net/rxrpc/rxkad.c | 7 +-
net/rxrpc/sendmsg.c | 2 +-
net/sched/act_csum.c | 6 +-
net/sched/act_ct.c | 8 +-
net/sched/cls_u32.c | 13 +-
net/sched/sch_cake.c | 15 +-
net/sched/sch_choke.c | 28 +-
net/sched/sch_fq_codel.c | 3 +-
net/sched/sch_fq_pie.c | 19 +-
net/sched/sch_gred.c | 3 -
net/sched/sch_hhf.c | 19 +-
net/sched/sch_netem.c | 57 ++-
net/sched/sch_pie.c | 52 ++-
net/sched/sch_red.c | 34 +-
net/sched/sch_sfb.c | 54 +--
net/sched/sch_taprio.c | 238 ++++++------
net/sctp/inqueue.c | 1 +
net/sctp/sm_statefuns.c | 6 +
net/sctp/socket.c | 11 +-
net/smc/smc_clc.c | 4 +-
net/strparser/strparser.c | 8 +
net/sunrpc/sysfs.c | 60 +--
net/sunrpc/xprtsock.c | 33 +-
net/tipc/msg.c | 14 +-
net/tls/tls_sw.c | 26 +-
net/unix/diag.c | 21 +-
net/vmw_vsock/af_vsock.c | 6 +-
net/vmw_vsock/hyperv_transport.c | 4 +-
net/vmw_vsock/virtio_transport_common.c | 3 +-
net/vmw_vsock/vmci_transport.c | 2 +-
net/wireless/core.c | 4 +-
net/wireless/scan.c | 3 +
net/xdp/xdp_umem.c | 3 +-
net/xfrm/xfrm_policy.c | 2 +
net/xfrm/xfrm_user.c | 4 +
scripts/checkpatch.pl | 10 +
scripts/dtc/dtc-lexer.l | 3 -
security/integrity/ima/ima_crypto.c | 2 +-
sound/aoa/soundbus/i2sbus/core.c | 9 +-
sound/core/compress_offload.c | 7 -
sound/core/control.c | 4 +
sound/core/control_led.c | 14 +-
sound/core/seq/oss/seq_oss_rw.c | 6 +-
sound/core/sound.c | 7 +
sound/firewire/fireworks/fireworks_command.c | 5 +-
sound/firewire/tascam/tascam-hwdep.c | 1 +
sound/isa/sc6000.c | 285 ++++++++-------
sound/pci/asihpi/hpicmn.c | 6 +
sound/pci/asihpi/hpimsgx.c | 6 +-
sound/pci/ctxfi/ctatc.c | 3 +-
sound/pci/ctxfi/ctvmem.h | 2 +-
sound/pci/hda/patch_conexant.c | 35 +-
sound/pci/hda/patch_realtek.c | 5 +-
sound/soc/codecs/ab8500-codec.c | 6 +-
sound/soc/fsl/fsl_easrc.c | 125 +++++--
sound/soc/fsl/fsl_xcvr.c | 22 +-
sound/soc/intel/boards/bytcr_wm5102.c | 1 +
sound/soc/soc-core.c | 1 +
sound/soc/sof/topology.c | 2 +-
sound/soc/sti/uniperif_player.c | 9 +-
sound/soc/stm/stm32_sai_sub.c | 3 +
sound/usb/6fire/chip.c | 17 +-
sound/usb/6fire/control.c | 10 +-
sound/usb/caiaq/control.c | 52 ++-
sound/usb/caiaq/device.c | 39 +-
sound/usb/caiaq/input.c | 2 +-
sound/usb/endpoint.c | 6 +-
sound/usb/format.c | 88 ++++-
sound/usb/midi.c | 22 +-
sound/usb/misc/ua101.c | 12 +-
sound/usb/mixer.c | 14 +-
sound/usb/mixer_quirks.c | 12 +-
sound/usb/quirks.c | 38 +-
sound/usb/stream.c | 4 +-
tools/lib/bpf/relo_core.c | 2 +
tools/perf/util/branch.h | 3 +
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 51 +--
tools/perf/util/expr.c | 3 +-
tools/perf/util/util.h | 1 -
tools/testing/ktest/ktest.pl | 37 +-
tools/testing/selftests/cgroup/test_memcontrol.c | 11 +-
.../testing/selftests/mqueue/{setting => settings} | 0
virt/kvm/dirty_ring.c | 3 +-
692 files changed, 6912 insertions(+), 3309 deletions(-)Greg Kroah-Hartman
maintainerPATCH 1/776 ALSA: asihpi: avoid write overflow check warning
5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 591721223be9e28f83489a59289579493b8e3d83 ]
clang-22 rightfully warns that the memcpy() in adapter_prepare() copies between different structures, crossing the boundary of nested structures inside it:
In file included from sound/pci/asihpi/hpimsgx.c:13:
In file included from include/linux/string.h:386:include/linux/fortify-string.h:569:4: error: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
569 | __write_overflow_field(p_size_field, size);
The two structures seem to refer to the same layout, despite the separate definitions, so the code is in fact correct.
Avoid the warning by copying the two inner structures separately. I see the same pattern happens in other functions in the same file, so there is a chance that this may come back in the future, but this instance is the only one that I saw in practice, hitting it multiple times per day in randconfig build.
--- sound/pci/asihpi/hpimsgx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/pci/asihpi/hpimsgx.c +4 -2
@@ -586,8 +586,10 @@ static u16 adapter_prepare(u16 adapter) HPI_ADAPTER_OPEN); hm.adapter_index = adapter;hw_entry_point (&hm, &hr); -memcpy (&rESP_HPI_ADAPTER_OPEN[adapter], &hr, -sizeof (rESP_HPI_ADAPTER_OPEN[0 ])); +memcpy (&rESP_HPI_ADAPTER_OPEN[adapter].h, &hr, +sizeof (rESP_HPI_ADAPTER_OPEN[adapter].h)); +memcpy (&rESP_HPI_ADAPTER_OPEN[adapter].a, &hr.u.ax.info, +sizeof (rESP_HPI_ADAPTER_OPEN[adapter].a));if (hr.error)return hr.error;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2/776 ASoC: SOF: topology: reject invalid vendor array size in token parser
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cássio Gabriel <[email protected]>
[ Upstream commit 215e5fe75881a7e2425df04aeeed47a903d5cd5d ]
sof_parse_token_sets() accepts array->size values that can be invalid for a vendor tuple array header. In particular, a zero size does not advance the parser state and can lead to non-progress parsing on malformed topology data.
Validate array->size against the minimum header size and reject values smaller than sizeof(*array) before parsing. This preserves behavior for valid topologies and hardens malformed-input handling.
--- sound/soc/sof/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/topology.c +1 -1
@@ -941,7 +941,7 @@ static int sof_parse_token_sets(struct snd_soc_component *scomp, asize =le32_to_cpu (array->size);/* validate asize */ -if (asize <0 ) {/* FIXME: A zero-size array makes no sense */ +if (asize <sizeof (*array)) {dev_err (scomp->dev,"error: invalid array size 0x%x\n" , asize);return -EINVAL ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 3/776 can: mcp251x: add error handling for power enable in open and resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenyuan Li <[email protected]>
[ Upstream commit 7a57354756c7df223abe2c33774235ad70cb4231 ]
Add missing error handling for mcp251x_power_enable() calls in both mcp251x_open() and mcp251x_can_resume() functions.
In mcp251x_open(), if power enable fails, jump to error path to close candev without attempting to disable power again.
In mcp251x_can_resume(), properly check return values of power enable calls for both power and transceiver regulators. If any fails, return the error code to the PM framework and log the failure.
This ensures the driver properly handles power control failures and maintains correct device state.
--- drivers/net/can/spi/mcp251x.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-)
drivers/net/can/spi/mcp251x.c +24 -5
@@ -1218,7 +1218,11 @@ static int mcp251x_open(struct net_device *net) }mutex_lock (&priv->mcp_lock); -mcp251x_power_enable (priv->transceiver,1 ); + ret =mcp251x_power_enable (priv->transceiver,1 ); +if (ret) { +dev_err (&spi->dev,"failed to enable transceiver power: %pe\n" ,ERR_PTR (ret)); + goto out_close_candev; + } priv->force_quit =0 ; priv->tx_skb =NULL ;
@@ -1267,6 +1271,7 @@ static int mcp251x_open(struct net_device *net)mcp251x_hw_sleep (spi); out_close:mcp251x_power_enable (priv->transceiver,0 ); +out_close_candev:close_candev (net);mutex_unlock (&priv->mcp_lock);if (release_irq)
@@ -1505,11 +1510,25 @@ static int __maybe_unused mcp251x_can_resume(struct device *dev) {struct spi_device *spi =to_spi_device (dev);struct mcp251x_priv *priv =spi_get_drvdata (spi); +int ret =0 ; -if (priv->after_suspend &AFTER_SUSPEND_POWER ) -mcp251x_power_enable (priv->power,1 ); -if (priv->after_suspend &AFTER_SUSPEND_UP ) -mcp251x_power_enable (priv->transceiver,1 ); +if (priv->after_suspend &AFTER_SUSPEND_POWER ) { + ret =mcp251x_power_enable (priv->power,1 ); +if (ret) { +dev_err (dev,"failed to restore power: %pe\n" ,ERR_PTR (ret)); +return ret; + } + } + +if (priv->after_suspend &AFTER_SUSPEND_UP ) { + ret =mcp251x_power_enable (priv->transceiver,1 ); +if (ret) { +dev_err (dev,"failed to restore transceiver power: %pe\n" ,ERR_PTR (ret)); +if (priv->after_suspend &AFTER_SUSPEND_POWER ) +mcp251x_power_enable (priv->power,0 ); +return ret; + } + }if (priv->after_suspend & (AFTER_SUSPEND_POWER |AFTER_SUSPEND_UP ))queue_work (priv->wq, &priv->restart_work);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 4/776 btrfs: tracepoints: get correct superblock from dentry in event btrfs_sync_file()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Goldwyn Rodrigues <[email protected]>
[ Upstream commit a85b46db143fda5869e7d8df8f258ccef5fa1719 ]
If overlay is used on top of btrfs, dentry->d_sb translates to overlay's super block and fsid assignment will lead to a crash.
Use file_inode(file)->i_sb to always get btrfs_sb.
--- include/trace/events/btrfs.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
include/trace/events/btrfs.h +7 -4
@@ -695,12 +695,15 @@ TRACE_EVENT(btrfs_sync_file, ),TP_fast_assign ( - const struct dentry *dentry = file->f_path.dentry; -const struct inode *inode =d_inode (dentry); + struct dentry *dentry = file_dentry(file); +struct inode *inode =file_inode (file); +struct dentry *parent =dget_parent (dentry); +struct inode *parent_inode =d_inode (parent); -TP_fast_assign_fsid (btrfs_sb (file->f_path.dentry->d_sb)); +dput (parent); +TP_fast_assign_fsid (btrfs_sb (inode->i_sb)); __entry->ino =btrfs_ino (BTRFS_I (inode)); - __entry->parent =btrfs_ino (BTRFS_I (d_inode (dentry->d_parent))); + __entry->parent =btrfs_ino (BTRFS_I (parent_inode)); __entry->datasync = datasync; __entry->root_objectid =BTRFS_I (inode)->root->root_key.objectid;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 5/776 ALSA: hda/realtek: Add mute LED quirk for HP Pavilion 15-eg0xxx
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: César Montoya <[email protected]>
[ Upstream commit 2f388b4e8fdd6b0f27cafd281658daacfd85807e ]
The HP Pavilion 15-eg0xxx with subsystem ID 0x103c87cb uses a Realtek ALC287 codec with a mute LED wired to GPIO pin 4 (mask 0x10). The existing ALC287_FIXUP_HP_GPIO_LED fixup already handles this correctly, but the subsystem ID was missing from the quirk table.
GPIO pin confirmed via manual hda-verb testing:
hda-verb SET_GPIO_MASK 0x10
hda-verb SET_GPIO_DIRECTION 0x10
hda-verb SET_GPIO_DATA 0x10
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9354,6 +9354,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x8788 ,"HP OMEN 15" ,ALC285_FIXUP_HP_MUTE_LED ),SND_PCI_QUIRK (0x103c ,0x87b7 ,"HP Laptop 14-fq0xxx" ,ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 ),SND_PCI_QUIRK (0x103c ,0x87c8 ,"HP" ,ALC287_FIXUP_HP_GPIO_LED ), +SND_PCI_QUIRK (0x103c ,0x87cb ,"HP Pavilion 15-eg0xxx" ,ALC287_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x87cc ,"HP Pavilion 15-eg0xxx" ,ALC287_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x87d3 ,"HP Laptop 15-gw0xxx" ,ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 ), SND_PCI_QUIRK(0x103c, 0x87df, "HP ProBook 430 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 6/776 netfilter: nft_set_pipapo_avx2: dont return non-matching entry on expiry
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit d3c0037ffe1273fa1961e779ff6906234d6cf53c ]
New test case fails unexpectedly when avx2 matching functions are used.
The test first loads a ranomly generated pipapo set with 'ipv4 . port' key, i.e. nft -f foo.
This works. Then, it reloads the set after a flush:
(echo flush set t s; cat foo) | nft -f -
This is expected to work, because its the same set after all and it was already loaded once.
But with avx2, this fails: nft reports a clashing element.
The reported clash is of following form:
We successfully re-inserted
a . b
c . d
Then we try to insert a . d
avx2 finds the already existing a . d, which (due to 'flush set') is marked as invalid in the new generation. It skips the element and moves to next.
Due to incorrect masking, the skip-step finds the next matching element *only considering the first field*,
i.e. we return the already reinserted "a . b", even though the last field is different and the entry should not have been matched.
No such error is reported for the generic c implementation (no avx2) or when the last field has to use the 'nft_pipapo_avx2_lookup_slow' fallback.
Bisection points to7711f4bb4b36 ("netfilter: nft_set_pipapo: fix range overlap detection") but that fix merely uncovers this bug.
Before this commit, the wrong element is returned, but erronously reported as a full, identical duplicate.
The root-cause is too early return in the avx2 match functions. When we process the last field, we should continue to process data until the entire input size has been consumed to make sure no stale bits remain in the map.
--- net/netfilter/nft_set_pipapo_avx2.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
net/netfilter/nft_set_pipapo_avx2.c +10 -10
@@ -242,7 +242,7 @@ static int nft_pipapo_avx2_lookup_4b_2(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -319,7 +319,7 @@ static int nft_pipapo_avx2_lookup_4b_4(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -414,7 +414,7 @@ static int nft_pipapo_avx2_lookup_4b_8(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -505,7 +505,7 @@ static int nft_pipapo_avx2_lookup_4b_12(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -641,7 +641,7 @@ static int nft_pipapo_avx2_lookup_4b_32(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -699,7 +699,7 @@ static int nft_pipapo_avx2_lookup_8b_1(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -764,7 +764,7 @@ static int nft_pipapo_avx2_lookup_8b_2(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -839,7 +839,7 @@ static int nft_pipapo_avx2_lookup_8b_4(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -925,7 +925,7 @@ static int nft_pipapo_avx2_lookup_8b_6(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
@@ -1019,7 +1019,7 @@ static int nft_pipapo_avx2_lookup_8b_16(unsigned long *map, unsigned long *fill, b =nft_pipapo_avx2_refill (i_ul, &map[i_ul], fill, f->mt, last);if (last) -return b; + ret = b;if (unlikely (ret ==-1 )) ret = b /XSAVE_YMM_SIZE ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 7/776 wifi: wl1251: validate packet IDs before indexing tx_frames
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 0fd56fad9c56356e7fa7a7c52e7ecbf807a44eb0 ]
wl1251_tx_packet_cb() uses the firmware completion ID directly to index the fixed 16-entry wl->tx_frames[] array. The ID is a raw u8 from the completion block, and the callback does not currently verify that it fits the array before dereferencing it.
Reject completion IDs that fall outside wl->tx_frames[] and keep the existing NULL check in the same guard. This keeps the fix local to the trust boundary and avoids touching the rest of the completion flow.
--- drivers/net/wireless/ti/wl1251/tx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/ti/wl1251/tx.c +5 -3
@@ -402,12 +402,14 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,int hdrlen;u8 *frame; - skb = wl->tx_frames[result->id]; -if (skb ==NULL ) { -wl1251_error ("SKB for packet %d is NULL" , result->id); +if (unlikely (result->id >=ARRAY_SIZE (wl->tx_frames) || + wl->tx_frames[result->id] ==NULL )) { +wl1251_error ("invalid packet id %u" , result->id);return ; } + skb = wl->tx_frames[result->id]; + info =IEEE80211_SKB_CB (skb); if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
Signature · 1 line
2.53.0
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 5.15.209-rc1-00789-g0e93b47df78b #1 SMP Sat May 30 17:02:18 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Greg Kroah-Hartman
maintainerPATCH 8/776 ASoC: soc-core: call missing INIT_LIST_HEAD() for card_aux_list
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <[email protected]>
[ Upstream commit b9eff9732cb0f86a68c9d1592a98ceab47c01e95 ]
Component has "card_aux_list" which is added/deled in bind/unbind aux dev function (A), and used in for_each_card_auxs() loop (B).
static void soc_unbind_aux_dev(...)
{
...
for_each_card_auxs_safe(...) {
...
(A) list_del(&component->card_aux_list);
} ^^^^^^^^^^^^^
}
static int soc_bind_aux_dev(...)
{
...
for_each_card_pre_auxs(...) {
...
(A) list_add(&component->card_aux_list, ...);
} ^^^^^^^^^^^^^
...
}
#define for_each_card_auxs(card, component) \
(B) list_for_each_entry(component, ..., card_aux_list)
^^^^^^^^^^^^^But it has been used without calling INIT_LIST_HEAD().
> git grep card_aux_list sound/soc sound/soc/soc-core.c: list_del(&component->card_aux_list); sound/soc/soc-core.c: list_add(&component->card_aux_list, ...);
call missing INIT_LIST_HEAD() for it.
--- sound/soc/soc-core.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/soc-core.c +1 -0
@@ -2646,6 +2646,7 @@ int snd_soc_component_initialize(struct snd_soc_component *component,INIT_LIST_HEAD (&component->dobj_list);INIT_LIST_HEAD (&component->card_list);INIT_LIST_HEAD (&component->list); +INIT_LIST_HEAD (&component->card_aux_list);mutex_init (&component->io_mutex); component->name =fmt_single_name (dev, &component->id);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 9/776 ALSA: usb-audio: Fix quirk flags for NeuralDSP Quad Cortex
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Willoughby <[email protected]>
[ Upstream commit bc5b4e5ae1a67700a618328217b6a3bd0f296e97 ]
The NeuralDSP Quad Cortex does not support DSD playback. We need this product-specific entry with zero quirks because otherwise it falls through to the vendor-specific entry which marks it as supporting DSD playback.
--- sound/usb/quirks.c | 2 ++ 1 file changed, 2 insertions(+)
sound/usb/quirks.c +2 -0
@@ -1863,6 +1863,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_PLAYBACK_FIRST | QUIRK_FLAG_GENERIC_IMPLICIT_FB),DEVICE_FLG (0x13e5 ,0x0001 ,/* Serato Phono */ QUIRK_FLAG_IGNORE_CTL_ERROR ), +DEVICE_FLG (0x152a ,0x880a ,/* NeuralDSP Quad Cortex */ +0 ),/* Doesn't have the vendor quirk which would otherwise apply */ DEVICE_FLG (0x154e ,0x1002 ,/* Denon DCD-1500RE */ QUIRK_FLAG_ITF_USB_DSD_DAC |QUIRK_FLAG_CTL_MSG_DELAY ), DEVICE_FLG(0x154e, 0x1003, /* Denon DA-300USB */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 10/776 fs/smb/client: fix out-of-bounds read in cifs_sanitize_prepath
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fredric Cover <[email protected]>
[ Upstream commit 78ec5bf2f589ec7fd8f169394bfeca541b077317 ]
When cifs_sanitize_prepath is called with an empty string or a string containing only delimiters (e.g., "/"), the current logic attempts to check *(cursor2 - 1) before cursor2 has advanced. This results in an out-of-bounds read.
This patch adds an early exit check after stripping prepended delimiters. If no path content remains, the function returns NULL.
The bug was identified via manual audit and verified using a standalone test case compiled with AddressSanitizer, which triggered a SEGV on affected inputs.
--- fs/cifs/fs_context.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/cifs/fs_context.c +4 -0
@@ -450,6 +450,10 @@ char *cifs_sanitize_prepath(char *prepath, gfp_t gfp)while (IS_DELIM (*cursor1)) cursor1++; +/* exit in case of only delimiters */ +if (!*cursor1) +return NULL ; +/* copy the first letter */ *cursor2 = *cursor1;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 11/776 pinctrl: intel: Fix the revision for new features (1kOhm PD, HW debouncer)
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit a4337a24d13e9e3b98a113e71d6b80dc5ed5f8c4 ]
The 1kOhm pull down and hardware debouncer are features of the revision 0.92 of the Chassis specification. Fix that in the code accordingly.
--- drivers/pinctrl/intel/pinctrl-intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-intel.c +1 -1
@@ -1532,7 +1532,7 @@ static int intel_pinctrl_probe(struct platform_device *pdev, value =readl (regs +REVID );if (value == ~0u )return -ENODEV ; -if (((value &REVID_MASK ) >>REVID_SHIFT ) >=0x94 ) { +if (((value &REVID_MASK ) >>REVID_SHIFT ) >=0x92 ) { community->features |=PINCTRL_FEATURE_DEBOUNCE ; community->features |=PINCTRL_FEATURE_1K_PD ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 12/776 HID: quirks: add HID_QUIRK_ALWAYS_POLL for 8BitDo Pro 3
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: leo vriska <[email protected]>
[ Upstream commit 532743944324a873bbaf8620fcabcd0e69e30c36 ]
According to a mailing list report [1], this controller's predecessor has the same issue. However, it uses the xpad driver instead of HID, so this quirk wouldn't apply.
[1]: https://lore.kernel.org/linux-input/[email protected]/
--- drivers/hid/hid-ids.h | 3 +++ drivers/hid/hid-quirks.c | 1 + 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +3 -0
@@ -22,6 +22,9 @@#define USB_DEVICE_ID_3M2256 0x0502#define USB_DEVICE_ID_3M3266 0x0506 +#define USB_VENDOR_ID_8BITDO 0x2dc8 +#define USB_DEVICE_ID_8BITDO_PRO_3 0x6009 +#define USB_VENDOR_ID_A4TECH 0x09da#define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006#define USB_DEVICE_ID_A4TECH_X5_005D 0x000a
drivers/hid/hid-quirks.c +1 -0
@@ -25,6 +25,7 @@*/ static const struct hid_device_id hid_quirks[] = { + {HID_USB_DEVICE (USB_VENDOR_ID_8BITDO ,USB_DEVICE_ID_8BITDO_PRO_3 ),HID_QUIRK_ALWAYS_POLL }, {HID_USB_DEVICE (USB_VENDOR_ID_AASHIMA ,USB_DEVICE_ID_AASHIMA_GAMEPAD ),HID_QUIRK_BADPAD }, {HID_USB_DEVICE (USB_VENDOR_ID_AASHIMA ,USB_DEVICE_ID_AASHIMA_PREDATOR ),HID_QUIRK_BADPAD }, {HID_USB_DEVICE (USB_VENDOR_ID_ADATA_XPG ,USB_VENDOR_ID_ADATA_XPG_WL_GAMING_MOUSE ),HID_QUIRK_ALWAYS_POLL },
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 13/776 HID: roccat: fix use-after-free in roccat_report_event
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benoît Sevens <[email protected]>
[ Upstream commit d802d848308b35220f21a8025352f0c0aba15c12 ]
roccat_report_event() iterates over the device->readers list without holding the readers_lock. This allows a concurrent roccat_release() to remove and free a reader while it's still being accessed, leading to a use-after-free.
Protect the readers list traversal with the readers_lock mutex.
--- drivers/hid/hid-roccat.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hid-roccat.c +2 -0
@@ -257,6 +257,7 @@ int roccat_report_event(int minor, u8 const *data)if (!new_value)return -ENOMEM ; +mutex_lock (&device->readers_lock);mutex_lock (&device->cbuf_lock); report = &device->cbuf[device->cbuf_end];
@@ -279,6 +280,7 @@ int roccat_report_event(int minor, u8 const *data) }mutex_unlock (&device->cbuf_lock); +mutex_unlock (&device->readers_lock);wake_up_interruptible (&device->wait);return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 14/776 ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arthur Husband <[email protected]>
[ Upstream commit 105c42566a550e2d05fc14f763216a8765ee5d0e ]
The JMicron JMB585 (and JMB582) SATA controllers advertise 64-bit DMA support via the S64A bit in the AHCI CAP register, but their 64-bit DMA implementation is defective. Under sustained I/O, DMA transfers targeting addresses above 4GB silently corrupt data -- writes land at incorrect memory addresses with no errors logged.
The failure pattern is similar to the ASMedia ASM1061 (commit 20730e9b2778 ("ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers")), which also falsely advertised full 64-bit DMA support. However, the JMB585 requires a stricter 32-bit DMA mask rather than 43-bit, as corruption occurs with any address above 4GB.
On the Minisforum N5 Pro specifically, the combination of the JMB585's broken 64-bit DMA with the AMD Family 1Ah (Strix Point) IOMMU causes silent data corruption that is only detectable via checksumming filesystems (BTRFS/ZFS scrub). The corruption occurs when 32-bit IOVA space is exhausted and the kernel transparently switches to 64-bit DMA addresses.
Add device-specific PCI ID entries for the JMB582 (0x0582) and JMB585 (0x0585) before the generic JMicron class match, using a new board type that combines AHCI_HFLAG_IGN_IRQ_IF_ERR (preserving existing behavior) with AHCI_HFLAG_32BIT_ONLY to force 32-bit DMA masks.
--- drivers/ata/ahci.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/ata/ahci.c +14 -0
@@ -61,6 +61,7 @@ enum board_ids {/* board IDs for specific chipsets in alphabetical order */ board_ahci_al, board_ahci_avn, + board_ahci_jmb585, board_ahci_mcp65, board_ahci_mcp77, board_ahci_mcp89,
@@ -200,6 +201,15 @@ static const struct ata_port_info ahci_port_info[] = { .udma_mask = ATA_UDMA6, .port_ops = &ahci_avn_ops, }, + /* JMicron JMB582/585: 64-bit DMA is broken, force 32-bit */ + [board_ahci_jmb585] = { +AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR | + AHCI_HFLAG_32BIT_ONLY), + .flags = AHCI_FLAG_COMMON, + .pio_mask = ATA_PIO4, + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, [board_ahci_mcp65] = {AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA |AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ),
@@ -436,6 +446,10 @@ static const struct pci_device_id ahci_pci_tbl[] = {/* Elkhart Lake IDs 0x4b60 & 0x4b62 https://sata-io.org/product/8803 not tested yet */ { PCI_VDEVICE(INTEL, 0x4b63), board_ahci_low_power }, /* Elkhart Lake AHCI */ +/* JMicron JMB582/585: force 32-bit DMA (broken 64-bit implementation) */ + { PCI_VDEVICE(JMICRON, 0x0582), board_ahci_jmb585 }, + { PCI_VDEVICE(JMICRON, 0x0585), board_ahci_jmb585 }, +/* JMicron 360/1/3/5/6, match class to avoid IDE function */ { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr },
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 15/776 wifi: brcmfmac: validate bsscfg indices in IF events
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 304950a467d83678bd0b0f46331882e2ac23b12d ]
brcmf_fweh_handle_if_event() validates the firmware-provided interface index before it touches drvr->iflist[], but it still uses the raw bsscfgidx field as an array index without a matching range check.
Reject IF events whose bsscfg index does not fit in drvr->iflist[] before indexing the interface array.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +5 -0
@@ -151,6 +151,11 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,bphy_err (drvr,"invalid interface index: %u\n" , ifevent->ifidx);return ; } +if (ifevent->bsscfgidx >=BRCMF_MAX_IFS ) { +bphy_err (drvr,"invalid bsscfg index: %u\n" , + ifevent->bsscfgidx); +return ; + } ifp = drvr->iflist[ifevent->bsscfgidx];
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 16/776 ASoC: stm32_sai: fix incorrect BCLK polarity for DSP_A/B, LEFT_J
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Merta <[email protected]>
[ Upstream commit 0669631dbccd41cf3ca7aa70213fcd8bb41c4b38 ]
The STM32 SAI driver do not set the clock strobing bit (CKSTR) for DSP_A, DSP_B and LEFT_J formats, causing data to be sampled on the wrong BCLK edge when SND_SOC_DAIFMT_NB_NF is used.
Per ALSA convention, NB_NF requires sampling on the rising BCLK edge. The STM32MP25 SAI reference manual states that CKSTR=1 is required for signals received by the SAI to be sampled on the SCK rising edge. Without setting CKSTR=1, the SAI samples on the falling edge, violating the NB_NF convention. For comparison, the NXP FSL SAI driver correctly sets FSL_SAI_CR2_BCP for DSP_A, DSP_B and LEFT_J, consistent with its I2S handling.
This patch adds SAI_XCR1_CKSTR for DSP_A, DSP_B and LEFT_J in stm32_sai_set_dai_fmt which was verified empirically with a cs47l35 codec. RIGHT_J (LSB) is not investigated and addressed by this patch.
Note: the STM32 I2S driver (stm32_i2s_set_dai_fmt) may have the same issue for DSP_A mode, as I2S_CGFR_CKPOL is not set. This has not been verified and is left for a separate investigation.
--- sound/soc/stm/stm32_sai_sub.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/stm/stm32_sai_sub.c +3 -0
@@ -671,6 +671,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)break ;/* Left justified */ case SND_SOC_DAIFMT_MSB : + cr1 |=SAI_XCR1_CKSTR ; frcr |=SAI_XFRCR_FSPOL |SAI_XFRCR_FSDEF ;break ;/* Right justified */
@@ -678,9 +679,11 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) frcr |=SAI_XFRCR_FSPOL |SAI_XFRCR_FSDEF ;break ;case SND_SOC_DAIFMT_DSP_A : + cr1 |=SAI_XCR1_CKSTR ; frcr |=SAI_XFRCR_FSPOL |SAI_XFRCR_FSOFF ;break ;case SND_SOC_DAIFMT_DSP_B : + cr1 |=SAI_XCR1_CKSTR ; frcr |=SAI_XFRCR_FSPOL ;break ;default :
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 17/776 soc: aspeed: socinfo: Mask table entries for accurate SoC ID matching
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Potin Lai <[email protected]>
[ Upstream commit 7ec1bd3d9be671d04325b9e06149b8813f6a4836 ]
The siliconid_to_name() function currently masks the input silicon ID with 0xff00ffff, but compares it against unmasked table entries. This causes matching to fail if the table entries contain non-zero values in the bits covered by the mask (bits 16-23).
Update the logic to apply the 0xff00ffff mask to the table entries during comparison. This ensures that only the relevant model and revision bits are considered, providing a consistent match across different manufacturing batches.
[arj: Add Fixes: tag, fix 'soninfo' typo, clarify function reference]
--- drivers/soc/aspeed/aspeed-socinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/aspeed/aspeed-socinfo.c +1 -1
@@ -39,7 +39,7 @@ static const char *siliconid_to_name(u32 siliconid)unsigned int i;for (i =0 ; i <ARRAY_SIZE (rev_table) ; ++i) { -if (rev_table[i].id == id) +if ((rev_table[i].id &0xff00ffff ) == id)return rev_table[i].name; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 18/776 arm64: dts: imx8mq: Set the correct gpu_ahb clock frequency
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit 1f99b5d93d99ca17d50b386a674d0ce1f20932d8 ]
According to i.MX 8M Quad Reference Manual, GPU_AHB_CLK_ROOT's maximum frequency is 400MHz.
--- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mq.dtsi +1 -1
@@ -1362,7 +1362,7 @@ gpu: gpu@38000000 { <&clk IMX8MQ_GPU_PLL_OUT>, <&clk IMX8MQ_GPU_PLL>; assigned-clock-rates = <800000000>, <800000000>, - <800000000>, <800000000>, <0>; + <800000000>, <400000000>, <0>; power-domains = <&pgc_gpu>; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 19/776 PCI: hv: Set default NUMA node to 0 for devices without affinity info
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Long Li <[email protected]>
[ Upstream commit 7b3b1e5a87b2f5e35c52b5386d7c327be869454f ]
When hv_pci_assign_numa_node() processes a device that does not have HV_PCI_DEVICE_FLAG_NUMA_AFFINITY set or has an out-of-range virtual_numa_node, the device NUMA node is left unset. On x86_64, the uninitialized default happens to be 0, but on ARM64 it is NUMA_NO_NODE (-1).
Tests show that when no NUMA information is available from the Hyper-V host, devices perform best when assigned to node 0. With NUMA_NO_NODE the kernel may spread work across NUMA nodes, which degrades performance on Hyper-V, particularly for high-throughput devices like MANA.
Always set the device NUMA node to 0 before the conditional NUMA affinity check, so that devices get a performant default when the host provides no NUMA information, and behavior is consistent on both x86_64 and ARM64.
--- drivers/pci/controller/pci-hyperv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/pci/controller/pci-hyperv.c +8 -0
@@ -1963,6 +1963,14 @@ static void hv_pci_assign_numa_node(struct hv_pcibus_device *hbus)if (!hv_dev)continue ; +/* +* If the Hyper-V host doesn't provide a NUMA node for the +* device, default to node 0. With NUMA_NO_NODE the kernel +* may spread work across NUMA nodes, which degrades +* performance on Hyper-V. +*/ +set_dev_node (&dev->dev,0 ); +if (hv_dev->desc.flags &HV_PCI_DEVICE_FLAG_NUMA_AFFINITY && hv_dev->desc.virtual_numa_node <num_possible_nodes ())/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 20/776 drm/vc4: Fix memory leak of BO array in hang state
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maíra Canal <[email protected]>
[ Upstream commit f4dfd6847b3e5d24e336bca6057485116d17aea4 ]
The hang state's BO array is allocated separately with kzalloc() in vc4_save_hang_state() but never freed in vc4_free_hang_state(). Add the missing kfree() for the BO array before freeing the hang state struct.
--- drivers/gpu/drm/vc4/vc4_gem.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vc4/vc4_gem.c +1 -0
@@ -60,6 +60,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state)for (i =0 ; i < state->user_state.bo_count; i++)drm_gem_object_put (state->bo[i]); +kfree (state->bo);kfree (state); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 21/776 drm/vc4: Fix a memory leak in hang state error path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maíra Canal <[email protected]>
[ Upstream commit 9525d169e5fd481538cf8c663cc5839e54f2e481 ]
When vc4_save_hang_state() encounters an early return condition, it returns without freeing the previously allocated kernel_state, leaking memory.
Add the missing kfree() calls by consolidating the early return paths into a single place.
--- drivers/gpu/drm/vc4/vc4_gem.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/vc4/vc4_gem.c +10 -8
@@ -166,10 +166,8 @@ vc4_save_hang_state(struct drm_device *dev)spin_lock_irqsave (&vc4->job_lock, irqflags); exec[0 ] =vc4_first_bin_job (vc4); exec[1 ] =vc4_first_render_job (vc4); -if (!exec[0 ] && !exec[1 ]) { -spin_unlock_irqrestore (&vc4->job_lock, irqflags); -return ; - } +if (!exec[0 ] && !exec[1 ]) + goto err_free_state;/* Get the bos from both binner and renderer into hang state. */ state->bo_count =0 ;
@@ -186,10 +184,8 @@ vc4_save_hang_state(struct drm_device *dev) kernel_state->bo =kcalloc (state->bo_count,sizeof (*kernel_state->bo),GFP_ATOMIC ); -if (!kernel_state->bo) { -spin_unlock_irqrestore (&vc4->job_lock, irqflags); -return ; - } +if (!kernel_state->bo) + goto err_free_state; k =0 ;for (i =0 ; i <2 ; i++) {
@@ -281,6 +277,12 @@ vc4_save_hang_state(struct drm_device *dev) vc4->hang_state = kernel_state;spin_unlock_irqrestore (&vc4->job_lock, irqflags); } + +return ; + +err_free_state: +spin_unlock_irqrestore (&vc4->job_lock, irqflags); +kfree (kernel_state); } static void
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 22/776 drm/vc4: Protect madv read in vc4_gem_object_mmap() with madv_lock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maíra Canal <[email protected]>
[ Upstream commit 338c56050d8e892604da97f67bfa8cc4015a955f ]
The mmap callback reads bo->madv without holding madv_lock, racing with concurrent DRM_IOCTL_VC4_GEM_MADVISE calls that modify the field under the same lock. Add the missing locking to prevent the data race.
--- drivers/gpu/drm/vc4/vc4_bo.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/vc4/vc4_bo.c +3 -0
@@ -713,12 +713,15 @@ static int vc4_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_structreturn -EINVAL ; } +mutex_lock (&bo->madv_lock);if (bo->madv !=VC4_MADV_WILLNEED ) {DRM_DEBUG ("mmaping of %s BO not allowed\n" , bo->madv ==VC4_MADV_DONTNEED ?"purgeable" :"purged" ); +mutex_unlock (&bo->madv_lock);return -EINVAL ; } +mutex_unlock (&bo->madv_lock);return drm_gem_cma_mmap (obj, vma); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 23/776 epoll: use refcount to reduce ep_mutex contention
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
[ Upstream commit 58c9b016e12855286370dfb704c08498edbc857a ]
We are observing huge contention on the epmutex during an http connection/rate test:
83.17% 0.25% nginx [kernel.kallsyms] [k] entry_SYSCALL_64_after_hwframe
[...]
|--66.96%--__fput
|--60.04%--eventpoll_release_file
|--58.41%--__mutex_lock.isra.6
|--56.56%--osq_lockThe application is multi-threaded, creates a new epoll entry for each incoming connection, and does not delete it before the connection shutdown - that is, before the connection's fd close().
Many different threads compete frequently for the epmutex lock, affecting the overall performance.
To reduce the contention this patch introduces explicit reference counting for the eventpoll struct. Each registered event acquires a reference, and references are released at ep_remove() time.
The eventpoll struct is released by whoever - among EP file close() and and the monitored file close() drops its last reference.
Additionally, this introduces a new 'dying' flag to prevent races between the EP file close() and the monitored file close(). ep_eventpoll_release() marks, under f_lock spinlock, each epitem as dying before removing it, while EP file close() does not touch dying epitems.
The above is needed as both close operations could run concurrently and drop the EP reference acquired via the epitem entry. Without the above flag, the monitored file close() could reach the EP struct via the epitem list while the epitem is still listed and then try to put it after its disposal.
An alternative could be avoiding touching the references acquired via the epitems at EP file close() time, but that could leave the EP struct alive for potentially unlimited time after EP file close(), with nasty side effects.
With all the above in place, we can drop the epmutex usage at disposal time.
Overall this produces a significant performance improvement in the mentioned connection/rate scenario: the mutex operations disappear from the topmost offenders in the perf report, and the measured connections/rate grows by ~60%.
To make the change more readable this additionally renames ep_free() to ep_clear_and_put(), and moves the actual memory cleanup in a separate ep_free() helper.
Stable-dep-of: 07712db80857 ("eventpoll: defer struct eventpoll free to RCU grace period")
--- fs/eventpoll.c | 195 +++++++++++++++++++++++++++++++------------------ 1 file changed, 123 insertions(+), 72 deletions(-)
fs/eventpoll.c +123 -72
@@ -57,13 +57,7 @@* we need a lock that will allow us to sleep. This lock is a * mutex (ep->mtx). It is acquired during the event transfer loop, * during epoll_ctl(EPOLL_CTL_DEL) and during eventpoll_release_file(). -* Then we also need a global mutex to serialize eventpoll_release_file() -* and ep_free(). -* This mutex is acquired by ep_free() during the epoll file -* cleanup path and it is also acquired by eventpoll_release_file() -* if a file has been pushed inside an epoll set and it is then -* close()d without a previous call to epoll_ctl(EPOLL_CTL_DEL). -* It is also acquired when inserting an epoll fd onto another epoll +* The epmutex is acquired when inserting an epoll fd onto another epoll * fd. We do this so that we walk the epoll tree and ensure that this * insertion does not create a cycle of epoll file descriptors, which * could lead to deadlock. We need a global mutex to prevent two
@@ -153,6 +147,13 @@ struct epitem {/* The file descriptor information this item refers to */ struct epoll_filefd ffd; +/* +* Protected by file->f_lock, true for to-be-released epitem already +* removed from the "struct file" items list; together with +* eventpoll->refcount orchestrates "struct eventpoll" disposal +*/ +bool dying; +/* List containing poll wait queues */ struct eppoll_entry *pwqlist;
@@ -218,6 +219,12 @@ struct eventpoll {struct hlist_head refs;u8 loop_check_depth; +/* +* usage count, used together with epitem->dying to +* orchestrate the disposal of this struct +*/ +refcount_t refcount; +#ifdef CONFIG_NET_RX_BUSY_POLL /* used to track busy poll napi_id */ unsigned int napi_id;
@@ -241,9 +248,7 @@ struct ep_pqueue {/* Maximum number of epoll watched descriptors, per user */ static long max_user_watches__read_mostly ; -/* -* This mutex is used to serialize ep_free() and eventpoll_release_file(). -*/ +/* Used for cycles detection */ static DEFINE_MUTEX (epmutex);static u64 loop_check_gen =0 ;
@@ -551,8 +556,7 @@ static void ep_remove_wait_queue(struct eppoll_entry *pwq)/* * This function unregisters poll callbacks from the associated file -* descriptor. Must be called with "mtx" held (or "epmutex" if called from -* ep_free). +* descriptor. Must be called with "mtx" held. */ static void ep_unregister_pollwait (struct eventpoll *ep,struct epitem *epi) {
@@ -675,11 +679,40 @@ static void epi_rcu_free(struct rcu_head *head)kmem_cache_free (epi_cache, epi); } +static void ep_get (struct eventpoll *ep) +{ +refcount_inc (&ep->refcount); +} + +/* +* Returns true if the event poll can be disposed +*/ +static bool ep_refcount_dec_and_test (struct eventpoll *ep) +{ +if (!refcount_dec_and_test (&ep->refcount)) +return false; + +WARN_ON_ONCE (!RB_EMPTY_ROOT (&ep->rbr.rb_root)); +return true; +} + +static void ep_free (struct eventpoll *ep) +{ +mutex_destroy (&ep->mtx); +free_uid (ep->user); +wakeup_source_unregister (ep->ws); +kfree (ep); +} +/* * Removes a "struct epitem" from the eventpoll RB tree and deallocates * all the associated resources. Must be called with "mtx" held. +* If the dying flag is set, do the removal only if force is true. +* This prevents ep_clear_and_put() from dropping all the ep references +* while running concurrently with eventpoll_release_file(). +* Returns true if the eventpoll can be disposed. */ -static int ep_remove (struct eventpoll *ep,struct epitem *epi) +static bool __ep_remove (struct eventpoll *ep,struct epitem *epi,bool force) {struct file *file = epi->ffd.file;struct epitems_head *to_free;
@@ -694,6 +727,11 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi)/* Remove the current item from the list of epoll hooks */ spin_lock (&file->f_lock); +if (epi->dying && !force) { +spin_unlock (&file->f_lock); +return false; + } + to_free =NULL ; head = file->f_ep;if (head->first == &epi->fllink && !epi->fllink.next) {
@@ -728,28 +766,28 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi)call_rcu (&epi->rcu, epi_rcu_free);percpu_counter_dec (&ep->user->epoll_watches); +return ep_refcount_dec_and_test (ep); +} -return 0 ; +/* +* ep_remove variant for callers owing an additional reference to the ep +*/ +static void ep_remove_safe (struct eventpoll *ep,struct epitem *epi) +{ +WARN_ON_ONCE (__ep_remove (ep, epi, false)); } -static void ep_free (struct eventpoll *ep) +static void ep_clear_and_put (struct eventpoll *ep) { -struct rb_node *rbp; +struct rb_node *rbp, *next;struct epitem *epi; +bool dispose;/* We need to release all tasks waiting for these file */ if (waitqueue_active (&ep->poll_wait))ep_poll_safewake (ep,NULL ,0 ); -/* -* We need to lock this because we could be hit by -* eventpoll_release_file() while we're freeing the "struct eventpoll". -* We do not need to hold "ep->mtx" here because the epoll file -* is on the way to be removed and no one has references to it -* anymore. The only hit might come from eventpoll_release_file() but -* holding "epmutex" is sufficient here. -*/ -mutex_lock (&epmutex); +mutex_lock (&ep->mtx);/* * Walks through the whole tree by unregistering poll callbacks.
@@ -762,26 +800,25 @@ static void ep_free(struct eventpoll *ep) }/* -* Walks through the whole tree by freeing each "struct epitem". At this -* point we are sure no poll callbacks will be lingering around, and also by -* holding "epmutex" we can be sure that no file cleanup code will hit -* us during this operation. So we can avoid the lock on "ep->lock". -* We do not need to lock ep->mtx, either, we only do it to prevent -* a lockdep warning. +* Walks through the whole tree and try to free each "struct epitem". +* Note that ep_remove_safe() will not remove the epitem in case of a +* racing eventpoll_release_file(); the latter will do the removal. +* At this point we are sure no poll callbacks will be lingering around. +* Since we still own a reference to the eventpoll struct, the loop can't +* dispose it. */ -mutex_lock (&ep->mtx); -while ((rbp =rb_first_cached (&ep->rbr)) !=NULL ) { +for (rbp =rb_first_cached (&ep->rbr); rbp; rbp = next) { + next =rb_next (rbp); epi = rb_entry(rbp, struct epitem, rbn); -ep_remove (ep, epi); +ep_remove_safe (ep, epi);cond_resched (); } + + dispose =ep_refcount_dec_and_test (ep);mutex_unlock (&ep->mtx); -mutex_unlock (&epmutex); -mutex_destroy (&ep->mtx); -free_uid (ep->user); -wakeup_source_unregister (ep->ws); -kfree (ep); +if (dispose) +ep_free (ep); }static int ep_eventpoll_release (struct inode *inode,struct file *file)
@@ -789,7 +826,7 @@ static int ep_eventpoll_release(struct inode *inode, struct file *file)struct eventpoll *ep = file->private_data;if (ep) -ep_free (ep); +ep_clear_and_put (ep);return 0 ; }
@@ -937,33 +974,34 @@ void eventpoll_release_file(struct file *file) {struct eventpoll *ep;struct epitem *epi; -struct hlist_node *next; +bool dispose;/* -* We don't want to get "file->f_lock" because it is not -* necessary. It is not necessary because we're in the "struct file" -* cleanup path, and this means that no one is using this file anymore. -* So, for example, epoll_ctl() cannot hit here since if we reach this -* point, the file counter already went to zero and fget() would fail. -* The only hit might come from ep_free() but by holding the mutex -* will correctly serialize the operation. We do need to acquire -* "ep->mtx" after "epmutex" because ep_remove() requires it when called -* from anywhere but ep_free(). -* -* Besides, ep_remove() acquires the lock, so we can't hold it here. +* Use the 'dying' flag to prevent a concurrent ep_clear_and_put() from +* touching the epitems list before eventpoll_release_file() can access +* the ep->mtx. */ -mutex_lock (&epmutex); -if (unlikely (!file->f_ep)) { -mutex_unlock (&epmutex); -return ; - } -hlist_for_each_entry_safe (epi, next, file->f_ep, fllink) { +again: +spin_lock (&file->f_lock); +if (file->f_ep && file->f_ep->first) { + epi = hlist_entry(file->f_ep->first, struct epitem, fllink); + epi->dying = true; +spin_unlock (&file->f_lock); + +/* +* ep access is safe as we still own a reference to the ep +* struct +*/ ep = epi->ep; -mutex_lock_nested (&ep->mtx,0 ); -ep_remove (ep, epi); +mutex_lock (&ep->mtx); + dispose =__ep_remove (ep, epi, true);mutex_unlock (&ep->mtx); + +if (dispose) +ep_free (ep); + goto again; } -mutex_unlock (&epmutex); +spin_unlock (&file->f_lock); }static int ep_alloc (struct eventpoll **pep)
@@ -986,6 +1024,7 @@ static int ep_alloc(struct eventpoll **pep) ep->rbr =RB_ROOT_CACHED ; ep->ovflist =EP_UNACTIVE_PTR ; ep->user = user; +refcount_set (&ep->refcount,1 ); *pep = ep;
@@ -1257,10 +1296,10 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v*/ list_del_init (&wait->entry);/* -* ->whead != NULL protects us from the race with ep_free() -* or ep_remove(), ep_remove_wait_queue() takes whead->lock -* held by the caller. Once we nullify it, nothing protects -* ep/epi or even wait. +* ->whead != NULL protects us from the race with +* ep_clear_and_put() or ep_remove(), ep_remove_wait_queue() +* takes whead->lock held by the caller. Once we nullify it, +* nothing protects ep/epi or even wait. */ smp_store_release (&ep_pwq_from_wait (wait)->whead,NULL ); }
@@ -1531,16 +1570,22 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,if (tep)mutex_unlock (&tep->mtx); +/* +* ep_remove_safe() calls in the later error paths can't lead to +* ep_free() as the ep file itself still holds an ep reference. +*/ +ep_get (ep); +/* now check if we've created too many backpaths */ if (unlikely (full_check &&reverse_path_check ())) { -ep_remove (ep, epi); +ep_remove_safe (ep, epi);return -EINVAL ; }if (epi->event.events &EPOLLWAKEUP ) { error =ep_create_wakeup_source (epi);if (error) { -ep_remove (ep, epi); +ep_remove_safe (ep, epi);return error; } }
@@ -1564,7 +1609,7 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,* high memory pressure. */ if (unlikely (!epq.epi)) { -ep_remove (ep, epi); +ep_remove_safe (ep, epi);return -ENOMEM ; }
@@ -2096,7 +2141,7 @@ static int do_epoll_create(int flags) out_free_fd:put_unused_fd (fd); out_free_ep: -ep_free (ep); +ep_clear_and_put (ep);return error; }
@@ -2238,10 +2283,16 @@ int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds, error = -EEXIST ;break ;case EPOLL_CTL_DEL : -if (epi) - error =ep_remove (ep, epi); -else +if (epi) { +/* +* The eventpoll itself is still alive: the refcount +* can't go to zero here. +*/ +ep_remove_safe (ep, epi); + error =0 ; + }else { error = -ENOENT ; + }break ;case EPOLL_CTL_MOD :if (epi) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 24/776 eventpoll: defer struct eventpoll free to RCU grace period
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Carlini <[email protected]>
[ Upstream commit 07712db80857d5d09ae08f3df85a708ecfc3b61f ]
In certain situations, ep_free() in eventpoll.c will kfree the epi->ep eventpoll struct while it still being used by another concurrent thread. Defer the kfree() to an RCU callback to prevent UAF.
--- fs/eventpoll.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/eventpoll.c +5 -1
@@ -225,6 +225,9 @@ struct eventpoll {*/ refcount_t refcount; +/* used to defer freeing past ep_get_upwards_depth_proc() RCU walk */ +struct rcu_head rcu; +#ifdef CONFIG_NET_RX_BUSY_POLL /* used to track busy poll napi_id */ unsigned int napi_id;
@@ -701,7 +704,8 @@ static void ep_free(struct eventpoll *ep)mutex_destroy (&ep->mtx);free_uid (ep->user);wakeup_source_unregister (ep->ws); -kfree (ep); +/* ep_get_upwards_depth_proc() may still hold epi->ep under RCU */ +kfree_rcu (ep, rcu); }/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 25/776 net: sched: act_csum: validate nested VLAN headers
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruide Cao <[email protected]>
[ Upstream commit c842743d073bdd683606cb414eb0ca84465dd834 ]
tcf_csum_act() walks nested VLAN headers directly from skb->data when an skb still carries in-payload VLAN tags. The current code reads vlan->h_vlan_encapsulated_proto and then pulls VLAN_HLEN bytes without first ensuring that the full VLAN header is present in the linear area.
If only part of an inner VLAN header is linearized, accessing h_vlan_encapsulated_proto reads past the linear area, and the following skb_pull(VLAN_HLEN) may violate skb invariants.
Fix this by requiring pskb_may_pull(skb, VLAN_HLEN) before accessing and pulling each nested VLAN header. If the header still is not fully available, drop the packet through the existing error path.
--- net/sched/act_csum.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/sched/act_csum.c +5 -1
@@ -602,8 +602,12 @@ static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a, protocol = skb->protocol; orig_vlan_tag_present = true; }else { -struct vlan_hdr *vlan = (struct vlan_hdr *)skb->data; +struct vlan_hdr *vlan; +if (!pskb_may_pull (skb,VLAN_HLEN )) + goto drop; + + vlan = (struct vlan_hdr *)skb->data; protocol = vlan->h_vlan_encapsulated_proto;skb_pull (skb,VLAN_HLEN );skb_reset_network_header (skb);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 26/776 net: lapbether: handle NETDEV_PRE_TYPE_CHANGE
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit b120e4432f9f56c7103133d6a11245e617695adb ]
lapbeth_data_transmit() expects the underlying device type to be ARPHRD_ETHER.
Returning NOTIFY_BAD from lapbeth_device_event() makes sure bonding driver can not break this expectation.
--- drivers/net/wan/lapbether.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wan/lapbether.c +8 -5
@@ -444,33 +444,36 @@ static void lapbeth_free_device(struct lapbethdev *lapbeth)static int lapbeth_device_event (struct notifier_block *this,unsigned long event,void *ptr) { -struct lapbethdev *lapbeth;struct net_device *dev =netdev_notifier_info_to_dev (ptr); +struct lapbethdev *lapbeth;if (dev_net (dev) != &init_net)return NOTIFY_DONE ; -if (!dev_is_ethdev (dev) && !lapbeth_get_x25_dev (dev)) + lapbeth =lapbeth_get_x25_dev (dev); +if (!dev_is_ethdev (dev) && !lapbeth)return NOTIFY_DONE ;switch (event) {case NETDEV_UP :/* New ethernet device -> new LAPB interface */ -if (!lapbeth_get_x25_dev (dev)) +if (!lapbeth)lapbeth_new_device (dev);break ;case NETDEV_GOING_DOWN :/* ethernet device closes -> close LAPB interface */ - lapbeth =lapbeth_get_x25_dev (dev);if (lapbeth)dev_close (lapbeth->axdev);break ;case NETDEV_UNREGISTER :/* ethernet device disappears -> remove LAPB interface */ - lapbeth =lapbeth_get_x25_dev (dev);if (lapbeth)lapbeth_free_device (lapbeth);break ; +case NETDEV_PRE_TYPE_CHANGE : +/* Our underlying device type must not change. */ +if (lapbeth) +return NOTIFY_BAD ; }return NOTIFY_DONE ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 27/776 ipv4: icmp: fix null-ptr-deref in icmp_build_probe()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yiqi Sun <[email protected]>
[ Upstream commit fde29fd9349327acc50d19a0b5f3d5a6c964dfd8 ]
ipv6_stub->ipv6_dev_find() may return ERR_PTR(-EAFNOSUPPORT) when the IPv6 stack is not active (CONFIG_IPV6=m and not loaded), and passing this error pointer to dev_hold() will cause a kernel crash with null-ptr-deref.
Instead, silently discard the request. RFC 8335 does not appear to define a specific response for the case where an IPv6 interface identifier is syntactically valid but the implementation cannot perform the lookup at runtime, and silently dropping the request may safer than misreporting "No Such Interface".
--- net/ipv4/icmp.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/ipv4/icmp.c +7 -0
@@ -1108,6 +1108,13 @@ bool icmp_build_probe(struct sk_buff *skb, struct icmphdr *icmphdr)if (iio->ident.addr.ctype3_hdr.addrlen !=sizeof (struct in6_addr )) goto send_mal_query; dev = ipv6_stub->ipv6_dev_find (net, &iio->ident.addr.ip_addr.ipv6_addr, dev); +/* +* If IPv6 identifier lookup is unavailable, silently +* discard the request instead of misreporting NO_IF. +*/ +if (IS_ERR (dev)) +return false; +dev_hold (dev);break ;#endif
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 28/776 nfc: s3fwrn5: allocate rx skb before consuming bytes
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 5c14a19d5b1645cce1cb1252833d70b23635b632 ]
s3fwrn82_uart_read() reports the number of accepted bytes to the serdev core. The current code consumes bytes into recv_skb and may already deliver a complete frame before allocating a fresh receive buffer.
If that alloc_skb() fails, the callback returns 0 even though it has already consumed bytes, and it leaves recv_skb as NULL for the next receive callback. That breaks the receive_buf() accounting contract and can also lead to a NULL dereference on the next skb_put_u8().
Allocate the receive skb lazily before consuming the next byte instead. If allocation fails, return the number of bytes already accepted.
--- drivers/nfc/s3fwrn5/uart.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/nfc/s3fwrn5/uart.c +7 -3
@@ -59,6 +59,12 @@ static int s3fwrn82_uart_read(struct serdev_device *serdev,size_t i;for (i =0 ; i < count; i++) { +if (!phy->recv_skb) { + phy->recv_skb =alloc_skb (NCI_SKB_BUFF_LEN ,GFP_KERNEL ); +if (!phy->recv_skb) +return i; + } +skb_put_u8 (phy->recv_skb, *data++);if (phy->recv_skb->len <S3FWRN82_NCI_HEADER )
@@ -70,9 +76,7 @@ static int s3fwrn82_uart_read(struct serdev_device *serdev,s3fwrn5_recv_frame (phy->common.ndev, phy->recv_skb, phy->common.mode); - phy->recv_skb =alloc_skb (NCI_SKB_BUFF_LEN ,GFP_KERNEL ); -if (!phy->recv_skb) -return 0 ; + phy->recv_skb =NULL ; }return i;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 29/776 tracing/probe: reject non-closed empty immediate strings
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 4346be6577aaa04586167402ae87bbdbe32484a4 ]
parse_probe_arg() accepts quoted immediate strings and passes the body after the opening quote to __parse_imm_string(). That helper currently computes strlen(str) and immediately dereferences str[len - 1], which underflows when the body is empty and not closed with double-quotation.
Reject empty non-closed immediate strings before checking for the closing quote.
--- kernel/trace/trace_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_probe.c +1 -1
@@ -362,7 +362,7 @@ static int __parse_imm_string(char *str, char **pbuf, int offs) {size_t len =strlen (str); -if (str[len -1 ] !='"' ) { +if (!len || str[len -1 ] !='"' ) {trace_probe_log_err (offs + len,IMMSTR_NO_CLOSE );return -EINVAL ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 30/776 e1000: check return value of e1000_read_eeprom
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Agalakov Daniil <[email protected]>
[ Upstream commit d3baa34a470771399c1495bc04b1e26ac15d598e ]
[Why]e1000_set_eeprom() performs a read-modify-write operation when the write range is not word-aligned. This requires reading the first and last words of the range from the EEPROM to preserve the unmodified bytes.
However, the code does not check the return value of e1000_read_eeprom(). If the read fails, the operation continues using uninitialized data from eeprom_buff. This results in corrupted data being written back to the EEPROM for the boundary words.
Add the missing error checks and abort the operation if reading fails.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +7 -1
@@ -496,14 +496,19 @@ static int e1000_set_eeprom(struct net_device *netdev,*/ ret_val =e1000_read_eeprom (hw, first_word,1 , &eeprom_buff[0 ]); +if (ret_val) + goto out; + ptr++; } -if (((eeprom->offset + eeprom->len) &1 ) && (ret_val ==0 )) { +if ((eeprom->offset + eeprom->len) &1 ) {/* need read/modify/write of last changed EEPROM word * only the first byte of the word is being modified */ ret_val =e1000_read_eeprom (hw, last_word,1 , &eeprom_buff[last_word - first_word]); +if (ret_val) + goto out; }/* Device's eeprom is always little-endian, word addressable */
@@ -522,6 +527,7 @@ static int e1000_set_eeprom(struct net_device *netdev,if ((ret_val ==0 ) && (first_word <=EEPROM_CHECKSUM_REG ))e1000_update_eeprom_checksum (hw); +out:kfree (eeprom_buff);return ret_val; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 31/776 xsk: tighten UMEM headroom validation to account for tailroom and min frame
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <[email protected]>
[ Upstream commit a315e022a72d95ef5f1d4e58e903cb492b0ad931 ]
The current headroom validation in xdp_umem_reg() could leave us with insufficient space dedicated to even receive minimum-sized ethernet frame. Furthermore if multi-buffer would come to play then skb_shared_info stored at the end of XSK frame would be corrupted.
HW typically works with 128-aligned sizes so let us provide this value as bare minimum.
Multi-buffer setting is known later in the configuration process so besides accounting for 128 bytes, let us also take care of tailroom space upfront.
--- net/xdp/xdp_umem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/xdp/xdp_umem.c +2 -1
@@ -198,7 +198,8 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)if (!unaligned_chunks && chunks_rem)return -EINVAL ; -if (headroom >= chunk_size -XDP_PACKET_HEADROOM ) +if (headroom > chunk_size -XDP_PACKET_HEADROOM - +SKB_DATA_ALIGN (sizeof (struct skb_shared_info )) -128 )return -EINVAL ; umem->size = size;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 32/776 xfrm: Wait for RCU readers during policy netns exit
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 069daad4f2ae9c5c108131995529d5f02392c446 ]
xfrm_policy_fini() frees the policy_bydst hash tables after flushing the policy work items and deleting all policies, but it does not wait for concurrent RCU readers to leave their read-side critical sections first.
The policy_bydst tables are published via rcu_assign_pointer() and are looked up through rcu_dereference_check(), so netns teardown must also wait for an RCU grace period before freeing the table memory.
Fix this by adding synchronize_rcu() before freeing the policy hash tables.
--- net/xfrm/xfrm_policy.c | 2 ++ 1 file changed, 2 insertions(+)
net/xfrm/xfrm_policy.c +2 -0
@@ -4125,6 +4125,8 @@ static void xfrm_policy_fini(struct net *net)#endif xfrm_policy_flush (net,XFRM_POLICY_TYPE_MAIN , false); +synchronize_rcu (); +WARN_ON (!list_empty (&net->xfrm.policy_all));for (dir =0 ; dir <XFRM_POLICY_MAX ; dir++) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 33/776 xfrm_user: fix info leak in build_mapping()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 1beb76b2053b68c491b78370794b8ff63c8f8c02 ]
struct xfrm_usersa_id has a one-byte padding hole after the proto field, which ends up never getting set to zero before copying out to userspace. Fix that up by zeroing out the whole structure before setting individual variables.
--- net/xfrm/xfrm_user.c | 1 + 1 file changed, 1 insertion(+)
net/xfrm/xfrm_user.c +1 -0
@@ -3592,6 +3592,7 @@ static int build_mapping(struct sk_buff *skb, struct xfrm_state *x, um =nlmsg_data (nlh); +memset (&um->id,0 ,sizeof (um->id));memcpy (&um->id.daddr, &x->id.daddr,sizeof (um->id.daddr)); um->id.spi = x->id.spi; um->id.family = x->props.family;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 34/776 netfilter: nfnetlink_log: initialize nfgenmsg in NLMSG_DONE terminator
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei <[email protected]>
[ Upstream commit 1f3083aec8836213da441270cdb1ab612dd82cf4 ]
When batching multiple NFLOG messages (inst->qlen > 1), __nfulnl_send() appends an NLMSG_DONE terminator with sizeof(struct nfgenmsg) payload via nlmsg_put(), but never initializes the nfgenmsg bytes. The nlmsg_put() helper only zeroes alignment padding after the payload, not the payload itself, so four bytes of stale kernel heap data are leaked to userspace in the NLMSG_DONE message body.
Use nfnl_msg_put() to build the NLMSG_DONE terminator, which initializes the nfgenmsg payload via nfnl_fill_hdr(), consistent with how __build_packet_message() already constructs NFULNL_MSG_PACKET headers.
--- net/netfilter/nfnetlink_log.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/nfnetlink_log.c +4 -4
@@ -350,10 +350,10 @@ static void __nfulnl_send(struct nfulnl_instance *inst) {if (inst->qlen >1 ) { -struct nlmsghdr *nlh =nlmsg_put (inst->skb,0 ,0 , -NLMSG_DONE , -sizeof (struct nfgenmsg ), -0 ); +struct nlmsghdr *nlh =nfnl_msg_put (inst->skb,0 ,0 , +NLMSG_DONE ,0 , +AF_UNSPEC ,NFNETLINK_V0 , +htons (inst->group_num));if (WARN_ONCE (!nlh,"bad nlskb size: %u, tailroom %d\n" , inst->skb->len,skb_tailroom (inst->skb))) {kfree_skb (inst->skb);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 35/776 netfilter: xt_multiport: validate range encoding in checkentry
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ren Wei <[email protected]>
[ Upstream commit ff64c5bfef12461df8450e0f50bb693b5269c720 ]
ports_match_v1() treats any non-zero pflags entry as the start of a port range and unconditionally consumes the next ports[] element as the range end.
The checkentry path currently validates protocol, flags and count, but it does not validate the range encoding itself. As a result, malformed rules can mark the last slot as a range start or place two range starts back to back, leaving ports_match_v1() to step past the last valid ports[] element while interpreting the rule.
Reject malformed multiport v1 rules in checkentry by validating that each range start has a following element and that the following element is not itself marked as another range start.
--- net/netfilter/xt_multiport.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-)
net/netfilter/xt_multiport.c +30 -4
@@ -105,6 +105,28 @@ multiport_mt(const struct sk_buff *skb, struct xt_action_param *par)return ports_match_v1 (multiinfo,ntohs (pptr[0 ]),ntohs (pptr[1 ])); } +static bool +multiport_valid_ranges (const struct xt_multiport_v1 *multiinfo) +{ +unsigned int i; + +for (i =0 ; i < multiinfo->count; i++) { +if (!multiinfo->pflags[i]) +continue ; + +if (++i >= multiinfo->count) +return false; + +if (multiinfo->pflags[i]) +return false; + +if (multiinfo->ports[i -1 ] > multiinfo->ports[i]) +return false; + } + +return true; +} + static inline bool check(u_int16_t proto, u_int8_t ip_invflags,
@@ -127,8 +149,10 @@ static int multiport_mt_check(const struct xt_mtchk_param *par)const struct ipt_ip *ip = par->entryinfo;const struct xt_multiport_v1 *multiinfo = par->matchinfo; -return check (ip->proto, ip->invflags, multiinfo->flags, - multiinfo->count) ?0 : -EINVAL ; +if (!check (ip->proto, ip->invflags, multiinfo->flags, multiinfo->count)) +return -EINVAL ; + +return multiport_valid_ranges (multiinfo) ?0 : -EINVAL ; }static int multiport_mt6_check (const struct xt_mtchk_param *par)
@@ -136,8 +160,10 @@ static int multiport_mt6_check(const struct xt_mtchk_param *par)const struct ip6t_ip6 *ip = par->entryinfo;const struct xt_multiport_v1 *multiinfo = par->matchinfo; -return check (ip->proto, ip->invflags, multiinfo->flags, - multiinfo->count) ?0 : -EINVAL ; +if (!check (ip->proto, ip->invflags, multiinfo->flags, multiinfo->count)) +return -EINVAL ; + +return multiport_valid_ranges (multiinfo) ?0 : -EINVAL ; }static struct xt_match multiport_mt_reg[]__read_mostly = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 36/776 netfilter: ip6t_eui64: reject invalid MAC header for all packets
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhengchuan Liang <[email protected]>
[ Upstream commit fdce0b3590f724540795b874b4c8850c90e6b0a8 ]
eui64_mt6() derives a modified EUI-64 from the Ethernet source address and compares it with the low 64 bits of the IPv6 source address.
The existing guard only rejects an invalid MAC header when par->fragoff != 0. For packets with par->fragoff == 0, eui64_mt6() can still reach eth_hdr(skb) even when the MAC header is not valid.
Fix this by removing the par->fragoff != 0 condition so that packets with an invalid MAC header are rejected before accessing eth_hdr(skb).
--- net/ipv6/netfilter/ip6t_eui64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/netfilter/ip6t_eui64.c +1 -2
@@ -22,8 +22,7 @@ eui64_mt6(const struct sk_buff *skb, struct xt_action_param *par)unsigned char eui64[8 ];if (!(skb_mac_header (skb) >= skb->head && -skb_mac_header (skb) +ETH_HLEN <= skb->data) && - par->fragoff !=0 ) { +skb_mac_header (skb) +ETH_HLEN <= skb->data)) { par->hotdrop = true;return false; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 37/776 af_unix: read UNIX_DIAG_VFS data under unix_state_lock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiexun Wang <[email protected]>
[ Upstream commit 39897df386376912d561d4946499379effa1e7ef ]
Exact UNIX diag lookups hold a reference to the socket, but not to u->path. Meanwhile, unix_release_sock() clears u->path under unix_state_lock() and drops the path reference after unlocking.
Read the inode and device numbers for UNIX_DIAG_VFS while holding unix_state_lock(), then emit the netlink attribute after dropping the lock.
This keeps the VFS data stable while the reply is being built.
--- net/unix/diag.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
net/unix/diag.c +13 -8
@@ -25,18 +25,23 @@ static int sk_diag_dump_name(struct sock *sk, struct sk_buff *nlskb)static int sk_diag_dump_vfs (struct sock *sk,struct sk_buff *nlskb) { -struct dentry *dentry =unix_sk (sk)->path.dentry; +struct unix_diag_vfs uv; +struct dentry *dentry; +bool have_vfs = false; +unix_state_lock (sk); + dentry =unix_sk (sk)->path.dentry;if (dentry) { -struct unix_diag_vfs uv = { - .udiag_vfs_ino =d_backing_inode (dentry)->i_ino, - .udiag_vfs_dev = dentry->d_sb->s_dev, - }; - -return nla_put (nlskb,UNIX_DIAG_VFS ,sizeof (uv), &uv); + uv.udiag_vfs_ino =d_backing_inode (dentry)->i_ino; + uv.udiag_vfs_dev = dentry->d_sb->s_dev; + have_vfs = true; } +unix_state_unlock (sk); -return 0 ; +if (!have_vfs) +return 0 ; + +return nla_put (nlskb,UNIX_DIAG_VFS ,sizeof (uv), &uv); }static int sk_diag_dump_peer (struct sock *sk,struct sk_buff *nlskb)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 38/776 l2tp: Drop large packets with UDP encap
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Mikityanska <[email protected]>
[ Upstream commit ebe560ea5f54134279356703e73b7f867c89db13 ]
syzbot reported a WARN on my patch series [1]. The actual issue is an overflow of 16-bit UDP length field, and it exists in the upstream code. My series added a debug WARN with an overflow check that exposed the issue, that's why syzbot tripped on my patches, rather than on upstream code.
syzbot's repro:
r0 = socket$pppl2tp(0x18, 0x1, 0x1)
r1 = socket$inet6_udp(0xa, 0x2, 0x0)
connect$inet6(r1, &(0x7f00000000c0)={0xa, 0x0, 0x0, @loopback, 0xfffffffc}, 0x1c)
connect$pppl2tp(r0, &(0x7f0000000240)=@pppol2tpin6={0x18, 0x1, {0x0, r1, 0x4, 0x0, 0x0, 0x0, {0xa, 0x4e22, 0xffff, @ipv4={'\x00', '\xff\xff', @empty}}}}, 0x32) writev(r0, &(0x7f0000000080)=[{&(0x7f0000000000)="ee", 0x34000}], 0x1)
It basically sends an oversized (0x34000 bytes) PPPoL2TP packet with UDP encapsulation, and l2tp_xmit_core doesn't check for overflows when it assigns the UDP length field. The value gets trimmed to 16 bites.
Add an overflow check that drops oversized packets and avoids sending packets with trimmed UDP length to the wire.
syzbot's stack trace (with my patch applied):
len >= 65536u
WARNING: ./include/linux/udp.h:38 at udp_set_len_short include/linux/udp.h:38 [inline], CPU#1: syz.0.17/5957 WARNING: ./include/linux/udp.h:38 at l2tp_xmit_core net/l2tp/l2tp_core.c:1293 [inline], CPU#1: syz.0.17/5957 WARNING: ./include/linux/udp.h:38 at l2tp_xmit_skb+0x1204/0x18d0 net/l2tp/l2tp_core.c:1327, CPU#1: syz.0.17/5957 Modules linked in: CPU: 1 UID: 0 PID: 5957 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:udp_set_len_short include/linux/udp.h:38 [inline] RIP: 0010:l2tp_xmit_core net/l2tp/l2tp_core.c:1293 [inline] RIP: 0010:l2tp_xmit_skb+0x1204/0x18d0 net/l2tp/l2tp_core.c:1327 Code: 0f 0b 90 e9 21 f9 ff ff e8 e9 05 ec f6 90 0f 0b 90 e9 8d f9 ff ff e8 db 05 ec f6 90 0f 0b 90 e9 cc f9 ff ff e8 cd 05 ec f6 90 <0f> 0b 90 e9 de fa ff ff 44 89 f1 80 e1 07 80 c1 03 38 c1 0f 8c 4f RSP: 0018:ffffc90003d67878 EFLAGS: 00010293 RAX: ffffffff8ad985e3 RBX: ffff8881a6400090 RCX: ffff8881697f0000 RDX: 0000000000000000 RSI: 0000000000034010 RDI: 000000000000ffff RBP: dffffc0000000000 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff520007acf00 R12: ffff8881baf20900 R13: 0000000000034010 R14: ffff8881a640008e R15: ffff8881760f7000 FS: 000055557e81f500(0000) GS:ffff8882a9467000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000200000033000 CR3: 00000001612f4000 CR4: 00000000000006f0 Call Trace: <TASK> pppol2tp_sendmsg+0x40a/0x5f0 net/l2tp/l2tp_ppp.c:302 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] sock_write_iter+0x503/0x550 net/socket.c:1195 do_iter_readv_writev+0x619/0x8c0 fs/read_write.c:-1 vfs_writev+0x33c/0x990 fs/read_write.c:1059 do_writev+0x154/0x2e0 fs/read_write.c:1105 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f636479c629 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffffd4241c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f6364a15fa0 RCX: 00007f636479c629 RDX: 0000000000000001 RSI: 0000200000000080 RDI: 0000000000000003 RBP: 00007f6364832b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f6364a15fac R14: 00007f6364a15fa0 R15: 00007f6364a15fa0 </TASK>
[1]: https://lore.kernel.org/all/[email protected]/
--- net/l2tp/l2tp_core.c | 5 +++++ 1 file changed, 5 insertions(+)
net/l2tp/l2tp_core.c +5 -0
@@ -1083,6 +1083,11 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, uns uh->source = inet->inet_sport; uh->dest = inet->inet_dport; udp_len = uhlen + session->hdr_len + data_len; +if (udp_len >U16_MAX ) { +kfree_skb (skb); + ret =NET_XMIT_DROP ; + goto out_unlock; + } uh->len =htons (udp_len);/* Calculate UDP checksum if configured to do so */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 39/776 gpio: tegra: fix irq_release_resources calling enable instead of disable
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samasth Norway Ananda <[email protected]>
[ Upstream commit 1561d96f5f55c1bca9ff047ace5813f4f244eea6 ]
tegra_gpio_irq_release_resources() erroneously calls tegra_gpio_enable() instead of tegra_gpio_disable(). When IRQ resources are released, the GPIO configuration bit (CNF) should be cleared to deconfigure the pin as a GPIO. Leaving it enabled wastes power and can cause unexpected behavior if the pin is later reused for an alternate function via pinctrl.
--- drivers/gpio/gpio-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-tegra.c +1 -1
@@ -598,7 +598,7 @@ static void tegra_gpio_irq_release_resources(struct irq_data *d)struct tegra_gpio_info *tgi =gpiochip_get_data (chip);gpiochip_relres_irq (chip, d->hwirq); -tegra_gpio_enable (tgi, d->hwirq); +tegra_gpio_disable (tgi, d->hwirq); }#ifdef CONFIG_DEBUG_FS
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 40/776 perf/x86/intel/uncore: Skip discovery table for offline dies
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zide Chen <[email protected]>
[ Upstream commit 7b568e9eba2fad89a696f22f0413d44cf4a1f892 ]
This warning can be triggered if NUMA is disabled and the system boots with fewer CPUs than the number of CPUs in die 0.
WARNING: CPU: 9 PID: 7257 at uncore.c:1157 uncore_pci_pmu_register+0x136/0x160 [intel_uncore]
Currently, the discovery table continues to be parsed even if all CPUs in the associated die are offline. This can lead to an array overflow at "pmu->boxes[die] = box" in uncore_pci_pmu_register(), which may trigger the warning above or cause other issues.
--- arch/x86/events/intel/uncore_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_discovery.c +1 -1
@@ -303,7 +303,7 @@ bool intel_uncore_has_discovery_tables(void) (val &UNCORE_DISCOVERY_DVSEC2_BIR_MASK ) *UNCORE_DISCOVERY_BIR_STEP ; die =get_device_die_id (dev); -if (die <0 ) +if ((die <0 ) || (die >=uncore_max_dies ()))continue ;parse_discovery_table (dev, die, bar_offset, &parsed);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 41/776 i3c: fix uninitialized variable use in i2c setup
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamie Iles <[email protected]>
[ Upstream commit 6cbf8b38dfe3aabe330f2c356949bc4d6a1f034f ]
Commit 31b9887c7258 ("i3c: remove i2c board info from i2c_dev_desc") removed the boardinfo from i2c_dev_desc to decouple device enumeration from setup but did not correctly lookup the i2c_dev_desc to store the new device, instead dereferencing an uninitialized variable.
Lookup the device that has already been registered by address to store the i2c client device.
--- drivers/i3c/master.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/i3c/master.c +6 -1
@@ -2199,8 +2199,13 @@ static int i3c_master_i2c_adapter_init(struct i3c_master_controller *master)* We silently ignore failures here. The bus should keep working * correctly even if one or more i2c devices are not registered. */ -list_for_each_entry (i2cboardinfo, &master->boardinfo.i2c, node) +list_for_each_entry (i2cboardinfo, &master->boardinfo.i2c, node) { + i2cdev =i3c_master_find_i2c_dev_by_addr (master, + i2cboardinfo->base.addr); +if (WARN_ON (!i2cdev)) +continue ; i2cdev->dev =i2c_new_client_device (adap, &i2cboardinfo->base); + }return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 42/776 netfilter: conntrack: add missing netlink policy validations
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit f900e1d77ee0ef87bfb5ab3fe60f0b3d8ad5ba05 ]
Hyunwoo Kim reports out-of-bounds access in sctp and ctnetlink.
These attributes are used by the kernel without any validation. Extend the netlink policies accordingly.
Quoting the reporter:
nlattr_to_sctp() assigns the user-supplied CTA_PROTOINFO_SCTP_STATE value directly to ct->proto.sctp.state without checking that it is within the valid range. [..]
and: ... with exp->dir = 100, the access at ct->master->tuplehash[100] reads 5600 bytes past the start of a 320-byte nf_conn object, causing a slab-out-of-bounds read confirmed by UBSAN.
--- net/netfilter/nf_conntrack_netlink.c | 2 +- net/netfilter/nf_conntrack_proto_sctp.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
net/netfilter/nf_conntrack_netlink.c +1 -1
@@ -3486,7 +3486,7 @@ ctnetlink_change_expect(struct nf_conntrack_expect *x,#if IS_ENABLED (CONFIG_NF_NAT )static const struct nla_policy exp_nat_nla_policy[CTA_EXPECT_NAT_MAX +1 ] = { - [CTA_EXPECT_NAT_DIR ] = { .type =NLA_U32 }, + [CTA_EXPECT_NAT_DIR ] =NLA_POLICY_MAX (NLA_BE32 ,IP_CT_DIR_REPLY ), [CTA_EXPECT_NAT_TUPLE ] = { .type =NLA_NESTED }, };#endif
net/netfilter/nf_conntrack_proto_sctp.c +2 -1
@@ -600,7 +600,8 @@ static int sctp_to_nlattr(struct sk_buff *skb, struct nlattr *nla, }static const struct nla_policy sctp_nla_policy[CTA_PROTOINFO_SCTP_MAX +1 ] = { - [CTA_PROTOINFO_SCTP_STATE ] = { .type =NLA_U8 }, + [CTA_PROTOINFO_SCTP_STATE ] =NLA_POLICY_MAX (NLA_U8 , +SCTP_CONNTRACK_HEARTBEAT_SENT ), [CTA_PROTOINFO_SCTP_VTAG_ORIGINAL ] = { .type =NLA_U32 }, [CTA_PROTOINFO_SCTP_VTAG_REPLY ] = { .type =NLA_U32 }, };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 43/776 MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Bogendoerfer <[email protected]>
commit 841ecc979b18d3227fad5e2d6a1e6f92688776b5 upstream.
Owing to Config4.MMUSizeExt and VTLB/FTLB MMU features later MIPSr2+ cores can have more than 64 TLB entries. Therefore allocate an array for uniquification instead of placing too an small array on the stack.
--- arch/mips/mm/tlb-r4k.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
arch/mips/mm/tlb-r4k.c +16 -2
@@ -12,6 +12,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/smp.h> +#include <linux/memblock.h> #include <linux/mm.h> #include <linux/hugetlb.h> #include <linux/export.h>
@@ -512,17 +513,26 @@ static int r4k_vpn_cmp(const void *a, const void *b)* Initialise all TLB entries with unique values that do not clash with * what we have been handed over and what we'll be using ourselves. */ -static void r4k_tlb_uniquify (void ) +static void __ref r4k_tlb_uniquify (void ) { -unsigned long tlb_vpns[1 <<MIPS_CONF1_TLBS_SIZE ];int tlbsize = current_cpu_data.tlbsize; +bool use_slab =slab_is_available ();int start =num_wired_entries (); +phys_addr_t tlb_vpn_size; +unsigned long *tlb_vpns;unsigned long vpn_mask;int cnt, ent, idx, i; vpn_mask =GENMASK (cpu_vmbits -1 ,13 ); vpn_mask |=IS_ENABLED (CONFIG_64BIT ) ?3ULL <<62 :1 <<31 ; + tlb_vpn_size = tlbsize *sizeof (*tlb_vpns); + tlb_vpns = (use_slab ? +kmalloc (tlb_vpn_size,GFP_KERNEL ) : +memblock_alloc_raw (tlb_vpn_size,sizeof (*tlb_vpns))); +if (WARN_ON (!tlb_vpns)) +return ;/* Pray local_flush_tlb_all() is good enough. */ +htw_stop ();for (i = start, cnt =0 ; i < tlbsize; i++, cnt++) {
@@ -575,6 +585,10 @@ static void r4k_tlb_uniquify(void)tlbw_use_hazard ();htw_start ();flush_micro_tlb (); +if (use_slab) +kfree (tlb_vpns); +else +memblock_free_ptr (tlb_vpns, tlb_vpn_size); }/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 44/776 mips: mm: Allocate tlb_vpn array atomically
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wiehler <[email protected]>
commit 01cc50ea5167bb14117257ec084637abe9e5f691 upstream.
Found by DEBUG_ATOMIC_SLEEP:
BUG: sleeping function called from invalid context at /include/linux/sched/mm.h:306
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
no locks held by swapper/1/0.
irq event stamp: 0
hardirqs last enabled at (0): [<0000000000000000>] 0x0
hardirqs last disabled at (0): [<ffffffff801477fc>] copy_process+0x75c/0x1b68
softirqs last enabled at (0): [<ffffffff801477fc>] copy_process+0x75c/0x1b68
softirqs last disabled at (0): [<0000000000000000>] 0x0
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.6.119-d79e757675ec-fct #1
Stack : 800000000290bad8 0000000000000000 0000000000000008 800000000290bae8
800000000290bae8 800000000290bc78 0000000000000000 0000000000000000
ffffffff80c80000 0000000000000001 ffffffff80d8dee8 ffffffff810d09c0
784bb2a7ec10647d 0000000000000010 ffffffff80a6fd60 8000000001d8a9c0
0000000000000000 0000000000000000 ffffffff80d90000 0000000000000000
ffffffff80c9e0e8 0000000007ffffff 0000000000000cc0 0000000000000400
ffffffffffffffff 0000000000000001 0000000000000002 ffffffffc0149ed8
fffffffffffffffe 8000000002908000 800000000290bae0 ffffffff80a81b74
ffffffff80129fb0 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 ffffffff80129fd0 0000000000000000
...
Call Trace:
[<ffffffff80129fd0>] show_stack+0x60/0x158
[<ffffffff80a7f894>] dump_stack_lvl+0x88/0xbc
[<ffffffff8018d3c8>] __might_resched+0x268/0x288
[<ffffffff803648b0>] __kmem_cache_alloc_node+0x2e0/0x330
[<ffffffff80302788>] __kmalloc+0x58/0xd0
[<ffffffff80a81b74>] r4k_tlb_uniquify+0x7c/0x428
[<ffffffff80143e8c>] tlb_init+0x7c/0x110
[<ffffffff8012bdb4>] per_cpu_trap_init+0x16c/0x1d0
[<ffffffff80133258>] start_secondary+0x28/0x128--- arch/mips/mm/tlb-r4k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/mm/tlb-r4k.c +1 -1
@@ -528,7 +528,7 @@ static void __ref r4k_tlb_uniquify(void) tlb_vpn_size = tlbsize *sizeof (*tlb_vpns); tlb_vpns = (use_slab ? -kmalloc (tlb_vpn_size,GFP_KERNEL ) : +kmalloc (tlb_vpn_size,GFP_ATOMIC ) :memblock_alloc_raw (tlb_vpn_size,sizeof (*tlb_vpns)));if (WARN_ON (!tlb_vpns))return ;/* Pray local_flush_tlb_all() is good enough. */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 45/776 MIPS: Always record SEGBITS in cpu_data.vmbits
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej W. Rozycki <[email protected]>
commit 8374c2cb83b95b3c92f129fd56527225c20a058c upstream.
With a 32-bit kernel running on 64-bit MIPS hardware the hardcoded value of `cpu_vmbits' only records the size of compatibility useg and does not reflect the size of native xuseg or the complete range of values allowed in the VPN2 field of TLB entries.
An upcoming change will need the actual VPN2 value range permitted even in 32-bit kernel configurations, so always include the vmbits' member in struct cpuinfo_mips' and probe for SEGBITS when running on 64-bit hardware and resorting to the currently hardcoded value of 31 on 32-bit processors. No functional change for users of `cpu_vmbits'.
--- arch/mips/include/asm/cpu-features.h | 1 - arch/mips/include/asm/cpu-info.h | 2 -- arch/mips/include/asm/mipsregs.h | 2 ++ arch/mips/kernel/cpu-probe.c | 13 ++++++++----- arch/mips/kernel/cpu-r3k-probe.c | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-)
arch/mips/include/asm/cpu-features.h +0 -1
@@ -484,7 +484,6 @@# endif # ifndef cpu_vmbits# define cpu_vmbits cpu_data[0].vmbits -# define __NEED_VMBITS_PROBE# endif #endif
arch/mips/include/asm/cpu-info.h +0 -2
@@ -80,9 +80,7 @@ struct cpuinfo_mips {int srsets;/* Shadow register sets */ int package;/* physical package number */ unsigned int globalnumber; -#ifdef CONFIG_64BIT int vmbits;/* Virtual memory size in bits */ -#endif void *data;/* Additional data */ unsigned int watch_reg_count;/* Number that exist */ unsigned int watch_reg_use_cnt;/* Usable by ptrace */
arch/mips/include/asm/mipsregs.h +2 -0
@@ -1719,6 +1719,8 @@ do { \#define read_c0_entryhi () __read_ulong_c0_register($10, 0)#define write_c0_entryhi (val) __write_ulong_c0_register($10, 0, val) +#define read_c0_entryhi_64 () __read_64bit_c0_register($10, 0) +#define write_c0_entryhi_64 (val) __write_64bit_c0_register($10, 0, val)#define read_c0_guestctl1 () __read_32bit_c0_register($10, 4)#define write_c0_guestctl1 (val) __write_32bit_c0_register($10, 4, val)
arch/mips/kernel/cpu-probe.c +8 -5
@@ -208,11 +208,14 @@ static inline void set_elf_base_platform(const char *plat)static inline void cpu_probe_vmbits (struct cpuinfo_mips *c) { -#ifdef __NEED_VMBITS_PROBE -write_c0_entryhi (0x3fffffffffffe000ULL ); -back_to_back_c0_hazard (); - c->vmbits =fls64 (read_c0_entryhi () &0x3fffffffffffe000ULL ); -#endif +int vmbits =31 ; + +if (cpu_has_64bits) { +write_c0_entryhi_64 (0x3fffffffffffe000ULL ); +back_to_back_c0_hazard (); + vmbits =fls64 (read_c0_entryhi_64 () &0x3fffffffffffe000ULL ); + } + c->vmbits = vmbits; }static void set_isa (struct cpuinfo_mips *c,unsigned int isa)
arch/mips/kernel/cpu-r3k-probe.c +2 -0
@@ -160,6 +160,8 @@ void cpu_probe(void)else cpu_set_nofpu_opts (c); + c->vmbits =31 ; +reserve_exception_space (0 ,0x400 ); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 46/776 MIPS: mm: Suppress TLB uniquification on EHINV hardware
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej W. Rozycki <[email protected]>
commit 74283cfe216392c7b776ebf6045b5b15ed9dffcd upstream.
Hardware that supports the EHINV feature, mandatory for R6 ISA and FTLB implementation, lets software mark TLB entries invalid, which eliminates the need to ensure no duplicate matching entries are ever created. This feature is already used by local_flush_tlb_all(), via the UNIQUE_ENTRYHI macro, making the preceding call to r4k_tlb_uniquify() superfluous.
The next change will also modify uniquification code such that it'll become incompatible with the FTLB and MMID features, as well as MIPSr6 CPUs that do not implement 4KiB pages.
Therefore prevent r4k_tlb_uniquify() from being used on EHINV hardware, as denoted by `cpu_has_tlbinv'.
--- arch/mips/mm/tlb-r4k.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/mm/tlb-r4k.c +2 -1
@@ -630,7 +630,8 @@ static void r4k_tlb_configure(void) temp_tlb_entry = current_cpu_data.tlbsize -1 ;/* From this point on the ARC firmware is dead. */ -r4k_tlb_uniquify (); +if (!cpu_has_tlbinv) +r4k_tlb_uniquify ();local_flush_tlb_all ();/* Did I tell you that ARC SUCKS? */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 47/776 MIPS: mm: Rewrite TLB uniquification for the hidden bit feature
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej W. Rozycki <[email protected]>
commit 540760b77b8fc49d39d1b2b76196e5ec57711a32 upstream.
Before the introduction of the EHINV feature, which lets software mark TLB entries invalid, certain older implementations of the MIPS ISA were equipped with an analogous bit, as a vendor extension, which however is hidden from software and only ever set at reset, and then any software write clears it, making the intended TLB entry valid.
This feature makes it unsafe to read a TLB entry with TLBR, modify the page mask, and write the entry back with TLBWI, because this operation will implicitly clear the hidden bit and this may create a duplicate entry, as with the presence of the hidden bit there is no guarantee all the entries across the TLB are unique each.
Usually the firmware has already uniquified TLB entries before handing control over, in which case we only need to guarantee at bootstrap no clash will happen with the VPN2 values chosen in local_flush_tlb_all().
However with systems such as Mikrotik RB532 we get handed the TLB as at reset, with the hidden bit set across the entries and possibly duplicate entries present. This then causes a machine check exception when page sizes are reset in r4k_tlb_uniquify() and prevents the system from booting.
Rewrite the algorithm used in r4k_tlb_uniquify() then such as to avoid the reuse of ASID/VPN values across the TLB. Get rid of global entries first as they may be blocking the entire address space, e.g. 16 256MiB pages will exhaust the whole address space of a 32-bit CPU and a single big page can exhaust the 32-bit compatibility space on a 64-bit CPU.
Details of the algorithm chosen are given across the code itself.
--- arch/mips/mm/tlb-r4k.c | 282 +++++++++++++++++++++++++++++++++-------- 1 file changed, 228 insertions(+), 54 deletions(-)
arch/mips/mm/tlb-r4k.c +228 -54
@@ -13,6 +13,7 @@#include <linux/sched.h> #include <linux/smp.h> #include <linux/memblock.h> +#include <linux/minmax.h> #include <linux/mm.h> #include <linux/hugetlb.h> #include <linux/export.h>
@@ -24,6 +25,7 @@#include <asm/hazards.h> #include <asm/mmu_context.h> #include <asm/tlb.h> +#include <asm/tlbdebug.h> #include <asm/tlbmisc.h> extern void build_tlb_refill_handler (void );
@@ -501,87 +503,259 @@ static int __init set_ntlb(char *str)__setup ("ntlb=" , set_ntlb); -/* Comparison function for EntryHi VPN fields. */ -static int r4k_vpn_cmp (const void *a,const void *b) +/* The start bit position of VPN2 and Mask in EntryHi/PageMask registers. */ +#define VPN2_SHIFT 13 + +/* Read full EntryHi even with CONFIG_32BIT. */ +static inline unsigned long long read_c0_entryhi_native (void ) +{ +return cpu_has_64bits ?read_c0_entryhi_64 () :read_c0_entryhi (); +} + +/* Write full EntryHi even with CONFIG_32BIT. */ +static inline void write_c0_entryhi_native (unsigned long long v) { -long v = *(unsigned long *)a - *(unsigned long *)b; -int s =sizeof (long ) >sizeof (int ) ?sizeof (long ) *8 -1 :0 ; -return s ? (v !=0 ) | v >> s : v; +if (cpu_has_64bits) +write_c0_entryhi_64 (v); +else +write_c0_entryhi (v); } +/* TLB entry state for uniquification. */ +struct tlbent { +unsigned long long wired:1 ; +unsigned long long global:1 ; +unsigned long long asid:10 ; +unsigned long long vpn:51 ; +unsigned long long pagesz:5 ; +unsigned long long index:14 ; +}; +/* -* Initialise all TLB entries with unique values that do not clash with -* what we have been handed over and what we'll be using ourselves. +* Comparison function for TLB entry sorting. Place wired entries first, +* then global entries, then order by the increasing VPN/ASID and the +* decreasing page size. This lets us avoid clashes with wired entries +* easily and get entries for larger pages out of the way first. +* +* We could group bits so as to reduce the number of comparisons, but this +* is seldom executed and not performance-critical, so prefer legibility. */ -static void __ref r4k_tlb_uniquify (void ) +static int r4k_entry_cmp (const void *a,const void *b) { -int tlbsize = current_cpu_data.tlbsize; -bool use_slab =slab_is_available (); -int start =num_wired_entries (); -phys_addr_t tlb_vpn_size; -unsigned long *tlb_vpns; -unsigned long vpn_mask; -int cnt, ent, idx, i; - - vpn_mask =GENMASK (cpu_vmbits -1 ,13 ); - vpn_mask |=IS_ENABLED (CONFIG_64BIT ) ?3ULL <<62 :1 <<31 ; +struct tlbent ea = *(struct tlbent *)a, eb = *(struct tlbent *)b; + +if (ea.wired > eb.wired) +return -1 ; +else if (ea.wired < eb.wired) +return 1 ; +else if (ea.global > eb.global) +return -1 ; +else if (ea.global < eb.global) +return 1 ; +else if (ea.vpn < eb.vpn) +return -1 ; +else if (ea.vpn > eb.vpn) +return 1 ; +else if (ea.asid < eb.asid) +return -1 ; +else if (ea.asid > eb.asid) +return 1 ; +else if (ea.pagesz > eb.pagesz) +return -1 ; +else if (ea.pagesz < eb.pagesz) +return 1 ; +else +return 0 ; +} - tlb_vpn_size = tlbsize *sizeof (*tlb_vpns); - tlb_vpns = (use_slab ? -kmalloc (tlb_vpn_size,GFP_ATOMIC ) : -memblock_alloc_raw (tlb_vpn_size,sizeof (*tlb_vpns))); -if (WARN_ON (!tlb_vpns)) -return ;/* Pray local_flush_tlb_all() is good enough. */ +/* +* Fetch all the TLB entries. Mask individual VPN values retrieved with +* the corresponding page mask and ignoring any 1KiB extension as we'll +* be using 4KiB pages for uniquification. +*/ +static void __ref r4k_tlb_uniquify_read (struct tlbent *tlb_vpns,int tlbsize) +{ +int start =num_wired_entries (); +unsigned long long vpn_mask; +bool global; +int i; -htw_stop (); + vpn_mask =GENMASK (current_cpu_data.vmbits -1 ,VPN2_SHIFT ); + vpn_mask |= cpu_has_64bits ?3ULL <<62 :1 <<31 ; -for (i = start, cnt =0 ; i < tlbsize; i++, cnt++) { -unsigned long vpn; +for (i =0 ; i < tlbsize; i++) { +unsigned long long entryhi, vpn, mask, asid; +unsigned int pagesz;write_c0_index (i);mtc0_tlbr_hazard ();tlb_read ();tlb_read_hazard (); - vpn =read_c0_entryhi (); - vpn &= vpn_mask &PAGE_MASK ; - tlb_vpns[cnt] = vpn; -/* Prevent any large pages from overlapping regular ones. */ -write_c0_pagemask (read_c0_pagemask () &PM_DEFAULT_MASK ); -mtc0_tlbw_hazard (); -tlb_write_indexed (); -tlbw_use_hazard (); + global = !!(read_c0_entrylo0 () &ENTRYLO_G ); + entryhi =read_c0_entryhi_native (); + mask =read_c0_pagemask (); + + asid = entryhi &cpu_asid_mask (¤t_cpu_data); + vpn = (entryhi & vpn_mask & ~mask) >>VPN2_SHIFT ; + pagesz =ilog2 ((mask >>VPN2_SHIFT ) +1 ); + + tlb_vpns[i].global = global; + tlb_vpns[i].asid = global ?0 : asid; + tlb_vpns[i].vpn = vpn; + tlb_vpns[i].pagesz = pagesz; + tlb_vpns[i].wired = i < start; + tlb_vpns[i].index = i; } +} -sort (tlb_vpns, cnt,sizeof (tlb_vpns[0 ]), r4k_vpn_cmp,NULL ); +/* +* Write unique values to all but the wired TLB entries each, using +* the 4KiB page size. This size might not be supported with R6, but +* EHINV is mandatory for R6, so we won't ever be called in that case. +* +* A sorted table is supplied with any wired entries at the beginning, +* followed by any global entries, and then finally regular entries. +* We start at the VPN and ASID values of zero and only assign user +* addresses, therefore guaranteeing no clash with addresses produced +* by UNIQUE_ENTRYHI. We avoid any VPN values used by wired or global +* entries, by increasing the VPN value beyond the span of such entry. +* +* When a VPN/ASID clash is found with a regular entry we increment the +* ASID instead until no VPN/ASID clash has been found or the ASID space +* has been exhausted, in which case we increase the VPN value beyond +* the span of the largest clashing entry. +* +* We do not need to be concerned about FTLB or MMID configurations as +* those are required to implement the EHINV feature. +*/ +static void __ref r4k_tlb_uniquify_write (struct tlbent *tlb_vpns,int tlbsize) +{ +unsigned long long asid, vpn, vpn_size, pagesz; +int widx, gidx, idx, sidx, lidx, i; -write_c0_pagemask (PM_DEFAULT_MASK ); + vpn_size =1ULL << (current_cpu_data.vmbits -VPN2_SHIFT ); + pagesz =ilog2 ((PM_4K >>VPN2_SHIFT ) +1 ); + +write_c0_pagemask (PM_4K );write_c0_entrylo0 (0 );write_c0_entrylo1 (0 ); - idx =0 ; - ent = tlbsize; -for (i = start; i < tlbsize; i++) -while (1 ) { -unsigned long entryhi, vpn; + asid =0 ; + vpn =0 ; + widx =0 ; + gidx =0 ; +for (sidx =0 ; sidx < tlbsize && tlb_vpns[sidx].wired; sidx++) + ; +for (lidx = sidx; lidx < tlbsize && tlb_vpns[lidx].global; lidx++) + ; + idx = gidx = sidx +1 ; +for (i = sidx; i < tlbsize; i++) { +unsigned long long entryhi, vpn_pagesz =0 ; - entryhi =UNIQUE_ENTRYHI (ent); - vpn = entryhi & vpn_mask &PAGE_MASK ; +while (1 ) { +if (WARN_ON (vpn >= vpn_size)) { +dump_tlb_all (); +/* Pray local_flush_tlb_all() will cope. */ +return ; + } -if (idx >= cnt || vpn < tlb_vpns[idx]) { -write_c0_entryhi (entryhi); -write_c0_index (i); -mtc0_tlbw_hazard (); -tlb_write_indexed (); - ent++; -break ; - }else if (vpn == tlb_vpns[idx]) { - ent++; - }else { +/* VPN must be below the next wired entry. */ +if (widx < sidx && vpn >= tlb_vpns[widx].vpn) { + vpn =max (vpn, + (tlb_vpns[widx].vpn + + (1ULL << tlb_vpns[widx].pagesz))); + asid =0 ; + widx++; +continue ; + } +/* VPN must be below the next global entry. */ +if (gidx < lidx && vpn >= tlb_vpns[gidx].vpn) { + vpn =max (vpn, + (tlb_vpns[gidx].vpn + + (1ULL << tlb_vpns[gidx].pagesz))); + asid =0 ; + gidx++; +continue ; + } +/* Try to find a free ASID so as to conserve VPNs. */ +if (idx < tlbsize && vpn == tlb_vpns[idx].vpn && + asid == tlb_vpns[idx].asid) { +unsigned long long idx_pagesz; + + idx_pagesz = tlb_vpns[idx].pagesz; + vpn_pagesz =max (vpn_pagesz, idx_pagesz); +do + idx++; +while (idx < tlbsize && + vpn == tlb_vpns[idx].vpn && + asid == tlb_vpns[idx].asid); + asid++; +if (asid >cpu_asid_mask (¤t_cpu_data)) { + vpn += vpn_pagesz; + asid =0 ; + vpn_pagesz =0 ; + } +continue ; + } +/* VPN mustn't be above the next regular entry. */ +if (idx < tlbsize && vpn > tlb_vpns[idx].vpn) { + vpn =max (vpn, + (tlb_vpns[idx].vpn + + (1ULL << tlb_vpns[idx].pagesz))); + asid =0 ; idx++; +continue ; } +break ; } + entryhi = (vpn <<VPN2_SHIFT ) | asid; +write_c0_entryhi_native (entryhi); +write_c0_index (tlb_vpns[i].index); +mtc0_tlbw_hazard (); +tlb_write_indexed (); + + tlb_vpns[i].asid = asid; + tlb_vpns[i].vpn = vpn; + tlb_vpns[i].pagesz = pagesz; + + asid++; +if (asid >cpu_asid_mask (¤t_cpu_data)) { + vpn +=1ULL << pagesz; + asid =0 ; + } + } +} + +/* +* Initialise all TLB entries with unique values that do not clash with +* what we have been handed over and what we'll be using ourselves. +*/ +static void __ref r4k_tlb_uniquify (void ) +{ +int tlbsize = current_cpu_data.tlbsize; +bool use_slab =slab_is_available (); +phys_addr_t tlb_vpn_size; +struct tlbent *tlb_vpns; + + tlb_vpn_size = tlbsize *sizeof (*tlb_vpns); + tlb_vpns = (use_slab ? +kmalloc (tlb_vpn_size,GFP_ATOMIC ) : +memblock_alloc_raw (tlb_vpn_size,sizeof (*tlb_vpns))); +if (WARN_ON (!tlb_vpns)) +return ;/* Pray local_flush_tlb_all() is good enough. */ + +htw_stop (); + +r4k_tlb_uniquify_read (tlb_vpns, tlbsize); + +sort (tlb_vpns, tlbsize,sizeof (*tlb_vpns), r4k_entry_cmp,NULL ); + +r4k_tlb_uniquify_write (tlb_vpns, tlbsize); + +write_c0_pagemask (PM_DEFAULT_MASK ); +tlbw_use_hazard ();htw_start ();flush_micro_tlb ();
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 48/776 ALSA: usb-audio: Improve Focusrite sample rate filtering
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geoffrey D. Bennett <[email protected]>
[ Upstream commit 24d2d3c5f94007a5a0554065ab7349bb69e28bcb ]
Replace the bLength == 10 max_rate check in focusrite_valid_sample_rate() with filtering that also examines the bmControls VAL_ALT_SETTINGS bit.
When VAL_ALT_SETTINGS is readable, the device uses strict per-altsetting rate filtering (only the highest rate pair for that altsetting is valid). When it is not readable, all rates up to max_rate are valid.
For devices without the bLength == 10 Format Type descriptor extension but with VAL_ALT_SETTINGS readable and multiple altsettings (only seen in Scarlett 18i8 3rd Gen playback), fall back to the Focusrite
convention: alt 1 = 48kHz, alt 2 = 96kHz, alt 3 = 192kHz.
This produces correct rate tables for all tested Focusrite devices (all Scarlett 2nd, 3rd, and 4th Gen, Clarett+, and Vocaster) using only USB descriptors, allowing QUIRK_FLAG_VALIDATE_RATES to be removed for Focusrite in the next commit.
--- sound/usb/format.c | 86 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 12 deletions(-)
sound/usb/format.c +74 -12
@@ -304,9 +304,37 @@ static bool s1810c_valid_sample_rate(struct audioformat *fp, }/* -* Many Focusrite devices supports a limited set of sampling rates per -* altsetting. Maximum rate is exposed in the last 4 bytes of Format Type -* descriptor which has a non-standard bLength = 10. +* Focusrite devices use rate pairs: 44100/48000, 88200/96000, and +* 176400/192000. Return true if rate is in the pair for max_rate. +*/ +static bool focusrite_rate_pair (unsigned int rate, +unsigned int max_rate) +{ +switch (max_rate) { +case 48000 :return rate ==44100 || rate ==48000 ; +case 96000 :return rate ==88200 || rate ==96000 ; +case 192000 :return rate ==176400 || rate ==192000 ; +default :return true; + } +} + +/* +* Focusrite devices report all supported rates in a single clock +* source but only a subset is valid per altsetting. +* +* Detection uses two descriptor features: +* +* 1. Format Type descriptor bLength == 10: non-standard extension +* with max sample rate in bytes 6..9. +* +* 2. bmControls VAL_ALT_SETTINGS readable bit: when set, the device +* only supports the highest rate pair for that altsetting, and when +* clear, all rates up to max_rate are valid. +* +* For devices without the bLength == 10 extension but with +* VAL_ALT_SETTINGS readable and multiple altsettings (only seen in +* Scarlett 18i8 3rd Gen playback), fall back to the Focusrite +* convention: alt 1 = 48kHz, alt 2 = 96kHz, alt 3 = 192kHz. */ static bool focusrite_valid_sample_rate(struct snd_usb_audio *chip, struct audioformat *fp,
@@ -314,8 +342,10 @@ static bool focusrite_valid_sample_rate(struct snd_usb_audio *chip, {struct usb_interface *iface;struct usb_host_interface *alts; +struct uac2_as_header_descriptor *as;unsigned char *fmt;unsigned int max_rate; +bool val_alt; iface =usb_ifnum_to_if (chip->dev, fp->iface);if (!iface)
@@ -327,26 +357,58 @@ static bool focusrite_valid_sample_rate(struct snd_usb_audio *chip,if (!fmt)return true; + as =snd_usb_find_csint_desc (alts->extra, alts->extralen, +NULL ,UAC_AS_GENERAL ); +if (!as) +return true; + + val_alt =uac_v2v3_control_is_readable (as->bmControls, +UAC2_AS_VAL_ALT_SETTINGS ); +if (fmt[0 ] ==10 ) {/* bLength */ max_rate =combine_quad (&fmt[6 ]); -/* Validate max rate */ -if (max_rate !=48000 && - max_rate !=96000 && - max_rate !=192000 && - max_rate !=384000 ) { - +if (val_alt) +return focusrite_rate_pair (rate, max_rate); + +/* No val_alt: rates fall through from higher */ +switch (max_rate) { +case 192000 : +if (rate ==176400 || rate ==192000 ) +return true; + fallthrough; +case 96000 : +if (rate ==88200 || rate ==96000 ) +return true; + fallthrough; +case 48000 : +return (rate ==44100 || rate ==48000 ); +default :usb_audio_info (chip,"%u:%d : unexpected max rate: %u\n" , fp->iface, fp->altsetting, max_rate); -return true; } + } -return rate <= max_rate; +if (!val_alt) +return true; + +/* Multi-altsetting device with val_alt but no max_rate +* in the format descriptor. Use Focusrite convention: +* alt 1 = 48kHz, alt 2 = 96kHz, alt 3 = 192kHz. +*/ +if (iface->num_altsetting <=2 ) +return true; + +switch (fp->altsetting) { +case 1 : max_rate =48000 ;break ; +case 2 : max_rate =96000 ;break ; +case 3 : max_rate =192000 ;break ; +default :return true; } -return true; +return focusrite_rate_pair (rate, max_rate); }/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 49/776 ALSA: usb-audio: Update for native DSD support quirks
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jussi Laako <[email protected]>
[ Upstream commit f7fea075edfa085c25eb34c44ceacf3602537f98 ]
Maintenance patch for native DSD support.
Remove incorrect T+A device quirks. Move set of device quirks to vendor quirks. Add set of missing device and vendor quirks.
Stable-dep-of: a8cc55bf81a4 ("ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices")
--- sound/usb/quirks.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-)
sound/usb/quirks.c +28 -6
@@ -1631,8 +1631,10 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,/* XMOS based USB DACs */ switch (chip->usb_id) { -case USB_ID (0x1511 ,0x0037 ):/* AURALiC VEGA */ -case USB_ID (0x21ed ,0xd75a ):/* Accuphase DAC-60 option card */ +case USB_ID (0x139f ,0x5504 ):/* Nagra DAC */ +case USB_ID (0x20b1 ,0x3089 ):/* Mola-Mola DAC */ +case USB_ID (0x2522 ,0x0007 ):/* LH Labs Geek Out 1V5 */ +case USB_ID (0x2522 ,0x0009 ):/* LH Labs Geek Pulse X Inifinity 2V0 */ case USB_ID (0x2522 ,0x0012 ):/* LH Labs VI DAC Infinity */ case USB_ID (0x2772 ,0x0230 ):/* Pro-Ject Pre Box S2 Digital */ if (fp->altsetting ==2 )
@@ -1642,14 +1644,18 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,case USB_ID (0x0d8c ,0x0316 ):/* Hegel HD12 DSD */ case USB_ID (0x10cb ,0x0103 ):/* The Bit Opus #3; with fp->dsd_raw */ case USB_ID (0x16d0 ,0x06b2 ):/* NuPrime DAC-10 */ -case USB_ID (0x16d0 ,0x09dd ):/* Encore mDSD */ +case USB_ID (0x16d0 ,0x06b4 ):/* NuPrime Audio HD-AVP/AVA */ case USB_ID (0x16d0 ,0x0733 ):/* Furutech ADL Stratos */ +case USB_ID (0x16d0 ,0x09d8 ):/* NuPrime IDA-8 */ case USB_ID (0x16d0 ,0x09db ):/* NuPrime Audio DAC-9 */ +case USB_ID (0x16d0 ,0x09dd ):/* Encore mDSD */ case USB_ID (0x1db5 ,0x0003 ):/* Bryston BDA3 */ +case USB_ID (0x20a0 ,0x4143 ):/* WaveIO USB Audio 2.0 */ case USB_ID (0x22e1 ,0xca01 ):/* HDTA Serenade DSD */ case USB_ID (0x249c ,0x9326 ):/* M2Tech Young MkIII */ case USB_ID (0x2616 ,0x0106 ):/* PS Audio NuWave DAC */ case USB_ID (0x2622 ,0x0041 ):/* Audiolab M-DAC+ */ +case USB_ID (0x278b ,0x5100 ):/* Rotel RC-1590 */ case USB_ID (0x27f7 ,0x3002 ):/* W4S DAC-2v2SE */ case USB_ID (0x29a2 ,0x0086 ):/* Mutec MC3+ USB */ case USB_ID (0x6b42 ,0x0042 ):/* MSB Technology */
@@ -1659,9 +1665,6 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,/* Amanero Combo384 USB based DACs with native DSD support */ case USB_ID (0x16d0 ,0x071a ):/* Amanero - Combo384 */ -case USB_ID (0x2ab6 ,0x0004 ):/* T+A DAC8DSD-V2.0, MP1000E-V2.0, MP2000R-V2.0, MP2500R-V2.0, MP3100HV-V2.0 */ -case USB_ID (0x2ab6 ,0x0005 ):/* T+A USB HD Audio 1 */ -case USB_ID (0x2ab6 ,0x0006 ):/* T+A USB HD Audio 2 */ if (fp->altsetting ==2 ) {switch (le16_to_cpu (chip->dev->descriptor.bcdDevice)) {case 0x199 :
@@ -1817,6 +1820,9 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_IFACE_DELAY),DEVICE_FLG (0x0644 ,0x805f ,/* TEAC Model 12 */ QUIRK_FLAG_FORCE_IFACE_RESET ), +DEVICE_FLG (0x0644 ,0x806b ,/* TEAC UD-701 */ +QUIRK_FLAG_ITF_USB_DSD_DAC |QUIRK_FLAG_CTL_MSG_DELAY | +QUIRK_FLAG_IFACE_DELAY ),DEVICE_FLG (0x06f8 ,0xb000 ,/* Hercules DJ Console (Windows Edition) */ QUIRK_FLAG_IGNORE_CTL_ERROR ), DEVICE_FLG(0x06f8, 0xd002, /* Hercules DJ Console (Macintosh Edition) */
@@ -1873,6 +1879,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY),DEVICE_FLG (0x154e ,0x3006 ,/* Marantz SA-14S1 */ QUIRK_FLAG_ITF_USB_DSD_DAC |QUIRK_FLAG_CTL_MSG_DELAY ), +DEVICE_FLG (0x154e ,0x300b ,/* Marantz SA-KI RUBY / SA-12 */ +QUIRK_FLAG_DSD_RAW ),DEVICE_FLG (0x154e ,0x500e ,/* Denon DN-X1600 */ QUIRK_FLAG_IGNORE_CLOCK_SOURCE ), DEVICE_FLG(0x1686, 0x00dd, /* Zoom R16/24 */
@@ -1929,6 +1937,10 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),DEVICE_FLG (0x21b4 ,0x0081 ,/* AudioQuest DragonFly */ QUIRK_FLAG_GET_SAMPLE_RATE ), +DEVICE_FLG (0x21b4 ,0x0230 ,/* Ayre QB-9 Twenty */ +QUIRK_FLAG_DSD_RAW ), +DEVICE_FLG (0x21b4 ,0x0232 ,/* Ayre QX-5 Twenty */ +QUIRK_FLAG_DSD_RAW ),DEVICE_FLG (0x2522 ,0x0007 ,/* LH Labs Geek Out HD Audio 1V5 */ QUIRK_FLAG_SET_IFACE_FIRST ), DEVICE_FLG(0x262a, 0x9302, /* ddHiFi TC44C */
@@ -1971,12 +1983,18 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_VALIDATE_RATES),VENDOR_FLG (0x1235 ,/* Focusrite Novation */ QUIRK_FLAG_VALIDATE_RATES ), +VENDOR_FLG (0x1511 ,/* AURALiC */ +QUIRK_FLAG_DSD_RAW ),VENDOR_FLG (0x152a ,/* Thesycon devices */ QUIRK_FLAG_DSD_RAW ), +VENDOR_FLG (0x18d1 ,/* iBasso devices */ +QUIRK_FLAG_DSD_RAW ),VENDOR_FLG (0x1de7 ,/* Phoenix Audio */ QUIRK_FLAG_GET_SAMPLE_RATE ),VENDOR_FLG (0x20b1 ,/* XMOS based devices */ QUIRK_FLAG_DSD_RAW ), +VENDOR_FLG (0x21ed ,/* Accuphase Laboratory */ +QUIRK_FLAG_DSD_RAW ),VENDOR_FLG (0x22d9 ,/* Oppo */ QUIRK_FLAG_DSD_RAW ), VENDOR_FLG(0x23ba, /* Playback Design */
@@ -1992,10 +2010,14 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_DSD_RAW),VENDOR_FLG (0x2ab6 ,/* T+A devices */ QUIRK_FLAG_DSD_RAW ), +VENDOR_FLG (0x2d87 ,/* Cayin device */ +QUIRK_FLAG_DSD_RAW ),VENDOR_FLG (0x3336 ,/* HEM devices */ QUIRK_FLAG_DSD_RAW ),VENDOR_FLG (0x3353 ,/* Khadas devices */ QUIRK_FLAG_DSD_RAW ), +VENDOR_FLG (0x35f4 ,/* MSB Technology */ +QUIRK_FLAG_DSD_RAW ),VENDOR_FLG (0x3842 ,/* EVGA */ QUIRK_FLAG_DSD_RAW ), VENDOR_FLG(0xc502, /* HiBy devices */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 50/776 ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geoffrey D. Bennett <[email protected]>
[ Upstream commit a8cc55bf81a45772cad44c83ea7bb0e98431094a ]
Remove QUIRK_FLAG_VALIDATE_RATES for Focusrite. With the previous commit, focusrite_valid_sample_rate() produces correct rate tables without USB probing.
QUIRK_FLAG_VALIDATE_RATES sends SET_CUR requests for each rate (~25ms each) and leaves the device at 192kHz. This is a problem because that
rate: 1) disables the internal mixer, so outputs are silent until an application opens the PCM and sets a lower rate, and 2) the Air and Safe modes get disabled.
--- sound/usb/quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/quirks.c +1 -1
@@ -1982,7 +1982,7 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {VENDOR_FLG (0x07fd ,/* MOTU */ QUIRK_FLAG_VALIDATE_RATES ),VENDOR_FLG (0x1235 ,/* Focusrite Novation */ -QUIRK_FLAG_VALIDATE_RATES ), +0 ),VENDOR_FLG (0x1511 ,/* AURALiC */ QUIRK_FLAG_DSD_RAW ), VENDOR_FLG(0x152a, /* Thesycon devices */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 51/776 batman-adv: hold claim backbone gateways by reference
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haoze Xie <[email protected]>
commit 82d8701b2c930d0e96b0dbc9115a218d791cb0d2 upstream.
batadv_bla_add_claim() can replace claim->backbone_gw and drop the old gateway's last reference while readers still follow the pointer.
The netlink claim dump path dereferences claim->backbone_gw->orig and takes claim->backbone_gw->crc_lock without pinning the underlying backbone gateway. batadv_bla_check_claim() still has the same naked pointer access pattern.
Reuse batadv_bla_claim_get_backbone_gw() in both readers so they operate on a stable gateway reference until the read-side work is complete. This keeps the dump and claim-check paths aligned with the lifetime rules introduced for the other BLA claim readers.
--- net/batman-adv/bridge_loop_avoidance.c | 27 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
net/batman-adv/bridge_loop_avoidance.c +18 -9
@@ -2131,6 +2131,7 @@ batadv_bla_claim_dump_entry(struct sk_buff *msg, u32 portid, struct batadv_bla_claim *claim) {u8 *primary_addr = primary_if->net_dev->dev_addr; +struct batadv_bla_backbone_gw *backbone_gw;u16 backbone_crc;bool is_own;void *hdr;
@@ -2146,32 +2147,35 @@ batadv_bla_claim_dump_entry(struct sk_buff *msg, u32 portid,genl_dump_check_consistent (cb, hdr); - is_own =batadv_compare_eth (claim->backbone_gw->orig, - primary_addr); + backbone_gw =batadv_bla_claim_get_backbone_gw (claim); + + is_own =batadv_compare_eth (backbone_gw->orig, primary_addr); -spin_lock_bh (&claim->backbone_gw->crc_lock); - backbone_crc = claim->backbone_gw->crc; -spin_unlock_bh (&claim->backbone_gw->crc_lock); +spin_lock_bh (&backbone_gw->crc_lock); + backbone_crc = backbone_gw->crc; +spin_unlock_bh (&backbone_gw->crc_lock);if (is_own)if (nla_put_flag (msg,BATADV_ATTR_BLA_OWN )) {genlmsg_cancel (msg, hdr); - goto out; + goto put_backbone_gw; }if (nla_put (msg,BATADV_ATTR_BLA_ADDRESS ,ETH_ALEN , claim->addr) ||nla_put_u16 (msg,BATADV_ATTR_BLA_VID , claim->vid) ||nla_put (msg,BATADV_ATTR_BLA_BACKBONE ,ETH_ALEN , - claim->backbone_gw->orig) || + backbone_gw->orig) ||nla_put_u16 (msg,BATADV_ATTR_BLA_CRC , backbone_crc)) {genlmsg_cancel (msg, hdr); - goto out; + goto put_backbone_gw; }genlmsg_end (msg, hdr); ret =0 ; +put_backbone_gw: +batadv_backbone_gw_put (backbone_gw); out:return ret; }
@@ -2467,6 +2471,7 @@ int batadv_bla_backbone_dump(struct sk_buff *msg, struct netlink_callback *cb)bool batadv_bla_check_claim (struct batadv_priv *bat_priv,u8 *addr,unsigned short vid) { +struct batadv_bla_backbone_gw *backbone_gw;struct batadv_bla_claim search_claim;struct batadv_bla_claim *claim =NULL ;struct batadv_hard_iface *primary_if =NULL ;
@@ -2489,9 +2494,13 @@ bool batadv_bla_check_claim(struct batadv_priv *bat_priv,* return false. */ if (claim) { -if (!batadv_compare_eth (claim->backbone_gw->orig, + backbone_gw =batadv_bla_claim_get_backbone_gw (claim); + +if (!batadv_compare_eth (backbone_gw->orig, primary_if->net_dev->dev_addr)) ret = false; + +batadv_backbone_gw_put (backbone_gw);batadv_claim_put (claim); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 52/776 nfc: llcp: add missing return after LLCP_CLOSED checks
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxi Qian <[email protected]>
commit 2b5dd4632966c39da6ba74dbc8689b309065e82c upstream.
In nfc_llcp_recv_hdlc() and nfc_llcp_recv_disc(), when the socket state is LLCP_CLOSED, the code correctly calls release_sock() and nfc_llcp_sock_put() but fails to return. Execution falls through to the remainder of the function, which calls release_sock() and nfc_llcp_sock_put() again. This results in a double release_sock() and a refcount underflow via double nfc_llcp_sock_put(), leading to a use-after-free.
Add the missing return statements after the LLCP_CLOSED branches in both functions to prevent the fall-through.
--- net/nfc/llcp_core.c | 2 ++ 1 file changed, 2 insertions(+)
net/nfc/llcp_core.c +2 -0
@@ -1098,6 +1098,7 @@ static void nfc_llcp_recv_hdlc(struct nfif (sk->sk_state ==LLCP_CLOSED ) {release_sock (sk);nfc_llcp_sock_put (llcp_sock); +return ; }/* Pass the payload upstream */
@@ -1189,6 +1190,7 @@ static void nfc_llcp_recv_disc(struct nfif (sk->sk_state ==LLCP_CLOSED ) {release_sock (sk);nfc_llcp_sock_put (llcp_sock); +return ; }if (sk->sk_state ==LLCP_CONNECTED ) {
Greg Kroah-Hartman
maintainerPATCH 53/776 can: raw: fix ro->uniq use-after-free in raw_rcv()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Page <[email protected]>
commit a535a9217ca3f2fccedaafb2fddb4c48f27d36dc upstream.
raw_release() unregisters raw CAN receive filters via can_rx_unregister(), but receiver deletion is deferred with call_rcu(). This leaves a window where raw_rcv() may still be running in an RCU read-side critical section after raw_release() frees ro->uniq, leading to a use-after-free of the percpu uniq storage.
Move free_percpu(ro->uniq) out of raw_release() and into a raw-specific socket destructor. can_rx_unregister() takes an extra reference to the socket and only drops it from the RCU callback, so freeing uniq from sk_destruct ensures the percpu area is not released until the relevant callbacks have drained.
--- net/can/raw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
net/can/raw.c +10 -1
@@ -333,6 +333,14 @@ static int raw_notifier(struct notifier_return NOTIFY_DONE ; } +static void raw_sock_destruct (struct sock *sk) +{ +struct raw_sock *ro =raw_sk (sk); + +free_percpu (ro->uniq); +can_sock_destruct (sk); +} +static int raw_init (struct sock *sk) {struct raw_sock *ro =raw_sk (sk);
@@ -358,6 +366,8 @@ static int raw_init(struct sock *sk)if (unlikely (!ro->uniq))return -ENOMEM ; + sk->sk_destruct = raw_sock_destruct; +/* set notifier */ spin_lock (&raw_notifier_lock);list_add_tail (&ro->notifier, &raw_notifier_list);
@@ -405,7 +415,6 @@ static int raw_release(struct socket *so ro->bound =0 ; ro->dev =NULL ; ro->count =0 ; -free_percpu (ro->uniq);sock_orphan (sk); sock->sk =NULL ;
Greg Kroah-Hartman
maintainerPATCH 54/776 i2c: s3c24xx: check the size of the SMBUS message before using it
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit c0128c7157d639a931353ea344fb44aad6d6e17a upstream.
The first byte of an i2c SMBUS message is the size, and it should be verified to ensure that it is in the range of 0..I2C_SMBUS_BLOCK_MAX before processing it.
This is the same logic that was added in commit a6e04f05ce0b ("i2c:
tegra: check msg length in SMBUS block read") to the i2c tegra driver.
--- drivers/i2c/busses/i2c-s3c2410.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-s3c2410.c +6 -1
@@ -508,8 +508,13 @@ static int i2c_s3c_irq_nextbyte(struct s i2c->msg->buf[i2c->msg_ptr++] = byte;/* Add actual length to read for smbus block read */ -if (i2c->msg->flags &I2C_M_RECV_LEN && i2c->msg->len ==1 ) +if (i2c->msg->flags &I2C_M_RECV_LEN && i2c->msg->len ==1 ) { +if (byte ==0 || byte >I2C_SMBUS_BLOCK_MAX ) { +s3c24xx_i2c_stop (i2c, -EPROTO ); +break ; + } i2c->msg->len += byte; + } prepare_read:if (is_msglast (i2c)) {/* last byte of buffer */
Greg Kroah-Hartman
maintainerPATCH 55/776 staging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin YuChen <[email protected]>
commit 8c964b82a4e97ec7f25e17b803ee196009b38a57 upstream.
Initialize le_tmp64 to zero in rtw_BIP_verify() to prevent using uninitialized data.
Smatch warns that only 6 bytes are copied to this 8-byte (u64) variable, leaving the last two bytes uninitialized:
drivers/staging/rtl8723bs/core/rtw_security.c:1308 rtw_BIP_verify()
warn: not copying enough bytes for '&le_tmp64' (8 vs 6 bytes)
Initializing the variable at the start of the function fixes this warning and ensures predictable behavior.
--- drivers/staging/rtl8723bs/core/rtw_security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_security.c +1 -1
@@ -1364,7 +1364,7 @@ u32 rtw_BIP_verify(struct adapter *padapu8 mic[16 ];struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;__le16 le_tmp; -__le64 le_tmp64; +__le64 le_tmp64 =0 ; ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN +BIP_AAD_SIZE ;BIP_AAD =rtw_zmalloc (ori_len);
Greg Kroah-Hartman
maintainerPATCH 56/776 HID: alps: fix NULL pointer dereference in alps_raw_event()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 1badfc4319224820d5d890f8eab6aa52e4e83339 upstream.
Commit ecfa6f34492c ("HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them") attempted to fix up the HID drivers that had missed the previous fix that was done in 2ff5baa9b527 ("HID: appleir:
Fix potential NULL dereference at raw event handle"), but the alps driver was missed.
Fix this up by properly checking in the hid-alps driver that it had been claimed correctly before attempting to process the raw event.
--- drivers/hid/hid-alps.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hid/hid-alps.c +3 -0
@@ -437,6 +437,9 @@ static int alps_raw_event(struct hid_devint ret =0 ;struct alps_dev *hdata =hid_get_drvdata (hdev); +if (!(hdev->claimed &HID_CLAIMED_INPUT ) || !hdata->input) +return 0 ; +switch (hdev->product) {case HID_PRODUCT_ID_T4_BTNLESS : ret =t4_raw_event (hdata, data, size);
Greg Kroah-Hartman
maintainerPATCH 57/776 HID: core: clamp report_size in s32ton() to avoid undefined shift
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 69c02ffde6ed4d535fa4e693a9e572729cad3d0d upstream.
s32ton() shifts by n-1 where n is the field's report_size, a value that comes directly from a HID device. The HID parser bounds report_size only to <= 256, so a broken HID device can supply a report descriptor with a wide field that triggers shift exponents up to 256 on a 32-bit type when an output report is built via hid_output_field() or hid_set_field().
Commit ec61b41918587 ("HID: core: fix shift-out-of-bounds in hid_report_raw_event") added the same n > 32 clamp to the function snto32(), but s32ton() was never given the same fix as I guess syzbot hadn't figured out how to fuzz a device the same way.
Fix this up by just clamping the max value of n, just like snto32() does.
--- drivers/hid/hid-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hid/hid-core.c +3 -0
@@ -1354,6 +1354,9 @@ static u32 s32ton(__s32 value, unsignedif (!value || !n)return 0 ; +if (n >32 ) + n =32 ; + a = value >> (n -1 );if (a && a !=-1 )return value <0 ?1 << (n -1 ) : (1 << (n -1 )) -1 ;
Greg Kroah-Hartman
maintainerPATCH 58/776 net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 600dc40554dc5ad1e6f3af51f700228033f43ea7 upstream.
A malicious USB device claiming to be a CDC Phonet modem can overflow the skb_shared_info->frags[] array by sending an unbounded sequence of full-page bulk transfers.
Drop the skb and increment the length error when the frag limit is reached. This matches the same fix that commit f0813bcd2d9d ("net:
wwan: t7xx: fix potential skb->frags overflow in RX path") did for the t7xx driver.
--- drivers/net/usb/cdc-phonet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/usb/cdc-phonet.c +6 -1
@@ -157,11 +157,16 @@ static void rx_complete(struct urb *req) PAGE_SIZE); page =NULL ; } - }else { + }else if (skb_shinfo (skb)->nr_frags <MAX_SKB_FRAGS ) {skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, page,0 , req->actual_length,PAGE_SIZE ); page =NULL ; + }else { +dev_kfree_skb_any (skb); + pnd->rx_skb =NULL ; + skb =NULL ; + dev->stats.rx_length_errors++; }if (req->actual_length <PAGE_SIZE ) pnd->rx_skb =NULL ;/* Last fragment */
Greg Kroah-Hartman
maintainerPATCH 59/776 NFC: digital: Bounds check NFC-A cascade depth in SDD response handler
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 46ce8be2ced389bccd84bcc04a12cf2f4d0c22d1 upstream.
The NFC-A anti-collision cascade in digital_in_recv_sdd_res() appends 3 or 4 bytes to target->nfcid1 on each round, but the number of cascade rounds is controlled entirely by the peer device. The peer sets the cascade tag in the SDD_RES (deciding 3 vs 4 bytes) and the cascade-incomplete bit in the SEL_RES (deciding whether another round follows).
ISO 14443-3 limits NFC-A to three cascade levels and target->nfcid1 is sized accordingly (NFC_NFCID1_MAXSIZE = 10), but nothing in the driver actually enforces this. This means a malicious peer can keep the cascade running, writing past the heap-allocated nfc_target with each round.
Fix this by rejecting the response when the accumulated UID would exceed the buffer.
Commit e329e71013c9 ("NFC: nci: Bounds check struct nfc_target arrays") fixed similar missing checks against the same field on the NCI path.
--- net/nfc/digital_technology.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/nfc/digital_technology.c +6 -0
@@ -424,6 +424,12 @@ static void digital_in_recv_sdd_res(stru size =4 ; } +if (target->nfcid1_len + size >NFC_NFCID1_MAXSIZE ) { +PROTOCOL_ERR ("4.7.2.1" ); + rc = -EPROTO ; + goto exit; + } +memcpy (target->nfcid1 + target->nfcid1_len, sdd_res->nfcid1 + offset, size); target->nfcid1_len += size;
Greg Kroah-Hartman
maintainerPATCH 60/776 ALSA: fireworks: bound device-supplied status before string array lookup
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 07704bbf36f57e4379e4cadf96410dab14621e3b upstream.
The status field in an EFW response is a 32-bit value supplied by the firewire device. efr_status_names[] has 17 entries so a status value outside that range goes off into the weeds when looking at the %s value.
Even worse, the status could return EFR_STATUS_INCOMPLETE which is 0x80000000, and is obviously not in that array of potential strings.
Fix this up by properly bounding the index against the array size and printing "unknown" if it's not recognized.
--- sound/firewire/fireworks/fireworks_command.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/firewire/fireworks/fireworks_command.c +4 -1
@@ -151,10 +151,13 @@ efw_transaction(struct snd_efw *efw, uns (be32_to_cpu(header->category) != category) || (be32_to_cpu(header->command) != command) || (be32_to_cpu(header->status) != EFR_STATUS_OK)) { +u32 st =be32_to_cpu (header->status); +dev_err (&efw->unit->device,"EFW command failed [%u/%u]: %s\n" ,be32_to_cpu (header->category),be32_to_cpu (header->command), - efr_status_names[be32_to_cpu (header->status)]); + st <ARRAY_SIZE (efr_status_names) ? + efr_status_names[st] :"unknown" ); err = -EIO ; goto end; }
Greg Kroah-Hartman
maintainerPATCH 61/776 fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 8f98b81fe011e1879e6a7b1247e69e06a5e17af2 upstream.
Much like commit 19f953e74356 ("fbdev: fb_pm2fb: Avoid potential divide by zero error"), we also need to prevent that same crash from happening in the udlfb driver as it uses pixclock directly when dividing, which will crash.
--- drivers/video/fbdev/tdfxfb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/tdfxfb.c +3 -0
@@ -495,6 +495,9 @@ static int tdfxfb_check_var(struct fb_va } } +if (!var->pixclock) +return -EINVAL ; +if (PICOS2KHZ (var->pixclock) > par->max_pixclock) {DPRINTK ("pixclock too high (%ldKHz)\n" ,PICOS2KHZ (var->pixclock));
Greg Kroah-Hartman
maintainerPATCH 62/776 usb: gadget: f_ncm: validate minimum block_len in ncm_unwrap_ntb()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 8f993d30b95dc9557a8a96ceca11abed674c8acb upstream.
The block_len read from the host-supplied NTB header is checked against ntb_max but has no lower bound. When block_len is smaller than opts->ndp_size, the bounds check of:
ndp_index > (block_len - opts->ndp_size)
will underflow producing a huge unsigned value that ndp_index can never exceed, defeating the check entirely.
The same underflow occurs in the datagram index checks against block_len
- opts->dpe_size. With those checks neutered, a malicious USB host can choose ndp_index and datagram offsets that point past the actual transfer, and the skb_put_data() copies adjacent kernel memory into the network skb.
Fix this by rejecting block lengths that cannot hold at least the NTB header plus one NDP. This will make block_len - opts->ndp_size and block_len - opts->dpe_size both well-defined.
Commit 8d2b1a1ec9f5 ("CDC-NCM: avoid overflow in sanity checking") fixed a related class of issues on the host side of NCM.
--- drivers/usb/gadget/function/f_ncm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_ncm.c +2 -2
@@ -1215,8 +1215,8 @@ parse_ntb: block_len =get_ncm (&tmp, opts->block_length);/* (d)wBlockLength */ -if (block_len > ntb_max) { -INFO (port->func.config->cdev,"OUT size exceeded\n" ); +if ((block_len < opts->nth_size + opts->ndp_size) || (block_len > ntb_max)) { +INFO (port->func.config->cdev,"Bad block length: %#X\n" , block_len); goto err; }
Greg Kroah-Hartman
maintainerPATCH 63/776 usb: gadget: f_phonet: fix skb frags[] overflow in pn_rx_complete()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit c088d5dd2fffb4de1fb8e7f57751c8b82942180a upstream.
A broken/bored/mean USB host can overflow the skb_shared_info->frags[] array on a Linux gadget exposing a Phonet function by sending an unbounded sequence of full-page OUT transfers.
pn_rx_complete() finalizes the skb only when req->actual < req->length, where req->length is set to PAGE_SIZE by the gadget. If the host always sends exactly PAGE_SIZE bytes per transfer, fp->rx.skb will never be reset and each completion will add another fragment via skb_add_rx_frag(). Once nr_frags exceeds MAX_SKB_FRAGS (default 17), subsequent frag stores overwrite memory adjacent to the shinfo on the heap.
Drop the skb and account a length error when the frag limit is reached, matching the fix applied in t7xx by commit f0813bcd2d9d ("net: wwan:
t7xx: fix potential skb->frags overflow in RX path").
--- drivers/usb/gadget/function/f_phonet.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/usb/gadget/function/f_phonet.c +9 -0
@@ -330,6 +330,15 @@ static void pn_rx_complete(struct usb_epif (unlikely (!skb))break ; +if (unlikely (skb_shinfo (skb)->nr_frags >=MAX_SKB_FRAGS )) { +/* Frame count from host exceeds frags[] capacity */ +dev_kfree_skb_any (skb); +if (fp->rx.skb == skb) + fp->rx.skb =NULL ; + dev->stats.rx_length_errors++; +break ; + } +if (skb->len ==0 ) {/* First fragment */ skb->protocol =htons (ETH_P_PHONET );skb_reset_mac_header (skb);
Greg Kroah-Hartman
maintainerPATCH 64/776 usb: gadget: renesas_usb3: validate endpoint index in standard request handlers
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit f880aac8a57ebd92abfa685d45424b2998ac1059 upstream.
The GET_STATUS and SET/CLEAR_FEATURE handlers extract the endpoint number from the host-supplied wIndex without any sort of validation. Fix this up by validating the number of endpoints actually match up with the number the device has before attempting to dereference a pointer based on this math.
This is just like what was done in commit ee0d382feb44 ("usb: gadget:aspeed_udc: validate endpoint index for ast udc") for the aspeed driver.
--- drivers/usb/gadget/udc/renesas_usb3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/gadget/udc/renesas_usb3.c +6 -1
@@ -1611,6 +1611,10 @@ static bool usb3_std_req_get_status(strubreak ;case USB_RECIP_ENDPOINT : num =le16_to_cpu (ctrl->wIndex) &USB_ENDPOINT_NUMBER_MASK ; +if (num >= usb3->num_usb3_eps) { + stall = true; +break ; + } usb3_ep =usb3_get_ep (usb3, num);if (usb3_ep->halt) status |=1 <<USB_ENDPOINT_HALT ;
@@ -1723,7 +1727,8 @@ static bool usb3_std_req_feature_endpoinstruct renesas_usb3_ep *usb3_ep;struct renesas_usb3_request *usb3_req; -if (le16_to_cpu (ctrl->wValue) !=USB_ENDPOINT_HALT ) +if ((le16_to_cpu (ctrl->wValue) !=USB_ENDPOINT_HALT ) || + (num >= usb3->num_usb3_eps))return true;/* stall */ usb3_ep =usb3_get_ep (usb3, num);
Greg Kroah-Hartman
maintainerPATCH 65/776 usbip: validate number_of_packets in usbip_pack_ret_submit()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Rebello <[email protected]>
commit 2ab833a16a825373aad2ba7d54b572b277e95b71 upstream.
When a USB/IP client receives a RET_SUBMIT response, usbip_pack_ret_submit() unconditionally overwrites urb->number_of_packets from the network PDU. This value is subsequently used as the loop bound in usbip_recv_iso() and usbip_pad_iso() to iterate over urb->iso_frame_desc[], a flexible array whose size was fixed at URB allocation time based on the *original* number_of_packets from the CMD_SUBMIT.
A malicious USB/IP server can set number_of_packets in the response to a value larger than what was originally submitted, causing a heap out-of-bounds write when usbip_recv_iso() writes to urb->iso_frame_desc[i] beyond the allocated region.
KASAN confirmed this with kernel 7.0.0-rc5:
BUG: KASAN: slab-out-of-bounds in usbip_recv_iso+0x46a/0x640 Write of size 4 at addr ffff888106351d40 by task vhci_rx/69
The buggy address is located 0 bytes to the right of
allocated 320-byte region [ffff888106351c00, ffff888106351d40)
The server side (stub_rx.c) and gadget side (vudc_rx.c) already validate number_of_packets in the CMD_SUBMIT path since commits c6688ef9f297 ("usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input") and b78d830f0049 ("usbip: fix vudc_rx: harden CMD_SUBMIT path to handle malicious input"). The server side validates against USBIP_MAX_ISO_PACKETS because no URB exists yet at that point. On the client side we have the original URB, so we can use the tighter
bound: the response must not exceed the original number_of_packets.
This mirrors the existing validation of actual_length against transfer_buffer_length in usbip_recv_xbuff(), which checks the response value against the original allocation size.
Kelvin Mbogo's series ("usb: usbip: fix integer overflow in usbip_recv_iso()", v2) hardens the receive-side functions themselves; this patch complements that work by catching the bad value at its source -- in usbip_pack_ret_submit() before the overwrite -- and using the tighter per-URB allocation bound rather than the global USBIP_MAX_ISO_PACKETS limit.
Fix this by checking rpdu->number_of_packets against urb->number_of_packets in usbip_pack_ret_submit() before the overwrite. On violation, clamp to zero so that usbip_recv_iso() and usbip_pad_iso() safely return early.
--- drivers/usb/usbip/usbip_common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/usb/usbip/usbip_common.c +12 -0
@@ -384,6 +384,18 @@ static void usbip_pack_ret_submit(struct urb->status = rpdu->status; urb->actual_length = rpdu->actual_length; urb->start_frame = rpdu->start_frame; +/* +* The number_of_packets field determines the length of +* iso_frame_desc[], which is a flexible array allocated +* at URB creation time. A response must never claim more +* packets than originally submitted; doing so would cause +* an out-of-bounds write in usbip_recv_iso() and +* usbip_pad_iso(). Clamp to zero on violation so both +* functions safely return early. +*/ +if (rpdu->number_of_packets <0 || + rpdu->number_of_packets > urb->number_of_packets) + rpdu->number_of_packets =0 ; urb->number_of_packets = rpdu->number_of_packets; urb->error_count = rpdu->error_count; }
Greg Kroah-Hartman
maintainerPATCH 66/776 usb: storage: Expand range of matched versions for VL817 quirks entry
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Brát <[email protected]>
commit 609865ab3d5d803556f628e221ecd3d06aed9f30 upstream.
Expands range of matched bcdDevice values for the VL817 quirk entry. This is based on experience with Axagon EE35-GTR rev1 3.5" HDD enclosure, which reports its bcdDevice as 0x0843, but presumably other vendors using this IC in their products may set it to any other value.
--- drivers/usb/storage/unusual_devs.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/storage/unusual_devs.h +4 -3
@@ -2339,10 +2339,11 @@ UNUSUAL_DEV( 0x2027, 0xa001, 0x0000, 0x US_FL_SCM_MULT_TARG ),/* -* Reported by DocMAX <[email protected]> -* and Thomas Weißschuh <[email protected]> +* Reported by DocMAX <[email protected]>, +* Thomas Weißschuh <[email protected]> +* and Daniel Brát <[email protected]> */ -UNUSUAL_DEV( 0x2109, 0x0715, 0x9999, 0x9999, +UNUSUAL_DEV( 0x2109, 0x0715, 0x0000, 0x9999, "VIA Labs, Inc.", "VL817 SATA Bridge", USB_SC_DEVICE, USB_PR_DEVICE, NULL,
Greg Kroah-Hartman
maintainerPATCH 67/776 fbdev: udlfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit a31e4518bec70333a0a98f2946a12b53b45fe5b9 upstream.
Much like commit 19f953e74356 ("fbdev: fb_pm2fb: Avoid potential divide by zero error"), we also need to prevent that same crash from happening in the udlfb driver as it uses pixclock directly when dividing, which will crash.
--- drivers/video/fbdev/udlfb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/udlfb.c +3 -0
@@ -1077,6 +1077,9 @@ static int dlfb_ops_check_var(struct fb_struct fb_videomode mode;struct dlfb_data *dlfb = info->par; +if (!var->pixclock) +return -EINVAL ; +/* set device-specific elements of var unrelated to mode */ dlfb_var_color_format (var);
Greg Kroah-Hartman
maintainerPATCH 68/776 staging: sm750fb: fix division by zero in ps_to_hz()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junrui Luo <[email protected]>
commit 75a1621e4f91310673c9acbcbb25c2a7ff821cd3 upstream.
ps_to_hz() is called from hw_sm750_crtc_set_mode() without validating that pixclock is non-zero. A zero pixclock passed via FBIOPUT_VSCREENINFO causes a division by zero.
Fix by rejecting zero pixclock in lynxfb_ops_check_var(), consistent with other framebuffer drivers.
--- drivers/staging/sm750fb/sm750.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/sm750fb/sm750.c +3 -0
@@ -482,6 +482,9 @@ static int lynxfb_ops_check_var(struct fstruct lynxfb_crtc *crtc;resource_size_t request; +if (!var->pixclock) +return -EINVAL ; + ret =0 ; par = info->par; crtc = &par->crtc;
Greg Kroah-Hartman
maintainerPATCH 69/776 USB: serial: option: add Telit Cinterion FN990A MBIM composition
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Porcedda <[email protected]>
commit f8cc59ecc22841be5deb07b549c0c6a2657cd5f9 upstream.
Add the following Telit Cinterion FN990A MBIM composition:
0x1074: MBIM + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (diag) +
DPL (Data Packet Logging) + adb
T: Bus=01 Lev=01 Prnt=04 Port=06 Cnt=01 Dev#= 7 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1bc7 ProdID=1074 Rev=05.04 S: Manufacturer=Telit Wireless Solutions S: Product=FN990 S: SerialNumber=70628d0c C: #Ifs= 8 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none) E: Ad=8f(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -1383,6 +1383,8 @@ static const struct usb_device_id option .driver_info = NCTRL(2) | RSVD(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990A (ECM) */ .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1074, 0xff), /* Telit FN990A (MBIM) */ + .driver_info = NCTRL(5) | RSVD(6) | RSVD(7) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990A (PCIe) */ .driver_info = RSVD(0) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1077, 0xff), /* Telit FN990A (rmnet + audio) */
Greg Kroah-Hartman
maintainerPATCH 70/776 ALSA: ctxfi: Limit PTP to a single page
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harin Lee <[email protected]>
commit e9418da50d9e5c496c22fe392e4ad74c038a94eb upstream.
Commit 391e69143d0a increased CT_PTP_NUM from 1 to 4 to support 256 playback streams, but the additional pages are not used by the card correctly. The CT20K2 hardware already has multiple VMEM_PTPAL registers, but using them separately would require refactoring the entire virtual memory allocation logic.
ct_vm_map() always uses PTEs in vm->ptp[0].area regardless of CT_PTP_NUM. On AMD64 systems, a single PTP covers 512 PTEs (2M). When aggregate memory allocations exceed this limit, ct_vm_map() tries to access beyond the allocated space and causes a page fault:
BUG: unable to handle page fault for address: ffffd4ae8a10a000 Oops: Oops: 0002 [#1] SMP PTI RIP: 0010:ct_vm_map+0x17c/0x280 [snd_ctxfi] Call Trace: atc_pcm_playback_prepare+0x225/0x3b0 ct_pcm_playback_prepare+0x38/0x60 snd_pcm_do_prepare+0x2f/0x50 snd_pcm_action_single+0x36/0x90 snd_pcm_action_nonatomic+0xbf/0xd0 snd_pcm_ioctl+0x28/0x40 __x64_sys_ioctl+0x97/0xe0 do_syscall_64+0x81/0x610 entry_SYSCALL_64_after_hwframe+0x76/0x7e
Revert CT_PTP_NUM to 1. The 256 SRC_RESOURCE_NUM and playback_count remain unchanged.
--- sound/pci/ctxfi/ctvmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ctxfi/ctvmem.h +1 -1
@@ -15,7 +15,7 @@#ifndef CTVMEM_H #define CTVMEM_H -#define CT_PTP_NUM 4/* num of device page table pages */ +#define CT_PTP_NUM 1/* num of device page table pages */ #include <linux/mutex.h> #include <linux/list.h>
Greg Kroah-Hartman
maintainerPATCH 71/776 media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruslan Valiyev <[email protected]>
commit f8e1fc918a9fe67103bcda01d20d745f264d00a7 upstream.
syzbot reported a general protection fault in vidtv_psi_desc_assign [1].
vidtv_psi_pmt_stream_init() can return NULL on memory allocation failure, but vidtv_channel_pmt_match_sections() does not check for this. When tail is NULL, the subsequent call to vidtv_psi_desc_assign(&tail->descriptor, desc) dereferences a NULL pointer offset, causing a general protection fault.
Add a NULL check after vidtv_psi_pmt_stream_init(). On failure, clean up the already-allocated stream chain and return.
[1]
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629 Call Trace: <TASK> vidtv_channel_pmt_match_sections drivers/media/test-drivers/vidtv/vidtv_channel.c:349 [inline] vidtv_channel_si_init+0x1445/0x1a50 drivers/media/test-drivers/vidtv/vidtv_channel.c:479 vidtv_mux_init+0x526/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:519 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 [inline] vidtv_start_feed+0x33e/0x4d0 drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
--- drivers/media/test-drivers/vidtv/vidtv_channel.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/media/test-drivers/vidtv/vidtv_channel.c +4 -0
@@ -341,6 +341,10 @@ vidtv_channel_pmt_match_sections(struct tail =vidtv_psi_pmt_stream_init (tail, s->type, e_pid); +if (!tail) { +vidtv_psi_pmt_stream_destroy (head); +return ; + }if (!head) head = tail;
Greg Kroah-Hartman
maintainerPATCH 72/776 ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejas Bharambe <[email protected]>
commit 7de554cabf160e331e4442e2a9ad874ca9875921 upstream.
filemap_fault() may drop the mmap_lock before returning VM_FAULT_RETRY, as documented in mm/filemap.c:
"If our return value has VM_FAULT_RETRY set, it's because the mmap_lock may be dropped before doing I/O or by lock_folio_maybe_drop_mmap()."
When this happens, a concurrent munmap() can call remove_vma() and free the vm_area_struct via RCU. The saved 'vma' pointer in ocfs2_fault() then becomes a dangling pointer, and the subsequent trace_ocfs2_fault() call dereferences it -- a use-after-free.
Fix this by saving ip_blkno as a plain integer before calling filemap_fault(), and removing vma from the trace event. Since ip_blkno is copied by value before the lock can be dropped, it remains valid regardless of what happens to the vma or inode afterward.
--- fs/ocfs2/mmap.c | 7 +++---- fs/ocfs2/ocfs2_trace.h | 10 ++++------ 2 files changed, 7 insertions(+), 10 deletions(-)
fs/ocfs2/mmap.c +3 -4
@@ -30,7 +30,8 @@static vm_fault_t ocfs2_fault (struct vm_fault *vmf) { -struct vm_area_struct *vma = vmf->vma; +unsigned long long ip_blkno = +OCFS2_I (file_inode (vmf->vma->vm_file))->ip_blkno;sigset_t oldset;vm_fault_t ret;
@@ -38,11 +39,9 @@ static vm_fault_t ocfs2_fault(struct vm_ ret =filemap_fault (vmf);ocfs2_unblock_signals (&oldset); -trace_ocfs2_fault (OCFS2_I (vma->vm_file->f_mapping->host)->ip_blkno, - vma, vmf->page, vmf->pgoff); +trace_ocfs2_fault (ip_blkno, vmf->page, vmf->pgoff);return ret; } -static vm_fault_t __ocfs2_page_mkwrite (struct file *file,struct buffer_head *di_bh,struct page *page) {
fs/ocfs2/ocfs2_trace.h +4 -6
@@ -1248,22 +1248,20 @@ TRACE_EVENT(ocfs2_write_end_inline,TRACE_EVENT (ocfs2_fault, TP_PROTO(unsigned long long ino, - void *area, void *page, unsigned long pgoff), -TP_ARGS (ino, area, page, pgoff), + void *page, unsigned long pgoff), +TP_ARGS (ino, page, pgoff),TP_STRUCT__entry ( __field(unsigned long long, ino) - __field(void *, area) __field(void *, page) __field(unsigned long, pgoff) ),TP_fast_assign ( __entry->ino = ino; - __entry->area = area; __entry->page = page; __entry->pgoff = pgoff; ), -TP_printk ("%llu %p %p %lu" , - __entry->ino, __entry->area, __entry->page, __entry->pgoff) +TP_printk ("%llu %p %lu" , + __entry->ino, __entry->page, __entry->pgoff) );/* End of trace events for fs/ocfs2/mmap.c. */
Greg Kroah-Hartman
maintainerPATCH 73/776 ocfs2: handle invalid dinode in ocfs2_group_extend
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: ZhengYuan Huang <[email protected]>
commit 4a1c0ddc6e7bcf2e9db0eeaab9340dcfe97f448f upstream.
[BUG]
kernel BUG at fs/ocfs2/resize.c:308!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:ocfs2_group_extend+0x10aa/0x1ae0 fs/ocfs2/resize.c:308 Code: 8b8520ff ffff83f8 860f8580 030000e8 5cc3c1fe Call Trace: ... ocfs2_ioctl+0x175/0x6e0 fs/ocfs2/ioctl.c:869 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x197/0x1e0 fs/ioctl.c:583 x64_sys_call+0x1144/0x26a0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x93/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e ...
[CAUSE]ocfs2_group_extend() assumes that the global bitmap inode block returned from ocfs2_inode_lock() has already been validated and BUG_ONs when the signature is not a dinode. That assumption is too strong for crafted filesystems because the JBD2-managed buffer path can bypass structural validation and return an invalid dinode to the resize ioctl.
[FIX]
Validate the dinode explicitly in ocfs2_group_extend(). If the global bitmap buffer does not contain a valid dinode, report filesystem corruption with ocfs2_error() and fail the resize operation instead of crashing the kernel.
--- fs/ocfs2/resize.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
fs/ocfs2/resize.c +7 -3
@@ -295,9 +295,13 @@ int ocfs2_group_extend(struct inode * in fe = (struct ocfs2_dinode *)main_bm_bh->b_data; -/* main_bm_bh is validated by inode read inside ocfs2_inode_lock(), -* so any corruption is a code bug. */ -BUG_ON (!OCFS2_IS_VALID_DINODE (fe)); +/* JBD-managed buffers can bypass validation, so treat this as corruption. */ +if (!OCFS2_IS_VALID_DINODE (fe)) { + ret =ocfs2_error (main_bm_inode->i_sb, +"Invalid dinode #%llu\n" , + (unsigned long long )OCFS2_I (main_bm_inode)->ip_blkno); + goto out_unlock; + }if (le16_to_cpu (fe->id2.i_chain.cl_cpg) != ocfs2_group_bitmap_size(osb->sb, 0,
Greg Kroah-Hartman
maintainerPATCH 74/776 KVM: SEV: Drop WARN on large size for KVM_MEMORY_ENCRYPT_REG_REGION
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
commit 8acffeef5ef720c35e513e322ab08e32683f32f2 upstream.
Drop the WARN in sev_pin_memory() on npages overflowing an int, as the WARN is comically trivially to trigger from userspace, e.g. by doing:
struct kvm_enc_region range = {
.addr = 0,
.size = -1ul,
};
__vm_ioctl(vm, KVM_MEMORY_ENCRYPT_REG_REGION, &range);Note, the checks in sev_mem_enc_register_region() that presumably exist to verify the incoming address+size are completely worthless, as both "addr" and "size" are u64s and SEV is 64-bit only, i.e. they _can't_ be greater than ULONG_MAX. That wart will be cleaned up in the near future.
if (range->addr > ULONG_MAX || range->size > ULONG_MAX) return -EINVAL;
Opportunistically add a comment to explain why the code calculates the number of pages the "hard" way, e.g. instead of just shifting @ulen.
--- arch/x86/kvm/svm/sev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/x86/kvm/svm/sev.c +7 -4
@@ -388,10 +388,16 @@ static struct page **sev_pin_memory(struif (ulen ==0 || uaddr + ulen < uaddr)return ERR_PTR (-EINVAL ); -/* Calculate number of pages. */ +/* +* Calculate the number of pages that need to be pinned to cover the +* entire range. Note! This isn't simply ulen >> PAGE_SHIFT, as KVM +* doesn't require the incoming address+size to be page aligned! +*/ first = (uaddr &PAGE_MASK ) >>PAGE_SHIFT ; last = ((uaddr + ulen -1 ) &PAGE_MASK ) >>PAGE_SHIFT ; npages = (last - first +1 ); +if (npages >INT_MAX ) +return ERR_PTR (-EINVAL ); locked = sev->pages_locked + npages; lock_limit =rlimit (RLIMIT_MEMLOCK ) >>PAGE_SHIFT ;
@@ -400,9 +406,6 @@ static struct page **sev_pin_memory(strureturn ERR_PTR (-ENOMEM ); } -if (WARN_ON_ONCE (npages >INT_MAX )) -return ERR_PTR (-EINVAL ); -/* Avoid using vmalloc for smaller buffers. */ size = npages *sizeof (struct page *);if (size >PAGE_SIZE )
Greg Kroah-Hartman
maintainerPATCH 75/776 fsl-mc: Use driver_set_override() instead of open-coding
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 5688f212e98a2469583a067fa5da4312ddc4e357 ]
Use a helper to set driver_override to reduce the amount of duplicated code. Make the driver_override field const char, because it is not modified by the core and it matches other subsystems.
--- drivers/bus/fsl-mc/fsl-mc-bus.c | 25 ++++--------------------- include/linux/fsl/mc.h | 6 ++++-- 2 files changed, 8 insertions(+), 23 deletions(-)
drivers/bus/fsl-mc/fsl-mc-bus.c +4 -21
@@ -166,31 +166,14 @@ static ssize_t driver_override_store(struct device *dev, const char *buf, size_t count) {struct fsl_mc_device *mc_dev =to_fsl_mc_device (dev); -char *driver_override, *old = mc_dev->driver_override; -char *cp; +int ret;if (WARN_ON (dev->bus != &fsl_mc_bus_type))return -EINVAL ; -if (count >= (PAGE_SIZE -1 )) -return -EINVAL ; - - driver_override =kstrndup (buf, count,GFP_KERNEL ); -if (!driver_override) -return -ENOMEM ; - - cp =strchr (driver_override,'\n' ); -if (cp) - *cp ='\0' ; - -if (strlen (driver_override)) { - mc_dev->driver_override = driver_override; - }else { -kfree (driver_override); - mc_dev->driver_override =NULL ; - } - -kfree (old); + ret =driver_set_override (dev, &mc_dev->driver_override, buf, count); +if (ret) +return ret;return count; }
include/linux/fsl/mc.h +4 -2
@@ -170,7 +170,9 @@ struct fsl_mc_obj_desc {* @regions: pointer to array of MMIO region entries * @irqs: pointer to array of pointers to interrupts allocated to this device * @resource: generic resource associated with this MC object device, if any. -* @driver_override: driver name to force a match +* @driver_override: driver name to force a match; do not set directly, +* because core frees it; use driver_set_override() to +* set or clear it. * * Generic device object for MC object devices that are "attached" to a * MC bus.
@@ -204,7 +206,7 @@ struct fsl_mc_device {struct fsl_mc_device_irq **irqs;struct fsl_mc_resource *resource;struct device_link *consumer_link; -char *driver_override; +const char *driver_override; };#define to_fsl_mc_device (_dev) \
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 76/776 smb: client: fix potential UAF in smb2_is_valid_oplock_break()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
[ Upstream commit 22863485a4626ec6ecf297f4cc0aef709bc862e4 ]
Skip sessions that are being teared down (status == SES_EXITING) to avoid UAF.
--- fs/cifs/smb2misc.c | 2 ++ 1 file changed, 2 insertions(+)
fs/cifs/smb2misc.c +2 -0
@@ -679,6 +679,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)/* look up tcon based on tid & uid */ spin_lock (&cifs_tcp_ses_lock);list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +if (cifs_ses_exiting (ses)) +continue ;list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {spin_lock (&tcon->open_file_lock);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 77/776 nf_tables: nft_dynset: fix possible stateful expression memleak in error path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 0548a13b5a145b16e4da0628b5936baf35f51b43 ]
If cloning the second stateful expression in the element via GFP_ATOMIC fails, then the first stateful expression remains in place without being released.
unreferenced object (percpu) 0x607b97e9cab8 (size 16):
comm "softirq", pid 0, jiffies 4294931867 hex dump (first 16 bytes on cpu 3):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 backtrace (crc 0):
pcpu_alloc_noprof+0x453/0xd80 nft_counter_clone+0x9c/0x190 [nf_tables] nft_expr_clone+0x8f/0x1b0 [nf_tables] nft_dynset_new+0x2cb/0x5f0 [nf_tables] nft_rhash_update+0x236/0x11c0 [nf_tables] nft_dynset_eval+0x11f/0x670 [nf_tables] nft_do_chain+0x253/0x1700 [nf_tables] nft_do_chain_ipv4+0x18d/0x270 [nf_tables] nf_hook_slow+0xaa/0x1e0 ip_local_deliver+0x209/0x330
--- include/net/netfilter/nf_tables.h | 2 ++ net/netfilter/nf_tables_api.c | 4 ++-- net/netfilter/nft_dynset.c | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-)
include/net/netfilter/nf_tables.h +2 -0
@@ -821,6 +821,8 @@ void *nft_set_elem_init(const struct nft_set *set, u64 timeout, u64 expiration, gfp_t gfp);int nft_set_elem_expr_clone (const struct nft_ctx *ctx,struct nft_set *set,struct nft_expr *expr_array[]); +void nft_set_elem_expr_destroy (const struct nft_ctx *ctx, +struct nft_set_elem_expr *elem_expr);void nft_set_elem_destroy (const struct nft_set *set,void *elem,bool destroy_expr); void nf_tables_set_elem_destroy(const struct nft_ctx *ctx,
net/netfilter/nf_tables_api.c +2 -2
@@ -5919,8 +5919,8 @@ static void __nft_set_elem_expr_destroy(const struct nft_ctx *ctx, } } -static void nft_set_elem_expr_destroy (const struct nft_ctx *ctx, -struct nft_set_elem_expr *elem_expr) +void nft_set_elem_expr_destroy (const struct nft_ctx *ctx, +struct nft_set_elem_expr *elem_expr) {struct nft_expr *expr;u32 size;
net/netfilter/nft_dynset.c +9 -1
@@ -30,18 +30,26 @@ static int nft_dynset_expr_setup(const struct nft_dynset *priv, const struct nft_set_ext *ext) {struct nft_set_elem_expr *elem_expr =nft_set_ext_expr (ext); +struct nft_ctx ctx = { + .net =read_pnet (&priv->set->net), + .family = priv->set->table->family, + };struct nft_expr *expr;int i;for (i =0 ; i < priv->num_exprs; i++) { expr =nft_setelem_expr_at (elem_expr, elem_expr->size);if (nft_expr_clone (expr, priv->expr_array[i],GFP_ATOMIC ) <0 ) -return -1 ; + goto err_out; elem_expr->size += priv->expr_array[i]->ops->size; }return 0 ; +err_out: +nft_set_elem_expr_destroy (&ctx, elem_expr); + +return -1 ; } static void *nft_dynset_new(struct nft_set *set, const struct nft_expr *expr,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 78/776 rxrpc: proc: size address buffers for %pISpc output
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit a44ce6aa2efb61fe44f2cfab72bb01544bbca272 ]
The AF_RXRPC procfs helpers format local and remote socket addresses into fixed 50-byte stack buffers with "%pISpc".
That is too small for the longest current-tree IPv6-with-port form the formatter can produce. In lib/vsprintf.c, the compressed IPv6 path uses a dotted-quad tail not only for v4mapped addresses, but also for ISATAP addresses via ipv6_addr_is_isatap().
As a result, a case such as
[ffff:ffff:ffff:ffff:0:5efe:255.255.255.255]:65535
is possible with the current formatter. That is 50 visible characters, so 51 bytes including the trailing NUL, which does not fit in the existing char[50] buffers used by net/rxrpc/proc.c.
Size the buffers from the formatter's maximum textual form and switch the call sites to scnprintf().
Changes since v1:
- correct the changelog to cite the actual maximum current-tree case explicitly
- frame the proof around the ISATAP formatting path instead of the earlier mapped-v4 example
--- net/rxrpc/proc.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
net/rxrpc/proc.c +15 -11
@@ -10,6 +10,10 @@#include <net/af_rxrpc.h> #include "ar-internal.h" +#define RXRPC_PROC_ADDRBUF_SIZE \ + (sizeof("[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255]") + \ + sizeof(":12345")) +static const char *const rxrpc_conn_states[RXRPC_CONN__NR_STATES ] = { [RXRPC_CONN_UNUSED ] ="Unused " , [RXRPC_CONN_CLIENT ] ="Client " ,
@@ -55,7 +59,7 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)struct rxrpc_net *rxnet =rxrpc_net (seq_file_net (seq));unsigned long timeout =0 ;rxrpc_seq_t tx_hard_ack, rx_hard_ack; -char lbuff[50 ], rbuff[50 ]; +char lbuff[RXRPC_PROC_ADDRBUF_SIZE ], rbuff[RXRPC_PROC_ADDRBUF_SIZE ];if (v == &rxnet->calls) { seq_puts(seq,
@@ -72,7 +76,7 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)if (rx) { local =READ_ONCE (rx->local);if (local) -sprintf (lbuff,"%pISpc" , &local->srx.transport); +scnprintf (lbuff,sizeof (lbuff),"%pISpc" , &local->srx.transport);else strcpy (lbuff,"no_local" ); }else {
@@ -81,7 +85,7 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v) peer = call->peer;if (peer) -sprintf (rbuff,"%pISpc" , &peer->srx.transport); +scnprintf (rbuff,sizeof (rbuff),"%pISpc" , &peer->srx.transport);else strcpy (rbuff,"no_connection" );
@@ -152,7 +156,7 @@ static int rxrpc_connection_seq_show(struct seq_file *seq, void *v) {struct rxrpc_connection *conn;struct rxrpc_net *rxnet =rxrpc_net (seq_file_net (seq)); -char lbuff[50 ], rbuff[50 ]; +char lbuff[RXRPC_PROC_ADDRBUF_SIZE ], rbuff[RXRPC_PROC_ADDRBUF_SIZE ];if (v == &rxnet->conn_proc_list) { seq_puts(seq,
@@ -171,9 +175,9 @@ static int rxrpc_connection_seq_show(struct seq_file *seq, void *v) goto print; } -sprintf (lbuff,"%pISpc" , &conn->params.local->srx.transport); +scnprintf (lbuff,sizeof (lbuff),"%pISpc" , &conn->params.local->srx.transport); -sprintf (rbuff,"%pISpc" , &conn->params.peer->srx.transport); +scnprintf (rbuff,sizeof (rbuff),"%pISpc" , &conn->params.peer->srx.transport); print:seq_printf (seq, "UDP %-47.47s %-47.47s %4x %08x %s %3u"
@@ -210,7 +214,7 @@ static int rxrpc_peer_seq_show(struct seq_file *seq, void *v) {struct rxrpc_peer *peer;time64_t now; -char lbuff[50 ], rbuff[50 ]; +char lbuff[RXRPC_PROC_ADDRBUF_SIZE ], rbuff[RXRPC_PROC_ADDRBUF_SIZE ];if (v ==SEQ_START_TOKEN ) { seq_puts(seq,
@@ -223,9 +227,9 @@ static int rxrpc_peer_seq_show(struct seq_file *seq, void *v) peer = list_entry(v, struct rxrpc_peer, hash_link); -sprintf (lbuff,"%pISpc" , &peer->local->srx.transport); +scnprintf (lbuff,sizeof (lbuff),"%pISpc" , &peer->local->srx.transport); -sprintf (rbuff,"%pISpc" , &peer->srx.transport); +scnprintf (rbuff,sizeof (rbuff),"%pISpc" , &peer->srx.transport); now =ktime_get_seconds (); seq_printf(seq,
@@ -335,7 +339,7 @@ const struct seq_operations rxrpc_peer_seq_ops = {static int rxrpc_local_seq_show (struct seq_file *seq,void *v) {struct rxrpc_local *local; -char lbuff[50 ]; +char lbuff[RXRPC_PROC_ADDRBUF_SIZE ];if (v ==SEQ_START_TOKEN ) { seq_puts(seq,
@@ -346,7 +350,7 @@ static int rxrpc_local_seq_show(struct seq_file *seq, void *v) local = hlist_entry(v, struct rxrpc_local, link); -sprintf (lbuff,"%pISpc" , &local->srx.transport); +scnprintf (lbuff,sizeof (lbuff),"%pISpc" , &local->srx.transport); seq_printf(seq, "UDP %-47.47s %3u %3u\n",
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 79/776 checkpatch: add support for Assisted-by tag
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <[email protected]>
commit d1db4118489fffd2b2f612140b7acbb477880839 upstream.
The Assisted-by tag was introduced in Documentation/process/coding-assistants.rst for attributing AI tool contributions to kernel patches. However, checkpatch.pl did not recognize this tag, causing two issues:
WARNING: Non-standard signature: Assisted-by:
ERROR: Unrecognized email address: 'AGENT_NAME:MODEL_VERSION'
Fix this by:
1. Adding Assisted-by to the recognized $signature_tags list
2. Skipping email validation for Assisted-by lines since they use the AGENT_NAME:MODEL_VERSION format instead of an email address
3. Warning when the Assisted-by value doesn't match the expected format
--- scripts/checkpatch.pl | 10 ++++++++++ 1 file changed, 10 insertions(+)
scripts/checkpatch.pl +10 -0
@@ -588,6 +588,7 @@ our $signature_tags = qr{(?xi: Reviewed-by:| Reported-by:| Suggested-by:| + Assisted-by:| To:| Cc: )};
@@ -3000,6 +3001,15 @@ sub process { } } + # Assisted-by uses AGENT_NAME:MODEL_VERSION format, not email + if ($sign_off =~ /^Assisted-by:/i) { + if ($email !~ /^\S+:\S+/) { + WARN("BAD_SIGN_OFF", + "Assisted-by expects 'AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]' format\n" . $herecurr); + } + next; + } + my ($email_name, $name_comment, $email_address, $comment) = parse_email($email); my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment)); if ($suggested_email eq "") {
Greg Kroah-Hartman
maintainerPATCH 80/776 KVM: x86: Use scratch field in MMIO fragment to hold small write values
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
commit 0b16e69d17d8c35c5c9d5918bf596c75a44655d3 upstream.
When exiting to userspace to service an emulated MMIO write, copy the to-be-written value to a scratch field in the MMIO fragment if the size of the data payload is 8 bytes or less, i.e. can fit in a single chunk, instead of pointing the fragment directly at the source value.
This fixes a class of use-after-free bugs that occur when the emulator initiates a write using an on-stack, local variable as the source, the write splits a page boundary, *and* both pages are MMIO pages. Because KVM's ABI only allows for physically contiguous MMIO requests, accesses that split MMIO pages are separated into two fragments, and are sent to userspace one at a time. When KVM attempts to complete userspace MMIO in response to KVM_RUN after the first fragment, KVM will detect the second fragment and generate a second userspace exit, and reference the on-stack variable.
The issue is most visible if the second KVM_RUN is performed by a separate task, in which case the stack of the initiating task can show up as truly freed data.
==================================================================
BUG: KASAN: use-after-free in complete_emulated_mmio+0x305/0x420
Read of size 1 at addr ffff888009c378d1 by task syz-executor417/984
CPU: 1 PID: 984 Comm: syz-executor417 Not tainted 5.10.0-182.0.0.95.h2627.eulerosv2r13.x86_64 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace:
dump_stack+0xbe/0xfd
print_address_description.constprop.0+0x19/0x170
__kasan_report.cold+0x6c/0x84
kasan_report+0x3a/0x50
check_memory_region+0xfd/0x1f0
memcpy+0x20/0x60
complete_emulated_mmio+0x305/0x420
kvm_arch_vcpu_ioctl_run+0x63f/0x6d0
kvm_vcpu_ioctl+0x413/0xb20
__se_sys_ioctl+0x111/0x160
do_syscall_64+0x30/0x40
entry_SYSCALL_64_after_hwframe+0x67/0xd1
RIP: 0033:0x42477d
Code: <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007faa8e6890e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004d7338 RCX: 000000000042477d
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005
RBP: 00000000004d7330 R08: 00007fff28d546df R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004d733c
R13: 0000000000000000 R14: 000000000040a200 R15: 00007fff28d54720
The buggy address belongs to the page:
page:0000000029f6a428 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9c37
flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff)
raw: 000fffffc0000000 0000000000000000 ffffea0000270dc8 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888009c37780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888009c37800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888009c37880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888009c37900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888009c37980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================The bug can also be reproduced with a targeted KVM-Unit-Test by hacking KVM to fill a large on-stack variable in complete_emulated_mmio(), i.e. by overwrite the data value with garbage.
Limit the use of the scratch fields to 8-byte or smaller accesses, and to just writes, as larger accesses and reads are not affected thanks to implementation details in the emulator, but add a sanity check to ensure those details don't change in the future. Specifically, KVM never uses on-stack variables for accesses larger that 8 bytes, e.g. uses an operand in the emulator context, and *all* reads are buffered through the mem_read cache.
Note! Using the scratch field for reads is not only unnecessary, it's also extremely difficult to handle correctly. As above, KVM buffers all reads through the mem_read cache, and heavily relies on that behavior when re-emulating the instruction after a userspace MMIO read exit. If a read splits a page, the first page is NOT an MMIO page, and the second page IS an MMIO page, then the MMIO fragment needs to point at _just_ the second chunk of the destination, i.e. its position in the mem_read cache. Taking the "obvious" approach of copying the fragment value into the destination when re-emulating the instruction would clobber the first chunk of the destination, i.e. would clobber the data that was read from guest memory.
--- arch/x86/kvm/x86.c | 14 +++++++++++++- include/linux/kvm_host.h | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-)
arch/x86/kvm/x86.c +13 -1
@@ -6971,7 +6971,13 @@ static int emulator_read_write_onepage(uWARN_ON (vcpu->mmio_nr_fragments >=KVM_MAX_MMIO_FRAGMENTS ); frag = &vcpu->mmio_fragments[vcpu->mmio_nr_fragments++]; frag->gpa = gpa; - frag->data = val; +if (write && bytes <=8u ) { + frag->val =0 ; + frag->data = &frag->val; +memcpy (&frag->val, val, bytes); + }else { + frag->data = val; + } frag->len = bytes;return X86EMUL_CONTINUE ; }
@@ -6986,6 +6992,9 @@ static int emulator_read_write(struct x8gpa_t gpa;int rc; +if (WARN_ON_ONCE ((bytes >8u || !ops->write) &&object_is_on_stack (val))) +return X86EMUL_UNHANDLEABLE ; +if (ops->read_write_prepare && ops->read_write_prepare (vcpu, val, bytes))return X86EMUL_CONTINUE ;
@@ -10268,6 +10277,9 @@ static int complete_emulated_mmio(struct frag++; vcpu->mmio_cur_fragment++; }else { +if (WARN_ON_ONCE (frag->data == &frag->val)) +return -EIO ; +/* Go forward to the next mmio piece. */ frag->data += len; frag->gpa += len;
include/linux/kvm_host.h +2 -1
@@ -291,7 +291,8 @@ static inline bool kvm_vcpu_can_poll(ktistruct kvm_mmio_fragment {gpa_t gpa;void *data; -unsigned len; +u64 val; +unsigned int len; };struct kvm_vcpu {
Greg Kroah-Hartman
maintainerPATCH 81/776 mm/kasan: fix double free for kasan pXds
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ritesh Harjani (IBM) <[email protected]>
commit 51d8c78be0c27ddb91bc2c0263941d8b30a47d3b upstream.
kasan_free_pxd() assumes the page table is always struct page aligned. But that's not always the case for all architectures. E.g. In case of powerpc with 64K pagesize, PUD table (of size 4096) comes from slab cache named pgtable-2^9. Hence instead of page_to_virt(pxd_page()) let's just directly pass the start of the pxd table which is passed as the 1st argument.
This fixes the below double free kasan issue seen with PMEM:
radix-mmu: Mapped 0x0000047d10000000-0x0000047f90000000 with 2.00 MiB pages
==================================================================
BUG: KASAN: double-free in kasan_remove_zero_shadow+0x9c4/0xa20
Free of addr c0000003c38e0000 by task ndctl/2164
CPU: 34 UID: 0 PID: 2164 Comm: ndctl Not tainted 6.19.0-rc1-00048-gea1013c15392 #157 VOLUNTARY Hardware name: IBM,9080-HEX POWER10 (architected) 0x800200 0xf000006 of:IBM,FW1060.00 (NH1060_012) hv:phyp pSeries Call Trace: dump_stack_lvl+0x88/0xc4 (unreliable) print_report+0x214/0x63c kasan_report_invalid_free+0xe4/0x110 check_slab_allocation+0x100/0x150 kmem_cache_free+0x128/0x6e0 kasan_remove_zero_shadow+0x9c4/0xa20 memunmap_pages+0x2b8/0x5c0 devm_action_release+0x54/0x70 release_nodes+0xc8/0x1a0 devres_release_all+0xe0/0x140 device_unbind_cleanup+0x30/0x120 device_release_driver_internal+0x3e4/0x450 unbind_store+0xfc/0x110 drv_attr_store+0x78/0xb0 sysfs_kf_write+0x114/0x140 kernfs_fop_write_iter+0x264/0x3f0 vfs_write+0x3bc/0x7d0 ksys_write+0xa4/0x190 system_call_exception+0x190/0x480 system_call_vectored_common+0x15c/0x2ec ---- interrupt: 3000 at 0x7fff93b3d3f4 NIP: 00007fff93b3d3f4 LR: 00007fff93b3d3f4 CTR: 0000000000000000 REGS: c0000003f1b07e80 TRAP: 3000 Not tainted (6.19.0-rc1-00048-gea1013c15392) MSR: 800000000280f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE> CR: 48888208 XER: 00000000
<...>
NIP [00007fff93b3d3f4] 0x7fff93b3d3f4
LR [00007fff93b3d3f4] 0x7fff93b3d3f4
---- interrupt: 3000
The buggy address belongs to the object at c0000003c38e0000 which belongs to the cache pgtable-2^9 of size 4096 The buggy address is located 0 bytes inside of 4096-byte region [c0000003c38e0000, c0000003c38e1000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3c38c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:c0000003bfd63e01 flags: 0x63ffff800000040(head|node=6|zone=0|lastcpupid=0x7ffff) page_type: f5(slab) raw: 063ffff800000040 c000000140058980 5deadbeef0000122 0000000000000000 raw: 0000000000000000 0000000080200020 00000000f5000000 c0000003bfd63e01 head: 063ffff800000040 c000000140058980 5deadbeef0000122 0000000000000000 head: 0000000000000000 0000000080200020 00000000f5000000 c0000003bfd63e01 head: 063ffff800000002 c00c000000f0e301 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected
[ 138.953636] [ T2164] Memory state around the buggy address: [ 138.953643] [ T2164] c0000003c38dff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953652] [ T2164] c0000003c38dff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953661] [ T2164] >c0000003c38e0000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953669] [ T2164] ^ [ 138.953675] [ T2164] c0000003c38e0080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953684] [ T2164] c0000003c38e0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953692] [ T2164] ================================================================== [ 138.953701] [ T2164] Disabling lock debugging due to kernel taint
--- mm/kasan/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
mm/kasan/init.c +4 -4
@@ -290,7 +290,7 @@ static void kasan_free_pte(pte_t *pte_streturn ; } -pte_free_kernel (&init_mm, (pte_t *)page_to_virt (pmd_page (*pmd))); +pte_free_kernel (&init_mm, pte_start);pmd_clear (pmd); }
@@ -305,7 +305,7 @@ static void kasan_free_pmd(pmd_t *pmd_streturn ; } -pmd_free (&init_mm, (pmd_t *)page_to_virt (pud_page (*pud))); +pmd_free (&init_mm, pmd_start);pud_clear (pud); }
@@ -320,7 +320,7 @@ static void kasan_free_pud(pud_t *pud_streturn ; } -pud_free (&init_mm, (pud_t *)page_to_virt (p4d_page (*p4d))); +pud_free (&init_mm, pud_start);p4d_clear (p4d); }
@@ -335,7 +335,7 @@ static void kasan_free_p4d(p4d_t *p4d_streturn ; } -p4d_free (&init_mm, (p4d_t *)page_to_virt (pgd_page (*pgd))); +p4d_free (&init_mm, p4d_start);pgd_clear (pgd); }
Greg Kroah-Hartman
maintainerPATCH 82/776 media: vidtv: fix nfeeds state corruption on start_streaming failure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruslan Valiyev <[email protected]>
commit a0e5a598fe9a4612b852406b51153b881592aede upstream.
syzbot reported a memory leak in vidtv_psi_service_desc_init [1].
When vidtv_start_streaming() fails inside vidtv_start_feed(), the nfeeds counter is left incremented even though no feed was actually started. This corrupts the driver state: subsequent start_feed calls see nfeeds > 1 and skip starting the mux, while stop_feed calls eventually try to stop a non-existent stream.
This state corruption can also lead to memory leaks, since the mux and channel resources may be partially allocated during a failed start_streaming but never cleaned up, as the stop path finds dvb->streaming == false and returns early.
Fix by decrementing nfeeds back when start_streaming fails, keeping the counter in sync with the actual number of active feeds.
[1]
BUG: memory leak unreferenced object 0xffff888145b50820 (size 32): comm "syz.0.17", pid 6068, jiffies 4294944486 backtrace (crc 90a0c7d4): vidtv_psi_service_desc_init+0x74/0x1b0 drivers/media/test-drivers/vidtv/vidtv_psi.c:288 vidtv_channel_s302m_init+0xb1/0x2a0 drivers/media/test-drivers/vidtv/vidtv_channel.c:83 vidtv_channels_init+0x1b/0x40 drivers/media/test-drivers/vidtv/vidtv_channel.c:524 vidtv_mux_init+0x516/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:518 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 [inline] vidtv_start_feed+0x33e/0x4d0 drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
--- drivers/media/test-drivers/vidtv/vidtv_bridge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/test-drivers/vidtv/vidtv_bridge.c +3 -1
@@ -237,8 +237,10 @@ static int vidtv_start_feed(struct dvb_dif (dvb->nfeeds ==1 ) { ret =vidtv_start_streaming (dvb); -if (ret <0 ) +if (ret <0 ) { + dvb->nfeeds--; rc = ret; + } }mutex_unlock (&dvb->feed_lock);
Greg Kroah-Hartman
maintainerPATCH 83/776 media: em28xx: fix use-after-free in em28xx_v4l2_open()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhishek Kumar <[email protected]>
commit a66485a934c7187ae8e36517d40615fa2e961cff upstream.
em28xx_v4l2_open() reads dev->v4l2 without holding dev->lock, creating a race with em28xx_v4l2_init()'s error path and em28xx_v4l2_fini(), both of which free the em28xx_v4l2 struct and set dev->v4l2 to NULL under dev->lock.
This race leads to two issues:
- use-after-free in v4l2_fh_init() when accessing vdev->ctrl_handler, since the video_device is embedded in the freed em28xx_v4l2 struct.
- NULL pointer dereference in em28xx_resolution_set() when accessing v4l2->norm, since dev->v4l2 has been set to NULL.
Fix this by moving the mutex_lock() before the dev->v4l2 read and adding a NULL check for dev->v4l2 under the lock.
--- drivers/media/usb/em28xx/em28xx-video.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/media/usb/em28xx/em28xx-video.c +10 -4
@@ -2136,7 +2136,7 @@ static int em28xx_v4l2_open(struct file {struct video_device *vdev =video_devdata (filp);struct em28xx *dev =video_drvdata (filp); -struct em28xx_v4l2 *v4l2 = dev->v4l2; +struct em28xx_v4l2 *v4l2;enum v4l2_buf_type fh_type =0 ;int ret;
@@ -2153,13 +2153,19 @@ static int em28xx_v4l2_open(struct filereturn -EINVAL ; } +if (mutex_lock_interruptible (&dev->lock)) +return -ERESTARTSYS ; + + v4l2 = dev->v4l2; +if (!v4l2) { +mutex_unlock (&dev->lock); +return -ENODEV ; + } +em28xx_videodbg ("open dev=%s type=%s users=%d\n" ,video_device_node_name (vdev), v4l2_type_names[fh_type], v4l2->users); -if (mutex_lock_interruptible (&dev->lock)) -return -ERESTARTSYS ; - ret =v4l2_fh_open (filp);if (ret) { dev_err(&dev->intf->dev,
Greg Kroah-Hartman
maintainerPATCH 84/776 ALSA: 6fire: fix use-after-free on disconnect
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Berk Cem Goksel <[email protected]>
commit b9c826916fdce6419b94eb0cd8810fdac18c2386 upstream.
In usb6fire_chip_abort(), the chip struct is allocated as the card's private data (via snd_card_new with sizeof(struct sfire_chip)). When snd_card_free_when_closed() is called and no file handles are open, the card and embedded chip are freed synchronously. The subsequent chip->card = NULL write then hits freed slab memory.
Call trace: usb6fire_chip_abort sound/usb/6fire/chip.c:59 [inline] usb6fire_chip_disconnect+0x348/0x358 sound/usb/6fire/chip.c:182 usb_unbind_interface+0x1a8/0x88c drivers/usb/core/driver.c:458 ... hub_event+0x1a04/0x4518 drivers/usb/core/hub.c:5953
Fix by moving the card lifecycle out of usb6fire_chip_abort() and into usb6fire_chip_disconnect(). The card pointer is saved in a local before any teardown, snd_card_disconnect() is called first to prevent new opens, URBs are aborted while chip is still valid, and snd_card_free_when_closed() is called last so chip is never accessed after the card may be freed.
--- sound/usb/6fire/chip.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
sound/usb/6fire/chip.c +12 -5
@@ -53,11 +53,6 @@ static void usb6fire_chip_abort(struct susb6fire_comm_abort (chip);if (chip->control)usb6fire_control_abort (chip); -if (chip->card) { -snd_card_disconnect (chip->card); -snd_card_free_when_closed (chip->card); - chip->card =NULL ; - } } }
@@ -170,6 +165,7 @@ destroy_chip:static void usb6fire_chip_disconnect (struct usb_interface *intf) {struct sfire_chip *chip; +struct snd_card *card; chip =usb_get_intfdata (intf);if (chip) {/* if !chip, fw upload has been performed */
@@ -180,8 +176,19 @@ static void usb6fire_chip_disconnect(str chips[chip->regidx] =NULL ;mutex_unlock (®ister_mutex); +/* +* Save card pointer before teardown. +* snd_card_free_when_closed() may free card (and +* the embedded chip) immediately, so it must be +* called last and chip must not be accessed after. +*/ + card = chip->card; chip->shutdown = true; +if (card) +snd_card_disconnect (card);usb6fire_chip_abort (chip); +if (card) +snd_card_free_when_closed (card); } } }
Greg Kroah-Hartman
maintainerPATCH 85/776 bcache: fix cached_dev.sb_bio use-after-free and crash
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingzhe Zou <[email protected]>
commit fec114a98b8735ee89c75216c45a78e28be0f128 upstream.
In our production environment, we have received multiple crash reports regarding libceph, which have caught our attention:
``` [6888366.280350] Call Trace: [6888366.280452] blk_update_request+0x14e/0x370 [6888366.280561] blk_mq_end_request+0x1a/0x130 [6888366.280671] rbd_img_handle_request+0x1a0/0x1b0 [rbd] [6888366.280792] rbd_obj_handle_request+0x32/0x40 [rbd] [6888366.280903] __complete_request+0x22/0x70 [libceph] [6888366.281032] osd_dispatch+0x15e/0xb40 [libceph] [6888366.281164] ? inet_recvmsg+0x5b/0xd0 [6888366.281272] ? ceph_tcp_recvmsg+0x6f/0xa0 [libceph] [6888366.281405] ceph_con_process_message+0x79/0x140 [libceph] [6888366.281534] ceph_con_v1_try_read+0x5d7/0xf30 [libceph] [6888366.281661] ceph_con_workfn+0x329/0x680 [libceph] ```
After analyzing the coredump file, we found that the address of dc->sb_bio has been freed. We know that cached_dev is only freed when it is stopped.
Since sb_bio is a part of struct cached_dev, rather than an alloc every time. If the device is stopped while writing to the superblock, the released address will be accessed at endio.
This patch hopes to wait for sb_write to complete in cached_dev_free.
It should be noted that we analyzed the cause of the problem, then tell all details to the QWEN and adopted the modifications it made.
--- drivers/md/bcache/super.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/md/bcache/super.c +7 -0
@@ -1377,6 +1377,13 @@ static void cached_dev_free(struct closumutex_unlock (&bch_register_lock); +/* +* Wait for any pending sb_write to complete before free. +* The sb_bio is embedded in struct cached_dev, so we must +* ensure no I/O is in progress. +*/ +closure_sync (&dc->sb_write); +if (dc->sb_disk)put_page (virt_to_page (dc->sb_disk));
Greg Kroah-Hartman
maintainerPATCH 86/776 media: as102: fix to not free memory after the device is registered in as102_usb_probe()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
commit 8bd29dbe03fc5b0f039ab2395ff37b64236d2f0c upstream.
In as102_usb driver, the following race condition occurs:
```
CPU0 CPU1
as102_usb_probe()
kzalloc(); // alloc as102_dev_t
....
usb_register_dev();
fd = sys_open("/path/to/dev"); // open as102 fd
....
usb_deregister_dev();
....
kfree(); // free as102_dev_t
....
sys_close(fd);
as102_release() // UAF!!
as102_usb_release()
kfree(); // DFB!!
```When a USB character device registered with usb_register_dev() is later unregistered (via usb_deregister_dev() or disconnect), the device node is removed so new open() calls fail. However, file descriptors that are already open do not go away immediately: they remain valid until the last reference is dropped and the driver's .release() is invoked.
In as102, as102_usb_probe() calls usb_register_dev() and then, on an error path, does usb_deregister_dev() and frees as102_dev_t right away. If userspace raced a successful open() before the deregistration, that open FD will later hit as102_release() --> as102_usb_release() and access or free as102_dev_t again, occur a race to use-after-free and double-free vuln.
The fix is to never kfree(as102_dev_t) directly once usb_register_dev() has succeeded. After deregistration, defer freeing memory to .release().
In other words, let release() perform the last kfree when the final open FD is closed.
--- drivers/media/usb/as102/as102_usb_drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/usb/as102/as102_usb_drv.c +2 -0
@@ -405,7 +405,9 @@ static int as102_usb_probe(struct usb_in failed_dvb:as102_free_usb_stream_buffer (as102_dev); failed_stream: +usb_set_intfdata (intf,NULL );usb_deregister_dev (intf, &as102_usb_class_driver); +return ret; failed:usb_put_dev (as102_dev->bus_adap.usb_dev);usb_set_intfdata (intf,NULL );
Greg Kroah-Hartman
maintainerPATCH 87/776 nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <[email protected]>
commit 4a4e0328edd9e9755843787d28f16dd4165f8b48 upstream.
The DAT inode's btree node cache (i_assoc_inode) is initialized lazily during btree operations. However, nilfs_mdt_save_to_shadow_map() assumes i_assoc_inode is already initialized when copying dirty pages to the shadow map during GC.
If NILFS_IOCTL_CLEAN_SEGMENTS is called immediately after mount before any btree operation has occurred on the DAT inode, i_assoc_inode is NULL leading to a general protection fault.
Fix this by calling nilfs_attach_btree_node_cache() on the DAT inode in nilfs_dat_read() at mount time, ensuring i_assoc_inode is always initialized before any GC operation can use it.
--- fs/nilfs2/dat.c | 3 +++ 1 file changed, 3 insertions(+)
fs/nilfs2/dat.c +3 -0
@@ -515,6 +515,9 @@ int nilfs_dat_read(struct super_block *sif (err) goto failed; + err =nilfs_attach_btree_node_cache (dat); +if (err) + goto failed; err =nilfs_read_inode_common (dat, raw_inode);if (err) goto failed;
Greg Kroah-Hartman
maintainerPATCH 88/776 media: vidtv: fix pass-by-value structs causing MSAN warnings
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abd-Alrhman Masalkhi <[email protected]>
commit 5f8e73bde67e931468bc2a1860d78d72f0c6ba41 upstream.
vidtv_ts_null_write_into() and vidtv_ts_pcr_write_into() take their argument structs by value, causing MSAN to report uninit-value warnings. While only vidtv_ts_null_write_into() has triggered a report so far, both functions share the same issue.
Fix by passing both structs by const pointer instead, avoiding the stack copy of the struct along with its MSAN shadow and origin metadata. The functions do not modify the structs, which is enforced by the const qualifier.
--- drivers/media/test-drivers/vidtv/vidtv_mux.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_ts.c | 50 +++++++++++++-------------- drivers/media/test-drivers/vidtv/vidtv_ts.h | 4 +- 3 files changed, 29 insertions(+), 29 deletions(-)
drivers/media/test-drivers/vidtv/vidtv_mux.c +2 -2
@@ -233,7 +233,7 @@ static u32 vidtv_mux_push_pcr(struct vid/* the 27Mhz clock will feed both parts of the PCR bitfield */ args.pcr = m->timing.clk; - nbytes +=vidtv_ts_pcr_write_into (args); + nbytes +=vidtv_ts_pcr_write_into (&args); m->mux_buf_offset += nbytes; m->num_streamed_pcr++;
@@ -363,7 +363,7 @@ static u32 vidtv_mux_pad_with_nulls(stru args.continuity_counter = &ctx->cc;for (i =0 ; i < npkts; ++i) { - m->mux_buf_offset +=vidtv_ts_null_write_into (args); + m->mux_buf_offset +=vidtv_ts_null_write_into (&args); args.dest_offset = m->mux_buf_offset; }
drivers/media/test-drivers/vidtv/vidtv_ts.c +25 -25
97 lines not on this page · raw message
drivers/media/test-drivers/vidtv/vidtv_ts.h +2 -2
@@ -90,7 +90,7 @@ void vidtv_ts_inc_cc(u8 *continuity_coun* * Return: The number of bytes written into the buffer. */ -u32 vidtv_ts_null_write_into (struct null_packet_write_args args); +u32 vidtv_ts_null_write_into (const struct null_packet_write_args *args);/** * vidtv_ts_pcr_write_into - Write a PCR packet into a buffer.
@@ -101,6 +101,6 @@ u32 vidtv_ts_null_write_into(struct null* * Return: The number of bytes written into the buffer. */ -u32 vidtv_ts_pcr_write_into (struct pcr_write_args args); +u32 vidtv_ts_pcr_write_into (const struct pcr_write_args *args);#endif //VIDTV_TS_H
Greg Kroah-Hartman
maintainerPATCH 89/776 media: hackrf: fix to not free memory after the device is registered in hackrf_probe()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
commit 3b7da2b4d0fe014eff181ed37e3bf832eb8ed258 upstream.
In hackrf driver, the following race condition occurs:
```
CPU0 CPU1
hackrf_probe()
kzalloc(); // alloc hackrf_dev
....
v4l2_device_register();
....
fd = sys_open("/path/to/dev"); // open hackrf fd
....
v4l2_device_unregister();
....
kfree(); // free hackrf_dev
....
sys_ioctl(fd, ...);
v4l2_ioctl();
video_is_registered() // UAF!!
....
sys_close(fd);
v4l2_release() // UAF!!
hackrf_video_release()
kfree(); // DFB!!
```When a V4L2 or video device is unregistered, the device node is removed so new open() calls are blocked.
However, file descriptors that are already open-and any in-flight I/O-do not terminate immediately; they remain valid until the last reference is dropped and the driver's release() is invoked.
Therefore, freeing device memory on the error path after hackrf_probe() has registered dev it will lead to a race to use-after-free vuln, since those already-open handles haven't been released yet.
And since release() free memory too, race to use-after-free and double-free vuln occur.
To prevent this, if device is registered from probe(), it should be modified to free memory only through release() rather than calling kfree() directly.
--- drivers/media/usb/hackrf/hackrf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/media/usb/hackrf/hackrf.c +4 -3
@@ -1485,7 +1485,7 @@ static int hackrf_probe(struct usb_interif (ret) {dev_err (dev->dev,"Failed to register as video device (%d)\n" , ret); - goto err_v4l2_device_unregister; + goto err_v4l2_device_put; }dev_info (dev->dev,"Registered as %s\n" ,video_device_node_name (&dev->rx_vdev));
@@ -1514,8 +1514,9 @@ static int hackrf_probe(struct usb_interreturn 0 ; err_video_unregister_device_rx:video_unregister_device (&dev->rx_vdev); -err_v4l2_device_unregister: -v4l2_device_unregister (&dev->v4l2_dev); +err_v4l2_device_put: +v4l2_device_put (&dev->v4l2_dev); +return ret; err_v4l2_ctrl_handler_free_tx:v4l2_ctrl_handler_free (&dev->tx_ctrl_handler); err_v4l2_ctrl_handler_free_rx:
Greg Kroah-Hartman
maintainerPATCH 90/776 net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cezar Bulinaru <[email protected]>
commit 4f61f133f354853bc394ec7d6028adb9b02dd701 upstream.
Fixes a NULL pointer derefence bug triggered from tap driver. When tap_get_user calls virtio_net_hdr_to_skb the skb->dev is null (in tap.c skb->dev is set after the call to virtio_net_hdr_to_skb) virtio_net_hdr_to_skb calls dev_parse_header_protocol which needs skb->dev field to be valid.
The line that trigers the bug is in dev_parse_header_protocol (dev is at offset 0x10 from skb and is stored in RAX register)
if (!dev->header_ops || !dev->header_ops->parse_protocol)
22e1: mov 0x10(%rbx),%rax 22e5: mov 0x230(%rax),%rax
Setting skb->dev before the call in tap.c fixes the issue.
BUG: kernel NULL pointer dereference, address: 0000000000000230 RIP: 0010:virtio_net_hdr_to_skb.constprop.0+0x335/0x410 [tap] Code: c0 0f 85 b7 fd ff ff eb d4 41 39 c6 77 cf 29 c6 48 89 df 44 01 f6 e8 7a 79 83 c1 48 85 c0 0f 85 d9 fd ff ff eb b7 48 8b 43 10 <48> 8b 80 30 02 00 00 48 85 c0 74 55 48 8b 40 28 48 85 c0 74 4c 48 RSP: 0018:ffffc90005c27c38 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888298f25300 RCX: 0000000000000010 RDX: 0000000000000005 RSI: ffffc90005c27cb6 RDI: ffff888298f25300 RBP: ffffc90005c27c80 R08: 00000000ffffffea R09: 00000000000007e8 R10: ffff88858ec77458 R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000000014 R14: ffffc90005c27e08 R15: ffffc90005c27cb6 FS: 0000000000000000(0000) GS:ffff88858ec40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000230 CR3: 0000000281408006 CR4: 00000000003706e0 Call Trace: tap_get_user+0x3f1/0x540 [tap] tap_sendmsg+0x56/0x362 [tap] ? get_tx_bufs+0xc2/0x1e0 [vhost_net] handle_tx_copy+0x114/0x670 [vhost_net] handle_tx+0xb0/0xe0 [vhost_net] handle_tx_kick+0x15/0x20 [vhost_net] vhost_worker+0x7b/0xc0 [vhost] ? vhost_vring_call_reset+0x40/0x40 [vhost] kthread+0xfa/0x120 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30
--- drivers/net/tap.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/net/tap.c +13 -10
@@ -703,11 +703,22 @@ static ssize_t tap_get_user(struct tap_queue *q, void *msg_control,skb_reset_mac_header (skb); skb->protocol =eth_hdr (skb)->h_proto; +rcu_read_lock (); + tap =rcu_dereference (q->tap); +if (!tap) { +kfree_skb (skb); +rcu_read_unlock (); +return total_len; + } + skb->dev = tap->dev; +if (vnet_hdr_len) { err =virtio_net_hdr_to_skb (skb, &vnet_hdr,tap_is_little_endian (q)); -if (err) +if (err) { +rcu_read_unlock (); goto err_kfree; + } }skb_probe_transport_header (skb);
@@ -717,8 +728,6 @@ static ssize_t tap_get_user(struct tap_queue *q, void *msg_control, vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)skb_set_network_header (skb, depth); -rcu_read_lock (); - tap =rcu_dereference (q->tap);/* copy skb_ubuf_info for callback when skb has no error */ if (zerocopy) {skb_zcopy_init (skb, msg_control);
@@ -727,14 +736,8 @@ static ssize_t tap_get_user(struct tap_queue *q, void *msg_control, uarg->callback (NULL , uarg, false); } -if (tap) { - skb->dev = tap->dev; -dev_queue_xmit (skb); - }else { -kfree_skb (skb); - } +dev_queue_xmit (skb);rcu_read_unlock (); -return total_len; err_kfree:
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 91/776 PCI: endpoint: pci-epf-vntb: Remove duplicate resource teardown
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koichiro Den <[email protected]>
[ Upstream commit 0da63230d3ec1ec5fcc443a2314233e95bfece54 ]
epf_ntb_epc_destroy() duplicates the teardown that the caller is supposed to perform later. This leads to an oops when .allow_link fails or when .drop_link is performed. The following is an example oops of the former case:
Unable to handle kernel paging request at virtual address dead000000000108 [...] [dead000000000108] address between user and kernel address ranges Internal error: Oops: 0000000096000044 [#1] SMP [...] Call trace: pci_epc_remove_epf+0x78/0xe0 (P) pci_primary_epc_epf_link+0x88/0xa8 configfs_symlink+0x1f4/0x5a0 vfs_symlink+0x134/0x1d8 do_symlinkat+0x88/0x138 __arm64_sys_symlinkat+0x74/0xe0 [...]
Remove the helper, and drop pci_epc_put(). EPC device refcounting is tied to the configfs EPC group lifetime, and pci_epc_put() in the .drop_link path is sufficient.
--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/pci/endpoint/functions/pci-epf-vntb.c +1 -17
@@ -650,18 +650,6 @@ static void epf_ntb_mw_bar_clear(struct epf_ntb *ntb) } } -/** -* epf_ntb_epc_destroy() - Cleanup NTB EPC interface -* @ntb: NTB device that facilitates communication between HOST and vHOST -* -* Wrapper for epf_ntb_epc_destroy_interface() to cleanup all the NTB interfaces -*/ -static void epf_ntb_epc_destroy (struct epf_ntb *ntb) -{ -pci_epc_remove_epf (ntb->epf->epc, ntb->epf,0 ); -pci_epc_put (ntb->epf->epc); -} -/** * epf_ntb_init_epc_bar() - Identify BARs to be used for each of the NTB * constructs (scratchpad region, doorbell, memorywindow)
@@ -1289,7 +1277,7 @@ static int epf_ntb_bind(struct pci_epf *epf) ret =epf_ntb_init_epc_bar (ntb);if (ret) {dev_err (dev,"Failed to create NTB EPC\n" ); - goto err_bar_init; +return ret; } ret =epf_ntb_config_spad_bar_alloc (ntb);
@@ -1326,9 +1314,6 @@ static int epf_ntb_bind(struct pci_epf *epf) err_bar_alloc:epf_ntb_config_spad_bar_free (ntb); -err_bar_init: -epf_ntb_epc_destroy (ntb); -return ret; }
@@ -1344,7 +1329,6 @@ static void epf_ntb_unbind(struct pci_epf *epf)epf_ntb_epc_cleanup (ntb);epf_ntb_config_spad_bar_free (ntb); -epf_ntb_epc_destroy (ntb);pci_unregister_driver (&vntb_pci_driver); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 92/776 Revert "net: ethernet: xscale: Check for PTP support properly"
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 144dde3146985b25fa84d4e4b7c3d11e0f5fc5a4.
--- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++++- drivers/net/ethernet/xscale/ptp_ixp46x.c | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/xscale/ixp4xx_eth.c +4 -1
@@ -380,6 +380,9 @@ static int ixp4xx_hwtstamp_set(struct net_device *netdev,int ret;int ch; +if (!cpu_is_ixp46x ()) +return -EOPNOTSUPP ; +if (!netif_running (netdev))return -EINVAL ;
@@ -388,7 +391,7 @@ static int ixp4xx_hwtstamp_set(struct net_device *netdev, ret =ixp46x_ptp_find (&port->timesync_regs, &port->phc_index);if (ret) -return -EOPNOTSUPP ; +return ret; ch =PORT2CHANNEL (port); regs = port->timesync_regs;
drivers/net/ethernet/xscale/ptp_ixp46x.c +0 -3
@@ -244,9 +244,6 @@ static struct ixp_clock ixp_clock;int ixp46x_ptp_find (struct ixp46x_ts_regs *__iomem *regs,int *phc_index) { -if (!cpu_is_ixp46x ()) -return -ENODEV ; - *regs = ixp_clock.regs; *phc_index =ptp_clock_index (ixp_clock.ptp_clock);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 93/776 Revert "net: ixp4xx_eth: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()"
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 612c622ab8efe9033a33eaad874ae69c090a53e1.
--- drivers/net/ethernet/xscale/ixp4xx_eth.c | 61 +++++++++++++----------- 1 file changed, 32 insertions(+), 29 deletions(-)
drivers/net/ethernet/xscale/ixp4xx_eth.c +32 -29
@@ -371,20 +371,16 @@ static void ixp_tx_timestamp(struct port *port, struct sk_buff *skb)__raw_writel (TX_SNAPSHOT_LOCKED , ®s->channel[ch].ch_event); } -static int ixp4xx_hwtstamp_set (struct net_device *netdev, -struct kernel_hwtstamp_config *cfg, -struct netlink_ext_ack *extack) +static int hwtstamp_set (struct net_device *netdev,struct ifreq *ifr) { +struct hwtstamp_config cfg;struct ixp46x_ts_regs *regs;struct port *port =netdev_priv (netdev);int ret;int ch; -if (!cpu_is_ixp46x ()) -return -EOPNOTSUPP ; - -if (!netif_running (netdev)) -return -EINVAL ; +if (copy_from_user (&cfg, ifr->ifr_data,sizeof (cfg))) +return -EFAULT ;if (cfg.flags)/* reserved for future extensions */ return -EINVAL ;
@@ -396,10 +392,10 @@ static int ixp4xx_hwtstamp_set(struct net_device *netdev, ch =PORT2CHANNEL (port); regs = port->timesync_regs; -if (cfg->tx_type !=HWTSTAMP_TX_OFF && cfg->tx_type !=HWTSTAMP_TX_ON ) +if (cfg.tx_type !=HWTSTAMP_TX_OFF && cfg.tx_type !=HWTSTAMP_TX_ON )return -ERANGE ; -switch (cfg->rx_filter) { +switch (cfg.rx_filter) {case HWTSTAMP_FILTER_NONE : port->hwts_rx_en =0 ;break ;
@@ -415,45 +411,39 @@ static int ixp4xx_hwtstamp_set(struct net_device *netdev,return -ERANGE ; } - port->hwts_tx_en = cfg->tx_type ==HWTSTAMP_TX_ON ; + port->hwts_tx_en = cfg.tx_type ==HWTSTAMP_TX_ON ;/* Clear out any old time stamps. */ __raw_writel (TX_SNAPSHOT_LOCKED |RX_SNAPSHOT_LOCKED , ®s->channel[ch].ch_event); -return 0 ; +return copy_to_user (ifr->ifr_data, &cfg,sizeof (cfg)) ? -EFAULT :0 ; } -static int ixp4xx_hwtstamp_get (struct net_device *netdev, -struct kernel_hwtstamp_config *cfg) +static int hwtstamp_get (struct net_device *netdev,struct ifreq *ifr) { +struct hwtstamp_config cfg;struct port *port =netdev_priv (netdev); -if (!cpu_is_ixp46x ()) -return -EOPNOTSUPP ; - -if (!netif_running (netdev)) -return -EINVAL ; - - cfg->flags =0 ; - cfg->tx_type = port->hwts_tx_en ?HWTSTAMP_TX_ON :HWTSTAMP_TX_OFF ; + cfg.flags =0 ; + cfg.tx_type = port->hwts_tx_en ?HWTSTAMP_TX_ON :HWTSTAMP_TX_OFF ;switch (port->hwts_rx_en) {case 0 : - cfg->rx_filter =HWTSTAMP_FILTER_NONE ; + cfg.rx_filter =HWTSTAMP_FILTER_NONE ;break ;case PTP_SLAVE_MODE : - cfg->rx_filter =HWTSTAMP_FILTER_PTP_V1_L4_SYNC ; + cfg.rx_filter =HWTSTAMP_FILTER_PTP_V1_L4_SYNC ;break ;case PTP_MASTER_MODE : - cfg->rx_filter =HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ; + cfg.rx_filter =HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ;break ;default :WARN_ON_ONCE (1 );return -ERANGE ; } -return 0 ; +return copy_to_user (ifr->ifr_data, &cfg,sizeof (cfg)) ? -EFAULT :0 ; } static int ixp4xx_mdio_cmd(struct mii_bus *bus, int phy_id, int location,
@@ -975,6 +965,21 @@ static void eth_set_mcast_list(struct net_device *dev) } +static int eth_ioctl (struct net_device *dev,struct ifreq *req,int cmd) +{ +if (!netif_running (dev)) +return -EINVAL ; + +if (cpu_is_ixp46x ()) { +if (cmd ==SIOCSHWTSTAMP ) +return hwtstamp_set (dev, req); +if (cmd ==SIOCGHWTSTAMP ) +return hwtstamp_get (dev, req); + } + +return phy_mii_ioctl (dev->phydev, req, cmd); +} +/* ethtool support */ static void ixp4xx_get_drvinfo(struct net_device *dev,
@@ -1360,11 +1365,9 @@ static const struct net_device_ops ixp4xx_netdev_ops = { .ndo_stop = eth_close, .ndo_start_xmit = eth_xmit, .ndo_set_rx_mode = eth_set_mcast_list, - .ndo_eth_ioctl = phy_do_ioctl_running, + .ndo_eth_ioctl = eth_ioctl, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, - .ndo_hwtstamp_get = ixp4xx_hwtstamp_get, - .ndo_hwtstamp_set = ixp4xx_hwtstamp_set, };#ifdef CONFIG_OF
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 94/776 ipv6: add NULL checks for idev in SRv6 paths
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Minhong He <[email protected]>
[ Upstream commit 06413793526251870e20402c39930804f14d59c0 ]
__in6_dev_get() can return NULL when the device has no IPv6 configuration (e.g. MTU < IPV6_MIN_MTU or after NETDEV_UNREGISTER).
Add NULL checks for idev returned by __in6_dev_get() in both seg6_hmac_validate_skb() and ipv6_srh_rcv() to prevent potential NULL pointer dereferences.
--- net/ipv6/exthdrs.c | 4 ++++ net/ipv6/seg6_hmac.c | 2 ++ 2 files changed, 6 insertions(+)
net/ipv6/exthdrs.c +4 -0
@@ -373,6 +373,10 @@ static int ipv6_srh_rcv(struct sk_buff *skb) hdr = (struct ipv6_sr_hdr *)skb_transport_header (skb); idev =__in6_dev_get (skb->dev); +if (!idev) { +kfree_skb (skb); +return -1 ; + } accept_seg6 = net->ipv6.devconf_all->seg6_enabled;if (accept_seg6 > idev->cnf.seg6_enabled)
net/ipv6/seg6_hmac.c +2 -0
@@ -244,6 +244,8 @@ bool seg6_hmac_validate_skb(struct sk_buff *skb)struct inet6_dev *idev; idev =__in6_dev_get (skb->dev); +if (!idev) +return false; srh = (struct ipv6_sr_hdr *)skb_transport_header (skb);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 95/776 gfs2: Improve gfs2_consist_inode() usage
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Price <[email protected]>
[ Upstream commit 10398ef57aa189153406c110f5957145030f08fe ]
gfs2_consist_inode() logs an error message with the source file and line number. When we jump before calling it, the line number becomes less useful as it no longer relates to the source of the error. To aid troubleshooting, replace the gotos with the gfs2_consist_inode() calls so that the error messages are more informative.
--- fs/gfs2/dir.c | 31 +++++++++++++++++-------------- fs/gfs2/glops.c | 34 ++++++++++++++++++++-------------- fs/gfs2/xattr.c | 28 ++++++++++++++++------------ 3 files changed, 53 insertions(+), 40 deletions(-)
fs/gfs2/dir.c +17 -14
@@ -562,15 +562,18 @@ static struct gfs2_dirent *gfs2_dirent_scan(struct inode *inode, void *buf,int ret =0 ; ret =gfs2_dirent_offset (GFS2_SB (inode), buf); -if (ret <0 ) - goto consist_inode; - +if (ret <0 ) { +gfs2_consist_inode (GFS2_I (inode)); +return ERR_PTR (-EIO ); + } offset = ret; prev =NULL ; dent = buf + offset; size =be16_to_cpu (dent->de_rec_len); -if (gfs2_check_dirent (GFS2_SB (inode), dent, offset, size, len,1 )) - goto consist_inode; +if (gfs2_check_dirent (GFS2_SB (inode), dent, offset, size, len,1 )) { +gfs2_consist_inode (GFS2_I (inode)); +return ERR_PTR (-EIO ); + } do { ret = scan(dent, name, opaque); if (ret)
@@ -582,8 +585,10 @@ static struct gfs2_dirent *gfs2_dirent_scan(struct inode *inode, void *buf, dent = buf + offset; size =be16_to_cpu (dent->de_rec_len);if (gfs2_check_dirent (GFS2_SB (inode), dent, offset, size, - len,0 )) - goto consist_inode; + len,0 )) { +gfs2_consist_inode (GFS2_I (inode)); +return ERR_PTR (-EIO ); + } }while (1 );switch (ret) {
@@ -597,10 +602,6 @@ static struct gfs2_dirent *gfs2_dirent_scan(struct inode *inode, void *buf,BUG_ON (ret >0 );return ERR_PTR (ret); } - -consist_inode: -gfs2_consist_inode (GFS2_I (inode)); -return ERR_PTR (-EIO ); } static int dirent_check_reclen(struct gfs2_inode *dip,
@@ -609,14 +610,16 @@ static int dirent_check_reclen(struct gfs2_inode *dip,const void *ptr = d;u16 rec_len =be16_to_cpu (d->de_rec_len); -if (unlikely (rec_len <sizeof (struct gfs2_dirent ))) - goto broken; +if (unlikely (rec_len <sizeof (struct gfs2_dirent ))) { +gfs2_consist_inode (dip); +return -EIO ; + } ptr += rec_len;if (ptr < end_p)return rec_len;if (ptr == end_p)return -ENOENT ; -broken: +gfs2_consist_inode (dip);return -EIO ; }
fs/gfs2/glops.c +20 -14
@@ -405,10 +405,14 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)struct inode *inode = &ip->i_inode;bool is_new = inode->i_state &I_NEW ; -if (unlikely (ip->i_no_addr !=be64_to_cpu (str->di_num.no_addr))) - goto corrupt; -if (unlikely (!is_new &&inode_wrong_type (inode, mode))) - goto corrupt; +if (unlikely (ip->i_no_addr !=be64_to_cpu (str->di_num.no_addr))) { +gfs2_consist_inode (ip); +return -EIO ; + } +if (unlikely (!is_new &&inode_wrong_type (inode, mode))) { +gfs2_consist_inode (ip); +return -EIO ; + } ip->i_no_formal_ino =be64_to_cpu (str->di_num.no_formal_ino); inode->i_mode = mode;if (is_new) {
@@ -444,26 +448,28 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)/* i_diskflags and i_eattr must be set before gfs2_set_inode_flags() */ gfs2_set_inode_flags (inode); height =be16_to_cpu (str->di_height); -if (unlikely (height > sdp->sd_max_height)) - goto corrupt; +if (unlikely (height > sdp->sd_max_height)) { +gfs2_consist_inode (ip); +return -EIO ; + } ip->i_height = (u8 )height; depth =be16_to_cpu (str->di_depth); -if (unlikely (depth >GFS2_DIR_MAX_DEPTH )) - goto corrupt; +if (unlikely (depth >GFS2_DIR_MAX_DEPTH )) { +gfs2_consist_inode (ip); +return -EIO ; + } ip->i_depth = (u8 )depth; ip->i_entries =be32_to_cpu (str->di_entries); -if (gfs2_is_stuffed (ip) && inode->i_size >gfs2_max_stuffed_size (ip)) - goto corrupt; - +if (gfs2_is_stuffed (ip) && inode->i_size >gfs2_max_stuffed_size (ip)) { +gfs2_consist_inode (ip); +return -EIO ; + }if (S_ISREG (inode->i_mode))gfs2_set_aops (inode);return 0 ; -corrupt: -gfs2_consist_inode (ip); -return -EIO ; }/**
fs/gfs2/xattr.c +16 -12
@@ -96,30 +96,34 @@ static int ea_foreach_i(struct gfs2_inode *ip, struct buffer_head *bh,return -EIO ;for (ea =GFS2_EA_BH2FIRST (bh);; prev = ea, ea =GFS2_EA2NEXT (ea)) { -if (!GFS2_EA_REC_LEN (ea)) - goto fail; +if (!GFS2_EA_REC_LEN (ea)) { +gfs2_consist_inode (ip); +return -EIO ; + }if (!(bh->b_data <= (char *)ea && (char *)GFS2_EA2NEXT (ea) <= - bh->b_data + bh->b_size)) - goto fail; -if (!gfs2_eatype_valid (sdp, ea->ea_type)) - goto fail; + bh->b_data + bh->b_size)) { +gfs2_consist_inode (ip); +return -EIO ; + } +if (!gfs2_eatype_valid (sdp, ea->ea_type)) { +gfs2_consist_inode (ip); +return -EIO ; + } error =ea_call (ip, bh, ea, prev, data);if (error)return error;if (GFS2_EA_IS_LAST (ea)) {if ((char *)GFS2_EA2NEXT (ea) != - bh->b_data + bh->b_size) - goto fail; + bh->b_data + bh->b_size) { +gfs2_consist_inode (ip); +return -EIO ; + }break ; } }return error; - -fail: -gfs2_consist_inode (ip); -return -EIO ; }static int ea_foreach (struct gfs2_inode *ip,ea_call_t ea_call,void *data)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 96/776 gfs2: Validate i_depth for exhash directories
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Price <[email protected]>
[ Upstream commit 557c024ca7250bb65ae60f16c02074106c2f197b ]
A fuzzer test introduced corruption that ends up with a depth of 0 in dir_e_read(), causing an undefined shift by 32 at:
index = hash >> (32 - dip->i_depth);
As calculated in an open-coded way in dir_make_exhash(), the minimum depth for an exhash directory is ilog2(sdp->sd_hash_ptrs) and 0 is invalid as sdp->sd_hash_ptrs is fixed as sdp->bsize / 16 at mount time.
So we can avoid the undefined behaviour by checking for depth values lower than the minimum in gfs2_dinode_in(). Values greater than the maximum are already being checked for there.
Also switch the calculation in dir_make_exhash() to use ilog2() to clarify how the depth is calculated.
Tested with the syzkaller repro.c and xfstests '-g quick'.
--- fs/gfs2/dir.c | 6 ++---- fs/gfs2/glops.c | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-)
fs/gfs2/dir.c +2 -4
@@ -60,6 +60,7 @@#include <linux/crc32.h> #include <linux/vmalloc.h> #include <linux/bio.h> +#include <linux/log2.h> #include "gfs2.h" #include "incore.h"
@@ -912,7 +913,6 @@ static int dir_make_exhash(struct inode *inode)struct qstr args;struct buffer_head *bh, *dibh;struct gfs2_leaf *leaf; -int y;u32 x;__be64 *lp;u64 bn;
@@ -979,9 +979,7 @@ static int dir_make_exhash(struct inode *inode)i_size_write (inode, sdp->sd_sb.sb_bsize /2 );gfs2_add_inode_blocks (&dip->i_inode,1 ); dip->i_diskflags |=GFS2_DIF_EXHASH ; - -for (x = sdp->sd_hash_ptrs, y =-1 ; x; x >>=1 , y++) ; - dip->i_depth = y; + dip->i_depth =ilog2 (sdp->sd_hash_ptrs);gfs2_dinode_out (dip, dibh->b_data);
fs/gfs2/glops.c +6 -0
@@ -11,6 +11,7 @@#include <linux/bio.h> #include <linux/posix_acl.h> #include <linux/security.h> +#include <linux/log2.h> #include "gfs2.h" #include "incore.h"
@@ -459,6 +460,11 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)gfs2_consist_inode (ip);return -EIO ; } +if ((ip->i_diskflags &GFS2_DIF_EXHASH ) && + depth <ilog2 (sdp->sd_hash_ptrs)) { +gfs2_consist_inode (ip); +return -EIO ; + } ip->i_depth = (u8 )depth; ip->i_entries =be32_to_cpu (str->di_entries);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 97/776 wifi: mac80211: always free skb on ieee80211_tx_prepare_skb() failure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit d5ad6ab61cbd89afdb60881f6274f74328af3ee9 ]
ieee80211_tx_prepare_skb() has three error paths, but only two of them free the skb. The first error path (ieee80211_tx_prepare() returning TX_DROP) does not free it, while invoke_tx_handlers() failure and the fragmentation check both do.
Add kfree_skb() to the first error path so all three are consistent, and remove the now-redundant frees in callers (ath9k, mt76, mac80211_hwsim) to avoid double-free.
Document the skb ownership guarantee in the function's kdoc.
[ Exclude changes to drivers/net/wireless/mediatek/mt76/scan.c as this file is first
introduced by commit 31083e38548f("wifi: mt76: add code for emulating hardware scanning") after linux-6.14.]
--- drivers/net/wireless/ath/ath9k/channel.c | 6 ++---- drivers/net/wireless/mac80211_hwsim.c | 1 - include/net/mac80211.h | 4 ++++ net/mac80211/tx.c | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/channel.c +2 -4
@@ -1011,7 +1011,7 @@ static void ath_scan_send_probe(struct ath_softc *sc,skb_set_queue_mapping (skb,IEEE80211_AC_VO );if (!ieee80211_tx_prepare_skb (sc->hw, vif, skb, band,NULL )) - goto error; +return ; txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO ];if (ath_tx_start (sc->hw, skb, &txctl))
@@ -1124,10 +1124,8 @@ ath_chanctx_send_vif_ps_frame(struct ath_softc *sc, struct ath_vif *avp, skb->priority =7 ;skb_set_queue_mapping (skb,IEEE80211_AC_VO ); -if (!ieee80211_tx_prepare_skb (sc->hw, vif, skb, band, &sta)) { -dev_kfree_skb_any (skb); +if (!ieee80211_tx_prepare_skb (sc->hw, vif, skb, band, &sta))return false; - }break ;default :return false;
drivers/net/wireless/mac80211_hwsim.c +0 -1
@@ -2347,7 +2347,6 @@ static void hw_scan_work(struct work_struct *work) hwsim->tmp_chan->band, NULL)) {rcu_read_unlock (); -kfree_skb (probe);continue ; }
include/net/mac80211.h +4 -0
@@ -6454,6 +6454,10 @@ void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif,* @band: the band to transmit on * @sta: optional pointer to get the station to send the frame to * +* Return: %true if the skb was prepared, %false otherwise. +* On failure, the skb is freed by this function; callers must not +* free it again. +* * Note: must be called under RCU lock */ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
net/mac80211/tx.c +3 -1
@@ -1882,8 +1882,10 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,struct ieee80211_tx_data tx;struct sk_buff *skb2; -if (ieee80211_tx_prepare (sdata, &tx,NULL , skb) ==TX_DROP ) +if (ieee80211_tx_prepare (sdata, &tx,NULL , skb) ==TX_DROP ) { +kfree_skb (skb);return false; + } info->band = band; info->control.vif = vif;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 98/776 PCI/ACPI: Restrict program_hpx_type2() to AER bits
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Håkon Bugge <[email protected]>
commit 9abf79c8d7b40db0e5a34aa8c744ea60ff9a3fcf upstream.
Previously program_hpx_type2() applied PCIe settings unconditionally, which could incorrectly change bits like Extended Tag Field Enable and Enable Relaxed Ordering.
When _HPX was added to ACPI r3.0, the intent of the PCIe Setting Record (Type 2) in sec 6.2.7.3 was to configure AER registers when the OS does not own the AER Capability:
The PCI Express setting record contains ... [the AER] Uncorrectable Error Mask, Uncorrectable Error Severity, Correctable Error Mask ... to be used when configuring registers in the Advanced Error Reporting Extended Capability Structure ...
OSPM [1] will only evaluate _HPX with Setting Record – Type 2 if OSPM is not controlling the PCI Express Advanced Error Reporting capability.
ACPI r3.0b, sec 6.2.7.3, added more AER registers, including registers in the PCIe Capability with AER-related bits, and the restriction that the OS use this only when it owns PCIe native hotplug:
... when configuring PCI Express registers in the Advanced Error Reporting Extended Capability Structure *or PCI Express Capability Structure* ...
An OS that has assumed ownership of native hot plug but does not ... have ownership of the AER register set must use ... the Type 2 record to program the AER registers ...
However, since the Type 2 record also includes register bits that have functions other than AER, the OS must ignore values ... that are not applicable.
Restrict program_hpx_type2() to only the intended purpose:
- Apply settings only when OS owns PCIe native hotplug but not AER,
- Only touch the AER-related bits (Error Reporting Enables) in Device Control
- Don't touch Link Control at all, since nothing there seems AER-related, but log _HPX settings for debugging purposes
Note that Read Completion Boundary is now configured elsewhere, since it is unrelated to _HPX.
[1] Operating System-directed configuration and Power Management
--- drivers/pci/pci-acpi.c | 59 +++++++++++++++++------------------------- drivers/pci/pci.h | 3 +++ drivers/pci/pcie/aer.c | 3 --- 3 files changed, 27 insertions(+), 38 deletions(-)
drivers/pci/pci-acpi.c +24 -35
@@ -245,21 +245,6 @@ static acpi_status decode_type1_hpx_record(union acpi_object *record,return AE_OK ; } -static bool pcie_root_rcb_set (struct pci_dev *dev) -{ -struct pci_dev *rp =pcie_find_root_port (dev); -u16 lnkctl; - -if (!rp) -return false; - -pcie_capability_read_word (rp,PCI_EXP_LNKCTL , &lnkctl); -if (lnkctl &PCI_EXP_LNKCTL_RCB ) -return true; - -return false; -} -/* _HPX PCI Express Setting Record (Type 2) */ struct hpx_type2 {u32 revision;
@@ -285,6 +270,7 @@ static void program_hpx_type2(struct pci_dev *dev, struct hpx_type2 *hpx) {int pos;u32 reg32; +const struct pci_host_bridge *host;if (!hpx)return ;
@@ -292,6 +278,15 @@ static void program_hpx_type2(struct pci_dev *dev, struct hpx_type2 *hpx)if (!pci_is_pcie (dev))return ; + host =pci_find_host_bridge (dev->bus); + +/* +* Only do the _HPX Type 2 programming if OS owns PCIe native +* hotplug but not AER. +*/ +if (!host->native_pcie_hotplug || host->native_aer) +return ; +if (hpx->revision >1 ) {pci_warn (dev,"PCIe settings rev %d not supported\n" , hpx->revision);
@@ -299,33 +294,27 @@ static void program_hpx_type2(struct pci_dev *dev, struct hpx_type2 *hpx) }/* -* Don't allow _HPX to change MPS or MRRS settings. We manage -* those to make sure they're consistent with the rest of the -* platform. +* We only allow _HPX to program DEVCTL bits related to AER, namely +* PCI_EXP_DEVCTL_CERE, PCI_EXP_DEVCTL_NFERE, PCI_EXP_DEVCTL_FERE, +* and PCI_EXP_DEVCTL_URRE. +* +* The rest of DEVCTL is managed by the OS to make sure it's +* consistent with the rest of the platform. */ - hpx->pci_exp_devctl_and |=PCI_EXP_DEVCTL_PAYLOAD | -PCI_EXP_DEVCTL_READRQ ; - hpx->pci_exp_devctl_or &= ~(PCI_EXP_DEVCTL_PAYLOAD | -PCI_EXP_DEVCTL_READRQ ); + hpx->pci_exp_devctl_and |= ~PCI_EXP_AER_FLAGS ; + hpx->pci_exp_devctl_or &=PCI_EXP_AER_FLAGS ;/* Initialize Device Control Register */ pcie_capability_clear_and_set_word (dev,PCI_EXP_DEVCTL , ~hpx->pci_exp_devctl_and, hpx->pci_exp_devctl_or); -/* Initialize Link Control Register */ +/* Log if _HPX attempts to modify Link Control Register */ if (pcie_cap_has_lnkctl (dev)) { - -/* -* If the Root Port supports Read Completion Boundary of -* 128, set RCB to 128. Otherwise, clear it. -*/ - hpx->pci_exp_lnkctl_and |=PCI_EXP_LNKCTL_RCB ; - hpx->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB ; -if (pcie_root_rcb_set (dev)) - hpx->pci_exp_lnkctl_or |=PCI_EXP_LNKCTL_RCB ; - -pcie_capability_clear_and_set_word (dev,PCI_EXP_LNKCTL , - ~hpx->pci_exp_lnkctl_and, hpx->pci_exp_lnkctl_or); +if (hpx->pci_exp_lnkctl_and !=0xffff || + hpx->pci_exp_lnkctl_or !=0 ) +pci_info (dev,"_HPX attempts Link Control setting (AND %#06x OR %#06x)\n" , + hpx->pci_exp_lnkctl_and, + hpx->pci_exp_lnkctl_or); }/* Find Advanced Error Reporting Enhanced Capability */
drivers/pci/pci.h +3 -0
@@ -11,6 +11,9 @@#define PCI_VSEC_ID_INTEL_TBT 0x1234/* Thunderbolt */ +#define PCI_EXP_AER_FLAGS (PCI_EXP_DEVCTL_CERE | PCI_EXP_DEVCTL_NFERE | \ + PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE) +extern const unsigned char pcie_link_speed[];extern bool pci_early_dump;
drivers/pci/pcie/aer.c +0 -3
@@ -214,9 +214,6 @@ void pcie_ecrc_get_policy(char *str) }#endif /* CONFIG_PCIE_ECRC */ -#define PCI_EXP_AER_FLAGS (PCI_EXP_DEVCTL_CERE | PCI_EXP_DEVCTL_NFERE | \ - PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE) -int pcie_aer_is_native (struct pci_dev *dev) {struct pci_host_bridge *host =pci_find_host_bridge (dev->bus);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 99/776 netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit 07ace0bbe03b3d8e85869af1dec5e4087b1d57b8 upstream.
pipapo relies on kmalloc(0) returning ZERO_SIZE_PTR (i.e., not NULL but pointer is invalid).
Rework this to not call slab allocator when we'd request a 0-byte allocation.
[Keerthana: In older stable branches (v6.6 and earlier), the allocation logic in pipapo_clone() still relies on src->rules rather than src->rules_alloc (introduced in v6.9 via 9f439bd6ef4f). Consequently, the previously backported INT_MAX clamping check uses src->rules. This patch correctly moves that src->rules > (INT_MAX / ...) check inside the newif (src->rules > 0) block]
--- net/netfilter/nft_set_pipapo.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
net/netfilter/nft_set_pipapo.c +14 -6
@@ -525,6 +525,8 @@ static struct nft_pipapo_elem *pipapo_geint i; m = priv->clone; +if (m->bsize_max ==0 ) +return ret; res_map =kmalloc_array (m->bsize_max,sizeof (*res_map),GFP_ATOMIC );if (!res_map) {
@@ -1365,14 +1367,20 @@ static struct nft_pipapo_match *pipapo_c src->bsize *sizeof (*dst->lt) * src->groups * NFT_PIPAPO_BUCKETS(src->bb)); -if (src->rules > (INT_MAX /sizeof (*src->mt))) - goto out_mt; +if (src->rules >0 ) { +if (src->rules > (INT_MAX /sizeof (*src->mt))) + goto out_mt; + + dst->mt =kvmalloc_array (src->rules,sizeof (*src->mt), +GFP_KERNEL ); +if (!dst->mt) + goto out_mt; - dst->mt =kvmalloc (src->rules *sizeof (*src->mt),GFP_KERNEL ); -if (!dst->mt) - goto out_mt; +memcpy (dst->mt, src->mt, src->rules *sizeof (*src->mt)); + }else { + dst->mt =NULL ; + } -memcpy (dst->mt, src->mt, src->rules *sizeof (*src->mt)); src++; dst++; }
Greg Kroah-Hartman
maintainerPATCH 100/776 powerpc64/bpf: do not increment tailcall count when prog is NULL
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hari Bathini <[email protected]>
commit 521bd39d9d28ce54cbfec7f9b89c94ad4fdb8350 upstream.
Do not increment tailcall count, if tailcall did not succeed due to missing BPF program.
[ Conflicts due to missing clean up commits
b10cb163c4b3 ("powerpc64/bpf elfv2: Setup kernel TOC in r2 on entry")
49c3af43e65f ("powerpc/bpf: Simplify bpf_to_ppc() and adopt it for powerpc64")
036d559c0bde ("powerpc/bpf: Use _Rn macros for GPRs")
and missing feature commit 2ed2d8f6fb38 ("powerpc64/bpf: Support tailcalls with subprogs") resolved accordingly. ]
--- arch/powerpc/net/bpf_jit_comp64.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
arch/powerpc/net/bpf_jit_comp64.c +11 -9
@@ -239,30 +239,32 @@ static int bpf_jit_emit_tail_call(u32 *i* tail_call_cnt++; */ EMIT (PPC_RAW_ADDI (b2p[TMP_REG_1 ], b2p[TMP_REG_1 ],1 )); -PPC_BPF_STL (b2p[TMP_REG_1 ],1 ,bpf_jit_stack_tailcallcnt (ctx));/* prog = array->ptrs[index]; */ -EMIT (PPC_RAW_MULI (b2p[TMP_REG_1 ], b2p_index,8 )); -EMIT (PPC_RAW_ADD (b2p[TMP_REG_1 ], b2p[TMP_REG_1 ], b2p_bpf_array)); -PPC_BPF_LL (b2p[TMP_REG_1 ], b2p[TMP_REG_1 ], offsetof(struct bpf_array , ptrs)); +EMIT (PPC_RAW_MULI (b2p[TMP_REG_2 ], b2p_index,8 )); +EMIT (PPC_RAW_ADD (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ], b2p_bpf_array)); +PPC_BPF_LL (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ], offsetof(struct bpf_array , ptrs));/* * if (prog == NULL) * goto out; */ -EMIT (PPC_RAW_CMPLDI (b2p[TMP_REG_1 ],0 )); +EMIT (PPC_RAW_CMPLDI (b2p[TMP_REG_2 ],0 ));PPC_BCC (COND_EQ , out);/* goto *(prog->bpf_func + prologue_size); */ -PPC_BPF_LL (b2p[TMP_REG_1 ], b2p[TMP_REG_1 ], offsetof(struct bpf_prog , bpf_func)); +PPC_BPF_LL (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ], offsetof(struct bpf_prog , bpf_func));#ifdef PPC64_ELF_ABI_v1/* skip past the function descriptor */ -EMIT (PPC_RAW_ADDI (b2p[TMP_REG_1 ], b2p[TMP_REG_1 ], +EMIT (PPC_RAW_ADDI (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ],FUNCTION_DESCR_SIZE +BPF_TAILCALL_PROLOGUE_SIZE ));#else -EMIT (PPC_RAW_ADDI (b2p[TMP_REG_1 ], b2p[TMP_REG_1 ],BPF_TAILCALL_PROLOGUE_SIZE )); +EMIT (PPC_RAW_ADDI (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ],BPF_TAILCALL_PROLOGUE_SIZE ));#endif -EMIT (PPC_RAW_MTCTR (b2p[TMP_REG_1 ])); +EMIT (PPC_RAW_MTCTR (b2p[TMP_REG_2 ])); + +/* Writeback updated tailcall count */ +PPC_BPF_STL (b2p[TMP_REG_1 ],1 ,bpf_jit_stack_tailcallcnt (ctx));/* tear down stack, restore NVRs, ... */ bpf_jit_emit_common_epilogue (image, ctx);
Greg Kroah-Hartman
maintainerPATCH 101/776 arm64: dts: imx8mq-librem5: Set the DVS voltages lower
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit c24a9b698fb02cd0723fa8375abab07f94b97b10 ]
They're still in the operating range according to i.MX 8M Quad datasheet. There's some headroom added over minimal values to account for voltage drop.
Operational ranges (min - typ - max [selected]):
- VDD_SOC (BUCK1): 0.81 - 0.9 - 0.99 [0.88]
- VDD_ARM (BUCK2): 0.81 - 0.9 - 1.05 [0.84] (1000MHz)
0.90 - 1.0 - 1.05 [0.93] (1500MHz)
- VDD_GPU (BUCK3): 0.81 - 0.9 - 1.05 [0.85] (800MHz)
0.90 - 1.0 - 1.05 [ -- ] (1000MHz)
- VDD_VPU (BUCK4): 0.81 - 0.9 - 1.05 [ -- ] (550/500/588MHz)
0.90 - 1.0 - 1.05 [0.93] (660/600/800MHz)Idle power consumption doesn't appear to be influenced much, but a simple load test (cat /dev/urandom | pigz - > /dev/null combined with running Animatch) seems to show about 0.3W of difference.
Care is advised, as there may be differences between each units in how low can they be undervolted - in my experience, reaching that point usually makes the phone fail to boot. In my case, it appears that my Birch phone can go down the most.
This is a somewhat conservative set of values that I've seen working well on all my devices; I haven't tried very hard to optimize it, so more experiments are welcome.
Stable-dep-of: 511f76bf1dce ("arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V")
--- arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts | 2 - arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 22 ++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts +1 -1
@@ -12,7 +12,7 @@ &a53_opp_table { opp-1000000000 { - opp-microvolt = <1000000>; + opp-microvolt = <950000>; }; };
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +16 -6
@@ -704,8 +704,8 @@ regulator-max-microvolt = <1300000>; regulator-boot-on; regulator-ramp-delay = <1250>; - rohm,dvs-run-voltage = <900000>; - rohm,dvs-idle-voltage = <850000>; + rohm,dvs-run-voltage = <880000>; + rohm,dvs-idle-voltage = <820000>; rohm,dvs-suspend-voltage = <800000>; regulator-always-on; };
@@ -716,8 +716,8 @@ regulator-max-microvolt = <1300000>; regulator-boot-on; regulator-ramp-delay = <1250>; - rohm,dvs-run-voltage = <1000000>; - rohm,dvs-idle-voltage = <900000>; + rohm,dvs-run-voltage = <950000>; + rohm,dvs-idle-voltage = <850000>; regulator-always-on; };
@@ -726,14 +726,14 @@ regulator-min-microvolt = <700000>; regulator-max-microvolt = <1300000>; regulator-boot-on; - rohm,dvs-run-voltage = <900000>; + rohm,dvs-run-voltage = <850000>; }; buck4_reg: BUCK4 { regulator-name = "buck4"; regulator-min-microvolt = <700000>; regulator-max-microvolt = <1300000>; - rohm,dvs-run-voltage = <1000000>; + rohm,dvs-run-voltage = <930000>; }; buck5_reg: BUCK5 {
@@ -1214,3 +1214,13 @@ fsl,ext-reset-output; status = "okay"; }; + +&a53_opp_table { + opp-1000000000 { + opp-microvolt = <850000>; + }; + + opp-1500000000 { + opp-microvolt = <950000>; + }; +};
Greg Kroah-Hartman
maintainerPATCH 102/776 arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage to 0.81V
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit 94b91e3ca6688fafd6a5dd70bd89fe9d3aee88da ]
0.8V is outside of the operating voltage specified for imx8mq, see chapter 3.1.4 "Operating ranges" of the IMX8MDQLQCEC document.
Stable-dep-of: 511f76bf1dce ("arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V")
--- arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +1 -1
@@ -706,7 +706,7 @@ regulator-ramp-delay = <1250>; rohm,dvs-run-voltage = <880000>; rohm,dvs-idle-voltage = <820000>; - rohm,dvs-suspend-voltage = <800000>; + rohm,dvs-suspend-voltage = <810000>; regulator-always-on; };
Greg Kroah-Hartman
maintainerPATCH 103/776 Revert "arm64: dts: imx8mq-librem5: Set the DVS voltages lower"
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit 4cd46ea0eb4504f7f4fea92cb4601c5c9a3e545e ]
This reverts commit c24a9b698fb02cd0723fa8375abab07f94b97b10.
It's been found that there's a significant per-unit variance in accepted supply voltages and the current set still makes some units unstable.
Revert back to nominal values.
Stable-dep-of: 511f76bf1dce ("arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V")
--- arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts | 2 - arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 22 +++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-)
arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts +1 -1
@@ -12,7 +12,7 @@ &a53_opp_table { opp-1000000000 { - opp-microvolt = <950000>; + opp-microvolt = <1000000>; }; };
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +6 -16
@@ -704,8 +704,8 @@ regulator-max-microvolt = <1300000>; regulator-boot-on; regulator-ramp-delay = <1250>; - rohm,dvs-run-voltage = <880000>; - rohm,dvs-idle-voltage = <820000>; + rohm,dvs-run-voltage = <900000>; + rohm,dvs-idle-voltage = <850000>; rohm,dvs-suspend-voltage = <810000>; regulator-always-on; };
@@ -716,8 +716,8 @@ regulator-max-microvolt = <1300000>; regulator-boot-on; regulator-ramp-delay = <1250>; - rohm,dvs-run-voltage = <950000>; - rohm,dvs-idle-voltage = <850000>; + rohm,dvs-run-voltage = <1000000>; + rohm,dvs-idle-voltage = <900000>; regulator-always-on; };
@@ -726,14 +726,14 @@ regulator-min-microvolt = <700000>; regulator-max-microvolt = <1300000>; regulator-boot-on; - rohm,dvs-run-voltage = <850000>; + rohm,dvs-run-voltage = <900000>; }; buck4_reg: BUCK4 { regulator-name = "buck4"; regulator-min-microvolt = <700000>; regulator-max-microvolt = <1300000>; - rohm,dvs-run-voltage = <930000>; + rohm,dvs-run-voltage = <1000000>; }; buck5_reg: BUCK5 {
@@ -1214,13 +1214,3 @@ fsl,ext-reset-output; status = "okay"; }; - -&a53_opp_table { - opp-1000000000 { - opp-microvolt = <850000>; - }; - - opp-1500000000 { - opp-microvolt = <950000>; - }; -};
Greg Kroah-Hartman
maintainerPATCH 104/776 arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit 511f76bf1dce5acf8907b65a7d1bc8f7e7c0d637 ]
The minimal voltage of VDD_SOC sourced from BUCK1 is 0.81V, which is the currently set value. However, BD71837 only guarantees accuracy of ±0.01V, and this still doesn't factor other reasons for actual voltage to slightly drop in, resulting in the possibility of running out of the operational range.
Bump the voltage up to 0.85V, which should give enough headroom.
--- arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +1 -1
@@ -706,7 +706,7 @@ regulator-ramp-delay = <1250>; rohm,dvs-run-voltage = <900000>; rohm,dvs-idle-voltage = <850000>; - rohm,dvs-suspend-voltage = <810000>; + rohm,dvs-suspend-voltage = <850000>; regulator-always-on; };
Greg Kroah-Hartman
maintainerPATCH 105/776 ocfs2: add inline inode consistency check to ocfs2_validate_inode_block()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit a2b1c419ff72ec62ff5831684e30cd1d4f0b09ee ]
In 'ocfs2_validate_inode_block()', add an extra check whether an inode with inline data (i.e. self-contained) has no clusters, thus preventing an invalid inode from being passed to 'ocfs2_evict_inode()' and below.
Stable-dep-of: 7bc5da4842be ("ocfs2: fix out-of-bounds write in ocfs2_write_end_inline")
--- fs/ocfs2/inode.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ocfs2/inode.c +8 -0
@@ -1416,6 +1416,14 @@ int ocfs2_validate_inode_block(struct su goto bail; } +if ((le16_to_cpu (di->i_dyn_features) &OCFS2_INLINE_DATA_FL ) && +le32_to_cpu (di->i_clusters)) { + rc =ocfs2_error (sb,"Invalid dinode %llu: %u clusters\n" , + (unsigned long long )bh->b_blocknr, +le32_to_cpu (di->i_clusters)); + goto bail; + } + rc =0 ; bail:
Greg Kroah-Hartman
maintainerPATCH 106/776 ocfs2: validate inline data i_size during inode read
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <[email protected]>
[ Upstream commit 1524af3685b35feac76662cc551cbc37bd14775f ]
When reading an inode from disk, ocfs2_validate_inode_block() performs various sanity checks but does not validate the size of inline data. If the filesystem is corrupted, an inode's i_size can exceed the actual inline data capacity (id_count).
This causes ocfs2_dir_foreach_blk_id() to iterate beyond the inline data buffer, triggering a use-after-free when accessing directory entries from freed memory.
In the syzbot report:
- i_size was 1099511627576 bytes (~1TB)
- Actual inline data capacity (id_count) is typically <256 bytes
- A garbage rec_len (54648) caused ctx->pos to jump out of bounds
- This triggered a UAF in ocfs2_check_dir_entry()
Fix by adding a validation check in ocfs2_validate_inode_block() to ensure inodes with inline data have i_size <= id_count. This catches the corruption early during inode read and prevents all downstream code from operating on invalid data.
Stable-dep-of: 7bc5da4842be ("ocfs2: fix out-of-bounds write in ocfs2_write_end_inline")
--- fs/ocfs2/inode.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
fs/ocfs2/inode.c +19 -6
@@ -1416,12 +1416,25 @@ int ocfs2_validate_inode_block(struct su goto bail; } -if ((le16_to_cpu (di->i_dyn_features) &OCFS2_INLINE_DATA_FL ) && -le32_to_cpu (di->i_clusters)) { - rc =ocfs2_error (sb,"Invalid dinode %llu: %u clusters\n" , - (unsigned long long )bh->b_blocknr, -le32_to_cpu (di->i_clusters)); - goto bail; +if (le16_to_cpu (di->i_dyn_features) &OCFS2_INLINE_DATA_FL ) { +struct ocfs2_inline_data *data = &di->id2.i_data; + +if (le32_to_cpu (di->i_clusters)) { + rc =ocfs2_error (sb, +"Invalid dinode %llu: %u clusters\n" , + (unsigned long long )bh->b_blocknr, +le32_to_cpu (di->i_clusters)); + goto bail; + } + +if (le64_to_cpu (di->i_size) >le16_to_cpu (data->id_count)) { + rc =ocfs2_error (sb, +"Invalid dinode #%llu: inline data i_size %llu exceeds id_count %u\n" , + (unsigned long long )bh->b_blocknr, + (unsigned long long )le64_to_cpu (di->i_size), +le16_to_cpu (data->id_count)); + goto bail; + } } rc =0 ;
Greg Kroah-Hartman
maintainerPATCH 107/776 ocfs2: fix out-of-bounds write in ocfs2_write_end_inline
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <[email protected]>
[ Upstream commit 7bc5da4842bed3252d26e742213741a4d0ac1b14 ]
KASAN reports a use-after-free write of 4086 bytes in ocfs2_write_end_inline, called from ocfs2_write_end_nolock during a copy_file_range splice fallback on a corrupted ocfs2 filesystem mounted on a loop device. The actual bug is an out-of-bounds write past the inode block buffer, not a true use-after-free. The write overflows into an adjacent freed page, which KASAN reports as UAF.
The root cause is that ocfs2_try_to_write_inline_data trusts the on-disk id_count field to determine whether a write fits in inline data. On a corrupted filesystem, id_count can exceed the physical maximum inline data capacity, causing writes to overflow the inode block buffer.
Call trace (crash path):
vfs_copy_file_range (fs/read_write.c:1634)
do_splice_direct
splice_direct_to_actor
iter_file_splice_write
ocfs2_file_write_iter
generic_perform_write
ocfs2_write_end
ocfs2_write_end_nolock (fs/ocfs2/aops.c:1949)
ocfs2_write_end_inline (fs/ocfs2/aops.c:1915)
memcpy_from_folio <-- KASAN: write OOBSo add id_count upper bound check in ocfs2_validate_inode_block() to alongside the existing i_size check to fix it.
--- fs/ocfs2/inode.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/ocfs2/inode.c +10 -0
@@ -1427,6 +1427,16 @@ int ocfs2_validate_inode_block(struct su goto bail; } +if (le16_to_cpu (data->id_count) > +ocfs2_max_inline_data_with_xattr (sb, di)) { + rc =ocfs2_error (sb, +"Invalid dinode #%llu: inline data id_count %u exceeds max %d\n" , + (unsigned long long )bh->b_blocknr, +le16_to_cpu (data->id_count), +ocfs2_max_inline_data_with_xattr (sb, di)); + goto bail; + } +if (le64_to_cpu (di->i_size) >le16_to_cpu (data->id_count)) { rc = ocfs2_error(sb, "Invalid dinode #%llu: inline data i_size %llu exceeds id_count %u\n",
Greg Kroah-Hartman
maintainerPATCH 108/776 xfrm: clear trailing padding in build_polexpire()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yasuaki Torimaru <[email protected]>
[ Upstream commit 71a98248c63c535eaa4d4c22f099b68d902006d0 ]
build_expire() clears the trailing padding bytes of struct xfrm_user_expire after setting the hard field via memset_after(), but the analogous function build_polexpire() does not do this for struct xfrm_user_polexpire.
The padding bytes after the __u8 hard field are left uninitialized from the heap allocation, and are then sent to userspace via netlink multicast to XFRMNLGRP_EXPIRE listeners, leaking kernel heap memory contents.
Add the missing memset_after() call, matching build_expire().
--- net/xfrm/xfrm_user.c | 2 ++ 1 file changed, 2 insertions(+)
net/xfrm/xfrm_user.c +2 -0
@@ -3389,6 +3389,8 @@ static int build_polexpire(struct sk_bufreturn err; } upe->hard = !!hard; +/* clear the padding bytes */ +memset (&upe->hard +1 ,0 ,sizeof (*upe) -offsetofend (typeof (*upe), hard));nlmsg_end (skb, nlh);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 109/776 rxrpc: Fix key quota calculation for multitoken keys
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit bdbfead6d38979475df0c2f4bad2b19394fe9bdc ]
In the rxrpc key preparsing, every token extracted sets the proposed quota value, but for multitoken keys, this will overwrite the previous proposed quota, losing it.
Fix this by adding to the proposed quota instead.
--- net/rxrpc/key.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/rxrpc/key.c +3 -2
@@ -72,7 +72,7 @@ static int rxrpc_preparse_xdr_rxkad(strureturn -EKEYREJECTED ; plen =sizeof (*token) +sizeof (*token->kad) + tktlen; - prep->quotalen = datalen + plen; + prep->quotalen += datalen + plen; plen -=sizeof (*token); token =kzalloc (sizeof (*token),GFP_KERNEL );
@@ -303,6 +303,7 @@ static int rxrpc_preparse(struct key_prememcpy (&kver, prep->data,sizeof (kver)); prep->data +=sizeof (kver); prep->datalen -=sizeof (kver); + prep->quotalen =0 ;_debug ("KEY I/F VERSION: %u" , kver);
@@ -340,7 +341,7 @@ static int rxrpc_preparse(struct key_pre goto error; plen =sizeof (*token->kad) + v1->ticket_length; - prep->quotalen = plen +sizeof (*token); + prep->quotalen += plen +sizeof (*token); ret = -ENOMEM ; token =kzalloc (sizeof (*token),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 110/776 rxrpc: Fix call removal to use RCU safe deletion
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 146d4ab94cf129ee06cd467cb5c71368a6b5bad6 ]
Fix rxrpc call removal from the rxnet->calls list to use list_del_rcu() rather than list_del_init() to prevent stuffing up reading /proc/net/rxrpc/calls from potentially getting into an infinite loop.
This, however, means that list_empty() no longer works on an entry that's been deleted from the list, making it harder to detect prior deletion. Fix this by:
Firstly, make rxrpc_destroy_all_calls() only dump the first ten calls that are unexpectedly still on the list. Limiting the number of steps means there's no need to call cond_resched() or to remove calls from the list here, thereby eliminating the need for rxrpc_put_call() to check for that.
rxrpc_put_call() can then be fixed to unconditionally delete the call from the list as it is the only place that the deletion occurs.
--- net/rxrpc/call_object.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-)
net/rxrpc/call_object.c +8 -14
@@ -634,11 +634,9 @@ void rxrpc_put_call(struct rxrpc_call *c_debug ("call %d dead" , call->debug_id); ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE); -if (!list_empty (&call->link)) { -spin_lock_bh (&rxnet->call_lock); -list_del_init (&call->link); -spin_unlock_bh (&rxnet->call_lock); - } +spin_lock_bh (&rxnet->call_lock); +list_del_rcu (&call->link); +spin_unlock_bh (&rxnet->call_lock);rxrpc_cleanup_call (call); }
@@ -709,24 +707,20 @@ void rxrpc_destroy_all_calls(struct rxrp_enter ("" );if (!list_empty (&rxnet->calls)) { -spin_lock_bh (&rxnet->call_lock); +int shown =0 ; -while (!list_empty (&rxnet->calls)) { - call =list_entry (rxnet->calls.next, - struct rxrpc_call, link); -_debug ("Zapping call %p" , call); +spin_lock_bh (&rxnet->call_lock); +list_for_each_entry (call, &rxnet->calls, link) {rxrpc_see_call (call); -list_del_init (&call->link);pr_err ("Call %p still in use (%d,%s,%lx,%lx)!\n" , call,refcount_read (&call->ref), rxrpc_call_states[call->state], call->flags, call->events); -spin_unlock_bh (&rxnet->call_lock); -cond_resched (); -spin_lock_bh (&rxnet->call_lock); +if (++shown >=10 ) +break ; }spin_unlock_bh (&rxnet->call_lock);
Greg Kroah-Hartman
maintainerPATCH 111/776 rxrpc: reject undecryptable rxkad response tickets
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuqi Xu <[email protected]>
[ Upstream commit fe4447cd95623b1cfacc15f280aab73a6d7340b2 ]
rxkad_decrypt_ticket() decrypts the RXKAD response ticket and then parses the buffer as plaintext without checking whether crypto_skcipher_decrypt() succeeded.
A malformed RESPONSE can therefore use a non-block-aligned ticket length, make the decrypt operation fail, and still drive the ticket parser with attacker-controlled bytes.
Check the decrypt result and abort the connection with RXKADBADTICKET when ticket decryption fails.
--- net/rxrpc/rxkad.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/rxrpc/rxkad.c +6 -1
@@ -1013,8 +1013,13 @@ static int rxkad_decrypt_ticket(struct rsg_init_one (&sg[0 ], ticket, ticket_len);skcipher_request_set_callback (req,0 ,NULL ,NULL );skcipher_request_set_crypt (req, sg, sg, ticket_len, iv.x); -crypto_skcipher_decrypt (req); + ret =crypto_skcipher_decrypt (req);skcipher_request_free (req); +if (ret <0 ) { + abort_code =RXKADBADTICKET ; + ret = -EPROTO ; + goto other_error; + } p = ticket; end = p + ticket_len;
Greg Kroah-Hartman
maintainerPATCH 112/776 fs/ocfs2: fix comments mentioning i_mutex
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: hongnanli <[email protected]>
[ Upstream commit 137cebf9432eae024d0334953ed92a2a78619b52 ]
inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix comments still mentioning i_mutex.
Stable-dep-of: b02da26a992d ("ocfs2: fix possible deadlock between unlink and dio_end_io_write")
--- fs/ocfs2/alloc.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/ocfs2/cluster/nodemanager.c | 2 +- fs/ocfs2/dir.c | 4 ++-- fs/ocfs2/file.c | 4 ++-- fs/ocfs2/inode.c | 2 +- fs/ocfs2/localalloc.c | 6 +++--- fs/ocfs2/namei.c | 2 +- fs/ocfs2/ocfs2.h | 4 ++-- fs/ocfs2/quota_global.c | 2 +- fs/ocfs2/xattr.c | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-)
fs/ocfs2/alloc.c +1 -1
@@ -5986,7 +5986,7 @@ bail:return status; } -/* Expects you to already be holding tl_inode->i_mutex */ +/* Expects you to already be holding tl_inode->i_rwsem */ int __ocfs2_flush_truncate_log (struct ocfs2_super *osb) {int status;
fs/ocfs2/aops.c +1 -1
@@ -2324,7 +2324,7 @@ static int ocfs2_dio_end_io_write(structdown_write (&oi->ip_alloc_sem); -/* Delete orphan before acquire i_mutex. */ +/* Delete orphan before acquire i_rwsem. */ if (dwc->dw_orphaned) {BUG_ON (dwc->dw_writer_pid !=task_pid_nr (current));
fs/ocfs2/cluster/nodemanager.c +1 -1
@@ -689,7 +689,7 @@ static struct config_group *o2nm_clusterstruct o2nm_node_group *ns =NULL ;struct config_group *o2hb_group =NULL , *ret =NULL ; -/* this runs under the parent dir's i_mutex; there can be only +/* this runs under the parent dir's i_rwsem; there can be only * one caller in here at a time */ if (o2nm_single_cluster)return ERR_PTR (-ENOSPC );
fs/ocfs2/dir.c +2 -2
@@ -1979,7 +1979,7 @@ bail_nolock: }/* -* NOTE: this should always be called with parent dir i_mutex taken. +* NOTE: this should always be called with parent dir i_rwsem taken. */ int ocfs2_find_files_on_disk(const char *name, int namelen,
@@ -2026,7 +2026,7 @@ int ocfs2_lookup_ino_from_name(struct in* Return -EEXIST if the directory contains the name * Return -EFSCORRUPTED if found corruption * -* Callers should have i_mutex + a cluster lock on dir +* Callers should have i_rwsem + a cluster lock on dir */ int ocfs2_check_dir_for_entry(struct inode *dir, const char *name,
fs/ocfs2/file.c +2 -2
@@ -270,7 +270,7 @@ int ocfs2_update_inode_atime(struct inod/* * Don't use ocfs2_mark_inode_dirty() here as we don't always -* have i_mutex to guard against concurrent changes to other +* have i_rwsem to guard against concurrent changes to other * inode fields. */ inode->i_atime =current_time (inode);
@@ -1068,7 +1068,7 @@ static int ocfs2_extend_file(struct inod/* * The alloc sem blocks people in read/write from reading our * allocation until we're done changing it. We depend on -* i_mutex to block other extend/truncate calls while we're +* i_rwsem to block other extend/truncate calls while we're * here. We even have to hold it for sparse files because there * might be some tail zeroing. */
fs/ocfs2/inode.c +1 -1
@@ -713,7 +713,7 @@ bail:/* * Serialize with orphan dir recovery. If the process doing * recovery on this orphan dir does an iget() with the dir -* i_mutex held, we'll deadlock here. Instead we detect this +* i_rwsem held, we'll deadlock here. Instead we detect this * and exit early - recovery will wipe this inode for us. */ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
fs/ocfs2/localalloc.c +3 -3
@@ -606,7 +606,7 @@ out:/* * make sure we've got at least bits_wanted contiguous bits in the -* local alloc. You lose them when you drop i_mutex. +* local alloc. You lose them when you drop i_rwsem. * * We will add ourselves to the transaction passed in, but may start * our own in order to shift windows.
@@ -636,7 +636,7 @@ int ocfs2_reserve_local_alloc_bits(struc/* * We must double check state and allocator bits because -* another process may have changed them while holding i_mutex. +* another process may have changed them while holding i_rwsem. */ spin_lock (&osb->osb_lock); if (!ocfs2_la_state_enabled(osb) ||
@@ -1029,7 +1029,7 @@ enum ocfs2_la_event {/* * Given an event, calculate the size of our next local alloc window. * -* This should always be called under i_mutex of the local alloc inode +* This should always be called under i_rwsem of the local alloc inode * so that local alloc disabling doesn't race with processes trying to * use the allocator. *
fs/ocfs2/namei.c +1 -1
@@ -485,7 +485,7 @@ leave:ocfs2_free_alloc_context (meta_ac);/* -* We should call iput after the i_mutex of the bitmap been +* We should call iput after the i_rwsem of the bitmap been * unlocked in ocfs2_free_alloc_context, or the * ocfs2_delete_inode will mutex_lock again. */
fs/ocfs2/ocfs2.h +2 -2
@@ -369,7 +369,7 @@ struct ocfs2_superstruct delayed_work la_enable_wq;/* -* Must hold local alloc i_mutex and osb->osb_lock to change +* Must hold local alloc i_rwsem and osb->osb_lock to change * local_alloc_bits. Reads can be done under either lock. */ unsigned int local_alloc_bits;
@@ -444,7 +444,7 @@ struct ocfs2_superatomic_t osb_tl_disable;/* * How many clusters in our truncate log. -* It must be protected by osb_tl_inode->i_mutex. +* It must be protected by osb_tl_inode->i_rwsem. */ unsigned int truncated_clusters;
fs/ocfs2/quota_global.c +1 -1
@@ -36,7 +36,7 @@* should be obeyed by all the functions: * - any write of quota structure (either to local or global file) is protected * by dqio_sem or dquot->dq_lock. -* - any modification of global quota file holds inode cluster lock, i_mutex, +* - any modification of global quota file holds inode cluster lock, i_rwsem, * and ip_alloc_sem of the global quota file (achieved by * ocfs2_lock_global_qf). It also has to hold qinfo_lock. * - an allocation of new blocks for local quota file is protected by
fs/ocfs2/xattr.c +1 -1
@@ -7208,7 +7208,7 @@ out:* Used for reflink a non-preserve-security file. * * It uses common api like ocfs2_xattr_set, so the caller -* must not hold any lock expect i_mutex. +* must not hold any lock expect i_rwsem. */ int ocfs2_init_security_and_acl(struct inode *dir, struct inode *inode,
Greg Kroah-Hartman
maintainerPATCH 113/776 ocfs2: fix possible deadlock between unlink and dio_end_io_write
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <[email protected]>
[ Upstream commit b02da26a992db0c0e2559acbda0fc48d4a2fd337 ]
ocfs2_unlink takes orphan dir inode_lock first and then ip_alloc_sem, while in ocfs2_dio_end_io_write, it acquires these locks in reverse order. This creates an ABBA lock ordering violation on lock classes ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE] and ocfs2_file_ip_alloc_sem_key.
Lock Chain #0 (orphan dir inode_lock -> ip_alloc_sem):ocfs2_unlink
ocfs2_prepare_orphan_dir
ocfs2_lookup_lock_orphan_dir
inode_lock(orphan_dir_inode) <- lock A
__ocfs2_prepare_orphan_dir
ocfs2_prepare_dir_for_insert
ocfs2_extend_dir
ocfs2_expand_inline_dir
down_write(&oi->ip_alloc_sem) <- Lock B
Lock Chain #1 (ip_alloc_sem -> orphan dir inode_lock):ocfs2_dio_end_io_write
down_write(&oi->ip_alloc_sem) <- Lock B ocfs2_del_inode_from_orphan()
inode_lock(orphan_dir_inode) <- Lock A
Deadlock Scenario:
CPU0 (unlink) CPU1 (dio_end_io_write)
------ ------
inode_lock(orphan_dir_inode)
down_write(ip_alloc_sem)
down_write(ip_alloc_sem)
inode_lock(orphan_dir_inode)
Since ip_alloc_sem is to protect allocation changes, which is unrelated with operations in ocfs2_del_inode_from_orphan. So move ocfs2_del_inode_from_orphan out of ip_alloc_sem to fix the deadlock.
--- fs/ocfs2/aops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ocfs2/aops.c +1 -2
@@ -2322,8 +2322,6 @@ static int ocfs2_dio_end_io_write(struct goto out; } -down_write (&oi->ip_alloc_sem); -/* Delete orphan before acquire i_rwsem. */ if (dwc->dw_orphaned) {BUG_ON (dwc->dw_writer_pid !=task_pid_nr (current));
@@ -2336,6 +2334,7 @@ static int ocfs2_dio_end_io_write(structmlog_errno (ret); } +down_write (&oi->ip_alloc_sem); di = (struct ocfs2_dinode *)di_bh->b_data;ocfs2_init_dinode_extent_tree (&et,INODE_CACHE (inode), di_bh);
Greg Kroah-Hartman
maintainerPATCH 114/776 mm: blk-cgroup: fix use-after-free in cgwb_release_workfn()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
[ Upstream commit 8f5857be99f1ed1fa80991c72449541f634626ee ]
cgwb_release_workfn() calls css_put(wb->blkcg_css) and then later accesses wb->blkcg_css again via blkcg_unpin_online(). If css_put() drops the last reference, the blkcg can be freed asynchronously (css_free_rwork_fn -> blkcg_css_free -> kfree) before blkcg_unpin_online() dereferences the pointer to access blkcg->online_pin, resulting in a use-after-free:
BUG: KASAN: slab-use-after-free in blkcg_unpin_online (./include/linux/instrumented.h:112 ./include/linux/atomic/atomic-instrumented.h:400 ./include/linux/refcount.h:389 ./include/linux/refcount.h:432 ./include/linux/refcount.h:450 block/blk-cgroup.c:1367)
Write of size 4 at addr ff11000117aa6160 by task kworker/71:1/531
Workqueue: cgwb_release cgwb_release_workfn
Call Trace:
<TASK>
blkcg_unpin_online (./include/linux/instrumented.h:112 ./include/linux/atomic/atomic-instrumented.h:400 ./include/linux/refcount.h:389 ./include/linux/refcount.h:432 ./include/linux/refcount.h:450 block/blk-cgroup.c:1367)
cgwb_release_workfn (mm/backing-dev.c:629)
process_scheduled_works (kernel/workqueue.c:3278 kernel/workqueue.c:3385)
Freed by task 1016:
kfree (./include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6246 mm/slub.c:6561)
css_free_rwork_fn (kernel/cgroup/cgroup.c:5542)
process_scheduled_works (kernel/workqueue.c:3302 kernel/workqueue.c:3385)** Stack based on commit 66672af7a095 ("Add linux-next specific files for 20260410")
I am seeing this crash sporadically in Meta fleet across multiple kernel versions. A full reproducer is available at:
https://github.com/leitao/debug/blob/main/reproducers/repro_blkcg_uaf.sh
(The race window is narrow. To make it easily reproducible, inject a msleep(100) between css_put() and blkcg_unpin_online() in cgwb_release_workfn(). With that delay and a KASAN-enabled kernel, the reproducer triggers the splat reliably in less than a second.)
Fix this by moving blkcg_unpin_online() before css_put(), so the cgwb's CSS reference keeps the blkcg alive while blkcg_unpin_online() accesses it.
--- mm/backing-dev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
mm/backing-dev.c +3 -2
@@ -404,12 +404,13 @@ static void cgwb_release_workfn(struct wwb_shutdown (wb);css_put (wb->memcg_css); -css_put (wb->blkcg_css); -mutex_unlock (&wb->bdi->cgwb_release_mutex);/* triggers blkg destruction if no online users left */ blkcg_unpin_online (blkcg); +css_put (wb->blkcg_css); +mutex_unlock (&wb->bdi->cgwb_release_mutex); +fprop_local_destroy_percpu (&wb->memcg_completions);spin_lock_irq (&cgwb_lock);
Greg Kroah-Hartman
maintainerPATCH 115/776 MPTCP: fix lock class name family in pm_nl_create_listen_socket
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Xiasong <[email protected]>
commit 7ab4a7c5d969642782b8a5b608da0dd02aa9f229 upstream.
In mptcp_pm_nl_create_listen_socket(), use entry->addr.family instead of sk->sk_family for lock class setup. The 'sk' parameter is a netlink socket, not the MPTCP subflow socket being created.
[ Conflict in pm_kernel.c, because commit 8617e85e04bd ("mptcp: pm:
split in-kernel PM specific code") is not in this version, and moves code from pm_netlink.c to pm_kernel.c. ]
--- net/mptcp/pm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/pm_netlink.c +1 -1
@@ -1041,7 +1041,7 @@ static struct lock_class_key mptcp_keys[static int mptcp_pm_nl_create_listen_socket (struct sock *sk,struct mptcp_pm_addr_entry *entry) { -bool is_ipv6 = sk->sk_family ==AF_INET6 ; +bool is_ipv6 = entry->addr.family ==AF_INET6 ;int addrlen =sizeof (struct sockaddr_in );struct sockaddr_storage addr;struct socket *ssock;