6.18.66-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainercover 6.18.66-rc1 review
This is the start of the stable review cycle for the 6.18.66 release. There are 990 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 Fri, 27 Nov 2026 14:36:57 +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/v6.x/stable-review/patch-6.18.66-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-6.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.18.66-rc1
Damien Riégel <[email protected]>
greybus: raw: fix use-after-free if write is called after disconnect
Karl Mehltretter <[email protected]>
mtd: core: avoid double-free of OTP NVMEM device
Kuniyuki Iwashima <[email protected]>
tcp: Set unhashed_state in inet_twsk_hashdance_schedule().
Andrea Mayer <[email protected]>
seg6: ensure packet data is writable before modifying SRH and IPv6 DA
Yuya Kusakabe <[email protected]>
net: ipv6: keep room for the mac header in dst_dev_overhead()
Cen Zhang (Microsoft Security FORGE Labs) <[email protected]>
xfrm: hold net_device reference under RCU in bundle creation
Nikolay Aleksandrov <[email protected]>
net: bridge: vlan: fix bugs caused by switchdev deletion errors
Vinay Belgaumkar <[email protected]>
drm/xe: Don't disable GuCRC in suspend path
Riana Tauro <[email protected]>
drm/xe/xe_survivability: Remove unused index
Baochen Qiang <[email protected]>
wifi: ath12k: fix EHT TX MCS limitation due to wrong 20 MHz-only parsing
Vinay Belgaumkar <[email protected]>
perf: Fix null pointer access in is_include_guest_event()
Christian Brauner <[email protected]>
9p: free the session after a grace period
Stefano Garzarella <[email protected]>
9p: fix privport option setting wrong RDMA field
Pierre Barre <[email protected]>
9p: fix access mode flags being ORed instead of replaced
Sasha Levin <[email protected]>
9p: fix memory leak in v9fs_init_fs_context error path
Luiz Capitulino (Red Hat) <[email protected]>
powerpc/watchdog: disable watchdog when watchdog_thresh=0
Hyunwoo Kim <[email protected]>
tcp: fix NULL pointer dereference when restarting a Fast Open listener
Mani Tofigh <[email protected]>
nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()
Henry Martin <[email protected]>
sctp: fix skb_over_panic when adding addresses with a pending delete of another family
Karol Wachowski <[email protected]>
accel/ivpu: Defer recovery until probe completes
Hyunjung Ko <[email protected]>
gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes
Mani Tofigh <[email protected]>
blk-mq: take quiesce_lock when removing a queue from the tag set
Theodor Arsenij Larionov Trichkine <[email protected]>
fou: reserve headroom before pushing the encap header
Karl Mehltretter <[email protected]>
iio: trigger: Return an error when the trigger has no free irq
Changyul Lee <[email protected]>
iio: trigger: free the trigger ID after device_del()
Salah Triki <[email protected]>
iio: temperature: mlx90614: Fix dual channel probe condition check
Arnav Kapoor <[email protected]>
iio: proximity: sx9500: ignore event config writes that don't change state
Arnav Kapoor <[email protected]>
iio: proximity: sx9324: fix out-of-bounds read of scan period table
Viral Patel <[email protected]>
iio: magnetometer: tlv493d: fix magnetic field scale
Shashank Mohan Jain <[email protected]>
iio: magnetometer: mmc35240: leave cache-only mode before the cache sync
Alexander Sarmanow <[email protected]>
iio: light: vcnl4035: Fix reversed ALS mode bit
Jan Remes <[email protected]>
iio: light: tsl2591: don't divide by zero
Jiale Yao <[email protected]>
iio: imu: kmx61: reject duplicate event disable
Arnav Kapoor <[email protected]>
iio: imu: inv_mpu6050: fix swapped accel and gyro startup times
Arnav Kapoor <[email protected]>
iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes
Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change
Vidhu Sarwal <[email protected]>
iio: humidity: am2315: fix negative temperature decoding
Srinivas Pandruvada <[email protected]>
iio: hid-sensors: fix fractional part for unit exponents -7 and -8
Maximilian Czirr <[email protected]>
iio: hid-sensor: Fix scale for magnetic north heading
Jiale Yao <[email protected]>
iio: gyro: bmg160: reject duplicate event disable
Baek Kyu, Kim <[email protected]>
iio: dac: mcp4725: Update the cached DAC value only on success
Arnav Kapoor <[email protected]>
iio: common: scmi_sensors: fix truncating 64-bit divisions
Nikhil Gautam <[email protected]>
iio: atlas-ezo: Fix humidity channel read support
Andrea Amer <[email protected]>
iio: afe: rescale: expose offset if rescaler or source has one
Yu-Hsiang Tseng <[email protected]>
iio: acpi: Accept comma separated values in ROTM strings
Guangshuo Li <[email protected]>
iio: accel: kxsd9: Fix potential use-after-free on removal
Alexis Bouzigues <[email protected]>
iio: accel: adxl313: add missing buffer selections in Kconfig
Billy Tsai <[email protected]>
dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs
Johan Hovold <[email protected]>
USB: serial: io_edgeport: serialise MCR accesses
Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential use-after-free on disconnect
Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential fifo corruption
Johan Hovold <[email protected]>
USB: serial: io_edgeport: move initial termios update to open()
Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential NULL-deref at open
Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential close() use-after-free
Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix NULL-deref on early status
Johan Hovold <[email protected]>
USB: serial: upd78f0730: fix NULL-deref on hangup
Tristan Madani <[email protected]>
USB: serial: sierra: validate URB length in instat callback
Hui Peng <[email protected]>
USB: serial: garmin_gps: validate packet data length in nat_receive()
Jesse Zhang <[email protected]>
drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()
Jesse Zhang <[email protected]>
drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings
Josef Bacik <[email protected]>
w1: w1_therm: leave the slaves of other families alone
Josef Bacik <[email protected]>
w1: use the bus mutex for the "rw" file
Josef Bacik <[email protected]>
w1: remove the master's files before taking its locks
Josef Bacik <[email protected]>
w1: netlink: drop the slave after the bus is unlocked
Josef Bacik <[email protected]>
w1: ds28e04: use the bus mutex to talk on the bus
Josef Bacik <[email protected]>
w1: ds2805: use the bus mutex to talk on the bus
Josef Bacik <[email protected]>
w1: ds2482: set the strong pull-up with its byte
Josef Bacik <[email protected]>
w1: don't hold list_mutex while a slave is torn down
Radhey Shyam Pandey <[email protected]>
usb: dwc3: xilinx: fix system suspend and resume PHY handling
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Wait for End Transfer completion on ep disable
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Track a timed out End Transfer
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Reset endpoint flags on controller start
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Reject requests to a disabled endpoint
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Recover from End Transfer timeout
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Clear delayed stop on End Transfer completion
Krystian Kaniewski <[email protected]>
usb: gadget: u_serial: pin ports while TTYs are installed
Brian Ellis <[email protected]>
usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
Cosmin Tanislav <[email protected]>
usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty
Sonali Pradhan <[email protected]>
usb: gadget: f_midi: fix UAF race during IN request handling
Yu Zhang <[email protected]>
usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF
Xu Rao <[email protected]>
usb: xhci: disable the correct slot on alloc_dev failure
Uttkarsh Aggarwal <[email protected]>
usb: typec: ucsi: Set ucsi->connector before enabling notifications
YuanZhe Liu <[email protected]>
usb: usbtest: prevent divide by zero in simple_io() with zero length
Olivier Kaloudoff <[email protected]>
usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)
Chaz Bailey <[email protected]>
usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove
Joonhoe Kim <[email protected]>
usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes
Josef Bacik <[email protected]>
USB: serial: oti6858: fix the teardown order in close
Johan Hovold <[email protected]>
USB: serial: garmin_gps: fix deadlock on reset request
Rishabh Jain <[email protected]>
usb: pci-quirks: always assert xHCI OS ownership
Johan Hovold <[email protected]>
USB: cdc-acm: fix NULL-deref on hangup
Jiri Slaby (SUSE) <[email protected]>
tty: fix misapplied compat_ptr() in tty_compat_ioctl()
Josef Bacik <[email protected]>
serial: samsung: put the previous baud clock
Josef Bacik <[email protected]>
serial: samsung: don't leak the tty on an RX IRQ
Josef Bacik <[email protected]>
serial: rda: free the interrupt on shutdown
Josef Bacik <[email protected]>
serial: core: respect runtime PM when sending x_char
Josef Bacik <[email protected]>
serial: 8250_lpss: don't divide by 0 above 6.25 Mbaud
Josef Bacik <[email protected]>
misc: vmw_vmci: wait for callbacks in event unsubscribe
Jiale Yao <[email protected]>
misc: ibmvmc: initialize HMC state before device registration
Guangshuo Li <[email protected]>
misc: bcm-vk: fix DMA allocation memory leak
Josef Bacik <[email protected]>
iio: sx9310: use the data of the I2C table
Josef Bacik <[email protected]>
iio: hid-sensors: fix a division by zero
Josef Bacik <[email protected]>
iio: addac: ad74413r: fix the values of set_multiple
Josef Bacik <[email protected]>
iio: adc: check the result of ad_sd_init()
Josef Bacik <[email protected]>
iio: accel: adxl380: don't stay in standby on -EINVAL
Josef Bacik <[email protected]>
comedi: vmk80xx: report failed transfers of the K8061
Josef Bacik <[email protected]>
comedi: ni_tio: Fix overflow of the clock period
Josef Bacik <[email protected]>
comedi: ni_660x: don't poll without a DMA channel
Josef Bacik <[email protected]>
comedi: addi_apci_1500: fix clearing of the gate enable
Chris Mason <[email protected]>
vt: serialise the producers of the flip buffer
Mikulas Patocka <[email protected]>
dm-thin: fix parsing of feature arguments
Mikulas Patocka <[email protected]>
dm-thin: fix leak if __set_snapshot_details fails
Mikulas Patocka <[email protected]>
dm-thin: fix data corruption if discard races with regular I/O
Li Youhong <[email protected]>
dm-raid: fix use-after-free in raid_dtr()
Jay Vadayath <[email protected]>
dm-raid: bound array_position before indexing failed_devices
Mikulas Patocka <[email protected]>
dm-integrity: don't attempt to commit journal on disabled device
Sinan Polat <[email protected]>
dm-integrity: don't recalculate with HMAC because of a dirty bitmap
Josef Schlehofer <[email protected]>
dm-crypt: defer async write submission to write thread
xietangxin <[email protected]>
dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers
Mikulas Patocka <[email protected]>
dm-cache: fix ending a cursor that never began
Mikulas Patocka <[email protected]>
dm-cache: fix NULL pointer dereference on open failure
Kyrylo Biryuk <[email protected]>
dm zoned: do not reclaim a random zone into another random zone
Kyrylo Biryuk <[email protected]>
dm zoned: back off when reclaim cannot make progress
Chen Cheng <[email protected]>
dm snapshot: fix discard writing into the next COW chunk
Chen Cheng <[email protected]>
dm snapshot: split discards on chunk boundaries
wuyuehong <[email protected]>
dm snapshot: fix discard_granularity unit in snapshot_io_hints
Mikulas Patocka <[email protected]>
dm persistent data: don't leak bufio buffer if find_leaf fails
Mikulas Patocka <[email protected]>
dm persistent data: don't ignore writeback errors
Mikulas Patocka <[email protected]>
dm persistent data: test return value of node_copy
Weijiang Zhou <[email protected]>
dm-verity: don't restart or panic on errors during system shutdown
Mikulas Patocka <[email protected]>
dm-sysfs: fix misbehavior if kobject_init_and_add fails
guolingxing <[email protected]>
dm-pcache: do not advance dirty_tail after backing flush failure
Yingjie Wang <[email protected]>
dm thin: avoid wrapping no_space_timeout
Yingjie Wang <[email protected]>
dm mpath: cap queue_if_no_path_timeout_secs
[email protected] <[email protected]>
dm mpath: fix buffer overflow in parse_hw_handler()
Zhao Feng <[email protected]>
dm crypt: fix use of uninitialized percpu_counter in ctr error path
Edward Adam Davis <[email protected]>
dm cache: reject kcopyd client destory if it setup failed
Kirtikumar Anandrao Ramchandani <[email protected]>
dm: Reject table setup after queue or disk teardown
Mark Bundschuh <[email protected]>
dm: fix infinite loop in dm_blk_do_report_zones()
Daejun Park <[email protected]>
dm: fail a REQ_PREFLUSH bio with data when its preflush fails
Yaohan Li <[email protected]>
dm: avoid double-dropping the zone reset submission reference
[email protected] <[email protected]>
dm log userspace: drop the device reference on error
liuyong <[email protected]>
smb: client: validate descriptor headers before query result allocation
Joseph Qi <[email protected]>
smb: client: skip NULL channel in __cifs_put_smb_ses()
Paulo Alcantara <[email protected]>
smb: client: retry writes that couldn't be issued due to a reconnect
Paulo Alcantara <[email protected]>
smb: client: issue writes from a worker if the task is dying
Joseph Qi <[email protected]>
smb: client: hold the inode across cifs_oplock_break()
Paulo Alcantara <[email protected]>
smb: client: flush deferred handles of other names before a hard link open
Fredric Cover <[email protected]>
smb: client: fix out-of-bounds read in dfs_parse_target_referral()
Andrey Misiurov <[email protected]>
smb: client: fix OOB write when compounding SMB2_IOCTL with encryption
Fredric Cover <[email protected]>
smb: client: fix double conversion of DFS path in setup_dfs_ref()
Paulo Alcantara <[email protected]>
smb: client: don't block dying tasks waiting for writeback on fsync
Paulo Alcantara <[email protected]>
smb: client: don't block dying tasks waiting for writeback on close
liuyong <[email protected]>
smb: client: compare owner and group SIDs using their encoded lengths
Yifan Zhang <[email protected]>
smb: client: bound invalid NTLMSSP signature diagnostic
Amir Goldstein <[email protected]>
ovl: do not allow nfs_export with data-only layers
Giuseppe Scrivano <[email protected]>
ovl: return EIO if the lowerdata is missing
Amir Goldstein <[email protected]>
ovl: report the requested redirect_dir mode in conflicting options
Jérémy Jean <[email protected]>
ovl: reject different lower idmaps on the same fs
Giuseppe Scrivano <[email protected]>
ovl: do not always clear absolute_redirect
Yu Zhang <[email protected]>
gpio: virtuser: remove the debugfs files before freeing the line data
Bartosz Golaszewski <[email protected]>
gpio: virtuser: fix interrupt leak and UAF
Bartosz Golaszewski <[email protected]>
gpio: sodaville: fix use-after-free bug when registering the irqchip
Cunhao Lu <[email protected]>
gpio: rockchip: Fix debounce arithmetic for GPIO v2
Guangshuo Li <[email protected]>
gpio: brcmstb: fix UAF after IRQ domain setup failure
Billy Tsai <[email protected]>
gpio: aspeed: Preserve the pending G7 interrupt status on control writes
Billy Tsai <[email protected]>
gpio: aspeed: Clear only the acked line's G4 interrupt status
Zhao Li <[email protected]>
wifi: mac80211: bound pending OCB station allocations
Zhao Li <[email protected]>
wifi: mac80211: bound pending IBSS station allocations
Johannes Berg <[email protected]>
wifi: mac80211: fix use-after-free on TTLM disconnect
Zhao Li <[email protected]>
wifi: mac80211: restore dormant links when link updates fail
Zhao Li <[email protected]>
wifi: mac80211: reject invalid EHT guard intervals in airtime estimates
Zhao Li <[email protected]>
wifi: mac80211: recheck the OCB station limit before insertion
Zhao Li <[email protected]>
wifi: mac80211: recheck the IBSS station limit before insertion
Zhao Li <[email protected]>
wifi: mac80211: recheck injected headers after removing FCS
Zhao Li <[email protected]>
wifi: mac80211: drain link readers before stopping removed links
Zhao Li <[email protected]>
wifi: mac80211: fix use-after-free when MLO link setup is rolled back
Wahid Khan <[email protected]>
wifi: cfg80211: don't truncate the merged MBSSID profile length
Zhao Li <[email protected]>
wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers
Zhao Li <[email protected]>
wifi: cfg80211: release rejected nontransmitted BSS reference
Mehmet Fide <[email protected]>
wifi: ath9k_htc: do not start ANI before the first channel is set
Benoit Masson <[email protected]>
wifi: ath12k: assign device id from the WSI index
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Reject array count on non-dereference string sources
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix user-space dereference string array store type
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Enable newly appended probe when target event is enabled
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Check enabled and busy state before unlinking sibling probes
Masami Hiramatsu (Google) <[email protected]>
tracing/eprobe: Disallow attaching eprobes to fprobe events
Masami Hiramatsu (Google) <[email protected]>
tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()
Masami Hiramatsu (Google) <[email protected]>
tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()
Paolo Bertinetti <[email protected]>
tracing/perf: Clear stop state in perf_trace_add()
Tao Cui <[email protected]>
LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT
Tao Cui <[email protected]>
LoongArch: KVM: Propagate real error code in kvm_pch_pic_create()
Mike Rapoport (Microsoft) <[email protected]>
LoongArch: Restore KFENCE pages through DMW on resume
Jinjie Ruan <[email protected]>
LoongArch: kexec_file: Fix elf_headers memory leak in retry loop
Jinjie Ruan <[email protected]>
LoongArch: kexec_file: Fix a modified cmdline leak
Weiming Shi <[email protected]>
sctp: reset stored flag for each association
Tim Budding <[email protected]>
sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED
Tim Budding <[email protected]>
sctp: fix I-FORWARD-TSN handling of fragments on other streams
Andrey Misiurov <[email protected]>
sctp: fix ASCONF address change on single-homed hosts
Kyle Zeng <[email protected]>
sctp: avoid requeueing pending control chunks
Tim Budding <[email protected]>
sctp: abort unordered partial delivery when its message is skipped
Andrea Parri <[email protected]>
sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler()
Andrea Parri <[email protected]>
sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE
Andrea Parri <[email protected]>
sched/deadline: Fix spurious -EPERM for migration-disabled tasks
Stefan Haberland <[email protected]>
s390/dasd: Don't trust userspace-supplied result field in format check
Stefan Haberland <[email protected]>
s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path
Stanislav Aleksandrov <[email protected]>
hwmon: (max31760) Report 0 RPM before the first fan speed measurement
Stanislav Aleksandrov <[email protected]>
hwmon: (max31760) Leave standby mode at probe
Stanislav Aleksandrov <[email protected]>
hwmon: (max31760) Fix the local temperature limit registers
Sudeep Holla <[email protected]>
hwmon: (scmi) Check channel config allocation
Pablo Mazzini <[email protected]>
hwmon: (sy7636a) fix negative temperatures
Felix Radensky <[email protected]>
hwmon: (pmbus/mp2975) Get vout fault limits dynamically
Guenter Roeck <[email protected]>
hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown
Rupesh Majhi <[email protected]>
hwmon: (aht10) Fix update_interval overflow on 64-bit
Yehyeong Lee <[email protected]>
xen/pvcalls: destroy the per-socket workqueue on release
Yehyeong Lee <[email protected]>
xen/pvcalls: unwind pvcalls_new_active_socket() step by step
Qihang <[email protected]>
xen/privcmd: fix double free when an irqfd is shut down twice
Andrey Misiurov <[email protected]>
xen/gntdev: fix deadlock between map ioctl and mmap
Hengyu Liang <[email protected]>
x86/video: Preserve the default VGA fallback for legacy modes
Dave Hansen <[email protected]>
x86/mm: Ensure write visibility during LDT installation
Jason Andryuk <[email protected]>
x86/CPU/AMD: Don't print reset reason in VMs
Zhao Feng <[email protected]>
watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog
Vishwaroop A <[email protected]>
spi: tegra210-quad: Track DMA mapping state
Hyunjung Ko <[email protected]>
tpm: flush timeout work outside buffer_mutex to avoid deadlock
Guanglei Zhu <[email protected]>
tpm: eventlog: check the payload size before reading tag events
Eric Biggers <[email protected]>
tpm: Check return value of crypto_kpp_set_secret()
Takashi Iwai <[email protected]>
tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path
Avi Weiss <[email protected]>
timekeeping: Refresh auxiliary base before offset validation
Hungyu Lin <[email protected]>
timekeeping: Read getboottime64() offsets under the sequence counter
Avi Weiss <[email protected]>
SUNRPC: Fix TCP-with-TLS transport class identification
Bartosz Golaszewski <[email protected]>
software node: only let the owner release a managed node
Rafael J. Wysocki <[email protected]>
cpufreq: Cache post-resolution target frequency in __resolve_freq()
Li Zhaoxin <[email protected]>
cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT
Rafael J. Wysocki <[email protected]>
cpufreq: intel_pstate: Clear last written P-state value on suspend
Rafael J. Wysocki <[email protected]>
cpufreq: Improve suspend-resume synchronization
Li RongQing <[email protected]>
cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()
Mark Brown <[email protected]>
arm64: suspend: Save GCS state over suspend
Mark Brown <[email protected]>
arm64: suspend: Save POR_EL0 over suspend
Zhao Gongyi <[email protected]>
arm64: ptrace: don't warn on missing siginfo in a group-stop
Jinjie Ruan <[email protected]>
arm64: kexec_file: Do not use CMA for images with a non-zero text_offset
Beata Michalska <[email protected]>
arm64: errata: Add Cortex-A715/A720 AMU core counter workaround
Mark Brown <[email protected]>
arm64/gcs: Ignore attempts to change GCS mode during signal return
Cheng Yongkang <[email protected]>
fs/splice: clamp an over-reported write_iter result
Cheng Yongkang <[email protected]>
fs/proc: fix the write length returned by proc_sys_call_handler()
HyeongJun An <[email protected]>
fs/adfs: bound directory entry name length in adfs_fplus_getnext()
Christian Brauner <[email protected]>
dcache: let d_invalidate() wait for a d_set_mounted() in flight
Jérémy Jean <[email protected]>
crypto: essiv - fix use-after-free in AEAD path
Jérémy Jean <[email protected]>
crypto: caam - reject overlong RSA CRT parameters
Ridong Chen <[email protected]>
cgroup/cpuset: Don't revive invalid partition without active CPU on hotplug
Zhao Li <[email protected]>
Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel
YuanZhe Liu <[email protected]>
Bluetooth: hci_qca: fix use-after-free in ibs debugfs files
Baoli Zhang <[email protected]>
ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup
Rafael J. Wysocki <[email protected]>
PM: runtime: Update last_busy in rpm_resume() for active devices
Paolo Bertinetti <[email protected]>
perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()
Phat Dinh <[email protected]>
perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit
Joas Antonio dos Santos <[email protected]>
openvswitch: advance by the real header length in get_ipv6_ext_hdrs()
Tim Menninger <[email protected]>
NFSv4: Prevent indefinite waits for out-of-order OPEN stateids
Jamal Hadi Salim <[email protected]>
net/sched: act_ife: require a full Ethernet header on egress
Jamal Hadi Salim <[email protected]>
net/sched: act_ife: encode configured zero metadata values
Jamal Hadi Salim <[email protected]>
net/sched: sch_teql: reject qdiscs from another network namespace
Paulo Alcantara <[email protected]>
netfs: don't hang a read whose retry is abandoned
Paulo Alcantara <[email protected]>
netfs: keep the prepare_read errno when abandoning read retries
Iván Ezequiel Rodriguez <[email protected]>
netfs: preserve prepare_write errno on reissue
Michail Andreas Michalopoulos <[email protected]>
netfilter: flowtable: extend ct timeout of offloaded GRE flows
Cen Zhang (Microsoft) <[email protected]>
netfilter: xt_recent: do not call remove_proc_entry() under recent_lock
Zihan Xi <[email protected]>
netfilter: nf_dup: preserve guard across NFQUEUE reinjection
Eric Dumazet <[email protected]>
net: gro: invalidate frag0 after a pull
Eric Dumazet <[email protected]>
net: gro: do not undo remote checksum offload on merged packets
Kyle Zeng <[email protected]>
net: gro: avoid parsing headers from shared fragments
Andrea Parri <[email protected]>
hv_sock: Report no unread data before a channel is available
Erni Sri Satya Vennela <[email protected]>
hv_netvsc: Stop PPI parsing on invalid metadata
Joas Antonio dos Santos <[email protected]>
gtp: free the skb after handling an echo response
Chengfeng Ye <[email protected]>
ipvs: fix protocol data lifetime during namespace teardown
Chengfeng Ye <[email protected]>
ipvs: Defer application parent freeing until after RCU readers
Yingjie Wang <[email protected]>
ipv6: reject routes without an inet6_dev
Xia Yan <[email protected]>
ipv6: fix cached route reuse for control messages
Daniël Trujillo <[email protected]>
ipv4: fib_trie: prevent speculative out-of-bounds child access
Kyle Zeng <[email protected]>
ipv4: keep XFRM headers out of corked skb lengths
Kyle Zeng <[email protected]>
mptcp: reject DATA_ACKs against a reversed send interval
Zixuan Chai <[email protected]>
seg6: validate state in netfilter continuations
Hyunwoo Kim <[email protected]>
tcp: fix request_sock use-after-free during Fast Open accept()
Jérémy Jean <[email protected]>
tcp: fix authentication bypass via unsupported TCP auth options
Hyunwoo Kim <[email protected]>
tcp: do not coalesce segments after FIN
Rishikesh Jethwani <[email protected]>
tls: only install push_pending_record for a TX context
Hungyu Lin <[email protected]>
tsacct: Keep task begin times stable across suspend
Jerome Mohm <[email protected]>
vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore
Rongzheng Wang <[email protected]>
xsk: defer software checksum until the skb is complete
YuanZhe Liu <[email protected]>
net: usb: lan78xx: let unregister_netdev() stop phylink
James Clark <[email protected]>
net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
Hamza Mahfooz <[email protected]>
net: mana: report RX checksum offload for IPv6
Jens Axboe <[email protected]>
net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls
Tapio Reijonen <[email protected]>
net: dsa: microchip: initialize the IRQ access mutex
Jun Yang <[email protected]>
net: bridge: use one headroom snapshot for ND replies
Mahanta Jambigi <[email protected]>
net/smc: fix link group ownership in handshake abort
Mahanta Jambigi <[email protected]>
net/smc: fix lgr/lnk lifetime vs diag reader race
Kyle Zeng <[email protected]>
net/rds: Do not unpin a page after a failed atomic pin
Jiabin Deng <[email protected]>
net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported
Breno Leitao <[email protected]>
net/mlx5e: Fix queue stats access to queues without stats
Davidlohr Bueso <[email protected]>
mctp: accept MSG_CMSG_COMPAT in recvmsg
Kyle Zeng <[email protected]>
macsec: reject frames that decapsulate into runt Ethernet frames
Jean-Paul Sergent <[email protected]>
net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp
Hungyu Lin <[email protected]>
coda: honor the append state of each write
Mani Tofigh <[email protected]>
btrfs: fix bio counter and bioc leak when async checksumming fails
Josef Bacik <[email protected]>
mm/page_alloc: clear ->private of deferred free pages
Gregory Price (Meta) <[email protected]>
mm/page_alloc: snapshot the preferred zone against shrink rebuilds
Gregory Price (Meta) <[email protected]>
mm/page_alloc: detect zonelist rebuilds from memory hot-add
Josef Bacik <[email protected]>
mm/page_alloc: keep the pagesets of an empty zone
Gregory Price (Meta) <[email protected]>
mm/page_alloc: don't undo another isolation in alloc_contig_range
Josef Bacik <[email protected]>
mm/memory_hotplug: resize zones under their seqlock
Gregory Price (Meta) <[email protected]>
mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
Josef Bacik <[email protected]>
mm: page_frag: refill the cache for large fragments
Josef Bacik <[email protected]>
mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone
Gregory Price (Meta) <[email protected]>
mm/mmzone: read the zoneref slot once in zonelist_zone()
Christian Brauner <[email protected]>
libfs: make i_rwsem the lock of the offset tree
Avi Weiss <[email protected]>
splice, net: avoid MSG_MORE when the bvec array fills
Christian Brauner <[email protected]>
fs: fix the SEEK_CUR f_lock condition
Christian Brauner <[email protected]>
aio: don't let exit_aio() return before complete() is done
Mani Tofigh <[email protected]>
eventpoll: wake the next waiter when a woken waiter is killed
Chen Linxuan <[email protected]>
pidfd: restrict task access ioctls to the caller's pid namespace
Chris Mason <[email protected]>
backing-file: pass RWF_NOAPPEND to synchronous writes
Shashank Mohan Jain <[email protected]>
errseq: don't let errseq_check_and_advance() hide later errors
Igor Velkov <[email protected]>
mmc: meson-gx: name the limit of the CMD_CFG timeout field
Igor Velkov <[email protected]>
mmc: meson-gx: report the longest busy wait the controller can do
Igor Velkov <[email protected]>
mmc: meson-gx: honour the busy timeout for R1b commands
Igor Velkov <[email protected]>
mmc: meson-gx: report busy from DAT0 alone
Ian Ray <[email protected]>
mmc: sdhci-esdhc-imx: map unsupported driver type to Type B
Runyu Xiao <[email protected]>
mmc: omap: synchronize clock timer before disabling fclk
Anfernee Cao <[email protected]>
mmc: mmci: fix DMA channel leak when mmc_add_host() fails
Anfernee Cao <[email protected]>
mmc: sunxi: fix clock and runtime PM leaks on probe failure
Olivier Louvignes <[email protected]>
mmc: jz4740: Remove the host before resetting the controller
Masami Hiramatsu (Google) <[email protected]>
kprobes: Validate re-registration earlier in register_kretprobe()
Masami Hiramatsu (Google) <[email protected]>
kprobes: Fix double free and NULL deref in unregister_kretprobes()
Masami Hiramatsu (Google) <[email protected]>
kprobes: Fix error return and slot leak in __register_kprobe()
Steven Rostedt <[email protected]>
tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc
Jaewon Jung <[email protected]>
selftests/ftrace: Add missing spaces after ! in probe syntax tests
Andrew Davison <[email protected]>
ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set
Gichoon Han <[email protected]>
ALSA: usb-audio: Drop capture packets with bogus actual_length
Angel J <[email protected]>
ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone
Sergei Nizovtsev <[email protected]>
ALSA: caiaq: Kill EP1 URB before unregistering the input device
Zhiqi Zhang <[email protected]>
bootconfig: Allow keys with the maximum supported depth
Jarkko Sakkinen <[email protected]>
KEYS: Verify the key identity in __key_unlink_begin
Jarkko Sakkinen <[email protected]>
KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE
David Carlier <[email protected]>
tracing/eprobe: Install the trigger for every instance that enables the eprobe
Hao Li <[email protected]>
mm/slub: refill prefilled sheaves from the barn
Pauli Virtanen <[email protected]>
Bluetooth: 6lowpan: avoid concurrent peer_del() in bt_6lowpan_disconnect
Nickolai Zeldovich <[email protected]>
pidfs: do not report fields that do not fit into the caller's struct
Josef Bacik <[email protected]>
blk-mq-dma: initialize the dma state for P2P, too
Jacob Keller <[email protected]>
ice: use reference counting and SRCU for PTP port access
Kuniyuki Iwashima <[email protected]>
ipv6: Protect multiple routes insertion by table lock.
Chuck Lever <[email protected]>
tls: Honor O_NONBLOCK in tls_sw_splice_read()
Josef Bacik <[email protected]>
block: don't enter reclaim under rq_qos_mutex
Namjae Jeon <[email protected]>
ksmbd: return complete and aligned stream information
Rishikesh Jethwani <[email protected]>
tls: keep TX and RX hardware offload on the same device
Dudu Lu <[email protected]>
net-sysfs: reject a one-entry RPS flow table
Junbin Zhang <[email protected]>
sched_ext: Reject rq-lock-taking kfuncs in tracing programs
Denis Kulikov <[email protected]>
ksmbd: use the resolved share path for the share root
Waiman Long <[email protected]>
cgroup/cpuset: Release invalid isolated CPUs with a shrunk root partition parent
Waiman Long <[email protected]>
cgroup/cpuset: Release invalid isolated CPUs in compute_partition_effective_cpumask()
Waiman Long <[email protected]>
cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier()
Waiman Long <[email protected]>
cgroup/cpuset: Minor fixes to prstate_housekeeping_conflict()
Waiman Long <[email protected]>
cgroup/cpuset: Properly compute effective xcpus in update_parent_effective_cpumask()
Waiman Long <[email protected]>
cgroup/cpuset: Find furthest isolated ancestor for invalidated isolated partition
Pooyan Azad <[email protected]>
zram: fix short reads from block_state
Ian Rogers <[email protected]>
perf lock contention: Filter events before creating lock_stat
Ajanesh Lal <[email protected]>
ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5)
Namjae Jeon <[email protected]>
ksmbd: fix durable reconnects for root shares
Namjae Jeon <[email protected]>
ksmbd: cache the resolved share path for durable reconnects
Namjae Jeon <[email protected]>
ksmbd: disconnect on invalid encryption transform flags
Chi Zhiling <[email protected]>
exfat: take bitmap_lock at the start of exfat_alloc_cluster()
Chi Zhiling <[email protected]>
exfat: fix used_clusters accounting during cluster allocation
Eric Dumazet <[email protected]>
ip6mr: clear skb->cb[] in reg_vif_xmit()
James Hilliard <[email protected]>
xsk: freeze deferred pool teardown without blocking unregister
Serhat Kumral <[email protected]>
RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler
Waiman Long <[email protected]>
cgroup/cpuset: Properly disabling partition when partition state switching fails
Waiman Long <[email protected]>
cgroup/cpuset: Do housekeeping check before converting invalid partition to valid
Waiman Long <[email protected]>
cgroup/cpuset: Consider all the exclusive CPUs when doing housekeeping check
Waiman Long <[email protected]>
cgroup/cpuset: Consolidate isolated_cpus_can_update() into prstate_housekeeping_conflict()
Waiman Long <[email protected]>
cgroup/cpuset: Fix a missing isolated_cpus update in update_cpumasks_hier()
Lorenzo Bianconi <[email protected]>
netfilter: flowtable: reset transport header after nf_flow_encap_pop()
Woojin Ji <[email protected]>
bpf: Zero-extend the index in inlined bpf_get_func_arg()
Sasha Levin <[email protected]>
locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local()
Josef Bacik <[email protected]>
bpf: Don't take a dynptr argument for a local dynptr
Josef Bacik <[email protected]>
bpf: Let bpf_dynptr_write() mark a global function
Josef Bacik <[email protected]>
bpf: Free what map_free() unlinks for sleepable readers
Josef Bacik <[email protected]>
bpf: Assume no bounds for a writable tp with tail calls
Josef Bacik <[email protected]>
bpf: Assume no bounds for buffers behind a tail call
Josef Bacik <[email protected]>
bpf: Count sleepable callbacks as sleepable map users
Josef Bacik <[email protected]>
bpf: Keep a program until its bpf_wq callback has ended
Josef Bacik <[email protected]>
bpf: Don't hand out a linked element as extra element
Ivan Vecera <[email protected]>
dpll: zl3073x: make embedded sync follow the output carrier frequency
Ju Nan <[email protected]>
pinctrl: stm32: Fix the unit of the hwspinlock timeout
Pengpeng Hou <[email protected]>
irqchip/mst-intc: Validate the DT interrupt range
Kevin Dewald <[email protected]>
Bluetooth: hci_event: Fix LE link drop on remote features command status
Ravindra <[email protected]>
Bluetooth: btintel_pcie: fix PM flow for S0ix, S3 and S4
Chandrashekar Devegowda <[email protected]>
Bluetooth: btintel_pcie: remove duplicate BTINTEL_PCIE_MAGIC_NUM definition
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Unpublish QP table before freeing it
Abhishek Mohapatra <[email protected]>
RDMA/bnxt_re: Use kvzalloc for QP table allocation
Vikas Gupta <[email protected]>
bnge: skip dev_addr when building the VNIC unicast list
Jiale Yao <[email protected]>
wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup
Aaradhana Sahu <[email protected]>
wifi: ath12k: Fix NAPI resource leaks in AHB external IRQ paths
Lorenzo Bianconi <[email protected]>
net: stmmac: align real_num_tx_queues to mqprio configuration
Lorenzo Bianconi <[email protected]>
net: stmmac: set real_num_tx_queues to max(offset + count)
Adrián Larumbe <[email protected]>
drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove
Kaifeng Wang <[email protected]>
net: devmem: check uid and netns in net_devmem_get_binding()
Linus Walleij <[email protected]>
dmaengine: ste_dma40: Preserve the LCPA I/O address space
Jacob Moroni <[email protected]>
RDMA/core: Clear driver_udata before destroying objects in rdma_core
Quanye Yang <[email protected]>
RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq
Maksim Krasutski <[email protected]>
ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx
Dave Jiang <[email protected]>
cxl/port: Attach endpoints to a dport under the lock that pins it
Marek Szyprowski <[email protected]>
dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case
Johannes Berg <[email protected]>
wifi: nl80211: reject zero RNR/MBSSID elements
Vineeth Karumanchi <[email protected]>
net: macb: configure ENST registers for all queues
Takashi Iwai <[email protected]>
ALSA: aloop: Avoid a bad mixure of guard() and goto
Takashi Iwai <[email protected]>
ALSA: pcmtest: Fix leak at probe error
Lorenzo Bianconi <[email protected]>
net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path
Dmitry Morgun <[email protected]>
fs/ntfs3: check return values in indx_delete_entry()
Melissa Wen <[email protected]>
drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class
Felix Fietkau <[email protected]>
wifi: mt76: mt7921: fix of_node reference leaks in regd update
Felix Fietkau <[email protected]>
wifi: mt76: mt7996: free the WTBL index if a link allocation fails
Linus Walleij <[email protected]>
dmaengine: ste_dma40: Recover coalesced cyclic callbacks
Linus Walleij <[email protected]>
dmaengine: ste_dma40: Fix cyclic transfer residue
Qing Ming <[email protected]>
dlm: validate node weights before building member array
Dmitry Baryshkov <[email protected]>
drm/msm/a5xx: don't read the GPMU registers on GPUs without a GPMU
Nicolin Chen <[email protected]>
iommu/arm-smmu-v3: Don't rb_erase() a never-inserted stream node
Niklas Cassel <[email protected]>
scsi: scsi_debug: Enforce physical block alignment of zoned writes
Yuan Chen <[email protected]>
bpf: Roll back freplace link state when bpf_arch_text_poke() fails
Lance Yang <[email protected]>
mm/memory_hotplug: fix missing rollback in __add_pages()
Nathan Chancellor <[email protected]>
serial: 8250_mid: Add missing module namespace import for SERIAL_8250
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix UAC2 mixer unit request handling
Ian Rogers <[email protected]>
perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events
Venkat Rao Bagalkote <[email protected]>
powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
Abhishek Dubey <[email protected]>
powerpc/bpf: Move out dummy_tramp_addr after Long branch stub
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Serialize dcb_wq access against async notifier
Yishai Hadas <[email protected]>
RDMA/mlx5: Set QP event handler before firmware QPC insertion
Yishai Hadas <[email protected]>
RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access
Danish Khateeb <[email protected]>
tools/nolibc: fix readdir_r() with 64-bit directory offsets
Daniel Borkmann <[email protected]>
bpf: Rebase the exception callback subprog when dead subprogs are removed
Mohd Ayaan Anwar <[email protected]>
arm64: dts: qcom: lemans-evk: fix SerDes PHY regulator supplies
Sudeep Holla <[email protected]>
ACPI: PCC: Free channel on OpRegion deactivation
Pardeep Kaur <[email protected]>
wifi: ath12k: fix out-of-bounds access on TX stats arrays
Kang Yang <[email protected]>
wifi: ath12k: fix skb leak on monitor PPDU ID wraparound
Kang Yang <[email protected]>
wifi: ath12k: place dp_mon_mpdu on stack in mon dst reap loop
Kang Yang <[email protected]>
wifi: ath12k: fix stale tail_msdu pointer returned from mpdu_pop
Kang Yang <[email protected]>
wifi: ath12k: free pending MSDUs on duplicate mon link descriptor
Kang Yang <[email protected]>
wifi: ath12k: fix skb leak on paddr mismatch in wifi7 mon RX pop
Abel Vesa <[email protected]>
arm64: dts: qcom: x1-asus-vivobook-s15: Mark the EC reset gpio as reserved
Ian Rogers <[email protected]>
perf machine: Add session back pointer to fix out of bounds read
Michael J. Ruhl <[email protected]>
platform/x86/intel/pmt: complete pcidev to device update
Joanne Koong <[email protected]>
fuse: zero the correct range on a short read reply
Hao Sun <[email protected]>
bpf: Fix uninit read for helper mem args on partially spilled slots
Hao Sun <[email protected]>
bpf: Fix uninit read for non-fetch atomics on partially spilled slots
Alexei Starovoitov <[email protected]>
bpf: Don't converge a loop on an iterator that was created anew
Alexei Starovoitov <[email protected]>
bpf: Fix overflow of jump offset in may_goto expansion
Alexei Starovoitov <[email protected]>
bpf: Adjust pc-relative insn copied into its own patch
Alexei Starovoitov <[email protected]>
bpf, x86: Fix timed may_goto with private stack
bui duc phuc <[email protected]>
ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
Puranjay Mohan <[email protected]>
bpf: Look at frame 0 when telling async callback entries apart
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Check fastcall stack contract once for all stack accesses
Lizhi Hou <[email protected]>
accel/amdxdna: Preallocate hardware context schedulers
Charles Keepax <[email protected]>
mfd: cs42l43: Move cancel_work_sync() into remove
Yuan Chen <[email protected]>
bpf: Keep target extended until its last freplace link detaches
Tate Whiteberg <[email protected]>
serial: 8250_mid: wait for LSR tx empty before setting termios
Tate Whiteberg <[email protected]>
serial: 8250: export and rename wait_for_xmitr()
Ahsan Atta <[email protected]>
crypto: qat - hold cfg->lock when accessing config sections
Kim Wooseok <[email protected]>
wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors
Kim Wooseok <[email protected]>
wifi: rtl8xxxu: unwind incomplete receive startup
Adrian Hunter <[email protected]>
i3c: mipi-i3c-hci: Process multiple IBIs per interrupt
Cristian Ciocaltea <[email protected]>
drm/connector: hdmi: Handle reset() state allocation failure
Ian Rogers <[email protected]>
perf dso: Separate libbfd and cmd addr2line caches to fix confusion
Vitaliy Sochnev <[email protected]>
thermal/drivers/airoha: Request the EN7581 IRQ after zone registration
Guixin Liu <[email protected]>
cxl/region: Unregister the pmem region when the bridge is unbound
Guixin Liu <[email protected]>
cxl/cdat: Fix uninitialized stack use in bandwidth gathering
Lizhi Hou <[email protected]>
accel/amdxdna: Fix race between unmap and free BO
Pengpeng Hou <[email protected]>
phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures
Lizhi Hou <[email protected]>
accel/amdxdna: Fix unsafe use of handle_mm_fault()
Rafael J. Wysocki <[email protected]>
ACPI: glue: Rearrange acpi_bind_one() to avoid breakage
Thomas Huth <[email protected]>
crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data
Eric Dumazet <[email protected]>
sit: charge ip_tunnel_prl_entry allocations to memcg
Kang Yang <[email protected]>
wifi: ath12k: preserve PPDU state across monitor status buffers
Baochen Qiang <[email protected]>
wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor
Golla Nagendra <[email protected]>
dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v alloc failure
Golla Nagendra <[email protected]>
dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure
Matt Turner <[email protected]>
perf thread: Fix live-session detection in thread__e_machine()
Dave Jiang <[email protected]>
ACPI: APEI: GHES: Validate memory error section length before payload access
Jingbo Xu <[email protected]>
fuse: don't bump attr_version for async direct read completion
Lizhi Hou <[email protected]>
accel/amdxdna: Fix unexpected wait when flushing notifier_wq
Davidlohr Bueso <[email protected]>
cxl/test: Map mock device nodes to an online node
Nicolas Frattaroli <[email protected]>
drm/panthor: Revisit reqs_lock handling in flush/reset paths
Christian Aurich Zanettini Martins <[email protected]>
nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()
Guixin Liu <[email protected]>
nvme-tcp: Validate the queue state under the queue lock in the address attribute
Salvatore Dipietro <[email protected]>
mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations
Josef Bacik <[email protected]>
mm/userfaultfd: wake all waiters on unregister
Cunhao Lu <[email protected]>
can: skb: make echo skb freeing safe in any IRQ context
Vidya Srinivas <[email protected]>
drm/i915/display: Disable pipe joiner on WCL
Jérémy Jean <[email protected]>
inet: frags: prevent acceptance of partially authenticated reassembly
Kevin Wang <[email protected]>
drm/amd/pm: preserve committed OD features for SMU 13.0.0/13.0.7
Ming Lei <[email protected]>
ublk: let STOP_DEV cancel the server's commands before its release
Jianping Li <[email protected]>
misc: fastrpc: Allocate entire reserved memory for Audio PD in probe
Abhishek Dubey <[email protected]>
powerpc/bpf: fix alignment of long branch trampoline address
Sean Young <[email protected]>
media: rc: Add missing locking for keymap
Sean Young <[email protected]>
media: rc: Replace open coded krealloc() for keymap
Chuck Lever <[email protected]>
NFSD: Destroy a recalled delegation the client does not hold
Vernon Yang <[email protected]>
mm: khugepaged: fix folio is used after pte_unmap_unlock()
Harald Freudenberger <[email protected]>
s390/zcrypt: Guard domain index uses against speculative bypass
Harald Freudenberger <[email protected]>
s390/zcrypt: Explicitly use a card variable in _zcrypt_send_cprb
Harald Freudenberger <[email protected]>
s390/zcrypt: Fix and improve zcrypt reply message verification checks
Harald Freudenberger <[email protected]>
s390/zcrypt: Make apfs a real unsigned int field
Jan Beulich <[email protected]>
Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()
Jude Gyimah <[email protected]>
ALSA: aw2-alsa: select SND_PCM
Guixiong Wei <[email protected]>
KEYS: do not let an unmatched key decide the search result
Manuel Ebner <[email protected]>
docs, kprobes: Fix bracket
Wenwen Fu <[email protected]>
tracing: skip boot kprobe setup when no events were requested
Eric Dumazet <[email protected]>
nsh: limit recursion in nsh_gso_segment()
Chuck Lever <[email protected]>
selftests: tls: Skip the zero_len tests when TLS is unavailable
Iustin Stolniceanu <[email protected]>
net: phy: c45: select BASE-T1 type for the forced speed
Cosmin Ratiu <[email protected]>
net/mlx5e: IPsec, don't match upper proto selectors in crypto offload TX
Jiahao Xu <[email protected]>
net: usb: cdc_ncm: don't underflow the NDP room check
Wenbo Sun <[email protected]>
amt: use ipv6_hdr() in amt_mldv1_leave_handler()
Wenbo Sun <[email protected]>
af_unix: Inherit SO_INQ in unix_stream_connect()
Jori Koolstra <[email protected]>
net: af_unix: useful handling of LSM denials on SCM_RIGHTS
Jori Koolstra <[email protected]>
net: scm: move scm_detach_fds() from common path to scm_recv_unix()
Kuniyuki Iwashima <[email protected]>
tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
Eric Dumazet <[email protected]>
net: virtio: fix UDP tunnel GSO header of VLAN tagged packets
Uri Dar <[email protected]>
net/mlx5: Lag, Return error when enabling MPESW without LAG support
Antonio Quartulli <[email protected]>
udp_tunnel: don't treat IPv4 sockets bound to an address as wildcard
Junyoung Jang <[email protected]>
igmp: use the joined device when leaving a multicast group
Gustavo Sousa <[email protected]>
drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule
Matt Roper <[email protected]>
drm/xe/wa_oob: Consolidate some OOB rules
Matt Roper <[email protected]>
drm/xe/pvc: Drop pre-prod workarounds
Vinay Belgaumkar <[email protected]>
drm/xe: Add a wrapper for SLPC set/unset params
Vinay Belgaumkar <[email protected]>
drm/xe: Decouple GuC RC code from xe_guc_pc
Matt Roper <[email protected]>
drm/xe/guc_pc: Use scope-based cleanup
Matt Roper <[email protected]>
drm/xe/forcewake: Add scope-based cleanup for forcewake
Sk Anirban <[email protected]>
drm/xe/guc: Eliminate RPe caching for SLPC parameter handling
Shekhar Chauhan <[email protected]>
drm/xe/xe3: Add support for graphics IP versions 30.04 & 30.05
Alexandre Cassen <[email protected]>
net/mlx5: HWS, fix flow meter release on FTE update
Ofri Zangi <[email protected]>
tls: fix async encryption race on weakly ordered architectures
Kalpesh Solanki <[email protected]>
tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK
Avi Weiss <[email protected]>
net: ena: avoid RX copybreak for multi-descriptor packets
Breno Leitao <[email protected]>
net: ena: Keep the RX buffer mapped if skb allocation fails
Omar Ramadan <[email protected]>
amt: tear down every amt device on an unregistering lower
Chris Mason <[email protected]>
tcp: Drop any segments if DEFER_CONNECT is set.
LiangCheng Wang <[email protected]>
ASoC: max98090: keep the MIC boost across mic input power-up
Kavitha Daula <[email protected]>
xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()
Pengpeng Hou <[email protected]>
drm/bridge: sii902x: validate I2S data lane values
Kyle Zeng <[email protected]>
udp: check frag_list IP family before using skb_segment_list()
Anandu Padinhare <[email protected]>
net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path
Eric Dumazet <[email protected]>
net: gro: compare skb->protocol in gro_list_prepare()
Eric Dumazet <[email protected]>
udp: do not use a cross-family sk_rx_dst in early demux
Eric Dumazet <[email protected]>
tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF
Kuniyuki Iwashima <[email protected]>
tcp: Do not allow buggy transitions between ehash and lhash2.
Eric Dumazet <[email protected]>
fou: gue: check IP version of held packets for direct IP encapsulation
Cosmin Ratiu <[email protected]>
net/mlx5e: Serialize TC and IPsec offload exclusion counters
Cosmin Ratiu <[email protected]>
net/mlx5e: Fix ipsec core device access during profile changes
Cosmin Ratiu <[email protected]>
net/mlx5e: Release IPsec root table reference on RX setup failure
Chris Mason <[email protected]>
net: skbuff: uncharge trimmed zerocopy frags on error
Yuho Choi <[email protected]>
ptp: kvm: x86: Leak clock_pair page if changing its encryption fails
Chase Hiltz <[email protected]>
ipv4: route: don't blackhole in-use routes when retiring fnhe routes
Ivan Vecera <[email protected]>
dpll: notify about a reference sync pair only if it was added
Changyul Lee <[email protected]>
net/mlx5: macsec: Don't remove fs_id when adding a rule fails
Alexander Duyck <[email protected]>
net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist
Alexander Duyck <[email protected]>
fbnic: Wait for the outbound flush to complete on mailbox teardown
Alexander Duyck <[email protected]>
fbnic: Suspend phylink after taking the datapath down in ndo_stop
Alexander Duyck <[email protected]>
fbnic: Disable PTP completions during the Tx force-flush
Alexander Duyck <[email protected]>
fbnic: Fix service task races with ndo_stop and PM suspend
Alexander Duyck <[email protected]>
fbnic: Add logic to track PMD state via MAC/PCS signals
Alexander Duyck <[email protected]>
fbnic: Rename PCS IRQ to MAC IRQ as it is actually a MAC interrupt
Umang Pokhriyal <[email protected]>
tun: delete the flow entries of the moved queue on detach
Olga Kornievskaia <[email protected]>
NFSv4: wake blocking lock waiters when a delegated lock is released
Eric Dumazet <[email protected]>
bonding: fix slave_cnt leak on XDP enslave failure
Denis V. Lunev <[email protected]>
ovl: release the upperdir/workdir in-use locks before the umount sync
Christian Brauner <[email protected]>
ovl: allow idmapping overlay mounts
Tianyi Gao <[email protected]>
net: fix mac_len of skbs copied by generic XDP
Mehmet Fide <[email protected]>
wifi: mac80211: abort chanswitch when leaving an IBSS
Johannes Berg <[email protected]>
wifi: mac80211: mesh: don't linearize SKBs unnecessarily
Kyle Zeng <[email protected]>
ipvlan: make outbound skb headers writable
Kyle Zeng <[email protected]>
net: require a full socket in sock_confirm_neigh()
Kyle Zeng <[email protected]>
net: protect negative destination advice with RCU
Mark Bloch <[email protected]>
net/mlx5: Lag, free steering resources on LAG destroy failure
Carolina Jubran <[email protected]>
net/mlx5: Use only loaded devices for PTP clock operations
Li RongQing <[email protected]>
team: fix promisc/allmulti leak in team_port_add error path
Nikola Z. Ivanov <[email protected]>
team: Add matching error label for failed action
Yaroslav Dudkov <[email protected]>
ipv6: ignore link state in gateway check
Gal Pressman <[email protected]>
net/mlx5: Bridge, fix bogus MDB offload errors
Kuniyuki Iwashima <[email protected]>
af_unix: Remove gc_in_progress check in unix_peek_fpl().
Kuniyuki Iwashima <[email protected]>
af_unix: Convert unsigned long to u64 for GC.
Francesco Valla <[email protected]>
spi: virtio: move teardown to .remove()
Jiayuan Chen <[email protected]>
net: raw: fix ICMP unreachable sent when receive queue is full
Stefano Munari <[email protected]>
net: usb: lan78xx: resume phylink on non-reset USB resume
Maciej Fijalkowski <[email protected]>
idpf: free stashed XSk Rx frame when releasing the queue
Maciej Fijalkowski <[email protected]>
ice: xsk: free stashed Rx frame when cleaning the ring
Chenguang Zhao <[email protected]>
i40e: xsk: fix multi-buffer XDP_PASS skb construction
Maciej Fijalkowski <[email protected]>
libeth: xsk: do not free in-flight frags on XDP_TX completion
Maciej Fijalkowski <[email protected]>
ice: xsk: do not free in-flight frags on XDP_TX completion
Maciej Fijalkowski <[email protected]>
ice: xsk: fix leaking Rx buffers in multi-buffer path
Maciej Fijalkowski <[email protected]>
i40e: xsk: fix xsk_buff_add_frag() error handling in Rx
Maciej Fijalkowski <[email protected]>
xsk: fix list corruption in xsk_buff_add_frag()
Kyle Zeng <[email protected]>
net: skbuff: preserve fclone lifetime when freeing stolen heads
Mark Korenberg <[email protected]>
ublk: publish a new device by its id only once it is set up
Mike Snitzer <[email protected]>
NFS/localio: hold the client across an asynchronous LOCALIO probe
Avi Weiss <[email protected]>
SUNRPC: Balance queue accounting when relocating a task
Avi Weiss <[email protected]>
SUNRPC: Balance switch queue length on transport removal
Avi Weiss <[email protected]>
SUNRPC: preserve transport security policy when cloning clients
Avi Weiss <[email protected]>
SUNRPC: preserve timeout policy when cloning clients
Avi Weiss <[email protected]>
SUNRPC: preserve fatal network errors during RPC binding
Avi Weiss <[email protected]>
SUNRPC: wake poll waiters when an empty pipe is unlinked
Avi Weiss <[email protected]>
NFS: restore directory index when resuming readdir
Avi Weiss <[email protected]>
NFS: Fix inverted cross-directory rename check
Avi Weiss <[email protected]>
NFS: update ctime for atime-only UTIME_NOW requests
Jeff Layton <[email protected]>
nfs: fix utimensat() for atime with delegated timestamps
Avi Weiss <[email protected]>
NFS: honor UTIME_NOW atime with explicit mtime
Avi Weiss <[email protected]>
NFSv4.1: retain MDS I/O until both thresholds are met
Eric Dumazet <[email protected]>
tcp: rate limit receive queue collapsing
Eric Dumazet <[email protected]>
tcp: move tp->bytes_acked to tcp_sock_write_tx group
Eric Dumazet <[email protected]>
tcp: move tp->first_tx_mstamp and tp->delivered_mstamp to tcp_sock_write_tx
Eric Dumazet <[email protected]>
tcp: move tp->segs_in and tp->segs_out to tcp_sock_write_txrx group
Eric Dumazet <[email protected]>
tcp: move tp->delivered and tp->delivered_ce to tcp_sock_write_tx group
Ilpo Järvinen <[email protected]>
tcp: try to avoid safer when ACKs are thinned
Cheng Yongkang <[email protected]>
btrfs: handle zero num_stripes in btrfs_chunk_item_size()
Filipe Manana <[email protected]>
btrfs: zstd: prevent leak of workspace below maximum level
Johannes Thumshirn <[email protected]>
btrfs: zoned: fix lockdep splat on mount
Johannes Thumshirn <[email protected]>
btrfs: zoned: don't wait for ordered extents in do_zone_finish()
Johannes Thumshirn <[email protected]>
btrfs: zoned: requeue block group if zone reset bails out
Johannes Thumshirn <[email protected]>
btrfs: zoned: fix possible UAF in wait_eb_writebacks()
Johannes Thumshirn <[email protected]>
btrfs: zoned: only change active zone counter on successful (de)activation
Samuel Leyva <[email protected]>
ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output
Vijendar Mukunda <[email protected]>
ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler
Vijendar Mukunda <[email protected]>
ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler
Tyler Baker <[email protected]>
ASoC: qcom: x1e80100: recreate the headset jack on card rebind
Hongyang Zhao <[email protected]>
ASoC: qcom: common: Add generic headset jack helpers
Prasad Kumpatla <[email protected]>
ASoC: qcom: common: add DAI-node TDM slot helpers
Srinivas Kandagatla <[email protected]>
ASoC: qcom: common: validate cpu dai id during parsing
Srinivas Kandagatla <[email protected]>
ASoC: dt-bindings: qcom: add LPASS LPI MI2S dai ids
Srinivas Kandagatla <[email protected]>
ASoC: qcom: sdw: remove redundant code
Tyler Baker <[email protected]>
ASoC: soc-core: copy the DAI link names into the card
Dmitry Torokhov <[email protected]>
gpiolib: of: return -ENOENT from of_gpio_count() stub
Dmitry Torokhov <[email protected]>
gpiolib: fix fast-path cancellation in gpiod_get_array()
Dmitry Torokhov <[email protected]>
gpiolib: fix GPIO descriptor leak in gpiod_get_array()
Badal Nilawar <[email protected]>
drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry
Vinay Belgaumkar <[email protected]>
drm/xe: Toggle the D3Cold enable flag at runtime resume
Arvind Yadav <[email protected]>
drm/xe: Rebind BOs evicted before the first LR queue
Raag Jadav <[email protected]>
drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM
Mallesh Koujalagi <[email protected]>
drm/xe/xe_survivability: Simplify runtime survivability error handling
Riana Tauro <[email protected]>
drm/xe/xe_survivability: Redesign survivability mode
Rodrigo Vivi <[email protected]>
drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m
Helen Koike <[email protected]>
drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2
Nitin Gote <[email protected]>
drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines
Satyanarayana K V P <[email protected]>
drm/xe: Prevent VF memory IRQ from accessing a torn-down engine
Greg Thelen <[email protected]>
kho: check fdt_phys in is_kho_boot()
Pasha Tatashin <[email protected]>
liveupdate: kho: move to kernel/liveupdate
Yifan Zhang <[email protected]>
tracing/probes: bound symstr stores to reserved length
Shao Mingyin <[email protected]>
ata: libata-scsi: set the field pointer when rejecting CDL
Niklas Cassel <[email protected]>
ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers
Niklas Cassel <[email protected]>
ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length
Niklas Cassel <[email protected]>
ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages
Niklas Cassel <[email protected]>
ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit
Niklas Cassel <[email protected]>
ata: libata-scsi: do not accept subpage code FFh in MODE SELECT
Niklas Cassel <[email protected]>
ata: libata-scsi: fix MODE SELECT handling of data after the mode page
Alexei Starovoitov <[email protected]>
ipv6: Check the Home Address option again before its address is used
Eric Dumazet <[email protected]>
calipso: do not charge request socket options to the listener
Or Har-Toov <[email protected]>
net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum
Anil Kaushik <[email protected]>
netlink: Do not call the unbind callback with the table locked
Prathamesh Deshpande <[email protected]>
net/mlx5e: IPoIB, Fix QPN lookup race
Kyle Pepper <[email protected]>
Bluetooth: reject invalid LE supervision timeout relationships
Christian Loehle <[email protected]>
cpufreq: Serialize global boost updates
Christian Loehle <[email protected]>
cpufreq: Preserve global boost state on failed updates
Lifeng Zheng <[email protected]>
cpufreq: Return -EOPNOTSUPP if no policy supports boost
Dheeraj Kumar Srivastava <[email protected]>
iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
Benjamin Segall <[email protected]>
perf: Fix racy update of cpc->hrtimer_interval
Sandipan Das <[email protected]>
perf/x86/amd/uncore: Avoid context migration from non-owners
Peter Zijlstra <[email protected]>
locking/osq: Fix unlink queue corruption
Peter Zijlstra <[email protected]>
locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering
Thomas Fourier <[email protected]>
net/mlx5e: TC, Fix double free of branch in failure
Ridge Lomont <[email protected]>
x86/kcfi: Don't emit KCFI_REFERENCE() in modules
Eric Dumazet <[email protected]>
tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND
Hui Su <[email protected]>
sched/topology: Balance cluster static-key updates
Hui Su <[email protected]>
sched/pelt: Fix u32 truncation of the PELT period count
Ravi Bangoria <[email protected]>
perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR
Kan Liang <[email protected]>
perf: Add sampling support for SIMD registers
Kan Liang <[email protected]>
perf: Move and enhance has_extended_regs() for arch-specific use
Dapeng Mi <[email protected]>
perf: Eliminate duplicate arch-specific function definitions
Kan Liang <[email protected]>
perf: Add APIs to create/release mediated guest vPMUs
James Clark <[email protected]>
perf: Add perf_event_attr::config4
Siddharth Chintamaneni <[email protected]>
fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()
Jeff Layton <[email protected]>
statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
Hungyu Lin <[email protected]>
vfs: preserve subsecond timestamps at filesystem time limits
Andrea Parri <[email protected]>
iov_iter: take an unsigned long segment count in import_iovec()
Abbott Liu <[email protected]>
initrd: flush deferred fput() before mounting root
Christian Brauner <[email protected]>
libfs: end offset readdir at positions past DIR_OFFSET_EOD
Christian Brauner <[email protected]>
libfs: walk offset directories in offset order
Al Viro <[email protected]>
introduce a flag for explicitly marking persistently pinned dentries
Florian Fainelli <[email protected]>
MIPS: SB1250: Validate and update IRQ affinity
Florian Fainelli <[email protected]>
MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window
Florian Fainelli <[email protected]>
MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
Imre Kaloz <[email protected]>
MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC
Rosen Penev <[email protected]>
MIPS: Avoid dead code/data elimination when using recordmcount
Eric Dumazet <[email protected]>
tcp: ipv6: free ireq->ipv6_opt after an RCU grace period
Long Zhao <[email protected]>
gpio: regmap: free the irqchip if adding the irq domain fails
Linus Walleij <[email protected]>
gpio: regmap: Support sparsed fixed direction
Florian Westphal <[email protected]>
netfilter: nat: zero newrange before filling it in
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload
Joas Antonio dos Santos <[email protected]>
netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()
Fernando Fernandez Mancera <[email protected]>
netfilter: x_tables: check target name before accessing verdict
Laveesh Bansal <[email protected]>
netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()
Xingyuan Mo <[email protected]>
netfilter: nft_set_rbtree: check catchall_sync return before queue_done
Qingfang Deng <[email protected]>
tcp: initialize send sequence numbers before deferring TFO
Cheng Yongkang <[email protected]>
net: bridge: disable MRP ports before the FDB flush in del_nbp()
Lorenzo Bianconi <[email protected]>
net: stmmac: set XDP metadata length on the page_pool RX path
Timur Stukan <[email protected]>
bonding: fix missing down path on speed/duplex failure after FAIL->UP
Jakub Kicinski <[email protected]>
net: bonding: don't recurse on the slave's netdev ops lock
Jakub Kicinski <[email protected]>
net: ethtool: add netif_get_link_ksettings() for correct ops-locked use
Kyle Zeng <[email protected]>
ip6mr: Serialize multicast router socket ownership
Timur Stukan <[email protected]>
bonding: 3ad: don't set BOND_LINK_FAIL on a slave that is not up
Colton Pawielski <[email protected]>
net: 8139cp: keep Rx masked while NAPI is scheduled
Richard Fitzgerald <[email protected]>
ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
Michał Kopeć <[email protected]>
ALSA: hda/core: Stop capability walk on empty capability header
Munique Feitoza <[email protected]>
drm/nouveau: Fix CE channel creation on pre-Kepler GPUs
Rosen Penev <[email protected]>
drm/nouveau/fifo: map Kepler video engine contexts non-privileged
Frederic Konrad <[email protected]>
spi: cadence-quadspi: Fix race between DMA completion and transfer start
Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix not updating of hdev->commands[] after reset
Florian Fainelli <[email protected]>
net: dsa: b53: restore the NSP IMP port 2 Gbps mode
Florian Fainelli <[email protected]>
net: ethernet: bgmac: preserve forced 2.5 Gbps link speed
Stanislavs Nilovs <[email protected]>
Bluetooth: qca: Disable SoC debug logging for WCN3950
Zhao Li <[email protected]>
Bluetooth: L2CAP: Clear request identifiers on incoming LE connections
Zijun Hu <[email protected]>
Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path
Richard Fitzgerald <[email protected]>
ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()
Sasha Levin <[email protected]>
ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()
Sasha Levin <[email protected]>
ACPI: scan: Print the offline failure message in acpi_bus_offline()
Richard Fitzgerald <[email protected]>
firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
Mario Limonciello <[email protected]>
drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence
Eric Dumazet <[email protected]>
tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()
Kuniyuki Iwashima <[email protected]>
ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().
Kuniyuki Iwashima <[email protected]>
ipv6: Flush exception route while replacing nexthop.
Zhou Minqiang <[email protected]>
PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
Avi Weiss <[email protected]>
net: skbuff: reject zero MPLS TTL before decrementing
Christian Loehle <[email protected]>
cpufreq: Hold the policy write lock when changing boost state
Guillaume Nault <[email protected]>
tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.
Hungyu Lin <[email protected]>
isofs: handle Rock Ridge long-form dates before 1900
James Clark <[email protected]>
net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes
Jude Gyimah <[email protected]>
ASoC: rockchip_spdif: select REGMAP_MMIO
Sugar Zhang <[email protected]>
ASoC: rockchip: spdif: Fill IEC958 CS info per params
Sugar Zhang <[email protected]>
ASoC: rockchip: spdif: Add support for format S32_LE
Sugar Zhang <[email protected]>
ASoC: rockchip: spdif: Add support for set mclk rate
Jude Gyimah <[email protected]>
ASoC: rockchip_sai: select REGMAP_MMIO
Jude Gyimah <[email protected]>
ASoC: rockchip_pdm: select REGMAP_MMIO
Jude Gyimah <[email protected]>
ASoC: rockchip_i2s_tdm: select REGMAP_MMIO
Jude Gyimah <[email protected]>
ASoC: rockchip_i2s: select REGMAP_MMIO
Chris Mason <[email protected]>
nvmet-rdma: disconnect a queue on device removal
Chris Mason <[email protected]>
nvmet-rdma: queue the release work under the mutex
Chris Mason <[email protected]>
nvmet-rdma: take a device off the list last
Josef Bacik <[email protected]>
nvmet-tcp: limit the connections accepted per work run
Chris Mason <[email protected]>
nvmet-rdma: disconnect only established queues
Josef Bacik <[email protected]>
nvmet-auth: keep the old keys if the new ones fail
Hannes Reinecke <[email protected]>
nvmet-auth: Do not print DH-HMAC-CHAP secrets
Chris Leech <[email protected]>
nvme-auth: Hash DH shared secret to create session key
Eric Biggers <[email protected]>
nvme-auth: common: use crypto library in nvme_auth_augmented_challenge()
Eric Biggers <[email protected]>
nvme-auth: common: add HMAC helper functions
Eric Biggers <[email protected]>
nvme-auth: common: add KUnit tests for TLS key derivation
Eric Biggers <[email protected]>
nvme-auth: use proper argument types
Eric Biggers <[email protected]>
nvme-auth: add NVME_AUTH_MAX_DIGEST_SIZE constant
Josef Bacik <[email protected]>
nvmet-tcp: ask for the TLS record type on every receive
Josef Bacik <[email protected]>
nvme-loop: delete the controller if a reset fails
Maurizio Lombardi <[email protected]>
nvmet-loop: do not alloc admin tag set during reset
Alexander Goodkind <[email protected]>
net: ethernet: mediatek: preserve sibling PPE bindings
Florian Fainelli <[email protected]>
net: dsa: b53: Enable IGMP and MLD control packet CPU copies
James Fantin-Hardesty <[email protected]>
nvmet: fix arbitration burst field mask
Kyle Zeng <[email protected]>
tcp: wait for TIME_WAIT teardown before freeing per-netns ehash
Niklas Cassel <[email protected]>
null_blk: don't finish zones to set them read-only or offline
Niklas Cassel <[email protected]>
null_blk: fix opening closed zones at the active zone limit
Nguyen Dinh Phi <[email protected]>
vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT
Shao Mingyin <[email protected]>
zloop: reject mismatched conventional zone files on restore
Shao Mingyin <[email protected]>
zloop: fix the error code in the blk_mq_alloc_disk message
Avi Weiss <[email protected]>
block: report the correct discard alignment in sysfs
Zizhi Wo <[email protected]>
block: partitions: reject GPT entries with starting_lba > ending_lba
Shao Mingyin <[email protected]>
virtio-blk: Fix zone append sector reporting in batched completion
Jianan Huang <[email protected]>
blk-mq: reset queue state on scheduler teardown
Yu Kuai <[email protected]>
blk-mq: add a new queue sysfs attribute async_depth
Yu Kuai <[email protected]>
block: convert nr_requests to unsigned int
John Ogness <[email protected]>
printk: Avoid multiple unregistration in unregister_console_locked()
Josef Bacik <[email protected]>
ext2: only flush DIRSYNC directories on every change
Jia Jia <[email protected]>
vhost-scsi: fix page reference leak in misaligned I/O fallback
Mingbing Zhai <[email protected]>
virtio_balloon: initialize wakeup_lock before virtqueues are set up
Linfeng Sun <[email protected]>
vhost-vdpa: initialize state before publishing cdev
Linfeng Sun <[email protected]>
vhost: reject backend enable without a kick file
Linfeng Sun <[email protected]>
vhost-scsi: reject delayed virtqueue setup
sungbyeongchan <[email protected]>
virtio_ring: use shadow flags when detaching split descriptors
Jason Wang <[email protected]>
virtio_ring: factor out split indirect detaching logic
[email protected] <[email protected]>
virtio_ring: code cleanup in detach_buf_split
Linfeng Sun <[email protected]>
vhost-scsi: validate event queue descriptor direction
Shuai Zhang <[email protected]>
power: sequencing: qcom-wcn: increase WCN7850 power-up delay
Eric Dumazet <[email protected]>
xfrm: iptfs: fix skb leak on error in __input_process_payload()
Jia Jia <[email protected]>
vhost-scsi: do not count PI bytes in the data length
Eric Dumazet <[email protected]>
soreuseport: annotate data-races around reuse->socks[] and num_socks
Yifan Zhang <[email protected]>
ksmbd: require NUL-terminated EA names
Aaditya Kansal <[email protected]>
ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server
Bart Van Assche <[email protected]>
mctp i3c: Fix locking in an error path
Danish Khateeb <[email protected]>
selftests/mm: merge: keep the far mremap() targets in the carveout
Kevin Dewald <[email protected]>
Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery
Yifan Zhang <[email protected]>
Bluetooth: validate retained LE Set CIG Parameters command length
Yifan Zhang <[email protected]>
Bluetooth: validate retained LE Create CIS command length
Cen Zhang <[email protected]>
Bluetooth: hci_core: Initialize advertising RPA work only once
Kevin Dewald <[email protected]>
Bluetooth: MGMT: Clear disabled connection parameters when loading none
Cen Zhang <[email protected]>
Bluetooth: hci_sync: Copy the resolving-list IRK under RCU
Cen Zhang <[email protected]>
Bluetooth: hci_core: Keep link-key filtering inside RCU
Ismail Tarim <[email protected]>
Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init()
Tobias Wilken <[email protected]>
Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller
Shuai Zhang <[email protected]>
Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping
Cen Zhang <[email protected]>
Bluetooth: hci_sync: Protect resolving-list lookups
Cen Zhang <[email protected]>
Bluetooth: hci_sync: Copy the LE accept list under hdev->lock
Chris Lu <[email protected]>
Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD
Chris Lu <[email protected]>
Bluetooth: btmtk: bound the ISO payload length by the controller's MTU
Chris Lu <[email protected]>
Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding
Kevin Dewald <[email protected]>
Bluetooth: hci_event: Clear explicit connect state on LE connection
Catherine L <[email protected]>
Bluetooth: btintel: fix buffer over-read in fw payload
Akhil Arul <[email protected]>
Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained
Binbin Deng <[email protected]>
Bluetooth: hci_core: Initialize LTK before publication
Binbin Deng <[email protected]>
Bluetooth: hci_core: Initialize link key before publication
Binbin Deng <[email protected]>
Bluetooth: hci_core: Initialize IRK before publication
Jerome Brunet <[email protected]>
ASoC: meson: axg-fifo: request the irq with the clock enabled
Baochen Qiang <[email protected]>
wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it
Muna Sinada <[email protected]>
wifi: ath12k: Add EHT MCS/NSS rates to Peer Assoc
Muna Sinada <[email protected]>
wifi: ath12k: add EHT rate handling to existing set rate functions
Muna Sinada <[email protected]>
wifi: ath12k: generalize GI and LTF fixed rate functions
Bryam Vargas <[email protected]>
net/iucv: take a private, writable frame before rewriting it in place
Guangshuo Li <[email protected]>
gpio: mpc8xxx: Fix potential use-after-free of IRQ domain
Daniel Machon <[email protected]>
net: sparx5/lan969x: release the in-flight slot of a stale TX skb
Dmitry Baryshkov <[email protected]>
regulator: qcom_spmi: don't take a sleeping lock in the SAW IPI
Yuho Choi <[email protected]>
virtio_blk: Reset device on probe error paths after DRIVER_OK
Jia Jia <[email protected]>
vduse: avoid infinite loop when no affinity CPU is online
Sergii Ushakov <[email protected]>
virtio-blk: clamp max_segments to virtqueue ring size
Yu Zhang <[email protected]>
vhost-vdpa: drop the parent's vq callback before the call fd is released
Linfeng Sun <[email protected]>
vhost: reject invalid IOTLB update permissions
Xiang Mei <[email protected]>
vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()
Maoxia <[email protected]>
virtio_pci: add missing newline to the pmcsr error message
Linfeng Sun <[email protected]>
vhost: fix dirty logging for in-order used ring entries
Jia Jia <[email protected]>
vhost-scsi: do not relock event vq mutex on send_evt fallback
Jia Jia <[email protected]>
vhost-scsi: preserve event ordering
Linfeng Sun <[email protected]>
vdpa: invalidate DMA mappings before releasing memory
Linfeng Sun <[email protected]>
vdpa_sim: serialize IOTLB updates with dataplane access
Karl Mehltretter <[email protected]>
virtio-spi: Fix virtio_spi_config kernel-doc
Alex Austin <[email protected]>
sfc: ptp: avoid racing PPS timestamp updates
Alex Austin <[email protected]>
sfc: ptp: serialize host and MC synchronization transactions
Alex Austin <[email protected]>
sfc: ptp: drop the stale frequency reset in efx_ptp_start()
Vladimir Zapolskiy <[email protected]>
drm/panel: visionox-r66451: Wait longer after the panel reset
Vladimir Zapolskiy <[email protected]>
drm/panel: visionox-r66451: Send the brightness value MSB first
Daniel Machon <[email protected]>
net: lan966x: don't free XDP buffers in fdma tx clear with budget 0
Giuseppe Piscitelli <[email protected]>
ata: libata-core: Check device support before querying power state
Lorenzo Bianconi <[email protected]>
net: stmmac: fix XDP RX buffer DMA sync length
Lorenzo Bianconi <[email protected]>
net: stmmac: fix VLAN tag stripping on short and non-linear RX frames
Lorenzo Bianconi <[email protected]>
net: stmmac: copy XDP metadata in AF_XDP zero-copy RX
Lorenzo Bianconi <[email protected]>
net: stmmac: drop multi-buffer frames in XDP mode
Lorenzo Bianconi <[email protected]>
net: stmmac: drop split frames on AF_XDP zero-copy RX
James Hilliard <[email protected]>
net: stmmac: take ownership of saved RX state at poll entry
Niklas Cassel <[email protected]>
ata: libata-eh: Retry non-NCQ commands when their sense data asks for it
Igor Pylypiv <[email protected]>
ata: libata-sata: allow re-enabling NCQ with the same queue_depth
Eric Dumazet <[email protected]>
tcp: do not let tcp_collapse() drive sk_forward_alloc negative
Cen Zhang (Microsoft) <[email protected]>
ipv6: fix fib6 walker UAF on NLM_F_REPLACE
Vlad Poenaru <[email protected]>
bnxt_en: Don't keep MSI-X vectors added before FW reserves them
Joas Antonio dos Santos <[email protected]>
net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period
Yuqiang Sun <[email protected]>
bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom
Rosen Penev <[email protected]>
spi: acpi: only look up the IRQ of confirmed SPI devices
Alban Bedel <[email protected]>
spi: Fix ACPI SPI resources using relative path
Chris Mason <[email protected]>
bpf: Check the offset in bpf_skb_generic_{push,pop}()
Chris Mason <[email protected]>
bpf: Move the transport header with the moved headers
Alexei Starovoitov <[email protected]>
bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol
Alexei Starovoitov <[email protected]>
bpf: Reset skb->cb after an lwt prog pushes an IP header
Alexei Starovoitov <[email protected]>
bpf: Don't leave a stale MAC header in bpf_lwt_push_ip_encap()
Chris Mason <[email protected]>
bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()
Alexei Starovoitov <[email protected]>
bpf: Don't look for the SRH again in the End.BPF helpers
Chris Mason <[email protected]>
bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()
Chris Mason <[email protected]>
bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6
Alexei Starovoitov <[email protected]>
bpf: Don't let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS
Chris Mason <[email protected]>
bpf, cgroup: Keep the skb network offset signed
Chris Mason <[email protected]>
bpf: Require prog fd or capability for cgroup detach
Alexei Starovoitov <[email protected]>
bpf: Remove the WARN from arena_get_unmapped_area()
Alexei Starovoitov <[email protected]>
bpf: Refuse an arena mmap() longer than max_entries pages
Alexei Starovoitov <[email protected]>
bpf: Refuse to map an arena at address 0
Alexei Starovoitov <[email protected]>
bpf: Clamp the trace length before the skip test in stackid_init()
Jiri Olsa <[email protected]>
bpf: Avoid changing callchain in bpf_get_stackid_pe
Josef Bacik <[email protected]>
bpf: Clamp the trace length in __bpf_get_stack() again
Jiri Olsa <[email protected]>
bpf: Avoid changing callchain in bpf_get_stack_pe
Hongjian Dai <[email protected]>
spi: pic32-sqi: fail transfer when the BD ring is exhausted
Fernando Fernandez Mancera <[email protected]>
netfilter: nft_reject: prevent unbounded recursion in output hooks
Sasha Levin <[email protected]>
ALSA: memalloc: Free the new pages when WC DMA mapping fails
Thomas Fourier <[email protected]>
net: ipa: Fix double free of the interrupt structure on config error
Tung Nguyen <[email protected]>
tipc: reject attaching bearer of different media to the same occupied device
Jia Jia <[email protected]>
scsi: target: Validate REGISTER AND MOVE TransportID length
Fernando Fernandez Mancera <[email protected]>
net/smc: fix limit_smc_hs sysctl on big-endian architecture
James Hilliard <[email protected]>
ptp: vclock: preserve missing hardware timestamps
James Hilliard <[email protected]>
ptp: vclock: serialize extended samples with counter updates
James Hilliard <[email protected]>
ptp: vclock: propagate physical clock sampling errors
James Hilliard <[email protected]>
ptp: unwind partially completed virtual clock creation
James Hilliard <[email protected]>
ptp: drain virtual clock sysfs operations before unregistering children
Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986
Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: free up rings during detach
Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: fix reset condition for rx wdma
Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3
Puranjay Mohan <[email protected]>
bpf: Drop percpu_counter from the htab element count
Thomas Fourier <[email protected]>
btrfs: zoned: fix double free of bitmaps on clone failure
Filipe Manana <[email protected]>
btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
Filipe Manana <[email protected]>
btrfs: fix fiemap merging compressed extents
guolingxing <[email protected]>
btrfs: verity: propagate orphan insertion errors when enabling verity
Jose Fernandez (Anthropic) <[email protected]>
bpf: Fix jited line info off by the CFI preamble
Avi Weiss <[email protected]>
gpio: omap: Propagate runtime PM failures in probe and request
Michal Wilczynski <[email protected]>
drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes
Andrea Mayer <[email protected]>
seg6: fix transport header for inner IPv4 with IP options
P Praneesh <[email protected]>
wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler
Filippo Falezza <[email protected]>
wifi: ath10k: Stop unanswered temperature reads
Yuanfu Xie <[email protected]>
9p: do not store the create fid on special files
Yuanfu Xie <[email protected]>
9p: fall back to the normal open path for non-regular files
Omokefe Emmanuel Onanaroghene <[email protected]>
9p: fix kernel-doc warning for enum p9_session_flags
Remi Pommarel <[email protected]>
9p: Add mount option for negative dentry cache retention
Remi Pommarel <[email protected]>
9p: Cache negative dentries for lookup performance
Barret Rhoden <[email protected]>
9p: treat read return values of 0 as EOF
Remi Pommarel <[email protected]>
9p: Enable symlink caching in page cache
Matthew Whitehead <[email protected]>
scsi: aha1542: Remove unneeded scsi_dma_unmap() call
Giuseppe Piscitelli <[email protected]>
scsi: scsi_debug: Drain target cleanup before module exit
Imre Kaloz <[email protected]>
scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
Mehmet Fide <[email protected]>
wifi: ath9k_htc: start ANI when an AP interface begins to beacon
Avi Weiss <[email protected]>
fsnotify: preserve 64-bit pre-content ranges
Cosmin Ratiu <[email protected]>
wifi: wext: Limit notifier event flushes to the device's netns
Deepanshu Kartikey <[email protected]>
batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
Shubham Antil <[email protected]>
xfrm: zero-initialise km_event in the replay-notify path
Haobin Wu <[email protected]>
9p: skip intermediate directory entry name copy in p9dirent_read()
Yizhou Zhao <[email protected]>
net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx
Yizhou Zhao <[email protected]>
net/9p/usbg: fix descriptor cleanup use-after-free
Yizhou Zhao <[email protected]>
9p: use fc->net_ns for network namespace in RDMA and socket transports
David Laight <[email protected]>
net/9p: Replace strlen() strcpy() pair with strscpy()
Eric Sandeen <[email protected]>
9p: convert to the new mount API
Eric Sandeen <[email protected]>
9p: create a v9fs_context structure to hold parsed options
Eric Sandeen <[email protected]>
net/9p: move structures and macros to header files
Eric Sandeen <[email protected]>
fs/fs_parse: add back fsparam_u32hex
Bitterblue Smith <[email protected]>
wifi: rtw89: usb: Avoid crash with dynamically added device ID
Feng Ning <[email protected]>
staging: media: atomisp: use array3_size() for overflow-safe allocation
Dmitry Torokhov <[email protected]>
Input: destroy force-feedback device on input unregistration
Bernard Pidoux <[email protected]>
bpqether: keep a bpq device in step with its Ethernet device
Bernard Pidoux <[email protected]>
bpqether: set both addresses or none in SIOCSBPQETHADDR
Bernard Pidoux <[email protected]>
bpqether: reserve the Ethernet device's own header room on transmit
Bryan Cochrane <[email protected]>
bnxt_en: Take RTNL before netif_close() when aborting FW reset
Mikhail Malyshev <[email protected]>
io_uring/io-wq: apply the current cpuset to new workers
Siddharth Chintamaneni <[email protected]>
io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()
Cheng Yongkang <[email protected]>
io_uring/rsrc: keep the old file when a file update fails
Cheng Yongkang <[email protected]>
io_uring/timeout: don't rearm a multishot timeout on cancel
Yang Xiuwei <[email protected]>
io_uring/rw: fail soft links on IOPOLL short or error IO
Yang Xiuwei <[email protected]>
io_uring/futex: fail soft links when cancelling a wait
Yang Xiuwei <[email protected]>
io_uring: fail soft links on negative IOU_COMPLETE results
Cinq Prairie <[email protected]>
io_uring/napi: don't end the single NAPI busy poll early on need_resched()
Hui Peng <[email protected]>
udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
Jan Kara <[email protected]>
udf: validate VAT inode size for old VAT format
Lance Yang <[email protected]>
mm/ksm: fix userfaultfd protection during merge and unmerge
Bernard Pidoux <[email protected]>
netrom: give the sysctl timer limits in milliseconds
Bernard Pidoux <[email protected]>
netrom: keep T1 running after answering a NAK
Bernard Pidoux <[email protected]>
ax25: end a REJ recovery count once frames are acknowledged
Bernard Pidoux <[email protected]>
rose: reset a call when a DATA packet arrives out of sequence
Bernard Pidoux <[email protected]>
ax25: drop a message being reassembled when a new one starts
Bernard Pidoux <[email protected]>
netrom: send the unacknowledged frames again when T1 or T4 expires
Sasha Levin <[email protected]>
Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"
Melbin K Mathew <[email protected]>
fbdev: serialize mode sysfs access with lock_fb_info()
Melbin K Mathew <[email protected]>
fbdev: clear fb_info->mode before deleting a videomode
Melbin K Mathew <[email protected]>
fbdev: bound mode sysfs output to the sysfs buffer
Long Li <[email protected]>
xfs: only assert new size for datafork during truncate extents
Gabriele Monaco <[email protected]>
sched/deadline: Fix server stopping with runnable tasks
Peter Zijlstra <[email protected]>
sched: Provide idle_rq() helper
Peter Zijlstra <[email protected]>
sched/deadline: Fix dl_server stop condition
Peter Zijlstra <[email protected]>
sched/deadline: Fix dl_server time accounting
Antheas Kapenekakis <[email protected]>
ALSA: hda/tas2781: Prevent throwing away custom calibration addresses
Vladimir Petrzhikovskii <[email protected]>
virtio_net: check RX buffer length before DMA sync
Rafael J. Wysocki <[email protected]>
ACPI: platform: Use acpi_bus_get_primary_device()
Zizhi Wo <[email protected]>
fs: aio: reject partial mremap to avoid Null-pointer-dereference error
Krittikun Wongnin <[email protected]>
ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]
Hakan Abay <[email protected]>
ACPI: PM: Add unused power resource quirk for Casper Excalibur G900
Matthias Dittrich <[email protected]>
ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)
Xiaoyao Li <[email protected]>
KVM: TDX: Enable Bus Lock VM exit
Baokun Li <[email protected]>
writeback: use a per-sb counter to drain inode wb switches at umount
Ilya Dryomov <[email protected]>
libceph: adapt ceph_x_challenge_blob hashing and msgr1 message signing
Ilya Dryomov <[email protected]>
libceph: add support for CEPH_CRYPTO_AES256KRB5
Ilya Dryomov <[email protected]>
libceph: introduce ceph_crypto_key_prepare()
Ilya Dryomov <[email protected]>
libceph: generalize ceph_x_encrypt_offset() and ceph_x_encrypt_buflen()
Sergey Lebedev <[email protected]>
soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel)
Charles Keepax <[email protected]>
soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9
Sataporn Saijai <[email protected]>
soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11
Eric Dumazet <[email protected]>
net: virtio: validate outer protocol of UDP tunnel GSO packets
Eric Dumazet <[email protected]>
tun: clear stale skb->protocol of NAPI frags skbs
Eric Dumazet <[email protected]>
net: always dissect GSO packets in __virtio_net_hdr_to_skb()
Johannes Weiner <[email protected]>
mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES
Pengpeng Hou <[email protected]>
irqchip/sifive-plic: Avoid signed shift in interrupt enable mask
KP Singh <[email protected]>
bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature
Pablo Neira Ayuso <[email protected]>
netfilter: nft_ct: move custom expectation support to helper
Florian Westphal <[email protected]>
netfilter: nft_ct: expectation timeouts are passed in milliseconds
-------------
Diffstat:
Documentation/arch/arm64/gcs.rst | 13 +-
Documentation/arch/arm64/silicon-errata.rst | 4 +
Documentation/block/ublk.rst | 7 +
Documentation/core-api/kho/concepts.rst | 2 +-
.../bindings/iio/adc/aspeed,ast2600-adc.yaml | 17 +
.../bindings/sound/qcom,q6dsp-lpass-ports.yaml | 5 +-
Documentation/filesystems/9p.rst | 7 +-
Documentation/gpu/xe/xe_firmware.rst | 3 +
.../networking/net_cachelines/tcp_sock.rst | 12 +-
Documentation/networking/tls-offload.rst | 16 +-
Documentation/trace/kprobes.rst | 2 +-
MAINTAINERS | 2 +-
Makefile | 4 +-
arch/alpha/include/uapi/asm/socket.h | 2 +
arch/arc/include/asm/cmpxchg.h | 4 +
arch/arm/kernel/perf_regs.c | 6 -
arch/arm64/Kconfig | 32 ++
arch/arm64/boot/dts/qcom/lemans-evk.dts | 3 +-
.../boot/dts/qcom/x1e80100-asus-vivobook-s15.dts | 1 +
arch/arm64/include/asm/suspend.h | 2 +-
arch/arm64/kernel/cpu_errata.c | 20 +
arch/arm64/kernel/cpufeature.c | 3 +-
arch/arm64/kernel/kexec_image.c | 7 +
arch/arm64/kernel/perf_regs.c | 6 -
arch/arm64/kernel/ptrace.c | 8 +-
arch/arm64/kernel/signal.c | 22 +-
arch/arm64/kernel/topology.c | 3 +-
arch/arm64/mm/proc.S | 20 +
arch/arm64/tools/cpucaps | 1 +
arch/csky/kernel/perf_regs.c | 6 -
arch/hexagon/include/asm/cmpxchg.h | 6 +
arch/loongarch/kernel/machine_kexec.c | 2 +
arch/loongarch/kernel/machine_kexec_file.c | 4 +
arch/loongarch/kernel/perf_regs.c | 6 -
arch/loongarch/kvm/intc/pch_pic.c | 17 +-
arch/loongarch/power/hibernate.c | 6 +
arch/mips/Kconfig | 2 +-
arch/mips/alchemy/common/prom.c | 23 +-
arch/mips/cobalt/pci.c | 11 +-
arch/mips/cobalt/setup.c | 4 +-
arch/mips/configs/ip30_defconfig | 9 +-
arch/mips/include/asm/mach-cobalt/cobalt.h | 1 +
arch/mips/include/uapi/asm/socket.h | 2 +
arch/mips/kernel/perf_regs.c | 6 -
arch/mips/sibyte/sb1250/irq.c | 3 +
arch/openrisc/include/asm/cmpxchg.h | 2 +
arch/parisc/include/uapi/asm/socket.h | 2 +
arch/parisc/kernel/perf_regs.c | 6 -
arch/powerpc/include/asm/interrupt.h | 5 +-
arch/powerpc/kernel/watchdog.c | 3 +
arch/powerpc/net/bpf_jit.h | 7 +-
arch/powerpc/net/bpf_jit_comp.c | 62 ++-
arch/powerpc/net/bpf_jit_comp32.c | 7 +-
arch/powerpc/net/bpf_jit_comp64.c | 7 +-
arch/riscv/kernel/perf_regs.c | 6 -
arch/sparc/include/uapi/asm/socket.h | 2 +
arch/um/drivers/vector_transports.c | 1 +
arch/x86/events/amd/ibs.c | 50 ++
arch/x86/events/amd/uncore.c | 2 +-
arch/x86/kernel/cpu/amd.c | 3 +-
arch/x86/kernel/ldt.c | 12 +-
arch/x86/kernel/perf_regs.c | 6 -
arch/x86/kvm/Kconfig | 1 +
arch/x86/kvm/vmx/tdx.c | 24 +-
arch/x86/net/bpf_jit_comp.c | 12 +
arch/x86/net/bpf_timed_may_goto.S | 10 +-
arch/x86/video/video-common.c | 2 +-
block/blk-cgroup.c | 13 +-
block/blk-core.c | 1 +
block/blk-iocost.c | 5 +-
block/blk-iolatency.c | 3 +-
block/blk-mq-dma.c | 2 +
block/blk-mq-sched.c | 6 +-
block/blk-mq.c | 9 +
block/blk-sysfs.c | 42 ++
block/blk-throttle.c | 3 +-
block/elevator.c | 1 +
block/genhd.c | 2 +-
block/partitions/efi.c | 1 +
crypto/essiv.c | 2 +-
drivers/accel/amdxdna/aie2_ctx.c | 117 ++--
drivers/accel/amdxdna/aie2_pci.c | 9 +-
drivers/accel/amdxdna/aie2_pci.h | 6 +-
drivers/accel/amdxdna/amdxdna_gem.c | 225 +++++---
drivers/accel/amdxdna/amdxdna_gem.h | 2 +-
drivers/accel/ivpu/ivpu_pm.c | 9 +-
drivers/acpi/acpi_pcc.c | 13 +
drivers/acpi/acpi_platform.c | 16 +-
drivers/acpi/apei/ghes.c | 41 ++
drivers/acpi/glue.c | 58 +-
drivers/acpi/power.c | 38 ++
drivers/acpi/scan.c | 108 +++-
drivers/ata/libata-core.c | 8 +-
drivers/ata/libata-eh.c | 16 +-
drivers/ata/libata-sata.c | 2 +-
drivers/ata/libata-scsi.c | 178 ++++---
drivers/base/power/runtime.c | 8 +-
drivers/base/swnode.c | 7 +-
drivers/block/null_blk/zoned.c | 48 +-
drivers/block/ublk_drv.c | 105 +++-
drivers/block/virtio_blk.c | 69 ++-
drivers/block/zloop.c | 5 +-
drivers/block/zram/zram_drv.c | 115 ++--
drivers/bluetooth/btintel.c | 24 +-
drivers/bluetooth/btintel_pcie.c | 47 +-
drivers/bluetooth/btintel_pcie.h | 2 -
drivers/bluetooth/btmtk.c | 49 +-
drivers/bluetooth/btqca.c | 1 +
drivers/bluetooth/hci_qca.c | 5 +
drivers/char/tpm/eventlog/acpi.c | 4 +-
drivers/char/tpm/eventlog/tpm1.c | 7 +
drivers/char/tpm/tpm-dev-common.c | 12 +-
drivers/char/tpm/tpm2-sessions.c | 4 +-
drivers/comedi/drivers/addi_apci_1500.c | 2 +-
drivers/comedi/drivers/ni_660x.c | 3 +-
drivers/comedi/drivers/ni_tio.c | 2 +-
drivers/comedi/drivers/vmk80xx.c | 25 +-
drivers/cpufreq/acpi-cpufreq.c | 9 +-
drivers/cpufreq/cpufreq.c | 110 +++-
drivers/cpufreq/intel_pstate.c | 18 +-
drivers/crypto/caam/caampkc.c | 75 ++-
drivers/crypto/inside-secure/safexcel_hash.c | 3 +
drivers/crypto/intel/qat/qat_common/adf_cfg.c | 49 +-
drivers/cxl/core/cdat.c | 8 +-
drivers/cxl/core/port.c | 121 +++--
drivers/cxl/core/region.c | 6 +-
drivers/dma/ste_dma40.c | 179 ++++++-
drivers/dma/ste_dma40_ll.c | 8 +-
drivers/dma/ste_dma40_ll.h | 2 +-
drivers/dma/xilinx/zynqmp_dma.c | 19 +-
drivers/dpll/dpll_core.c | 3 +-
drivers/dpll/zl3073x/dpll.c | 56 +-
drivers/dpll/zl3073x/out.h | 40 ++
drivers/firmware/cirrus/cs_dsp.c | 6 +
drivers/gpio/gpio-aspeed.c | 19 +-
drivers/gpio/gpio-brcmstb.c | 1 +
drivers/gpio/gpio-mpc8xxx.c | 22 +-
drivers/gpio/gpio-mpsse.c | 4 +
drivers/gpio/gpio-omap.c | 13 +-
drivers/gpio/gpio-regmap.c | 42 +-
drivers/gpio/gpio-rockchip.c | 15 +-
drivers/gpio/gpio-sodaville.c | 9 +-
drivers/gpio/gpio-virtuser.c | 85 ++-
drivers/gpio/gpiolib-of.h | 2 +-
drivers/gpio/gpiolib.c | 35 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +-
.../drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 56 +-
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 20 +-
.../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 193 +++++--
.../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 193 +++++--
drivers/gpu/drm/bridge/sii902x.c | 8 +-
drivers/gpu/drm/drm_connector.c | 5 +-
drivers/gpu/drm/i915/display/intel_dp.c | 4 +-
drivers/gpu/drm/imagination/pvr_rogue_fwif.h | 2 +-
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 49 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +-
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 13 +
.../gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c | 20 -
drivers/gpu/drm/panel/panel-visionox-r66451.c | 4 +-
drivers/gpu/drm/panfrost/panfrost_drv.c | 11 +
drivers/gpu/drm/panthor/panthor_gpu.c | 61 +--
drivers/gpu/drm/xe/Makefile | 1 +
drivers/gpu/drm/xe/regs/xe_lrc_layout.h | 3 +
drivers/gpu/drm/xe/xe_configfs.h | 2 +-
drivers/gpu/drm/xe/xe_force_wake.c | 7 +
drivers/gpu/drm/xe/xe_force_wake.h | 40 ++
drivers/gpu/drm/xe/xe_gt.c | 3 +-
drivers/gpu/drm/xe/xe_guc.c | 8 +-
drivers/gpu/drm/xe/xe_guc_pc.c | 227 +++-----
drivers/gpu/drm/xe/xe_guc_pc.h | 6 +-
drivers/gpu/drm/xe/xe_guc_pc_types.h | 2 -
drivers/gpu/drm/xe/xe_guc_rc.c | 131 +++++
drivers/gpu/drm/xe/xe_guc_rc.h | 16 +
drivers/gpu/drm/xe/xe_hw_engine.c | 17 +-
drivers/gpu/drm/xe/xe_hw_error.c | 7 +-
drivers/gpu/drm/xe/xe_irq.c | 3 +
drivers/gpu/drm/xe/xe_late_bind_fw.c | 15 +-
drivers/gpu/drm/xe/xe_lrc.c | 8 +-
drivers/gpu/drm/xe/xe_memirq.c | 3 +
drivers/gpu/drm/xe/xe_oa.c | 22 +-
drivers/gpu/drm/xe/xe_oa_types.h | 3 -
drivers/gpu/drm/xe/xe_pci.c | 5 +
drivers/gpu/drm/xe/xe_survivability_mode.c | 247 +++++----
drivers/gpu/drm/xe/xe_survivability_mode.h | 2 +-
drivers/gpu/drm/xe/xe_survivability_mode_types.h | 22 +-
drivers/gpu/drm/xe/xe_tuning.c | 2 +-
drivers/gpu/drm/xe/xe_uc.c | 10 +-
drivers/gpu/drm/xe/xe_uc.h | 1 -
drivers/gpu/drm/xe/xe_vm.c | 9 +-
drivers/gpu/drm/xe/xe_wa.c | 16 +-
drivers/gpu/drm/xe/xe_wa_oob.rules | 33 +-
drivers/hwmon/aht10.c | 2 +-
drivers/hwmon/gpio-fan.c | 24 +-
drivers/hwmon/max31760.c | 12 +-
drivers/hwmon/pmbus/mp2975.c | 207 ++++----
drivers/hwmon/scmi-hwmon.c | 12 +-
drivers/hwmon/sy7636a-hwmon.c | 2 +-
drivers/i3c/master/mipi-i3c-hci/dma.c | 40 +-
drivers/iio/accel/Kconfig | 2 +
drivers/iio/accel/adxl380.c | 11 +-
drivers/iio/accel/kxsd9.c | 2 +-
drivers/iio/adc/ad7780.c | 4 +-
drivers/iio/adc/ad7791.c | 4 +-
drivers/iio/adc/ad7793.c | 4 +-
drivers/iio/adc/max11205.c | 4 +-
drivers/iio/addac/ad74413r.c | 2 +-
drivers/iio/afe/iio-rescale.c | 3 +-
drivers/iio/chemical/atlas-ezo-sensor.c | 3 -
.../iio/common/hid-sensors/hid-sensor-attributes.c | 14 +-
drivers/iio/common/scmi_sensors/scmi_iio.c | 27 +-
drivers/iio/dac/mcp4725.c | 2 +
drivers/iio/gyro/bmg160_core.c | 2 +-
drivers/iio/humidity/am2315.c | 12 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 24 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 97 +++-
drivers/iio/imu/kmx61.c | 2 +-
drivers/iio/industrialio-acpi.c | 9 +
drivers/iio/industrialio-trigger.c | 4 +-
drivers/iio/light/tsl2591.c | 32 +-
drivers/iio/light/vcnl4035.c | 4 +-
drivers/iio/magnetometer/mmc35240.c | 3 +-
drivers/iio/magnetometer/tlv493d.c | 6 +-
drivers/iio/proximity/sx9310.c | 2 +-
drivers/iio/proximity/sx9324.c | 13 +-
drivers/iio/proximity/sx9500.c | 6 +
drivers/iio/temperature/mlx90614.c | 2 +-
drivers/infiniband/core/rdma_core.c | 2 +
drivers/infiniband/hw/bnxt_re/bnxt_re.h | 4 +
drivers/infiniband/hw/bnxt_re/main.c | 26 +-
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 +
drivers/infiniband/hw/bnxt_re/qplib_res.c | 14 +-
drivers/infiniband/hw/mlx5/fs.c | 3 +
drivers/infiniband/hw/mlx5/qp.c | 22 +-
drivers/infiniband/hw/mlx5/qpc.c | 10 +
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 6 +-
drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c | 3 +-
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 45 +-
drivers/input/ff-core.c | 2 +-
drivers/input/ff-memless.c | 10 +-
drivers/input/input.c | 2 +
drivers/iommu/amd/init.c | 1 +
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 +-
drivers/irqchip/irq-mst-intc.c | 3 +
drivers/irqchip/irq-sifive-plic.c | 2 +-
drivers/md/dm-cache-metadata.c | 4 +-
drivers/md/dm-cache-target.c | 1 +
drivers/md/dm-crypt.c | 22 +-
drivers/md/dm-integrity.c | 30 +-
drivers/md/dm-log-userspace-base.c | 6 +-
drivers/md/dm-mpath.c | 6 +-
drivers/md/dm-pcache/backing_dev.c | 4 +-
drivers/md/dm-pcache/backing_dev.h | 2 +-
drivers/md/dm-pcache/cache_writeback.c | 28 +-
drivers/md/dm-raid.c | 5 +-
drivers/md/dm-snap.c | 18 +-
drivers/md/dm-sysfs.c | 17 +-
drivers/md/dm-thin-metadata.c | 5 +-
drivers/md/dm-thin.c | 7 +-
drivers/md/dm-verity-target.c | 27 +-
drivers/md/dm-zone.c | 2 +
drivers/md/dm-zoned-reclaim.c | 18 +-
drivers/md/dm.c | 19 +-
drivers/md/persistent-data/dm-btree-remove.c | 13 +-
drivers/md/persistent-data/dm-btree.c | 8 +-
drivers/md/persistent-data/dm-space-map-common.c | 9 +-
drivers/media/rc/rc-main.c | 125 +++--
drivers/mfd/cs42l43-i2c.c | 8 +
drivers/mfd/cs42l43-sdw.c | 10 +
drivers/mfd/cs42l43.c | 12 +-
drivers/mfd/cs42l43.h | 1 +
drivers/misc/bcm-vk/bcm_vk_sg.c | 43 +-
drivers/misc/fastrpc.c | 188 ++++---
drivers/misc/ibmvmc.c | 16 +-
drivers/misc/vmw_vmci/vmci_event.c | 7 +-
drivers/mmc/host/jz4740_mmc.c | 5 +-
drivers/mmc/host/meson-gx-mmc.c | 26 +-
drivers/mmc/host/mmci.c | 4 +-
drivers/mmc/host/omap.c | 4 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 17 +
drivers/mmc/host/sunxi-mmc.c | 24 +-
drivers/mtd/mtdcore.c | 1 +
drivers/net/amt.c | 61 +--
drivers/net/bonding/bond_main.c | 108 ++--
drivers/net/can/dev/skb.c | 6 +-
drivers/net/dsa/b53/b53_common.c | 69 ++-
drivers/net/dsa/b53/b53_priv.h | 1 +
drivers/net/dsa/b53/b53_regs.h | 17 +
drivers/net/dsa/bcm_sf2.c | 5 +
drivers/net/dsa/microchip/ksz_common.c | 1 +
drivers/net/ethernet/amazon/ena/ena_netdev.c | 13 +-
drivers/net/ethernet/broadcom/bgmac-platform.c | 3 +-
drivers/net/ethernet/broadcom/bgmac.c | 8 +-
drivers/net/ethernet/broadcom/bnge/bnge_netdev.c | 27 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 55 +-
drivers/net/ethernet/cadence/macb.h | 2 -
drivers/net/ethernet/cadence/macb_main.c | 23 +-
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 35 +-
drivers/net/ethernet/intel/ice/ice_adapter.c | 17 +-
drivers/net/ethernet/intel/ice/ice_adapter.h | 17 +-
drivers/net/ethernet/intel/ice/ice_ptp.c | 125 +++--
drivers/net/ethernet/intel/ice/ice_ptp.h | 4 +
drivers/net/ethernet/intel/ice/ice_xsk.c | 19 +-
drivers/net/ethernet/intel/idpf/xsk.c | 5 +
drivers/net/ethernet/mediatek/mtk_ppe.c | 5 +-
drivers/net/ethernet/mediatek/mtk_wed.c | 27 +-
.../net/ethernet/mellanox/mlx5/core/en/params.c | 5 +-
.../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 38 +-
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 65 +--
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 19 +-
.../net/ethernet/mellanox/mlx5/core/esw/bridge.c | 21 +-
.../net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c | 15 +-
.../net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h | 6 +
.../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 2 +-
.../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c | 26 +-
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +-
.../net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/lib/clock.c | 248 ++++++---
.../net/ethernet/mellanox/mlx5/core/lib/clock.h | 2 +
.../ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 41 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
.../mellanox/mlx5/core/steering/hws/fs_hws.c | 8 +-
.../mellanox/mlx5/core/steering/hws/fs_hws.h | 2 +-
drivers/net/ethernet/meta/fbnic/fbnic.h | 10 +-
drivers/net/ethernet/meta/fbnic/fbnic_csr.h | 7 +
drivers/net/ethernet/meta/fbnic/fbnic_fw.c | 16 +
drivers/net/ethernet/meta/fbnic/fbnic_irq.c | 34 +-
drivers/net/ethernet/meta/fbnic/fbnic_mac.c | 81 ++-
drivers/net/ethernet/meta/fbnic/fbnic_mac.h | 40 +-
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c | 8 +-
drivers/net/ethernet/meta/fbnic/fbnic_netdev.h | 2 +-
drivers/net/ethernet/meta/fbnic/fbnic_pci.c | 42 +-
drivers/net/ethernet/meta/fbnic/fbnic_phylink.c | 102 +++-
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 10 +-
.../net/ethernet/microchip/lan966x/lan966x_fdma.c | 6 +
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 10 +-
drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +-
drivers/net/ethernet/realtek/8139cp.c | 8 +-
drivers/net/ethernet/sfc/ptp.c | 108 ++--
drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 6 +
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 11 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 260 +++++----
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 17 +-
drivers/net/ethernet/ti/am65-cpts.c | 67 ++-
drivers/net/gtp.c | 22 +-
drivers/net/hamradio/bpqether.c | 62 ++-
drivers/net/hyperv/rndis_filter.c | 6 +-
drivers/net/ipa/ipa_interrupt.c | 12 +-
drivers/net/ipvlan/ipvlan_core.c | 6 +-
drivers/net/macsec.c | 15 +-
drivers/net/mctp/mctp-i3c.c | 3 +-
drivers/net/phy/phy-c45.c | 46 +-
drivers/net/team/team_core.c | 12 +-
drivers/net/tun.c | 42 +-
drivers/net/tun_vnet.h | 5 +-
drivers/net/usb/cdc_ncm.c | 4 +-
drivers/net/usb/lan78xx.c | 21 +-
drivers/net/virtio_net.c | 51 +-
drivers/net/wireless/ath/ath10k/core.c | 1 +
drivers/net/wireless/ath/ath10k/thermal.c | 9 +-
drivers/net/wireless/ath/ath10k/thermal.h | 2 +
drivers/net/wireless/ath/ath12k/ahb.c | 52 +-
drivers/net/wireless/ath/ath12k/core.c | 6 +-
drivers/net/wireless/ath/ath12k/dp_mon.c | 60 ++-
drivers/net/wireless/ath/ath12k/dp_tx.c | 15 +-
drivers/net/wireless/ath/ath12k/mac.c | 430 ++++++++++++---
drivers/net/wireless/ath/ath12k/mac.h | 16 +-
drivers/net/wireless/ath/ath12k/wmi.h | 12 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 8 +-
drivers/net/wireless/mediatek/mt76/mt7921/init.c | 31 +-
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 7 +-
drivers/net/wireless/mediatek/mt76/mt7996/main.c | 4 +-
drivers/net/wireless/realtek/rtl8xxxu/core.c | 140 +++--
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
drivers/net/wireless/realtek/rtw89/rtw8851bu.c | 8 +-
drivers/net/wireless/realtek/rtw89/rtw8852bu.c | 8 +-
drivers/net/wireless/realtek/rtw89/usb.c | 5 +-
drivers/net/wireless/realtek/rtw89/usb.h | 3 +-
drivers/nvme/common/.kunitconfig | 6 +
drivers/nvme/common/Kconfig | 10 +
drivers/nvme/common/Makefile | 2 +
drivers/nvme/common/auth.c | 291 ++++++----
drivers/nvme/common/tests/auth_kunit.c | 175 ++++++
drivers/nvme/host/auth.c | 22 +-
drivers/nvme/host/core.c | 4 +
drivers/nvme/host/tcp.c | 54 +-
drivers/nvme/target/Kconfig | 9 +
drivers/nvme/target/admin-cmd.c | 4 +-
drivers/nvme/target/auth.c | 98 ++--
drivers/nvme/target/loop.c | 34 +-
drivers/nvme/target/nvmet.h | 2 +-
drivers/nvme/target/rdma.c | 55 +-
drivers/nvme/target/tcp.c | 13 +-
drivers/phy/samsung/phy-exynos5-usbdrd.c | 66 ++-
drivers/pinctrl/stm32/pinctrl-stm32.c | 12 +-
drivers/platform/x86/intel/pmt/class.c | 4 +-
drivers/platform/x86/intel/pmt/class.h | 3 +-
drivers/platform/x86/intel/pmt/discovery.c | 2 +-
drivers/power/sequencing/pwrseq-qcom-wcn.c | 2 +-
drivers/ptp/ptp_clock.c | 5 +
drivers/ptp/ptp_kvm_x86.c | 7 +-
drivers/ptp/ptp_private.h | 7 +-
drivers/ptp/ptp_sysfs.c | 18 +-
drivers/ptp/ptp_vclock.c | 123 +++--
drivers/regulator/Kconfig | 1 +
drivers/regulator/qcom_spmi-regulator.c | 35 +-
drivers/s390/block/dasd_eckd.c | 3 +-
drivers/s390/block/dasd_ioctl.c | 4 +-
drivers/s390/crypto/zcrypt_api.c | 41 +-
drivers/s390/crypto/zcrypt_error.h | 28 +-
drivers/s390/crypto/zcrypt_msgtype50.c | 95 +++-
drivers/s390/crypto/zcrypt_msgtype6.c | 208 ++++++--
drivers/s390/crypto/zcrypt_msgtype6.h | 4 +-
drivers/scsi/aha1542.c | 2 -
drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
drivers/scsi/scsi_debug.c | 12 +
drivers/soundwire/dmi-quirks.c | 42 ++
drivers/spi/spi-cadence-quadspi.c | 4 +-
drivers/spi/spi-pic32-sqi.c | 3 +-
drivers/spi/spi-tegra210-quad.c | 31 +-
drivers/spi/spi-virtio.c | 26 +-
drivers/spi/spi.c | 40 +-
drivers/staging/greybus/raw.c | 23 +-
.../staging/media/atomisp/pci/sh_css_param_dvs.c | 11 +-
.../media/atomisp/pci/sh_css_param_shading.c | 4 +-
drivers/staging/media/atomisp/pci/sh_css_params.c | 35 +-
drivers/target/target_core_pr.c | 9 +-
drivers/thermal/airoha_thermal.c | 25 +-
drivers/tty/serial/8250/8250.h | 1 +
drivers/tty/serial/8250/8250_lpss.c | 3 +
drivers/tty/serial/8250/8250_mid.c | 16 +-
drivers/tty/serial/8250/8250_port.c | 13 +-
drivers/tty/serial/rda-uart.c | 2 +
drivers/tty/serial/samsung_tty.c | 8 +-
drivers/tty/serial/serial_core.c | 25 +-
drivers/tty/serial/serial_port.c | 4 +-
drivers/tty/tty_io.c | 3 +-
drivers/tty/vt/keyboard.c | 6 +
drivers/tty/vt/vt.c | 2 +
drivers/usb/class/cdc-acm.c | 18 +-
drivers/usb/dwc3/core.h | 4 +-
drivers/usb/dwc3/dwc3-xilinx.c | 24 +-
drivers/usb/dwc3/ep0.c | 2 +-
drivers/usb/dwc3/gadget.c | 160 ++++--
drivers/usb/gadget/function/f_mass_storage.c | 8 +-
drivers/usb/gadget/function/f_midi.c | 4 +
drivers/usb/gadget/function/f_ncm.c | 7 +-
drivers/usb/gadget/function/storage_common.c | 7 +-
drivers/usb/gadget/function/storage_common.h | 3 +-
drivers/usb/gadget/function/u_serial.c | 170 ++++--
drivers/usb/host/pci-quirks.c | 13 +-
drivers/usb/host/xhci.c | 2 +-
drivers/usb/misc/usbtest.c | 3 +
drivers/usb/serial/garmin_gps.c | 31 +-
drivers/usb/serial/io_edgeport.c | 141 +++--
drivers/usb/serial/oti6858.c | 16 +-
drivers/usb/serial/sierra.c | 18 +-
drivers/usb/serial/upd78f0730.c | 13 +-
drivers/usb/storage/uas-detect.h | 8 +-
drivers/usb/typec/mux/fsa4480.c | 9 +-
drivers/usb/typec/mux/nb7vpq904m.c | 1 +
drivers/usb/typec/ucsi/ucsi.c | 10 +-
drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +-
drivers/vdpa/vdpa.c | 7 +-
drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 +
drivers/vdpa/vdpa_user/vduse_dev.c | 15 +-
drivers/vhost/scsi.c | 61 ++-
drivers/vhost/test.c | 4 +
drivers/vhost/vdpa.c | 87 ++-
drivers/vhost/vhost.c | 33 +-
drivers/video/fbdev/core/fbmem.c | 5 +-
drivers/video/fbdev/core/fbsysfs.c | 59 ++-
drivers/virtio/virtio_balloon.c | 3 +-
drivers/virtio/virtio_pci_common.c | 2 +-
drivers/virtio/virtio_ring.c | 70 +--
drivers/w1/masters/ds2482.c | 36 +-
drivers/w1/slaves/w1_ds2805.c | 8 +-
drivers/w1/slaves/w1_ds28e04.c | 18 +-
drivers/w1/slaves/w1_therm.c | 37 +-
drivers/w1/w1.c | 21 +-
drivers/w1/w1_int.c | 8 +-
drivers/w1/w1_netlink.c | 8 +-
drivers/watchdog/npcm_wdt.c | 15 +-
drivers/xen/gntdev.c | 8 +-
drivers/xen/grant-table.c | 37 +-
drivers/xen/privcmd.c | 15 +
drivers/xen/pvcalls-back.c | 26 +-
fs/9p/fid.c | 11 +-
fs/9p/v9fs.c | 589 +++++++++++----------
fs/9p/v9fs.h | 58 +-
fs/9p/v9fs_vfs.h | 15 +
fs/9p/vfs_addr.c | 39 +-
fs/9p/vfs_dentry.c | 105 +++-
fs/9p/vfs_dir.c | 6 +-
fs/9p/vfs_inode.c | 28 +-
fs/9p/vfs_inode_dotl.c | 90 +++-
fs/9p/vfs_super.c | 135 +++--
fs/adfs/dir_fplus.c | 2 +
fs/aio.c | 7 +-
fs/backing-file.c | 7 +-
fs/btrfs/bio.c | 4 +
fs/btrfs/fiemap.c | 3 +-
fs/btrfs/scrub.c | 8 +-
fs/btrfs/verity.c | 2 +-
fs/btrfs/volumes.h | 5 +-
fs/btrfs/zoned.c | 81 ++-
fs/btrfs/zstd.c | 3 +-
fs/coda/file.c | 3 +-
fs/dcache.c | 46 +-
fs/dlm/config.c | 9 +-
fs/dlm/member.c | 17 +-
fs/eventpoll.c | 11 +-
fs/exfat/fatent.c | 20 +-
fs/ext2/dir.c | 3 +
fs/file.c | 10 +-
fs/fs-writeback.c | 97 ++--
fs/fuse/dev.c | 32 +-
fs/fuse/file.c | 2 +-
fs/fuse/notify.c | 2 +-
fs/inode.c | 3 +-
fs/isofs/util.c | 8 +-
fs/libfs.c | 133 ++---
fs/netfs/read_retry.c | 17 +-
fs/netfs/write_issue.c | 4 +-
fs/nfs/dir.c | 4 +-
fs/nfs/inode.c | 11 +-
fs/nfs/localio.c | 13 +-
fs/nfs/nfs4proc.c | 24 +-
fs/nfs/pnfs.c | 2 +-
fs/nfsd/nfs4state.c | 196 +++++--
fs/nfsd/state.h | 13 +-
fs/notify/fanotify/fanotify.h | 2 +-
fs/notify/fsnotify.c | 2 +-
fs/ntfs3/index.c | 10 +
fs/overlayfs/namei.c | 13 +-
fs/overlayfs/overlayfs.h | 11 +-
fs/overlayfs/ovl_entry.h | 2 +
fs/overlayfs/params.c | 58 +-
fs/overlayfs/super.c | 37 +-
fs/overlayfs/util.c | 12 +
fs/pidfs.c | 12 +
fs/proc/proc_sysctl.c | 5 +-
fs/read_write.c | 10 +-
fs/smb/client/cifsacl.c | 5 +-
fs/smb/client/cifsacl.h | 14 -
fs/smb/client/cifsfs.c | 13 +-
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/connect.c | 3 +-
fs/smb/client/dfs.c | 12 +-
fs/smb/client/file.c | 100 +++-
fs/smb/client/sess.c | 4 +-
fs/smb/client/smb2pdu.c | 23 +-
fs/smb/server/mgmt/share_config.c | 43 +-
fs/smb/server/mgmt/share_config.h | 2 +
fs/smb/server/smb2pdu.c | 223 +++++---
fs/smb/server/vfs.c | 9 +-
fs/smb/server/vfs_cache.c | 16 +-
fs/splice.c | 11 +-
fs/stat.c | 6 +-
fs/udf/super.c | 19 +-
fs/userfaultfd.c | 22 +-
fs/xfs/xfs_inode.c | 3 +-
include/acpi/acpi_bus.h | 1 +
include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h | 12 +
include/linux/blk-mq.h | 3 +-
include/linux/blkdev.h | 3 +-
include/linux/bpf.h | 16 +-
include/linux/can/dev.h | 2 +-
include/linux/can/skb.h | 4 +-
include/linux/ceph/ceph_fs.h | 5 +-
include/linux/compiler.h | 7 +-
include/linux/cpufreq.h | 3 +
include/linux/dcache.h | 1 +
include/linux/ethtool.h | 2 +
include/linux/fs.h | 10 +-
include/linux/fs_parser.h | 2 +
include/linux/fsnotify.h | 4 +-
include/linux/fsnotify_backend.h | 6 +-
include/linux/gpio/regmap.h | 7 +
include/linux/key.h | 3 +
include/linux/mlx5/driver.h | 8 +-
include/linux/mmzone.h | 3 +-
include/linux/netdevice.h | 5 +
include/linux/netdevice_xmit.h | 4 +-
include/linux/nvme-auth.h | 44 +-
include/linux/nvme.h | 5 +
include/linux/perf_event.h | 34 ++
include/linux/perf_regs.h | 36 +-
include/linux/ptp_clock_kernel.h | 2 +-
include/linux/sched.h | 16 +-
include/linux/stat.h | 3 +
include/linux/tcp.h | 37 +-
include/linux/uio.h | 8 +-
include/linux/virtio_net.h | 245 +++++++--
include/media/rc-map.h | 2 -
include/net/9p/client.h | 102 +++-
include/net/9p/transport.h | 9 +-
include/net/af_unix.h | 1 +
include/net/bluetooth/hci_core.h | 15 +-
include/net/dst.h | 3 +-
include/net/dst_metadata.h | 2 +
include/net/gro.h | 18 +-
include/net/gso.h | 2 +-
include/net/inet_connection_sock.h | 1 +
include/net/inet_frag.h | 1 +
include/net/iw_handler.h | 8 +-
include/net/libeth/xsk.h | 10 +-
include/net/netfilter/nf_conntrack_helper.h | 1 +
include/net/netfilter/nf_dup_netdev.h | 35 --
include/net/netfilter/nf_queue.h | 1 +
include/net/netfilter/nf_recursion.h | 42 ++
include/net/scm.h | 13 +-
include/net/sock.h | 24 +-
include/net/tcp.h | 9 +
include/net/tcp_ao.h | 3 +-
include/net/xdp_sock_drv.h | 7 +-
include/net/xfrm.h | 17 +
include/net/xsk_buff_pool.h | 3 +
include/trace/events/huge_memory.h | 6 +-
include/trace/events/oom.h | 8 +-
include/uapi/asm-generic/socket.h | 2 +
include/uapi/linux/mdio.h | 13 +-
include/uapi/linux/perf_event.h | 51 +-
include/uapi/linux/virtio_spi.h | 2 +-
init/Kconfig | 6 +
init/do_mounts_rd.c | 5 +
io_uring/futex.c | 1 +
io_uring/io-wq.c | 44 +-
io_uring/io_uring.c | 8 +-
io_uring/io_uring.h | 1 +
io_uring/kbuf.c | 1 +
io_uring/napi.c | 31 +-
io_uring/rsrc.c | 7 +-
io_uring/rw.c | 4 +-
io_uring/timeout.c | 3 +-
kernel/Kconfig.kexec | 34 --
kernel/Makefile | 4 +-
kernel/bpf/arena.c | 10 +-
kernel/bpf/arraymap.c | 2 +-
kernel/bpf/bpf_local_storage.c | 2 +-
kernel/bpf/cgroup.c | 26 +-
kernel/bpf/core.c | 10 +-
kernel/bpf/hashtab.c | 86 ++-
kernel/bpf/helpers.c | 14 +-
kernel/bpf/stackmap.c | 102 ++--
kernel/bpf/syscall.c | 4 +-
kernel/bpf/trampoline.c | 19 +-
kernel/bpf/verifier.c | 210 ++++++--
kernel/cgroup/cpuset-internal.h | 5 +
kernel/cgroup/cpuset.c | 437 +++++++++------
kernel/dma/direct.c | 21 +-
kernel/events/core.c | 298 +++++++++--
kernel/events/hw_breakpoint.c | 3 +-
kernel/kprobes.c | 82 +--
kernel/liveupdate/Kconfig | 40 ++
kernel/liveupdate/Makefile | 5 +
kernel/{ => liveupdate}/kexec_handover.c | 6 +-
kernel/{ => liveupdate}/kexec_handover_debug.c | 0
kernel/{ => liveupdate}/kexec_handover_debugfs.c | 0
kernel/{ => liveupdate}/kexec_handover_internal.h | 0
kernel/locking/osq_lock.c | 62 ++-
kernel/printk/printk.c | 34 +-
kernel/sched/deadline.c | 89 +++-
kernel/sched/ext.c | 24 +-
kernel/sched/fair.c | 9 +-
kernel/sched/idle.c | 16 +-
kernel/sched/pelt.c | 2 +-
kernel/sched/sched.h | 25 +-
kernel/sched/syscalls.c | 40 +-
kernel/sched/topology.c | 16 +-
kernel/time/timekeeping.c | 9 +-
kernel/trace/trace_eprobe.c | 83 ++-
kernel/trace/trace_event_perf.c | 3 +-
kernel/trace/trace_fprobe.c | 22 +-
kernel/trace/trace_kprobe.c | 11 +-
kernel/trace/trace_probe.c | 20 +-
kernel/trace/trace_probe_tmpl.h | 14 +-
kernel/trace/trace_uprobe.c | 67 ++-
kernel/tsacct.c | 10 +-
lib/bootconfig.c | 2 +-
lib/errseq.c | 29 +-
lib/iov_iter.c | 6 +-
mm/internal.h | 11 +-
mm/khugepaged.c | 9 +-
mm/ksm.c | 4 +
mm/memory_hotplug.c | 49 +-
mm/mempolicy.c | 4 +-
mm/page_alloc.c | 83 ++-
mm/page_frag_cache.c | 21 +-
mm/shmem.c | 2 +-
mm/slub.c | 86 ++-
net/9p/client.c | 154 +-----
net/9p/mod.c | 2 +-
net/9p/protocol.c | 12 +-
net/9p/trans_fd.c | 144 +----
net/9p/trans_rdma.c | 133 +----
net/9p/trans_usbg.c | 14 +-
net/9p/trans_virtio.c | 8 +-
net/9p/trans_xen.c | 4 +-
net/ax25/ax25_in.c | 30 +-
net/ax25/ax25_std_in.c | 23 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/bluetooth/6lowpan.c | 21 +-
net/bluetooth/hci_conn.c | 23 +-
net/bluetooth/hci_core.c | 66 ++-
net/bluetooth/hci_event.c | 68 ++-
net/bluetooth/hci_sync.c | 116 +++-
net/bluetooth/l2cap_core.c | 5 +-
net/bluetooth/l2cap_sock.c | 3 +-
net/bluetooth/mgmt.c | 45 +-
net/bridge/br_arp_nd_proxy.c | 6 +-
net/bridge/br_if.c | 6 +-
net/bridge/br_vlan.c | 31 +-
net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
net/ceph/Kconfig | 1 +
net/ceph/auth_x.c | 195 +++++--
net/ceph/auth_x_protocol.h | 38 ++
net/ceph/crypto.c | 269 ++++++++--
net/ceph/crypto.h | 21 +-
net/ceph/messenger_v2.c | 14 +-
net/compat.c | 4 +-
net/core/dev.c | 12 +
net/core/devmem.c | 7 +-
net/core/devmem.h | 5 +
net/core/filter.c | 103 +++-
net/core/gro.c | 31 +-
net/core/lwt_bpf.c | 55 +-
net/core/net-sysfs.c | 8 +
net/core/netdev-genl.c | 6 +-
net/core/scm.c | 40 +-
net/core/skbuff.c | 18 +-
net/core/sock_reuseport.c | 26 +-
net/ethtool/ioctl.c | 17 +-
net/ethtool/linkinfo.c | 4 +-
net/ethtool/linkmodes.c | 4 +-
net/ipv4/esp4_offload.c | 1 +
net/ipv4/fib_trie.c | 14 +-
net/ipv4/fou_core.c | 31 +-
net/ipv4/igmp.c | 2 +
net/ipv4/inet_connection_sock.c | 23 +-
net/ipv4/inet_fragment.c | 5 +
net/ipv4/inet_hashtables.c | 11 +
net/ipv4/inet_timewait_sock.c | 6 +-
net/ipv4/ip_fragment.c | 3 +-
net/ipv4/ip_output.c | 8 +-
net/ipv4/ip_tunnel.c | 6 +-
net/ipv4/netfilter/arp_tables.c | 5 +-
net/ipv4/netfilter/ip_tables.c | 5 +-
net/ipv4/netfilter/nf_reject_ipv4.c | 12 +
net/ipv4/raw.c | 15 +-
net/ipv4/route.c | 25 +-
net/ipv4/tcp.c | 23 +-
net/ipv4/tcp_fastopen.c | 2 +
net/ipv4/tcp_input.c | 98 +++-
net/ipv4/tcp_ipv4.c | 25 +-
net/ipv4/tcp_metrics.c | 3 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/udp.c | 5 +-
net/ipv4/udp_offload.c | 10 +-
net/ipv4/udp_tunnel_core.c | 6 +-
net/ipv6/calipso.c | 12 +-
net/ipv6/esp6_offload.c | 1 +
net/ipv6/exthdrs.c | 5 +-
net/ipv6/exthdrs_core.c | 7 +-
net/ipv6/icmp.c | 7 +-
net/ipv6/ip6_fib.c | 54 +-
net/ipv6/ip6_output.c | 13 +-
net/ipv6/ip6mr.c | 43 +-
net/ipv6/mip6.c | 9 +-
net/ipv6/netfilter/ip6_tables.c | 5 +-
net/ipv6/netfilter/nf_reject_ipv6.c | 13 +
net/ipv6/raw.c | 15 +-
net/ipv6/reassembly.c | 5 +-
net/ipv6/route.c | 32 +-
net/ipv6/seg6_iptunnel.c | 46 +-
net/ipv6/seg6_local.c | 264 +++++++--
net/ipv6/sit.c | 2 +-
net/ipv6/tcp_ipv6.c | 9 +-
net/ipv6/udp.c | 5 +-
net/iucv/af_iucv.c | 9 +
net/mac80211/airtime.c | 2 +
net/mac80211/ibss.c | 27 +-
net/mac80211/ieee80211_i.h | 3 +
net/mac80211/link.c | 13 +-
net/mac80211/mlme.c | 25 +-
net/mac80211/ocb.c | 23 +-
net/mac80211/rx.c | 7 +-
net/mac80211/tx.c | 6 +
net/mctp/af_mctp.c | 2 +-
net/mptcp/options.c | 12 +-
net/netfilter/ipvs/ip_vs_app.c | 2 +-
net/netfilter/ipvs/ip_vs_core.c | 12 +-
net/netfilter/nf_conntrack_helper.c | 20 +-
net/netfilter/nf_conntrack_sip.c | 4 +-
net/netfilter/nf_dup_netdev.c | 1 +
net/netfilter/nf_flow_table_core.c | 1 +
net/netfilter/nf_flow_table_ip.c | 2 +
net/netfilter/nf_nat_masquerade.c | 4 +-
net/netfilter/nf_queue.c | 1 +
net/netfilter/nf_tables_api.c | 21 +-
net/netfilter/nf_tables_offload.c | 3 +
net/netfilter/nfnetlink_queue.c | 17 +-
net/netfilter/nft_ct.c | 119 ++++-
net/netfilter/nft_fwd_netdev.c | 1 +
net/netfilter/nft_set_rbtree.c | 3 +-
net/netfilter/xt_NETMAP.c | 4 +-
net/netfilter/xt_recent.c | 7 +-
net/netlink/af_netlink.c | 3 +-
net/netrom/nr_out.c | 7 +-
net/netrom/nr_subr.c | 6 +-
net/netrom/nr_timer.c | 4 +
net/netrom/sysctl_net_netrom.c | 17 +-
net/nsh/nsh.c | 7 +
net/openvswitch/flow.c | 19 +-
net/rds/rdma.c | 5 +-
net/rose/rose_in.c | 21 +
net/sched/act_ife.c | 13 +-
net/sched/sch_teql.c | 9 +-
net/sctp/sm_make_chunk.c | 43 +-
net/sctp/sm_statefuns.c | 16 +-
net/sctp/socket.c | 2 +-
net/sctp/stream.c | 2 +
net/sctp/stream_interleave.c | 38 +-
net/smc/af_smc.c | 21 +-
net/smc/smc.h | 1 +
net/smc/smc_close.c | 14 +
net/smc/smc_core.c | 86 ++-
net/smc/smc_core.h | 6 +-
net/smc/smc_diag.c | 12 +-
net/smc/smc_sysctl.c | 6 +-
net/socket.c | 11 +-
net/sunrpc/clnt.c | 10 +-
net/sunrpc/rpc_pipe.c | 1 +
net/sunrpc/xprtsock.c | 2 +-
net/tipc/bearer.c | 33 ++
net/tls/tls_device.c | 24 +
net/tls/tls_sw.c | 25 +-
net/unix/af_unix.c | 15 +-
net/unix/garbage.c | 31 +-
net/vmw_vsock/af_vsock.c | 3 +-
net/vmw_vsock/hyperv_transport.c | 3 +
net/vmw_vsock/virtio_transport.c | 16 +-
net/wireless/core.c | 2 +-
net/wireless/nl80211.c | 9 +-
net/wireless/scan.c | 3 +-
net/wireless/util.c | 6 +-
net/wireless/wext-core.c | 33 +-
net/xdp/xsk.c | 28 +-
net/xdp/xsk_buff_pool.c | 46 +-
net/xfrm/xfrm_iptfs.c | 3 +-
net/xfrm/xfrm_policy.c | 20 +-
net/xfrm/xfrm_replay.c | 6 +-
security/keys/key.c | 10 +-
security/keys/keyctl.c | 2 -
security/keys/keyring.c | 25 +-
security/keys/request_key.c | 14 +-
sound/core/memalloc.c | 2 +-
sound/drivers/aloop.c | 11 +-
sound/drivers/pcmtest.c | 66 +--
sound/hda/codecs/realtek/alc269.c | 19 +-
sound/hda/codecs/realtek/alc882.c | 10 +
sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 +
sound/hda/codecs/side-codecs/tas2781_hda.c | 4 +-
sound/hda/common/sysfs.c | 5 +-
sound/hda/core/controller.c | 10 +-
sound/pci/Kconfig | 1 +
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 16 +-
sound/soc/amd/ps/pci-ps.c | 32 +-
sound/soc/codecs/max98090.c | 22 +-
sound/soc/codecs/wm_adsp.c | 10 +
sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +-
sound/soc/meson/axg-fifo.c | 30 +-
sound/soc/qcom/common.c | 222 +++++++-
sound/soc/qcom/common.h | 20 +
sound/soc/qcom/lpass.h | 3 +-
sound/soc/qcom/qdsp6/q6afe.h | 3 +-
sound/soc/qcom/qdsp6/q6apm.h | 3 +-
sound/soc/qcom/sc8280xp.c | 33 +-
sound/soc/qcom/sdw.c | 24 +-
sound/soc/qcom/sdw.h | 6 +-
sound/soc/qcom/sm8250.c | 33 +-
sound/soc/qcom/x1e80100.c | 41 +-
sound/soc/rockchip/Kconfig | 6 +
sound/soc/rockchip/rockchip_spdif.c | 97 +++-
sound/soc/rockchip/rockchip_spdif.h | 18 +-
sound/soc/soc-core.c | 16 +
sound/soc/sof/amd/acp.c | 32 +-
sound/soc/sof/ipc4-topology.c | 2 +-
sound/usb/caiaq/device.c | 11 +-
sound/usb/mixer.c | 23 +
sound/usb/mixer.h | 2 +
sound/usb/pcm.c | 6 +
tools/include/nolibc/dirent.h | 7 +-
tools/perf/builtin-lock.c | 61 ++-
tools/perf/tests/hists_cumulate.c | 2 +-
tools/perf/tests/hists_filter.c | 2 +-
tools/perf/tests/hists_link.c | 2 +-
tools/perf/tests/hists_output.c | 2 +-
tools/perf/tests/thread-maps-share.c | 2 +-
tools/perf/util/dso.c | 2 +
tools/perf/util/dso.h | 15 +
tools/perf/util/evlist.c | 6 +-
tools/perf/util/evsel.c | 59 ++-
tools/perf/util/evsel.h | 1 +
tools/perf/util/libbfd.c | 10 +-
tools/perf/util/machine.c | 4 +-
tools/perf/util/machine.h | 10 +-
tools/perf/util/session.c | 2 +-
tools/perf/util/srcline.c | 2 +
tools/perf/util/thread.c | 8 +-
tools/testing/cxl/test/cxl.c | 6 +-
.../selftests/bpf/prog_tests/kfunc_dynptr_param.c | 2 +-
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 29 +-
.../ftrace/test.d/dynevent/fprobe_syntax_errors.tc | 4 +-
.../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 2 +-
.../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 2 +-
tools/testing/selftests/mm/merge.c | 33 +-
.../tcp_bidir_fast_retransmit_nosack.pkt | 42 ++
tools/testing/selftests/net/tls.c | 3 +
924 files changed, 16070 insertions(+), 7084 deletions(-)Greg Kroah-Hartman
maintainerPATCH 1/990 netfilter: nft_ct: expectation timeouts are passed in milliseconds
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 6fb421bd07f156cdf0cdede062d31f1c21def326 ]
Userspace passes '5000' in case user asks for 5 seconds.
Allowing for sub-second expectation lifetimes makes sense to me. so fix up the kernel side instead of munging nft to send a value rounded up to next second.
Also note that this violates nft convention of passing integers in network byte order, but we can't change this anymore.
Stable-dep-of: 3679da4ad8be ("netfilter: nft_ct: move custom expectation support to helper")
--- net/netfilter/nft_ct.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
net/netfilter/nft_ct.c +18 -3
@@ -1217,11 +1217,23 @@ struct nft_ct_expect_obj {u32 timeout; }; +static int nft_ct_expect_timeout_get (const struct nlattr *attr,u32 *val) +{ +unsigned long jiffies_val =msecs_to_jiffies (nla_get_u32 (attr)); + +if (jiffies_val >UINT_MAX ) +return -ERANGE ; + + *val = jiffies_val; +return 0 ; +} +static int nft_ct_expect_obj_init (const struct nft_ctx *ctx,const struct nlattr *const tb[],struct nft_object *obj) {struct nft_ct_expect_obj *priv =nft_obj_data (obj); +int err; if (!tb[NFTA_CT_EXPECT_L4PROTO] || !tb[NFTA_CT_EXPECT_DPORT] ||
@@ -1257,8 +1269,11 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,return -EOPNOTSUPP ; } + err =nft_ct_expect_timeout_get (tb[NFTA_CT_EXPECT_TIMEOUT ], &priv->timeout); +if (err) +return err; + priv->dport =nla_get_be16 (tb[NFTA_CT_EXPECT_DPORT ]); - priv->timeout =nla_get_u32 (tb[NFTA_CT_EXPECT_TIMEOUT ]); priv->size =nla_get_u8 (tb[NFTA_CT_EXPECT_SIZE ]);return nf_ct_netns_get (ctx->net, ctx->family);
@@ -1278,7 +1293,7 @@ static int nft_ct_expect_obj_dump(struct sk_buff *skb,if (nla_put_be16 (skb,NFTA_CT_EXPECT_L3PROTO ,htons (priv->l3num)) ||nla_put_u8 (skb,NFTA_CT_EXPECT_L4PROTO , priv->l4proto) ||nla_put_be16 (skb,NFTA_CT_EXPECT_DPORT , priv->dport) || -nla_put_u32 (skb,NFTA_CT_EXPECT_TIMEOUT , priv->timeout) || +nla_put_u32 (skb,NFTA_CT_EXPECT_TIMEOUT ,jiffies_to_msecs (priv->timeout)) ||nla_put_u8 (skb,NFTA_CT_EXPECT_SIZE , priv->size))return -1 ;
@@ -1328,7 +1343,7 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj, &ct->tuplehash[!dir].tuple.src.u3, &ct->tuplehash[!dir].tuple.dst.u3, priv->l4proto, NULL, &priv->dport); - exp->timeout += priv->timeout *HZ ; + exp->timeout += priv->timeout;if (nf_ct_expect_related (exp,0 ) !=0 ) regs->verdict.code =NF_DROP ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2/990 netfilter: nft_ct: move custom expectation support to helper
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 3679da4ad8be84cddaf40bc307fef1fe13e051ff ]
Originally, the ct expectation support called nf_ct_helper_ext_add() for confirmed conntracks, which is invalid, triggering a splat. This was fixed by commit 1710eb913bdc ("netfilter: nft_ct: skip expectations for confirmed conntrack") which restricted it to unconfirmed conntracks.
However, early insertion of expectations into the expectations list when the conntrack is unconfirmed leads to stale entries pointing to the wrong hlist_head through .pprev due to ct extension reallocation.
Commit 7c9664351980 ("netfilter: move nat hlist_head to nf_conn") moved the nat hlist_head to nf_conn for this reason:
1. ...
2. When reallocation of extension area occurs we need to fixup the bysource hash head via hlist_replace_rcu.
I'd rather not increase the size of the struct nf_conn for this feature has very limited scope: only one expectation can be created at a time given expect_clash() will make nf_ct_expect_related() reports EBUSY. For this reason, relax nf_ct_expect_related() not to drop packets in case expectation creation fails, therefore, expectation creation becomes best effort.
To address this issue, add an internal ct helper and attach it to the conntrack entry to streamline the custom ct expectation support with existing ct helpers.
Expose a new nf_conntrack_helper_release() function to release the internal helper that is allocated and attached to the conntrack entry to create the custom expectations. The nft_ct module removal always waits for rcu grace period, then the NULL helper callback is observed after this.
This patch also restricts the creation of expectations to different helpers other than this custom helper that is created for this type of expectations.
[ - ac46f3f35b6e ("netfilter: nf_conntrack_helper: add refcounting from
datapath") is not backported because it reworks helper lifetime around a datapath ct_refcnt in 9 files, so one static nft_ct_expect helper is unhelped at nft_ct module exit.
- d4beefc90a66 ("netfilter: nft_ct: support expectation creation for natted flows") is not backported because it adds expectation support for NATed flows, so the moved expectation code has no NAT follow-master part.
- Context differs due to commit: 6031487d4e27 ]
--- include/net/netfilter/nf_conntrack_helper.h | 1 + net/netfilter/nf_conntrack_helper.c | 20 ++-- net/netfilter/nft_ct.c | 100 +++++++++++++++----- 3 files changed, 89 insertions(+), 32 deletions(-)
include/net/netfilter/nf_conntrack_helper.h +1 -0
@@ -105,6 +105,7 @@ void nf_ct_helper_init(struct nf_conntrack_helper *helper,int nf_conntrack_helper_register (struct nf_conntrack_helper *);void nf_conntrack_helper_unregister (struct nf_conntrack_helper *); +void nf_conntrack_helper_release (struct nf_conntrack_helper *);int nf_conntrack_helpers_register (struct nf_conntrack_helper *,unsigned int ); void nf_conntrack_helpers_unregister(struct nf_conntrack_helper *,
net/netfilter/nf_conntrack_helper.c +13 -7
@@ -425,6 +425,18 @@ static bool expect_iter_me(struct nf_conntrack_expect *exp, void *data)return this == me; } +void nf_conntrack_helper_release (struct nf_conntrack_helper *me) +{ +nf_ct_expect_iterate_destroy (expect_iter_me, me); +nf_ct_iterate_destroy (unhelp, me); + +/* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as +* last step, this ensures rcu readers of exp->helper are done. +* No need for another synchronize_rcu() here. +*/ +} +EXPORT_SYMBOL_GPL (nf_conntrack_helper_release); +void nf_conntrack_helper_unregister (struct nf_conntrack_helper *me) {mutex_lock (&nf_ct_helper_mutex);
@@ -437,13 +449,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)*/ synchronize_rcu (); -nf_ct_expect_iterate_destroy (expect_iter_me, me); -nf_ct_iterate_destroy (unhelp, me); - -/* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as -* last step, this ensures rcu readers of exp->helper are done. -* No need for another synchronize_rcu() here. -*/ +nf_conntrack_helper_release (me); }EXPORT_SYMBOL_GPL (nf_conntrack_helper_unregister);
net/netfilter/nft_ct.c +75 -25
149 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 3/990 bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: KP Singh <[email protected]>
[ Upstream commit 49b18315be4eecfc36b75f4aecb4d40a87d68a20 ]
__bpf_dynptr_data() can return NULL (FILE dynptrs, any non-contiguous backing). bpf_verify_pkcs7_signature() forwards the pointer to verify_pkcs7_signature() unchecked, causing a NULL deref in asn1_ber_decoder() reachable from a sleepable BPF LSM at lsm.s/bpf.
NULL-check both pointers and reject with -EINVAL. Mirrors the guards already in kernel/bpf/crypto.c.
--- kernel/bpf/helpers.c | 5 +++++ tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
kernel/bpf/helpers.c +5 -0
@@ -3915,8 +3915,13 @@ __bpf_kfunc int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_p, data_len =__bpf_dynptr_size (data_ptr); data =__bpf_dynptr_data (data_ptr, data_len); +if (!data) +return -EINVAL ; + sig_len =__bpf_dynptr_size (sig_ptr); sig =__bpf_dynptr_data (sig_ptr, sig_len); +if (!sig) +return -EINVAL ; return verify_pkcs7_signature(data, data_len, sig, sig_len, trusted_keyring->key,
tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +1 -1
@@ -14,7 +14,7 @@ static struct {const char *prog_name;int expected_runtime_err; } kfunc_dynptr_tests[] = { - {"dynptr_data_null", -EBADMSG}, + {"dynptr_data_null", -EINVAL}, }; static bool kfunc_not_supported;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 4/990 irqchip/sifive-plic: Avoid signed shift in interrupt enable mask
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 0f214e5bbee59d5952d3c061fd65ed9a1e175981 ]
__plic_toggle() builds a 32-bit interrupt enable mask using a signed integer literal. A valid interrupt selecting bit 31 evaluates 1 << 31, which shifts a signed int into its sign bit.
Use BIT(), matching the equivalent mask construction in plic_irq_eoi(). The resulting mask remains representable in u32 on both RV32 and RV64.
The issue was found by our static-analysis tool.
--- drivers/irqchip/irq-sifive-plic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-sifive-plic.c +1 -1
@@ -97,7 +97,7 @@ static int plic_irq_set_type(struct irq_data *d, unsigned int type);static void __plic_toggle (void __iomem *enable_base,int hwirq,int enable) {u32 __iomem *reg = enable_base + (hwirq /32 ) *sizeof (u32); -u32 hwirq_mask =1 << (hwirq %32 ); +u32 hwirq_mask =BIT (hwirq %32 );if (enable)writel (readl (reg) | hwirq_mask, reg);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 5/990 mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <[email protected]>
[ Upstream commit fe21f930d1e64d121191673076fc4ebe79fc82d5 ]
1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves") stopped handing out reserve access for ALLOC_NON_BLOCK on its own: the extra 25% below the min watermark is now only granted on top of ALLOC_MIN_RESERVE. But the flag was left in ALLOC_RESERVES, which produces something odd:
With the ALLOC_RESERVES match, __zone_watermark_unusable_free() doesn't subtract the free highatomic pages for them. So in the slowpath, they get to consume regular blocks below the min watermark by the number of free highatomic pages. The highatomic reserve is capped at 1% of the zone, which on any decently sized machine is a multiple of the min watermark:GFP_NOWAIT can drain regular memory to zero.
The user-visible result is brutal hiccups during bursts of GFP_NOWAIT allocations under memory pressure. This was found in review and reproduced with a synthetic burst, not observed in production, but the sequence of events is a realistic one: On a 32G box with an anonymous working set, swap, and a filled 290M highatomic reserve, a GFP_NOWAIT burst drove regular free memory in the 28G Normal zone (min=60M) to 28M, 0.8M and 0.6M in three runs. Swapout failed to allocate its swap table, reclaim scanned 13M pages to reclaim 200k, page faults stalled for tens to hundreds of milliseconds. The machine survives it, but not by design:
direct reclaimers eventually fail and start unreserving highatomic blocks, until the allocation succeeds or the reserve is gone and the OOM killer runs. That reserve exists for high-order atomic allocations; here it is destroyed to bail out a GFP_NOWAIT consumer that was never entitled to the memory.
Remove ALLOC_NON_BLOCK from ALLOC_RESERVES. With that, the GFP_NOWAIT burst is stopped short at the min watermark. No direct reclaim, no stalls, no failed allocations, and the highatomic reserve stays intact for the requests it exists for.
__zone_watermark_ok() is unaffected, since everything it keys on ALLOC_NON_BLOCK is already nested under ALLOC_MIN_RESERVE. Update the flag comments accordingly: ALLOC_NON_BLOCK just means the caller can't block; the reserve math belongs with ALLOC_MIN_RESERVE.
GFP_ATOMIC order-0 requests have a milder version of the same problem. Through ALLOC_MIN_RESERVE they also count the free highatomic pages in their watermark check, but rmqueue_buddy() serves them regular pages first and only falls back to the reserve once those are gone. They can still push regular free memory to 37.5% of min minus the free highatomic pages before the reserve is touched. Unlike GFP_NOWAIT they are entitled to the reserve, so this needs the watermark check and the freelist order reworked together, and is left to a separate patch.
--- mm/internal.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
mm/internal.h +5 -6
@@ -1322,12 +1322,11 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#define ALLOC_OOM ALLOC_NO_WATERMARKS#endif -#define ALLOC_NON_BLOCK 0x10/* Caller cannot block. Allow access -* to 25% of the min watermark or -* 62.5% if __GFP_HIGH is set. -*/ +#define ALLOC_NON_BLOCK 0x10/* Caller cannot block. */ #define ALLOC_MIN_RESERVE 0x20/* __GFP_HIGH set. Allow access to 50% -* of the min watermark. +* of the min watermark, or 62.5% if +* the caller cannot block either +* (ALLOC_NON_BLOCK). */ #define ALLOC_CPUSET 0x40/* check for correct cpuset */ #define ALLOC_CMA 0x80/* allow allocations from CMA areas */
@@ -1341,7 +1340,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#define ALLOC_KSWAPD 0x800/* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */ /* Flags that allow allocations below the min watermark. */ -#define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM) +#define ALLOC_RESERVES (ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)/* Flags that mean GFP_ATOMIC */ #define ALLOC_MASK_ATOMIC (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 6/990 net: always dissect GSO packets in __virtio_net_hdr_to_skb()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 44378d02c5aaae24b60a75fbbb539b4aa4db503d ]
Commit 9e8db5913264 ("net: avoid false positives in untrusted gso validation") added a '&& skb->network_header' check before flow-dissecting GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM in __virtio_net_hdr_to_skb(), because some callers (such as tun_get_user(), tun_xdp_one(), virtnet_receive_done(), and raw_verify_header()) called virtio_net_hdr_*_to_skb() before initializing skb->network_header and skb->dev.
Because __alloc_skb() and __build_skb_around() zero-initialize skb->network_header to 0 (unlike mac_header and transport_header which are initialized to ~0U), those four callers always had skb->network_header == 0 and bypassed flow dissection in __virtio_net_hdr_to_skb(). More generally, skb->network_header is an offset from skb->head (where 0 is also a valid offset whenever skb_headroom(skb) is 0), not a boolean flag.
Whenever the 'if (gso_type && skb->network_header)' branch was skipped, the fallback 'else if (gso_type)' only pulled nh_min_len + thlen (40 bytes for TCPv4) without dissecting the packet, without validating ip_proto or n_proto, and without setting skb->transport_header.
If the packet has a malformed network header, it is not rejected and a subsequent skb_probe_transport_header() also fails, leaving skb->transport_header at ~0U (0xffff). Similarly, if an IPv4 packet carries IP options (ihl > 5) or an IPv6 packet carries extension headers, pulling only nh_min_len + thlen can leave the TCP header outside skb->head. In both cases, tcp_hdrlen(skb) in skb_gso_transport_seglen() reads out-of-bounds:
BUG: KASAN: slab-out-of-bounds in skb_gso_transport_seglen Read of size 2 by task poc/133 skb_gso_transport_seglen (net/core/gso.c:155) skb_gso_validate_mac_len (net/core/gso.c:270) tbf_enqueue (net/sched/sch_tbf.c:260) dev_qdisc_enqueue (net/core/dev.c:4227) __dev_queue_xmit (net/core/dev.c:4884)
In addition, checking virtio_net_hdr_match_proto() only inside 'if (!skb->protocol)' before flow dissection both skipped validation when skb->protocol was pre-set by the caller and rejected VLAN-tagged frames whose outer L2 protocol is ETH_P_8021Q or ETH_P_8021AD.
Fix this by:
1. Initializing skb->dev and skb->network_header (plus skb->protocol for IFF_TUN) before virtio_net_hdr_*_to_skb() in tun_get_user(), tun_xdp_one(), virtnet_receive_done(), and raw_verify_header(). In tun_get_user(), drop the redundant skb_reset_mac_header(skb) in the IFF_TUN case since __virtio_net_hdr_to_skb() unconditionally resets mac_header.
2. Removing '&& skb->network_header' and the unvalidated 'else if (gso_type)' fallback in __virtio_net_hdr_to_skb() so all GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM are flow-dissected, have their transport header pulled into linear data, and have skb->transport_header set.
3. Moving the virtio_net_hdr_match_proto() check to after skb_flow_dissect_flow_keys_basic(), validating keys.basic.n_proto against hdr_gso_type.
--- arch/um/drivers/vector_transports.c | 1 + drivers/net/tun.c | 23 ++++++----- drivers/net/virtio_net.c | 2 + include/linux/virtio_net.h | 60 ++++++++++++----------------- 4 files changed, 42 insertions(+), 44 deletions(-)
arch/um/drivers/vector_transports.c +1 -0
@@ -209,6 +209,7 @@ static int raw_verify_header(if ((vheader->flags &VIRTIO_NET_HDR_F_DATA_VALID ) >0 )return 1 ; +skb_set_network_header (skb,ETH_HLEN );virtio_net_hdr_to_skb (skb, vheader,virtio_legacy_is_little_endian ());return 0 ; }
drivers/net/tun.c +14 -9
@@ -1824,12 +1824,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, } } -if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, &hdr)) { -atomic_long_inc (&tun->rx_frame_errors); - err = -EINVAL ; - goto free_skb; - } - + skb->dev = tun->dev;switch (tun->flags &TUN_TYPE_MASK ) {case IFF_TUN :if (tun->flags &IFF_NO_PI ) {
@@ -1854,9 +1849,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, } } -skb_reset_mac_header (skb); +skb_reset_network_header (skb); skb->protocol = pi.proto; - skb->dev = tun->dev;break ;case IFF_TAP :if (!pskb_may_pull (skb,ETH_HLEN )) {
@@ -1864,10 +1858,19 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, drop_reason =SKB_DROP_REASON_HDR_TRUNC ; goto drop; } - skb->protocol =eth_type_trans (skb, tun->dev); +skb_set_network_header (skb,ETH_HLEN );break ; } +if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, &hdr)) { +atomic_long_inc (&tun->rx_frame_errors); + err = -EINVAL ; + goto free_skb; + } + +if ((tun->flags &TUN_TYPE_MASK ) ==IFF_TAP ) + skb->protocol =eth_type_trans (skb, tun->dev); +/* copy skb_ubuf_info for callback when skb has no error */ if (zerocopy) {skb_zcopy_init (skb, msg_control);
@@ -2481,6 +2484,8 @@ static int tun_xdp_one(struct tun_struct *tun, features =tun_vnet_hdr_guest_features (READ_ONCE (tun->vnet_hdr_sz)); tnl_hdr = (struct virtio_net_hdr_v1_hash_tunnel *)gso; + skb->dev = tun->dev; +skb_set_network_header (skb,ETH_HLEN );if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, tnl_hdr)) {atomic_long_inc (&tun->rx_frame_errors);kfree_skb (skb);
drivers/net/virtio_net.c +2 -0
@@ -2602,6 +2602,8 @@ static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue * goto frame_err; } + skb->dev = dev; +skb_set_network_header (skb,ETH_HLEN );if (virtio_net_hdr_tnl_to_skb (skb, &hdr->tnl_hdr, vi->rx_tnl, vi->rx_tnl_csum,virtio_is_little_endian (vi->vdev))) {
include/linux/virtio_net.h +25 -35
73 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 7/990 tun: clear stale skb->protocol of NAPI frags skbs
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 3287cd714a853d9443c4a743eca010aedcfbbcdd ]
With IFF_NAPI_FRAGS, tun_napi_alloc_frags() gets its skb from napi_get_frags(). If GRO merged the previous frame with GRO_MERGED_FREE, that skb was recycled by napi_reuse_skb(), which does not reset skb->protocol set by napi_frags_skb() for the previous frame.
tun_get_user() calls tun_vnet_hdr_tnl_to_skb() before eth_type_trans(), so the virtio header checks see the protocol of the previous frame:
GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM are dissected with the wrong protocol. A following change checks the outer protocol of UDP tunnel GSO packets, which would then reject a valid frame when the two ethertypes differ.
This needs GRO to hold packets across writes, and IFF_NAPI_FRAGS needs CAP_NET_ADMIN.
Clear skb->protocol in tun_napi_alloc_frags(), like skbs allocated by tun_alloc_skb() or build_skb(). eth_type_trans() sets it later.
--- drivers/net/tun.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/tun.c +6 -0
@@ -1419,6 +1419,12 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile,if (!skb)return ERR_PTR (-ENOMEM ); +/* An skb recycled by napi_reuse_skb() keeps the protocol of a +* previous frame. eth_type_trans() sets it after the virtio +* header checks, which must not see a stale one. +*/ + skb->protocol =0 ; + linear =iov_iter_single_seg_count (it); err =__skb_grow (skb, linear);if (err)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 8/990 net: virtio: validate outer protocol of UDP tunnel GSO packets
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 73e08d50eb139e7329032c89a4cb105cf43ef278 ]
virtio_net_hdr_tnl_to_skb() trusts the virtio header to describe a UDP tunnel over IPv4 or IPv6, but never checks that the frame actually carries such outer headers. Because VIRTIO_NET_HDR_F_NEEDS_CSUM is mandatory for tunnel GSO, __virtio_net_hdr_to_skb() skips the flow dissector, so virtio_net_hdr_match_proto() is never applied either.
A guest (or a tap writer) can then inject a frame with an arbitrary outer ethertype, for example ETH_P_NSH, with SKB_GSO_UDP_TUNNEL set. The GSO stack then runs nsh_gso_segment() on top of the UDP tunnel segmentation, which assumes a different header layout. The result is segments with skb->data before skb->head, and a host crash in skb_under_panic() as soon as a later layer pushes a header:
skbuff: skb_under_panic: ... put:4 ... dev:gretap1 kernel BUG at net/core/skbuff.c:215!
skb_push
__gre_xmit
gre_tap_xmit
...
tun_get_user
Validate the outer headers with the parsing helpers from Michael's series "net: resolve uncommon partial checksums at ingress":
- locate the L3 header: Ethernet with optional VLAN tags, or the network header set by the caller. skb->protocol is not trusted when it disagrees with the frame.
- require the outer L3 protocol to match the declared tunnel type.
- require the outer UDP header exactly at outer_th_offset, after IPv4 options or IPv6 extension headers, and reject fragments.
Unlike the original helpers:
- the callers tell whether the frame starts with an Ethernet header, with a new has_eth argument of virtio_net_hdr_tnl_to_skb(), instead of using the device type. tun frames packets from its IFF_TAP and IFF_TUN flags, and TUNSETLINK can set the device type to any value. virtio_net and tun_xdp_one() always pass true, tun_get_user() passes whether the device is IFF_TAP.
- ipv6_find_hdr() stops at an AH header, as Willem suggested in the review of that series.
--- drivers/net/tun.c | 9 +- drivers/net/tun_vnet.h | 5 +- drivers/net/virtio_net.c | 2 +- include/linux/virtio_net.h | 169 +++++++++++++++++++++++++++++++++++++ 4 files changed, 180 insertions(+), 5 deletions(-)
drivers/net/tun.c +7 -2
@@ -1868,7 +1868,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,break ; } -if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, &hdr)) { +if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, &hdr, + (tun->flags &TUN_TYPE_MASK ) ==IFF_TAP )) {atomic_long_inc (&tun->rx_frame_errors); err = -EINVAL ; goto free_skb;
@@ -2492,7 +2493,11 @@ static int tun_xdp_one(struct tun_struct *tun, tnl_hdr = (struct virtio_net_hdr_v1_hash_tunnel *)gso; skb->dev = tun->dev;skb_set_network_header (skb,ETH_HLEN ); -if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, tnl_hdr)) { +/* Frames always start with an Ethernet header here, as the +* eth_type_trans() call below expects. +*/ +if (tun_vnet_hdr_tnl_to_skb (tun->flags, features, skb, tnl_hdr, + true)) {atomic_long_inc (&tun->rx_frame_errors);kfree_skb (skb); ret = -EINVAL ;
drivers/net/tun_vnet.h +3 -2
@@ -197,9 +197,10 @@ static inline netdev_features_t tun_vnet_hdr_guest_features(int vnet_hdr_sz)static inline int tun_vnet_hdr_tnl_to_skb (unsigned int flags,netdev_features_t features,struct sk_buff *skb, -const struct virtio_net_hdr_v1_hash_tunnel *hdr) +const struct virtio_net_hdr_v1_hash_tunnel *hdr, +bool has_eth) { -return virtio_net_hdr_tnl_to_skb (skb, hdr, +return virtio_net_hdr_tnl_to_skb (skb, hdr, has_eth, features &NETIF_F_GSO_UDP_TUNNEL , features &NETIF_F_GSO_UDP_TUNNEL_CSUM ,tun_vnet_is_little_endian (flags));
drivers/net/virtio_net.c +1 -1
@@ -2604,7 +2604,7 @@ static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue * skb->dev = dev;skb_set_network_header (skb,ETH_HLEN ); -if (virtio_net_hdr_tnl_to_skb (skb, &hdr->tnl_hdr, vi->rx_tnl, +if (virtio_net_hdr_tnl_to_skb (skb, &hdr->tnl_hdr, true, vi->rx_tnl, vi->rx_tnl_csum,virtio_is_little_endian (vi->vdev))) { net_warn_ratelimited("%s: bad gso: type: %x, size: %u, flags %x tunnel %d tnl csum %d\n",
include/linux/virtio_net.h +169 -0
197 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 9/990 soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sataporn Saijai <[email protected]>
[ Upstream commit c3133906d5bda343bd5c1d8ad63074a14506ad72 ]
The Lenovo Yoga Slim 7i 14IPH11 (DMI product 83QM) declares an RT722 on link 3 that is not actually present and never attaches, leaving the machine with no audio. Since the address is already handled by the ghost_realtek table, only the DMI match is needed.
--- drivers/soundwire/dmi-quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/soundwire/dmi-quirks.c +7 -0
@@ -214,6 +214,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)ghost_realtek, }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "83QM"), + }, + .driver_data = (void *)ghost_realtek, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 10/990 soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit a6a867552a36e647cbd35aceae24754c9bcd3661 ]
The Lenovo Pro 9 also has a Realtek device in the ACPI that doesn't exist in the physical hardware. This confuses the machine driver into attempting to create DAI links for the device. Add a quirk to remove this device.
--- drivers/soundwire/dmi-quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/soundwire/dmi-quirks.c +7 -0
@@ -235,6 +235,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)ghost_realtek, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83U9"), + }, + .driver_data = (void *)ghost_realtek, + }, {} };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 11/990 soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel)
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Lebedev <[email protected]>
[ Upstream commit d32e04c052342d7d1cc03f6ba4cbd135cd0112bc ]
The Microsoft Surface Pro 11 for Business (Intel, Lunar Lake) carries a single physical RT1320 amplifier on link 0 and describes it twice:
SWRA _ADR 0x000030025D132000 SDCA class 0 SWRB _ADR 0x000030025D132001 SDCA class 1
Identical apart from the class id: same link, same manufacturer, part and version, same unique id 0. The part reports class 1, so only SWRB enumerates. SWRA never attaches on any boot or firmware version tested, including the November 2025 bundle.
The ghost is not harmless. It consumes an amplifier index in find_acpi_adr_device(), so the real part is named "rt1320-2" and the stock sof-soundwire UCM profile enables switches on a device that is not there. Its endpoints also reach create_sdw_dailink(), which builds DAI link names from link id and function type alone; the ghost declares the same SmartMic function as the real part, so the card fails to register at all:
sysfs: cannot create duplicate filename
'.../sof_sdw/SDW0-Capture-SmartMic'
kobject_add_internal failed for SDW0-Capture-SmartMic with -EEXIST sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12
Remap its _ADR to zero so sdw_acpi_find_slaves() never creates the peripheral, which is how ghost devices are handled already - see ghost_realtek and global_ghost_adr in this file. Both failures then disappear, because neither path is reached.
Matched on DMI_PRODUCT_SKU rather than the product name. A later batch of the same model could carry a different RT1320 version, which would change the _ADR; keying on the SKU keeps this remap to the hardware it was verified on, and follows dell_sku_0A3E above.
--- drivers/soundwire/dmi-quirks.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/soundwire/dmi-quirks.c +28 -0
@@ -111,6 +111,25 @@ static const struct adr_remap ghost_realtek[] = { {} }; +/* +* The Microsoft Surface Pro 11 (Intel) describes its single physical RT1320 +* amplifier twice on link 0, as two _ADR entries differing only in SDCA class +* id and sharing the same unique id. Only the class 1 entry enumerates; the +* class 0 entry is a ghost. +* +* Matched on the product SKU rather than the product name: a later batch of the +* same model could carry a different RT1320 version, which would change the +* _ADR. Keying on the SKU keeps this remap to the hardware it was verified on. +*/ +static const struct adr_remap microsoft_sp11_intel[] = { +/* ghost rt1320 on link0 */ + { +0x000030025d132000ull , +0x0000000000000000ull + }, + {} +}; +static const struct dmi_system_id adr_remap_quirk_table[] = {/* TGL devices */ {
@@ -242,6 +261,15 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)ghost_realtek, }, +/* LNL devices */ + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, + "Surface_Pro_11th_Edition_With_Intel_For_Business_2103") + }, + .driver_data = (void *)microsoft_sp11_intel, + }, {} };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 12/990 libceph: generalize ceph_x_encrypt_offset() and ceph_x_encrypt_buflen()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit 0ee8bccf7396d50726c9c8dd3135fb64a9fe8426 upstream.
- introduce the notion of a data offset for ceph_x_encrypt_offset() to allow for e.g. confounder to be prepended before the encryption header in the future. For CEPH_CRYPTO_AES, the data offset is 0 (i.e. nothing is prepended).
- adjust ceph_x_encrypt_buflen() accordingly and make it account for PKCS#7 padding that is used by CEPH_CRYPTO_AES precisely instead of just always adding 16.
--- net/ceph/auth_x.c | 44 +++++++++++++++++++++++++++++--------------- net/ceph/crypto.c | 25 +++++++++++++++++++++++++ net/ceph/crypto.h | 2 ++ 3 files changed, 56 insertions(+), 15 deletions(-)
net/ceph/auth_x.c +29 -15
@@ -44,23 +44,35 @@ static int ceph_x_should_authenticate(struct ceph_auth_client *ac)return !!need; } -static int ceph_x_encrypt_offset (void ) +static int __ceph_x_encrypt_offset (const struct ceph_crypto_key *key) { -return sizeof (u32) +sizeof (struct ceph_x_encrypt_header ); +return ceph_crypt_data_offset (key) + +sizeof (struct ceph_x_encrypt_header ); } -static int ceph_x_encrypt_buflen (int ilen) +static int ceph_x_encrypt_offset (const struct ceph_crypto_key *key) { -return ceph_x_encrypt_offset () + ilen +16 ; +return sizeof (u32) +__ceph_x_encrypt_offset (key); +} + +/* +* AES: ciphertext_len | hdr | data... | padding +*/ +static int ceph_x_encrypt_buflen (const struct ceph_crypto_key *key, +int data_len) +{ +int encrypt_len =sizeof (struct ceph_x_encrypt_header ) + data_len; +return sizeof (u32) +ceph_crypt_buflen (key, encrypt_len); }static int ceph_x_encrypt (struct ceph_crypto_key *secret,void *buf,int buf_len,int plaintext_len) { -struct ceph_x_encrypt_header *hdr = buf +sizeof (u32); +struct ceph_x_encrypt_header *hdr;int ciphertext_len;int ret; + hdr = buf +sizeof (u32) +ceph_crypt_data_offset (secret); hdr->struct_v =1 ; hdr->magic =cpu_to_le64 (CEPHX_ENC_MAGIC );
@@ -77,7 +89,7 @@ static int ceph_x_encrypt(struct ceph_crypto_key *secret, void *buf,static int __ceph_x_decrypt (struct ceph_crypto_key *secret,void *p,int ciphertext_len) { -struct ceph_x_encrypt_header *hdr = p; +struct ceph_x_encrypt_header *hdr;int plaintext_len;int ret;
@@ -91,6 +103,7 @@ static int __ceph_x_decrypt(struct ceph_crypto_key *secret, void *p,return -EINVAL ; } + hdr = p +ceph_crypt_data_offset (secret);if (le64_to_cpu (hdr->magic) !=CEPHX_ENC_MAGIC ) {pr_err ("%s bad magic\n" , __func__);return -EINVAL ;
@@ -198,7 +211,7 @@ static int process_one_ticket(struct ceph_auth_client *ac, }/* blob for me */ - dp = *p +ceph_x_encrypt_offset (); + dp = *p +ceph_x_encrypt_offset (secret); ret =ceph_x_decrypt (secret, p, end);if (ret <0 ) goto out;
@@ -225,7 +238,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,ceph_decode_8_safe (p, end, is_enc, bad);if (is_enc) {/* encrypted */ - tp = *p +ceph_x_encrypt_offset (); + tp = *p +ceph_x_encrypt_offset (&th->session_key); ret =ceph_x_decrypt (&th->session_key, p, end);if (ret <0 ) goto out;
@@ -317,7 +330,7 @@ static int encrypt_authorizer(struct ceph_x_authorizer *au, p = (void *)(msg_a +1 ) +le32_to_cpu (msg_a->ticket_blob.blob_len); end = au->buf->vec.iov_base + au->buf->vec.iov_len; - msg_b = p +ceph_x_encrypt_offset (); + msg_b = p +ceph_x_encrypt_offset (&au->session_key); msg_b->struct_v =2 ; msg_b->nonce =cpu_to_le64 (au->nonce);if (server_challenge) {
@@ -373,7 +386,7 @@ static int ceph_x_build_authorizer(struct ceph_auth_client *ac, goto out_au; maxlen =sizeof (*msg_a) + ticket_blob_len + -ceph_x_encrypt_buflen (sizeof (*msg_b)); +ceph_x_encrypt_buflen (&au->session_key,sizeof (*msg_b));dout (" need len %d\n" , maxlen);if (au->buf && au->buf->alloc_len < maxlen) {ceph_buffer_put (au->buf);
@@ -512,7 +525,7 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,struct ceph_x_authenticate *auth = (void *)(head +1 );void *enc_buf = xi->auth_authorizer.enc_buf;struct ceph_x_challenge_blob *blob = enc_buf + -ceph_x_encrypt_offset (); +ceph_x_encrypt_offset (&xi->secret);u64 *u; p = auth +1 ;
@@ -639,7 +652,7 @@ static int handle_auth_session_key(struct ceph_auth_client *ac, u64 global_id,ceph_decode_need (p, end, len, e_inval);dout ("%s connection secret blob len %d\n" , __func__, len);if (len >0 ) { - dp = *p +ceph_x_encrypt_offset (); + dp = *p +ceph_x_encrypt_offset (&th->session_key); ret =ceph_x_decrypt (&th->session_key, p, *p + len);if (ret <0 )return ret;
@@ -816,7 +829,7 @@ static int decrypt_authorizer_challenge(struct ceph_crypto_key *secret,return ret;dout ("%s decrypted %d bytes\n" , __func__, ret); - dp = challenge +sizeof (struct ceph_x_encrypt_header ); + dp = challenge +__ceph_x_encrypt_offset (secret); dend = dp + ret;ceph_decode_skip_8 (&dp, dend, e_inval);/* struct_v */
@@ -863,7 +876,7 @@ static int decrypt_authorizer_reply(struct ceph_crypto_key *secret,u8 struct_v;int ret; - dp = *p +ceph_x_encrypt_offset (); + dp = *p +ceph_x_encrypt_offset (secret); ret =ceph_x_decrypt (secret, p, end);if (ret <0 )return ret;
@@ -986,7 +999,8 @@ static int calc_signature(struct ceph_x_authorizer *au, struct ceph_msg *msg,__le32 front_crc;__le32 middle_crc;__le32 data_crc; - }__packed *sigblock = enc_buf +ceph_x_encrypt_offset (); + }__packed *sigblock = enc_buf + +ceph_x_encrypt_offset (&au->session_key); sigblock->len =cpu_to_le32 (4 *sizeof (u32)); sigblock->header_crc = msg->hdr.crc;
net/ceph/crypto.c +25 -0
@@ -285,6 +285,31 @@ int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt, } } +int ceph_crypt_data_offset (const struct ceph_crypto_key *key) +{ +switch (key->type) { +case CEPH_CRYPTO_NONE : +case CEPH_CRYPTO_AES : +return 0 ; +default : +BUG (); + } +} + +int ceph_crypt_buflen (const struct ceph_crypto_key *key,int data_len) +{ +switch (key->type) { +case CEPH_CRYPTO_NONE : +return data_len; +case CEPH_CRYPTO_AES : +/* PKCS#7 padding at the end */ +return data_len +AES_BLOCK_SIZE - + (data_len & (AES_BLOCK_SIZE -1 )); +default : +BUG (); + } +} +static int ceph_key_preparse (struct key_preparsed_payload *prep) {struct ceph_crypto_key *ckey;
net/ceph/crypto.h +2 -0
@@ -28,6 +28,8 @@ void ceph_crypto_key_destroy(struct ceph_crypto_key *key);/* crypto.c */ int ceph_crypt (const struct ceph_crypto_key *key,bool encrypt,void *buf,int buf_len,int in_len,int *pout_len); +int ceph_crypt_data_offset (const struct ceph_crypto_key *key); +int ceph_crypt_buflen (const struct ceph_crypto_key *key,int data_len);int ceph_crypto_init (void );void ceph_crypto_shutdown (void );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 13/990 libceph: introduce ceph_crypto_key_prepare()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit 6cec0b61aacce4da5125b21c718189f0dc11eb51 upstream.
In preparation for bringing in a new encryption scheme/key type, decouple decoding or cloning the key from allocating required crypto API objects and setting them up. The rationale is that a) in some cases a shallow clone is sufficient and b) ceph_crypto_key_prepare() may grow additional parameters that would be inconvenient to provide at the point the key is originally decoded.
--- net/ceph/auth_x.c | 26 +++++++++++++---- net/ceph/crypto.c | 71 +++++++++++++++++++++++------------------------ net/ceph/crypto.h | 1 + 3 files changed, 56 insertions(+), 42 deletions(-)
net/ceph/auth_x.c +20 -6
@@ -226,6 +226,10 @@ static int process_one_ticket(struct ceph_auth_client *ac,if (ret) goto out; + ret =ceph_crypto_key_prepare (&new_session_key); +if (ret) + goto out; +ceph_decode_need (&dp, dend,sizeof (struct ceph_timespec ), bad);ceph_decode_timespec64 (&validity, dp); dp +=sizeof (struct ceph_timespec );
@@ -385,6 +389,10 @@ static int ceph_x_build_authorizer(struct ceph_auth_client *ac,if (ret) goto out_au; + ret =ceph_crypto_key_prepare (&au->session_key); +if (ret) + goto out_au; + maxlen =sizeof (*msg_a) + ticket_blob_len +ceph_x_encrypt_buflen (&au->session_key,sizeof (*msg_b));dout (" need len %d\n" , maxlen);
@@ -1118,21 +1126,26 @@ int ceph_x_init(struct ceph_auth_client *ac)int ret;dout ("ceph_x_init %p\n" , ac); - ret = -ENOMEM ; xi =kzalloc (sizeof (*xi),GFP_NOFS );if (!xi) - goto out; +return -ENOMEM ; ret = -EINVAL ;if (!ac->key) {pr_err ("no secret set (for auth_x protocol)\n" ); - goto out_nomem; + goto err_xi; } ret =ceph_crypto_key_clone (&xi->secret, ac->key);if (ret <0 ) {pr_err ("cannot clone key: %d\n" , ret); - goto out_nomem; + goto err_xi; + } + + ret =ceph_crypto_key_prepare (&xi->secret); +if (ret) { +pr_err ("cannot prepare key: %d\n" , ret); + goto err_secret; } xi->starting = true;
@@ -1143,8 +1156,9 @@ int ceph_x_init(struct ceph_auth_client *ac) ac->ops = &ceph_x_ops;return 0 ; -out_nomem: +err_secret: +ceph_crypto_key_destroy (&xi->secret); +err_xi:kfree (xi); -out:return ret; }
net/ceph/crypto.c +35 -36
117 lines not on this page · raw message
net/ceph/crypto.h +1 -0
@@ -19,6 +19,7 @@ struct ceph_crypto_key {struct crypto_sync_skcipher *tfm; }; +int ceph_crypto_key_prepare (struct ceph_crypto_key *key);int ceph_crypto_key_clone (struct ceph_crypto_key *dst,const struct ceph_crypto_key *src);int ceph_crypto_key_decode (struct ceph_crypto_key *key,void **p,void *end);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 14/990 libceph: add support for CEPH_CRYPTO_AES256KRB5
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit b7cc142dbafeaf6c053284ca9121b9f70b6d6d06 upstream.
This is based on AES256-CTS-HMAC384-192 crypto algorithm per RFC 8009 (i.e. Kerberos 5, hence the name) with custom-defined key usage numbers. The implementation allows a given key to have/be linked to between one and three usage numbers.
The existing CEPH_CRYPTO_AES remains in place and unchanged. The usage_slot parameter that needed to be added to ceph_crypt() and its wrappers is simply ignored there.
--- include/linux/ceph/ceph_fs.h | 5 +- net/ceph/Kconfig | 1 + net/ceph/auth_x.c | 88 ++++++++++++++------ net/ceph/auth_x_protocol.h | 38 +++++++++ net/ceph/crypto.c | 157 +++++++++++++++++++++++++++++++---- net/ceph/crypto.h | 16 +++- 6 files changed, 257 insertions(+), 48 deletions(-)
include/linux/ceph/ceph_fs.h +3 -2
@@ -89,8 +89,9 @@ struct ceph_dir_layout { } __attribute__ ((packed));/* crypto algorithms */ -#define CEPH_CRYPTO_NONE 0x0 -#define CEPH_CRYPTO_AES 0x1 +#define CEPH_CRYPTO_NONE 0x0 +#define CEPH_CRYPTO_AES 0x1 +#define CEPH_CRYPTO_AES256KRB5 0x2/* AES256-CTS-HMAC384-192 */ #define CEPH_AES_IV "cephsageyudagreg"
net/ceph/Kconfig +1 -0
@@ -6,6 +6,7 @@ config CEPH_LIB select CRYPTO_AES select CRYPTO_CBC select CRYPTO_GCM + select CRYPTO_KRB5 select CRYPTO_LIB_SHA256 select CRYPTO select KEYS
net/ceph/auth_x.c +61 -27
215 lines not on this page · raw message
net/ceph/auth_x_protocol.h +38 -0
@@ -6,6 +6,44 @@#define CEPHX_GET_PRINCIPAL_SESSION_KEY 0x0200#define CEPHX_GET_ROTATING_KEY 0x0400 +/* Client <-> AuthMonitor */ +/* +* The AUTH session's connection secret: encrypted with the AUTH +* ticket session key +*/ +#define CEPHX_KEY_USAGE_AUTH_CONNECTION_SECRET 0x03 +/* +* The ticket's blob for the client ("blob for me", contains the +* session key): encrypted with the client's secret key in case of +* the AUTH ticket and the AUTH ticket session key in case of other +* service tickets +*/ +#define CEPHX_KEY_USAGE_TICKET_SESSION_KEY 0x04 +/* +* The ticket's blob for the service (ceph_x_ticket_blob): possibly +* encrypted with the old AUTH ticket session key in case of the AUTH +* ticket and not encrypted in case of other service tickets +*/ +#define CEPHX_KEY_USAGE_TICKET_BLOB 0x05 + +/* Client <-> Service */ +/* +* The client's authorization request (ceph_x_authorize_b): +* encrypted with the service ticket session key +*/ +#define CEPHX_KEY_USAGE_AUTHORIZE 0x10 +/* +* The service's challenge (ceph_x_authorize_challenge): +* encrypted with the service ticket session key +*/ +#define CEPHX_KEY_USAGE_AUTHORIZE_CHALLENGE 0x11 +/* +* The service's final reply (ceph_x_authorize_reply + the service +* session's connection secret): encrypted with the service ticket +* session key +*/ +#define CEPHX_KEY_USAGE_AUTHORIZE_REPLY 0x12 +/* common bits */ struct ceph_x_ticket_blob {__u8 struct_v;
net/ceph/crypto.c +142 -15
227 lines not on this page · raw message
net/ceph/crypto.h +12 -4
@@ -5,7 +5,7 @@#include <linux/ceph/types.h> #include <linux/ceph/buffer.h> -#define CEPH_MAX_KEY_LEN 16 +#define CEPH_MAX_KEY_LEN 32#define CEPH_MAX_CON_SECRET_LEN 64/*
@@ -16,10 +16,18 @@ struct ceph_crypto_key {struct ceph_timespec created;int len;void *key; -struct crypto_sync_skcipher *tfm; + +union { +struct crypto_sync_skcipher *aes_tfm; +struct { +const struct krb5_enctype *krb5_type; +struct crypto_aead *krb5_tfms[3 ]; + }; + }; }; -int ceph_crypto_key_prepare (struct ceph_crypto_key *key); +int ceph_crypto_key_prepare (struct ceph_crypto_key *key, +const u32 *key_usages,int key_usage_cnt);int ceph_crypto_key_clone (struct ceph_crypto_key *dst,const struct ceph_crypto_key *src);int ceph_crypto_key_decode (struct ceph_crypto_key *key,void **p,void *end);
@@ -27,7 +35,7 @@ int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in);void ceph_crypto_key_destroy (struct ceph_crypto_key *key);/* crypto.c */ -int ceph_crypt (const struct ceph_crypto_key *key,bool encrypt, +int ceph_crypt (const struct ceph_crypto_key *key,int usage_slot,bool encrypt,void *buf,int buf_len,int in_len,int *pout_len);int ceph_crypt_data_offset (const struct ceph_crypto_key *key);int ceph_crypt_buflen (const struct ceph_crypto_key *key,int data_len);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 15/990 libceph: adapt ceph_x_challenge_blob hashing and msgr1 message signing
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit 8356b4b1103b8c970648c94bab724aa30e42d869 upstream.
The existing approach where ceph_x_challenge_blob is encrypted with the client's secret key and then the digest derived from the ciphertext is used for the test doesn't work with CEPH_CRYPTO_AES256KRB5 because the confounder randomizes the ciphertext: the client and the server get two different ciphertexts and therefore two different digests.
msgr1 signatures are affected the same way: a digest derived from the ciphertext for the message's "sigblock" is what becomes a signature and the two sides disagree on the expected value.
For CEPH_CRYPTO_AES256KRB5 (and potential future encryption schemes), switch to HMAC-SHA256 function keyed in the same way as the existing encryption. For CEPH_CRYPTO_AES, everything is preserved as is.
--- net/ceph/auth_x.c | 59 ++++++++++++++++++++++++++++++----------- net/ceph/crypto.c | 18 +++++++++++++ net/ceph/crypto.h | 4 +++ net/ceph/messenger_v2.c | 14 +++++----- 4 files changed, 72 insertions(+), 23 deletions(-)
net/ceph/auth_x.c +43 -16
@@ -558,8 +558,7 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,if (need &CEPH_ENTITY_TYPE_AUTH ) {struct ceph_x_authenticate *auth = (void *)(head +1 );void *enc_buf = xi->auth_authorizer.enc_buf; -struct ceph_x_challenge_blob *blob = enc_buf + -ceph_x_encrypt_offset (&xi->secret); +struct ceph_x_challenge_blob *blob;u64 *u; p = auth +1 ;
@@ -569,15 +568,29 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,dout (" get_auth_session_key\n" ); head->op =cpu_to_le16 (CEPHX_GET_AUTH_SESSION_KEY ); -/* encrypt and hash */ +if (xi->secret.type ==CEPH_CRYPTO_AES ) { + blob = enc_buf +ceph_x_encrypt_offset (&xi->secret); + }else { +BUILD_BUG_ON (SHA256_DIGEST_SIZE +sizeof (*blob) > +CEPHX_AU_ENC_BUF_LEN ); + blob = enc_buf +SHA256_DIGEST_SIZE ; + } +get_random_bytes (&auth->client_challenge,sizeof (u64)); blob->client_challenge = auth->client_challenge; blob->server_challenge =cpu_to_le64 (xi->server_challenge); - ret =ceph_x_encrypt (&xi->secret,0 /* dummy */ , - enc_buf,CEPHX_AU_ENC_BUF_LEN , -sizeof (*blob)); -if (ret <0 ) -return ret; + +if (xi->secret.type ==CEPH_CRYPTO_AES ) { + ret =ceph_x_encrypt (&xi->secret,0 /* dummy */ , + enc_buf,CEPHX_AU_ENC_BUF_LEN , +sizeof (*blob)); +if (ret <0 ) +return ret; + }else { +ceph_hmac_sha256 (&xi->secret, blob,sizeof (*blob), + enc_buf); + ret =SHA256_DIGEST_SIZE ; + } auth->struct_v =3 ;/* nautilus+ */ auth->key =0 ;
@@ -1065,11 +1078,19 @@ static int calc_signature(struct ceph_x_authorizer *au, struct ceph_msg *msg,__le32 data_crc;__le32 data_len;__le32 seq_lower_word; - }__packed *sigblock = enc_buf; + }__packed *sigblock;struct {__le64 a, b, c, d; } __packed *penc = enc_buf; -int ciphertext_len; + +if (au->session_key.type ==CEPH_CRYPTO_AES ) { +/* no leading len, no ceph_x_encrypt_header */ + sigblock = enc_buf; + }else { +BUILD_BUG_ON (SHA256_DIGEST_SIZE +sizeof (*sigblock) > +CEPHX_AU_ENC_BUF_LEN ); + sigblock = enc_buf +SHA256_DIGEST_SIZE ; + } sigblock->header_crc = msg->hdr.crc; sigblock->front_crc = msg->footer.front_crc;
@@ -1080,12 +1101,18 @@ static int calc_signature(struct ceph_x_authorizer *au, struct ceph_msg *msg, sigblock->data_len = msg->hdr.data_len; sigblock->seq_lower_word = *(__le32 *)&msg->hdr.seq; -/* no leading len, no ceph_x_encrypt_header */ - ret =ceph_crypt (&au->session_key,0 /* dummy */ , - true, enc_buf,CEPHX_AU_ENC_BUF_LEN , -sizeof (*sigblock), &ciphertext_len); -if (ret) -return ret; +if (au->session_key.type ==CEPH_CRYPTO_AES ) { +int ciphertext_len;/* unused */ + + ret =ceph_crypt (&au->session_key,0 /* dummy */ , + true, enc_buf,CEPHX_AU_ENC_BUF_LEN , +sizeof (*sigblock), &ciphertext_len); +if (ret) +return ret; + }else { +ceph_hmac_sha256 (&au->session_key, sigblock, +sizeof (*sigblock), enc_buf); + } *psig = penc->a ^ penc->b ^ penc->c ^ penc->d; }
net/ceph/crypto.c +18 -0
@@ -84,6 +84,7 @@ int ceph_crypto_key_prepare(struct ceph_crypto_key *key,case CEPH_CRYPTO_AES :return set_aes_tfm (key);case CEPH_CRYPTO_AES256KRB5 : +hmac_sha256_preparekey (&key->hmac_key, key->key, key->len);return set_krb5_tfms (key, key_usages, key_usage_cnt);default :return -ENOTSUPP ;
@@ -178,6 +179,7 @@ void ceph_crypto_key_destroy(struct ceph_crypto_key *key) key->aes_tfm =NULL ; } }else if (key->type ==CEPH_CRYPTO_AES256KRB5 ) { +memzero_explicit (&key->hmac_key,sizeof (key->hmac_key));for (i =0 ; i <ARRAY_SIZE (key->krb5_tfms); i++) {if (key->krb5_tfms[i]) {crypto_free_aead (key->krb5_tfms[i]);
@@ -436,6 +438,22 @@ int ceph_crypt_buflen(const struct ceph_crypto_key *key, int data_len) } } +void ceph_hmac_sha256 (const struct ceph_crypto_key *key,const void *buf, +int buf_len,u8 hmac[SHA256_DIGEST_SIZE ]) +{ +switch (key->type) { +case CEPH_CRYPTO_NONE : +case CEPH_CRYPTO_AES : +memset (hmac,0 ,SHA256_DIGEST_SIZE ); +return ; +case CEPH_CRYPTO_AES256KRB5 : +hmac_sha256 (&key->hmac_key, buf, buf_len, hmac); +return ; +default : +BUG (); + } +} +static int ceph_key_preparse (struct key_preparsed_payload *prep) {struct ceph_crypto_key *ckey;
net/ceph/crypto.h +4 -0
@@ -2,6 +2,7 @@#ifndef _FS_CEPH_CRYPTO_H#define _FS_CEPH_CRYPTO_H +#include <crypto/sha2.h> #include <linux/ceph/types.h> #include <linux/ceph/buffer.h>
@@ -20,6 +21,7 @@ struct ceph_crypto_key {union {struct crypto_sync_skcipher *aes_tfm;struct { +struct hmac_sha256_key hmac_key;const struct krb5_enctype *krb5_type;struct crypto_aead *krb5_tfms[3 ]; };
@@ -39,6 +41,8 @@ int ceph_crypt(const struct ceph_crypto_key *key, int usage_slot, bool encrypt, void *buf, int buf_len, int in_len, int *pout_len);int ceph_crypt_data_offset (const struct ceph_crypto_key *key);int ceph_crypt_buflen (const struct ceph_crypto_key *key,int data_len); +void ceph_hmac_sha256 (const struct ceph_crypto_key *key,const void *buf, +int buf_len,u8 hmac[SHA256_DIGEST_SIZE ]);int ceph_crypto_init (void );void ceph_crypto_shutdown (void );
net/ceph/messenger_v2.c +7 -7
@@ -778,9 +778,9 @@ static int setup_crypto(struct ceph_connection *con,return 0 ;/* auth_x, secure mode */ } -static void ceph_hmac_sha256 (struct ceph_connection *con, -const struct kvec *kvecs,int kvec_cnt, -u8 hmac[SHA256_DIGEST_SIZE ]) +static void con_hmac_sha256 (struct ceph_connection *con, +const struct kvec *kvecs,int kvec_cnt, +u8 hmac[SHA256_DIGEST_SIZE ]) {struct hmac_sha256_ctx ctx;int i;
@@ -1437,8 +1437,8 @@ static int prepare_auth_signature(struct ceph_connection *con)if (!buf)return -ENOMEM ; -ceph_hmac_sha256 (con, con->v2.in_sign_kvecs, con->v2.in_sign_kvec_cnt, -CTRL_BODY (buf)); +con_hmac_sha256 (con, con->v2.in_sign_kvecs, con->v2.in_sign_kvec_cnt, +CTRL_BODY (buf));return prepare_control (con,FRAME_TAG_AUTH_SIGNATURE , buf,SHA256_DIGEST_SIZE );
@@ -2441,8 +2441,8 @@ static int process_auth_signature(struct ceph_connection *con,return -EINVAL ; } -ceph_hmac_sha256 (con, con->v2.out_sign_kvecs, con->v2.out_sign_kvec_cnt, - hmac); +con_hmac_sha256 (con, con->v2.out_sign_kvecs, con->v2.out_sign_kvec_cnt, + hmac);ceph_decode_need (&p, end,SHA256_DIGEST_SIZE , bad);if (crypto_memneq (p, hmac,SHA256_DIGEST_SIZE )) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 16/990 writeback: use a per-sb counter to drain inode wb switches at umount
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
commit 31c1d19ead2c26a63859a2757d8b786765ba9cdd upstream.
Tracking in-flight inode wb switches with a single global counter (isw_nr_in_flight) plus a synchronize_rcu() based wait in cgroup_writeback_umount() forces every umount to take a global hit whenever any other superblock on the system has wb switches in flight, even if the superblock being unmounted has none of its own.
Replace the global synchronize_rcu()/flush_workqueue() pair with a per-sb counter, s_isw_nr_in_flight, plus three small helpers:
- cgroup_writeback_pin(sb) - increment counter
- cgroup_writeback_unpin(sb) - decrement and wake drainer if last
- cgroup_writeback_drain(sb) - wait for counter to reach zero
The wiring is:
- inode_prepare_wbs_switch() pins before checking SB_ACTIVE and grabbing the inode; failure paths unpin before returning. A lockless SB_ACTIVE check at the top of the function lets us skip the atomic_inc/smp_mb dance once SB_ACTIVE has been cleared (it is monotonic and never set back).
- process_inode_switch_wbs() unpins after the matching iput().
- cgroup_writeback_umount() drains the per-sb counter via
wait_var_event().
The smp_mb() pair between inode_prepare_wbs_switch() and cgroup_writeback_umount() keeps the SB_ACTIVE / counter ordering:
either the umounter sees a non-zero counter and waits, or the switcher sees SB_ACTIVE cleared and aborts before grabbing the inode.
The global isw_nr_in_flight is left in place, since it is still used to throttle in-flight switches via WB_FRN_MAX_IN_FLIGHT.
The rcu_read_lock() extension in inode_switch_wbs() and cleanup_offline_cgwb() that the race fix added is no longer needed and is reverted; the synchronize_rcu() that the race fix added to cgroup_writeback_umount() is dropped as well.
The following numbers were measured on a 16 vCPU QEMU guest with 4 background superblocks each churning "create memcg -> write 1 MiB -> rmdir memcg" to keep the global isw_nr_in_flight non-zero. Latencies are wall-clock around umount(8); only the target sb's umount is measured.
Target sb runs its own cgwb churn:
p50 p95 p99 max
global synchronize_rcu() 67.6 ms 88.3 ms 88.3 ms 96.8 ms per-sb counter (this) 7.9 ms 10.0 ms 10.0 ms 10.1 ms
Idle target umount latency under cross-sb cgwb-switch pressure:
p50 p95 p99 max
global synchronize_rcu() 62.7 ms 95.4 ms 108.1 ms 108.6 ms
per-sb counter (this) 5.3 ms 6.9 ms 7.4 ms 7.4 ms no-pressure baseline 4.9 ms 5.9 ms 6.3 ms 6.7 ms
8 concurrent umounts of idle sbs under the same pressure:
p50 p95 max
global synchronize_rcu() 61.3 ms 99.5 ms 113.7 ms
per-sb counter (this) 8.1 ms 9.1 ms 9.5 ms
In-kernel cgroup_writeback_umount() time across the same run (bpftrace, ~340 calls covering all scenarios):
global synchronize_rcu() 12371 ms total (~36 ms / call)
per-sb counter (this) 1.37 ms total ( ~4 us / call)
[ ehagberg: Backported to 6.18.y. struct super_block lives in
include/linux/fs.h here, so add the field there. 6.18.y predates the inode_state_read()/inode_state_set() accessors, so adjust context accordingly. Also adjust context in cleanup_offline_cgwb() for "writeback: keep cleanup_offline_cgwb()'s scan out of syncs". No functional change from upstream. ]
--- fs/fs-writeback.c | 97 ++++++++++++++++++++++------------------------ include/linux/fs.h | 8 ++++ 2 files changed, 55 insertions(+), 50 deletions(-)
fs/fs-writeback.c +47 -50
@@ -488,6 +488,23 @@ static bool inode_do_switch_wbs(struct inode *inode,return switched; } +static inline void cgroup_writeback_pin (struct super_block *sb) +{ +atomic_inc (&sb->s_isw_nr_in_flight); +} + +static inline void cgroup_writeback_unpin (struct super_block *sb) +{ +if (atomic_dec_and_test (&sb->s_isw_nr_in_flight)) +wake_up_var (&sb->s_isw_nr_in_flight); +} + +static inline void cgroup_writeback_drain (struct super_block *sb) +{ +wait_var_event (&sb->s_isw_nr_in_flight, + !atomic_read (&sb->s_isw_nr_in_flight)); +} +static void process_inode_switch_wbs (struct bdi_writeback *new_wb,struct inode_switch_wbs_context *isw) {
@@ -546,8 +563,12 @@ static void process_inode_switch_wbs(struct bdi_writeback *new_wb,wb_put_many (old_wb, nr_switched); } -for (inodep = isw->inodes; *inodep; inodep++) +for (inodep = isw->inodes; *inodep; inodep++) { +struct super_block *sb = (*inodep)->i_sb; +iput (*inodep); +cgroup_writeback_unpin (sb); + }wb_put (new_wb);kfree (isw);atomic_dec (&isw_nr_in_flight);
@@ -590,16 +611,19 @@ void inode_switch_wbs_work_fn(struct work_struct *work)static bool inode_prepare_wbs_switch (struct inode *inode,struct bdi_writeback *new_wb) { +/* Avoid the atomic_inc/smp_mb dance once SB_ACTIVE is gone. */ +if (!(inode->i_sb->s_flags &SB_ACTIVE )) +return false; +/* -* Paired with smp_mb() in cgroup_writeback_umount(). -* isw_nr_in_flight must be increased before checking SB_ACTIVE and -* grabbing an inode, otherwise isw_nr_in_flight can be observed as 0 -* in cgroup_writeback_umount() and the isw_wq will be not flushed. +* Pairs with smp_mb() in cgroup_writeback_umount(): the umounter either +* sees a non-zero counter and waits, or we see SB_ACTIVE clear below. */ +cgroup_writeback_pin (inode->i_sb);smp_mb ();if (IS_DAX (inode)) -return false; + goto out_unpin;/* while holding I_WB_SWITCH, no one else can update the association */ spin_lock (&inode->i_lock);
@@ -607,13 +631,17 @@ static bool inode_prepare_wbs_switch(struct inode *inode, inode->i_state & (I_WB_SWITCH | I_FREEING | I_WILL_FREE) || inode_to_wb(inode) == new_wb) {spin_unlock (&inode->i_lock); -return false; + goto out_unpin; } inode->i_state |=I_WB_SWITCH ;__iget (inode);spin_unlock (&inode->i_lock);return true; + +out_unpin: +cgroup_writeback_unpin (inode->i_sb); +return false; } static void wb_queue_isw(struct bdi_writeback *wb,
@@ -652,19 +680,12 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)atomic_inc (&isw_nr_in_flight); -/* -* Paired with synchronize_rcu() in cgroup_writeback_umount(): -* holding rcu_read_lock across inode_prepare_wbs_switch() -* (covering the SB_ACTIVE check and the inode grab) and -* wb_queue_isw() ensures synchronize_rcu() cannot return until -* the work is queued, so the subsequent flush_workqueue() will -* wait for the switch. -*/ -rcu_read_lock ();/* find and pin the new wb */ +rcu_read_lock (); memcg_css =css_from_id (new_wb_id, &memory_cgrp_subsys);if (memcg_css && !css_tryget (memcg_css)) memcg_css =NULL ; +rcu_read_unlock ();if (!memcg_css) goto out_free;
@@ -680,11 +701,9 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)trace_inode_switch_wbs_queue (inode->i_wb, new_wb,1 );wb_queue_isw (new_wb, isw); -rcu_read_unlock ();return ; out_free: -rcu_read_unlock ();atomic_dec (&isw_nr_in_flight);if (new_wb)wb_put (new_wb);
@@ -765,14 +784,6 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)* moved ones. Exclude syncs as process_inode_switch_wbs() does. */ down_read (&wb->bdi->wb_switch_rwsem); -/* -* Paired with synchronize_rcu() in cgroup_writeback_umount(). -* Holding rcu_read_lock across the SB_ACTIVE check, the inode grab -* and wb_queue_isw() ensures synchronize_rcu() cannot return until -* the work is queued, so the subsequent flush_workqueue() will wait -* for the switch. -*/ -rcu_read_lock ();spin_lock (&wb->list_lock);/* * In addition to the inodes that have completed writeback, also switch
@@ -791,7 +802,6 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)/* no attached inodes? bail out */ if (nr ==0 ) { -rcu_read_unlock ();atomic_dec (&isw_nr_in_flight);wb_put (new_wb);kfree (isw);
@@ -800,7 +810,6 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)trace_inode_switch_wbs_queue (wb, new_wb, nr);wb_queue_isw (new_wb, isw); -rcu_read_unlock ();return restart; }
@@ -1228,39 +1237,27 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, }/** -* cgroup_writeback_umount - flush inode wb switches for umount +* cgroup_writeback_umount - wait for in-flight inode wb switches on @sb * @sb: target super_block * -* This function is called when a super_block is about to be destroyed and -* flushes in-flight inode wb switches. An inode wb switch goes through -* RCU and then workqueue, so the two need to be flushed in order to ensure -* that all previously scheduled switches are finished. As wb switches are -* rare occurrences and synchronize_rcu() can take a while, perform -* flushing iff wb switches are in flight. +* Wait until every inode wb switch that already passed the SB_ACTIVE +* check on this superblock has been completed by the worker. Since +* SB_ACTIVE is cleared before this is called, no new switches can start +* for @sb, so s_isw_nr_in_flight will monotonically drop to zero. */ void cgroup_writeback_umount (struct super_block *sb) { -if (!(sb->s_bdi->capabilities &BDI_CAP_WRITEBACK ))return ;/* -* SB_ACTIVE should be reliably cleared before checking -* isw_nr_in_flight, see generic_shutdown_super(). +* Pairs with smp_mb() in inode_prepare_wbs_switch(): we either observe +* a non-zero counter and wait, or the switcher sees SB_ACTIVE clear +* (cleared by generic_shutdown_super()) and bails before grabbing the +* inode. */ smp_mb (); - -if (atomic_read (&isw_nr_in_flight)) { -/* -* Paired with rcu_read_lock() in inode_switch_wbs() and -* cleanup_offline_cgwb(). synchronize_rcu() waits for any -* in-flight switcher that already passed the SB_ACTIVE check -* to finish queueing its work, so flush_workqueue() below -* will then drain it. -*/ -synchronize_rcu (); -flush_workqueue (isw_wq); - } +cgroup_writeback_drain (sb); }static int __init cgroup_writeback_init (void )
include/linux/fs.h +8 -0
@@ -1660,6 +1660,14 @@ struct super_block {spinlock_t s_inode_wblist_lock;struct list_head s_inodes_wb;/* writeback inodes */ + +#ifdef CONFIG_CGROUP_WRITEBACK +/* +* Number of in-flight inode wb switches for this sb. Drained by +* cgroup_writeback_umount() before tear-down. +*/ +atomic_t s_isw_nr_in_flight; +#endif } __randomize_layout;static inline struct user_namespace *i_user_ns (const struct inode *inode)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 17/990 KVM: TDX: Enable Bus Lock VM exit
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaoyao Li <[email protected]>
[ Upstream commit 63d196e2e20429de5ba501f1b6059d9b93140007 ]
Enable Bus Lock VM exit functionality for TDX guests.
Bus Lock VM exit is an existing feature supported by KVM. Userspace can enable Bus Lock VM exit through KVM_BUS_LOCK_DETECTION_EXIT when it's reported as supported. However, KVM reports the support of this CAP just based on the hardware capability but doesn't differentiate between VMX and TDX. This leads to the issue that userspace can enable this cap for TDX guests without getting an error, but the feature is not actually enabled because KVM doesn't call the TDX module API to program the relevant TD VMCS fields.
Enable Bus Lock VM exit for TDX guests by programming the BUS_LOCK_DETECTION control in the TD VMCS and by adding the exit handler.
Note, there is no enumeration bit for this feature by TDX module because all TDX modules support it and allow to set the TD VMCS as long as the hardware supports the feature.
--- arch/x86/kvm/vmx/tdx.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx/tdx.c +23 -1
@@ -2058,7 +2058,7 @@ int tdx_complete_emulated_msr(struct kvm_vcpu *vcpu, int err) } -int tdx_handle_exit (struct kvm_vcpu *vcpu,fastpath_t fastpath) +static int __tdx_handle_exit (struct kvm_vcpu *vcpu,fastpath_t fastpath) {struct vcpu_tdx *tdx =to_tdx (vcpu);u64 vp_enter_ret = tdx->vp_enter_ret;
@@ -2159,6 +2159,8 @@ int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)case EXIT_REASON_NOTIFY :/* NMI blocking state is handled by TDX module */ return __vt_handle_notify (vcpu,vmx_get_exit_qual (vcpu)); +case EXIT_REASON_BUS_LOCK : +return vt_handle_bus_lock_vmexit (vcpu);default :break ; }
@@ -2172,6 +2174,22 @@ int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)return 0 ; } +int tdx_handle_exit (struct kvm_vcpu *vcpu,fastpath_t fastpath) +{ +int ret =__tdx_handle_exit (vcpu, fastpath); + +/* Exit to user space when bus lock was detected */ +if (vmx_get_exit_reason (vcpu).bus_lock_detected) { +if (ret >0 ) { + vcpu->run->exit_reason =KVM_EXIT_X86_BUS_LOCK ; + ret =0 ; + } + + vcpu->run->flags |=KVM_RUN_X86_BUS_LOCK ; + } +return ret; +} +void tdx_get_exit_info (struct kvm_vcpu *vcpu,u32 *reason,u64 *info1,u64 *info2,u32 *intr_info,u32 *error_code) {
@@ -3167,6 +3185,10 @@ static int tdx_vcpu_init(struct kvm_vcpu *vcpu, struct kvm_tdx_cmd *cmd) vcpu->kvm->arch.notify_window); } +if (vcpu->kvm->arch.bus_lock_detection_enabled) +td_vmcs_setbit32 (tdx,SECONDARY_VM_EXEC_CONTROL , +SECONDARY_EXEC_BUS_LOCK_DETECTION ); + tdx->state =VCPU_TD_STATE_INITIALIZED ;return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 18/990 ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Dittrich <[email protected]>
[ Upstream commit a0039113053d4d3f629ea1b9cd74130ca597f14a ]
The Acer Swift 3 SF314-56G (with NVIDIA GeForce MX250) suffers from the same ACPI power resource regression as the Thunderobot ZERO. The power resource controlling the dGPU is incorrectly turned off during initialization, causing the GPU to fall off the bus (D3cold).
This commit adds a DMI quirk to keep the power resource on for this model, similar to the existing Thunderobot quirk.
Tested on Acer Swift 3 SF314-56G with NVIDIA MX250.
--- drivers/acpi/power.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/acpi/power.c +13 -0
@@ -1125,6 +1125,19 @@ static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = { DMI_MATCH(DMI_PRODUCT_NAME, "ZERO"), } + }, + { + /* + * Acer Swift 3 SF314-56G with NVIDIA MX250 suffers from the + * same ACPI power resource regression as the Thunderobot ZERO. + * The power resource controlling the dGPU is incorrectly turned off + * during initialization, causing the GPU to fall off the bus (D3cold). + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Swift SF314-56G"), + } + }, {} };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 19/990 ACPI: PM: Add unused power resource quirk for Casper Excalibur G900
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hakan Abay <[email protected]>
[ Upstream commit 23ec17231cc6a83bb11d8660db5bfc5336f53a0e ]
On the Casper Excalibur G900, the NVIDIA discrete GPU and the second NVMe device become inaccessible when unused ACPI power resources are turned off during initialization.
The failure is similar to the THUNDEROBOT ZERO case addressed by
commit cd7ef20ba8c6 ("ACPI: PM: Add unused power resource quirk for THUNDEROBOT ZERO").
Without the quirk, the NVIDIA GPU and the second NVMe device are left inaccessible in D3cold and attempts to transition them back to D0 fail.
Add a DMI quirk for the affected Casper Excalibur G900 with NLCC 001 mainboard to leave unused ACPI power resources on.
With the quirk applied, the second NVMe device remains accessible. The NVIDIA GPU can enter D3cold while idle and subsequently return to D0 for accelerated rendering.
--- drivers/acpi/power.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/acpi/power.c +12 -0
@@ -1139,6 +1139,18 @@ static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = { } }, + { + /* + * CASPER EXCALIBUR G900 laptop: Keep unused ACPI power + * resources on to prevent the NVIDIA dGPU and NVMe #2 + * from becoming inaccessible. + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "CASPER BILGISAYAR SISTEMLERI"), + DMI_MATCH(DMI_PRODUCT_NAME, "EXCALIBUR G900"), + DMI_MATCH(DMI_BOARD_NAME, "NLCC 001"), + }, + }, {} };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 20/990 ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krittikun Wongnin <[email protected]>
[ Upstream commit 8eb2754ef96d77d870d6b1ef1e0e8470c892b6b4 ]
On the Acer Aspire A515-53G (Whiskey Lake + NVIDIA GeForce MX230), the dGPU behind root port RP05 (00:1c.4) falls off the bus during boot and is unusable until the next power cycle:
nvidia 0000:02:00.0: Unable to change power state from D3cold to D0, device inaccessible
NVRM: The NVIDIA GPU 0000:02:00.0 ... has fallen off the bus
The firmware ships two SSDTs which both provide power management for the dGPU:
- One SSDT defines \_SB.PCI0.RP05.PC01 together with RP05._PR0/_PR2/_PR3 = { PC01 }.
- A second SSDT defines \_SB.PCI0.RP05.PCRP (_STA initially One, _OFF calls \_SB.PCI0.HGOF, which puts the link into L2/L3 and drops the dGPU power enable GPIO) and its own RP05._PR0/_PR2/_PR3/_S0W. The latter fail to load:
ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.RP05._PR0], AE_ALREADY_EXISTS
As a result PCRP is not referenced by any device and acpi_turn_off_unused_power_resources() turns it off right after the ACPI namespace scan. This cuts power to the dGPU, but PC01 still believes it is on, so its _ON method is a no-op when the PCI core later tries to bring the GPU back to D0.
Windows does not turn off unused power resources, so the dGPU works there.
Add the machine to dmi_leave_unused_power_resources_on[], like the THUNDEROBOT ZERO which has a similar SSDT bug. With this change the dGPU stays on the bus and the nvidia driver binds. Runtime PM of the dGPU is unaffected, as it is handled through PC01: with no driver bound and power/control set to auto, RP05 reaches D3cold and the GPU comes back to D0 on resume.
--- drivers/acpi/power.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/acpi/power.c +13 -0
@@ -1151,6 +1151,19 @@ static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = { DMI_MATCH(DMI_BOARD_NAME, "NLCC 001"), }, }, + { + /* + * Acer Aspire A515-53G: Two SSDTs both define power resources + * for the dGPU root port RP05 ('PC01' and 'PCRP'). Only PC01 ends + * up in RP05's _PR0/_PR3, so 'PCRP' is shut down on + * initialization, cutting power to the NVIDIA dGPU behind the + * back of 'PC01' and making the dGPU unavailable. + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A515-53G"), + }, + }, {} };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 21/990 fs: aio: reject partial mremap to avoid Null-pointer-dereference error
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <[email protected]>
[ Upstream commit 3adf7ae18bf42601246031002287c103a27df307 ]
[BUG]
Recently, our internal syzkaller testing uncovered a null pointer dereference issue:
BUG: kernel NULL pointer dereference, address: 0000000000000000 ... [ 51.111664] filemap_read_folio+0x25/0xe0 [ 51.112410] filemap_fault+0xad7/0x1250 [ 51.113112] __do_fault+0x4b/0x460 [ 51.113699] do_pte_missing+0x5bc/0x1db0 [ 51.114250] ? __pte_offset_map+0x23/0x170 [ 51.114822] __handle_mm_fault+0x9f8/0x1680
...
Crash analysis showed the file involved was an AIO ring file. The phenomenon triggered is the same as the issue described in [1].
[CAUSE]
Consider the following scenario: userspace sets up an AIO context via io_setup(), which creates a VMA covering the entire ring buffer. Then userspace calls mremap() with the AIO ring address as the source, a smaller old_len (less than the full ring size), MREMAP_MAYMOVE set, and without MREMAP_DONTUNMAP. The kernel will relocate the requested portion to a new destination address.
During this move, __split_vma() splits the original AIO ring VMA. The requested portion is unmapped from the source and re-established at the destination, while the remainder stays at the original source address as an orphan VMA. The aio_ring_mremap() callback fires on the new destination VMA, updating ctx->mmap_base to the destination address. But the callback is unaware that only a partial region was moved and that an orphan VMA still exists at the source:
source(AIO):
+-------------------+---------------------+ | moved to dest | orphan VMA (AIO) | +-------------------+---------------------+ A A+partial_len A+ctx->mmap_size
dest:
+-------------------+ | moved VMA (AIO) | +-------------------+ B B+partial_len
Later, io_destroy() calls vm_munmap(ctx->mmap_base, ctx->mmap_size), which unmaps the destination. This not only fails to unmap the orphan VMA at the source, but also overshoots the destination VMA and may unmap unrelated mappings adjacent to it! After put_aio_ring_file() calls truncate_setsize() to remove all pages from the pagecache, any subsequent access to the orphan VMA triggers filemap_fault(), which calls a_ops->read_folio(). Since aio does not implement read_folio, this results in a NULL pointer dereference.
[FIX]
Note that expanding mremap (new_len > old_len) is already rejected because AIO ring VMAs are created with VM_DONTEXPAND. The only problematic case is a partial move where "old_len == new_len" but both are smaller than the full ring size.
Fix this by checking in aio_ring_mremap() that the new VMA covers the entire ring. This ensures the AIO ring is always moved as a whole, preventing orphan VMAs and the subsequent crash.
[1]: https://lore.kernel.org/all/[email protected]/
--- fs/aio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/aio.c +2 -1
@@ -369,7 +369,8 @@ static int aio_ring_mremap(struct vm_area_struct *vma) ctx =rcu_dereference (table->table[i]);if (ctx && ctx->aio_ring_file == file) { -if (!atomic_read (&ctx->dead)) { +if (!atomic_read (&ctx->dead) && + (ctx->mmap_size == (vma->vm_end - vma->vm_start))) { ctx->user_id = ctx->mmap_base = vma->vm_start; res =0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 22/990 ACPI: platform: Use acpi_bus_get_primary_device()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit a9ba4dd2f18bf3f439d9ef0d8f375f90360ba1bd ]
The acpi_get_first_physical_node() usage in acpi_platform_fill_resource() and acpi_create_platform_device() is generally unsafe because in theory the device returned by it may be freed at any time [1].
It is also inefficient because acpi_get_first_physical_node() is called multiple times for the same argument which can be avoided.
Address these issues by using acpi_bus_get_primary_device() instead of acpi_get_first_physical_node() and adjusting the code to call it just once at the beginning of and acpi_create_platform_device() and drop the device reference acquired by it upon the return from that function.
--- drivers/acpi/acpi_platform.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/acpi/acpi_platform.c +7 -9
@@ -108,18 +108,15 @@ static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,return count; } -static void acpi_platform_fill_resource (struct acpi_device *adev, -const struct resource *src,struct resource *dest) +static void acpi_platform_fill_resource (struct device *parent, +const struct resource *src, +struct resource *dest) { -struct device *parent; - *dest = *src; -/* * If the device has parent we need to take its resources into * account as well because this device might consume part of those. */ - parent =acpi_get_first_physical_node (acpi_dev_parent (adev));if (parent &&dev_is_pci (parent)) dest->parent =pci_find_resource (to_pci_dev (parent), dest); }
@@ -147,7 +144,8 @@ static unsigned int acpi_platform_resource_count(struct acpi_resource *ares, voistruct platform_device *acpi_create_platform_device (struct acpi_device *adev,const struct property_entry *properties) { -struct acpi_device *parent =acpi_dev_parent (adev); +struct acpi_device *p =acpi_dev_parent (adev); + struct device *parent __free(put_device) = acpi_bus_get_primary_device(p);struct platform_device *pdev =NULL ;struct platform_device_info pdevinfo;const struct acpi_device_id *match;
@@ -193,7 +191,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, rentry->res, resources, count); -acpi_platform_fill_resource (adev, rentry->res, +acpi_platform_fill_resource (parent, rentry->res, &resources[count++]); }acpi_dev_free_resource_list (&resource_list);
@@ -206,7 +204,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,* attached to it, that physical device should be the parent of the * platform device we are about to create. */ - pdevinfo.parent = parent ?acpi_get_first_physical_node (parent) :NULL ; + pdevinfo.parent = parent; pdevinfo.name =dev_name (&adev->dev); pdevinfo.id =PLATFORM_DEVID_NONE ; pdevinfo.res = resources;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 23/990 virtio_net: check RX buffer length before DMA sync
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Petrzhikovskii <[email protected]>
[ Upstream commit 29dfa436bc488056a84ee423ba82336db453e2a6 ]
An RX queue that uses the DMA API (rq->use_page_pool_dma, for example with VIRTIO_F_ACCESS_PLATFORM) syncs each received buffer with page_pool_dma_sync_for_cpu() using the length the device wrote to the used ring, and checks that length against the posted buffer only after the sync.
With SWIOTLB bouncing (swiotlb=force, or a confidential-computing guest), the sync copies from the shared bounce buffer into the guest's private page, so an oversized length also copies the bytes the device wrote past the posted buffer over the neighbouring page pool fragments. The later check drops the packet, but the copy has already happened. A malicious device, such as a host the confidential guest does not trust, can overwrite guest kernel memory next to an RX buffer with bytes it chooses, which is enough to take an unprivileged guest process to root.
Check the length before the sync in the per-fragment loops. receive_buf() has to sync the header before the length check, because the mergeable error path reads num_buffers from it, so limit that sync to the posted length. A device that reports correct lengths sees no change.
The driver has synced with the device's length since
commit 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers"), at first in virtnet_rq_unmap(). Commit 24fbd3967f3f ("virtio_net: add page_pool support for buffer allocation") moved the sync to the page_pool call sites that this patch changes, so the patch applies to v7.1 and later. Older kernels need a separate backport that limits the sync in virtnet_rq_unmap().
Found by an LLM code review agent auditing users of the DMA API; the fix and this changelog were also written with an LLM coding assistant and reviewed by us. Reproduced in QEMU with swiotlb=force and iommu_platform=on, a test-only device change that reports a used length 64 bytes past the posted buffer and writes a marker there, and a guest kprobe module that reads the buffer after the sync: without this patch the marker reaches the guest page for small and mergeable buffers; with it the packets are dropped and counted in rx_length_errors. The virtio_net selftest basic_features.sh passes with and without mergeable buffers.
[ vladimir: 6.18.y has no page_pool RX buffers. The driver syncs small
and mergeable RX buffers in virtnet_rq_get_buf() with the length from the used ring, before any length check. Limit that sync to the length of the posted buffer; the existing checks then drop the packet. Tested with the reproducer described above: without this patch the marker reaches the guest page for small and mergeable buffers; with it the sync stops at the posted length and the packets are counted in rx_length_errors. ]
--- drivers/net/virtio_net.c | 47 ++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 11 deletions(-)
drivers/net/virtio_net.c +36 -11
@@ -805,19 +805,32 @@ static unsigned int mergeable_ctx_to_truesize(void *mrg_ctx)return (unsigned long )mrg_ctx & ((1 <<MRG_CTX_HEADER_SHIFT ) -1 ); } -static int check_mergeable_len (struct net_device *dev,void *mrg_ctx, -unsigned int len) +/* Length of the mergeable buffer that add_recvbuf_mergeable() posted. */ +static unsigned int mergeable_ctx_to_buflen (void *mrg_ctx) { -unsigned int headroom, tailroom, room, truesize; +unsigned int headroom, tailroom, room; - truesize =mergeable_ctx_to_truesize (mrg_ctx); headroom =mergeable_ctx_to_headroom (mrg_ctx); tailroom = headroom ?sizeof (struct skb_shared_info ) :0 ; room =SKB_DATA_ALIGN (headroom + tailroom); -if (len > truesize - room) { -pr_debug ("%s: rx error: len %u exceeds truesize %lu\n" , - dev->name, len, (unsigned long )(truesize - room)); +return mergeable_ctx_to_truesize (mrg_ctx) - room; +} + +/* Length of the small buffer that add_recvbuf_small() posts. */ +static unsigned int small_buflen (const struct virtnet_info *vi) +{ +return vi->hdr_len +GOOD_PACKET_LEN ; +} + +static int check_mergeable_len (struct net_device *dev,void *mrg_ctx, +unsigned int len) +{ +unsigned int buflen =mergeable_ctx_to_buflen (mrg_ctx); + +if (len > buflen) { +pr_debug ("%s: rx error: len %u exceeds buffer length %u\n" , + dev->name, len, buflen);DEV_STATS_INC (dev, rx_length_errors);return -1 ; }
@@ -974,13 +987,25 @@ static void virtnet_rq_unmap(struct receive_queue *rq, void *buf, u32 len)static void *virtnet_rq_get_buf (struct receive_queue *rq,u32 *len,void **ctx) {struct virtnet_info *vi = rq->vq->vdev->priv; +void *buf_ctx; +u32 buflen;void *buf;BUG_ON (vi->big_packets && !vi->mergeable_rx_bufs); - buf =virtqueue_get_buf_ctx (rq->vq, len, ctx); -if (buf) -virtnet_rq_unmap (rq, buf, *len); + buf =virtqueue_get_buf_ctx (rq->vq, len, &buf_ctx); +if (!buf) +return NULL ; + +/* The device chooses *len. Sync only the buffer that was posted, so +* that a larger *len cannot copy over the buffers next to it. +*/ + buflen = vi->mergeable_rx_bufs ?mergeable_ctx_to_buflen (buf_ctx) : +small_buflen (vi); +virtnet_rq_unmap (rq, buf,min (*len, buflen)); + +if (ctx) + *ctx = buf_ctx;return buf; }
@@ -2698,7 +2723,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq, buf +=VIRTNET_RX_PAD + xdp_headroom; -virtnet_rq_init_one_sg (rq, buf, vi->hdr_len +GOOD_PACKET_LEN ); +virtnet_rq_init_one_sg (rq, buf,small_buflen (vi)); err =virtqueue_add_inbuf_premapped (rq->vq, rq->sg,1 , buf, ctx, gfp);if (err <0 ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 24/990 ALSA: hda/tas2781: Prevent throwing away custom calibration addresses
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antheas Kapenekakis <[email protected]>
[ Upstream commit ba39a31448857da3b848174c9130b466b3ccddba ]
The V2 UEFI spec for per-device calibration data in TAS allows for manufacturers to specify up to five custom calibration register addresses and values to optimize per-device in factory.
A basic description of the spec is found in a comment in function tas2781_apply_calib(). However, currently, for the condition of p->dspbin_typ != TASDEV_BASIC, if custom calibration addresses have been provided by the manufacturer, they are ignored and the ones listed in firmware are used.
In case the manufacturer chose to change different registers other than the default ones (r0, invr0, r0_low, pow, tlimit), this causes the UEFI calibration data to scratch different registers and cause the firmware to misbehave. This is true in the Xbox ROG Ally X, for one of the firmwares, where it pops and has audio dropouts after the calibration data is applied.
Therefore, add a new bool to indicate that UEFI supplied custom calibration addresses, and if so, use them regardless of dspbin_typ.
--- sound/hda/codecs/side-codecs/tas2781_hda.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/hda/codecs/side-codecs/tas2781_hda.c +3 -1
@@ -89,6 +89,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p) TASDEVICE_REG(0, 0x18, 0x7c), };unsigned int crc, oft, node_num; +bool custom_addr = false;unsigned char *buf;int i, j, k, l;
@@ -129,6 +130,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)for (j =0 , k =0 ; j < node_num; j++) { oft = j *6 +3 ;if (tmp_val[oft] ==TASDEV_UEFI_CALI_REG_ADDR_FLG ) { + custom_addr = true;for (i =0 ; i <TASDEV_CALIB_N ; i++) { buf = &data[(oft + i +1 ) *4 ]; cali_reg[i] = TASDEVICE_REG(buf[1],
@@ -188,7 +190,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p) } } -if (p->dspbin_typ ==TASDEV_BASIC ) { +if (custom_addr || p->dspbin_typ ==TASDEV_BASIC ) { r->r0_reg = cali_reg[0 ]; r->invr0_reg = cali_reg[1 ]; r->r0_low_reg = cali_reg[2 ];
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 25/990 sched/deadline: Fix dl_server time accounting
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit e636ffb9e31b4f7dde7fef5358669266b9ce02ec ]
The dl_server time accounting code is a little odd. The normal scheduler pattern is to update curr before doing something, such that the old state is fully accounted before changing state.
Notably, the dl_server_timer() needs to propagate the current time accounting since the current task could be ran by dl_server and thus this can affect dl_se->runtime. Similarly for dl_server_start().
And since the (deferred) dl_server wants idle time accounted, rework sched_idle_class time accounting to be more like all the others.
--- kernel/sched/deadline.c | 40 +++++++++++++++------------------------- kernel/sched/fair.c | 9 ++------- kernel/sched/idle.c | 16 +++++++++++++++- kernel/sched/sched.h | 3 +-- 4 files changed, 33 insertions(+), 35 deletions(-)
kernel/sched/deadline.c +15 -25
@@ -1171,8 +1171,12 @@ static enum hrtimer_restart dl_server_timer(struct hrtimer *timer, struct sched_sched_clock_tick ();update_rq_clock (rq); -if (!dl_se->dl_runtime) -return HRTIMER_NORESTART ; +/* +* Make sure current has propagated its pending runtime into +* any relevant server through calling dl_server_update() and +* friends. +*/ + rq->donor->sched_class->update_curr (rq);if (dl_se->dl_defer_armed) {/*
@@ -1548,35 +1552,16 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64* as time available for the fair server, avoiding a penalty for the * rt scheduler that did not consumed that time. */ -void dl_server_update_idle_time (struct rq *rq,struct task_struct *p) +void dl_server_update_idle (struct sched_dl_entity *dl_se,s64 delta_exec) { -s64 delta_exec; - -if (!rq->fair_server.dl_defer) -return ; - -/* no need to discount more */ -if (rq->fair_server.runtime <0 ) -return ; - - delta_exec =rq_clock_task (rq) - p->se.exec_start; -if (delta_exec <0 ) -return ; - - rq->fair_server.runtime -= delta_exec; - -if (rq->fair_server.runtime <0 ) { - rq->fair_server.dl_defer_running =0 ; - rq->fair_server.runtime =0 ; - } - - p->se.exec_start =rq_clock_task (rq); +if (dl_se->dl_server_active && dl_se->dl_runtime && dl_se->dl_defer) +update_curr_dl_se (dl_se->rq, dl_se, delta_exec); }void dl_server_update (struct sched_dl_entity *dl_se,s64 delta_exec) {/* 0 runtime = fair server disabled */ -if (dl_se->dl_runtime) +if (dl_se->dl_server_active && dl_se->dl_runtime)update_curr_dl_se (dl_se->rq, dl_se, delta_exec); }
@@ -1787,6 +1772,11 @@ void dl_server_start(struct sched_dl_entity *dl_se)if (!dl_server (dl_se) || dl_se->dl_server_active)return ; +/* +* Update the current task to 'now'. +*/ + rq->donor->sched_class->update_curr (rq); +if (WARN_ON_ONCE (!cpu_online (cpu_of (rq))))return ;
kernel/sched/fair.c +2 -7
@@ -1325,8 +1325,7 @@ static void update_curr(struct cfs_rq *cfs_rq)* against fair_server such that it can account for this time * and possibly avoid running this period. */ -if (dl_server_active (&rq->fair_server)) -dl_server_update (&rq->fair_server, delta_exec); +dl_server_update (&rq->fair_server, delta_exec); }account_cfs_rq_runtime (cfs_rq, delta_exec);
@@ -7176,12 +7175,8 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) h_nr_idle =1 ; } -if (!rq_h_nr_queued && rq->cfs.h_nr_queued) { -/* Account for idle runtime */ -if (!rq->nr_running) -dl_server_update_idle_time (rq, rq->curr); +if (!rq_h_nr_queued && rq->cfs.h_nr_queued)dl_server_start (&rq->fair_server); - }/* At this point se is NULL and we are at root level*/ add_nr_running (rq,1 );
kernel/sched/idle.c +15 -1
@@ -473,9 +473,11 @@ static void wakeup_preempt_idle(struct rq *rq, struct task_struct *p, int flags)resched_curr (rq); } +static void update_curr_idle (struct rq *rq); +static void put_prev_task_idle (struct rq *rq,struct task_struct *prev,struct task_struct *next) { -dl_server_update_idle_time (rq, prev); +update_curr_idle (rq);scx_update_idle (rq, false, true); }
@@ -523,6 +525,7 @@ dequeue_task_idle(struct rq *rq, struct task_struct *p, int flags)*/ static void task_tick_idle (struct rq *rq,struct task_struct *curr,int queued) { +update_curr_idle (rq); }static void switching_to_idle (struct rq *rq,struct task_struct *p)
@@ -538,6 +541,17 @@ prio_changed_idle(struct rq *rq, struct task_struct *p, int oldprio)static void update_curr_idle (struct rq *rq) { +struct sched_entity *se = &rq->idle->se; +u64 now =rq_clock_task (rq); +s64 delta_exec; + + delta_exec = now - se->exec_start; +if (unlikely (delta_exec <=0 )) +return ; + + se->exec_start = now; + +dl_server_update_idle (&rq->fair_server, delta_exec); }/*
kernel/sched/sched.h +1 -2
@@ -405,6 +405,7 @@ extern s64 dl_scaled_delta_exec(struct rq *rq, struct sched_dl_entity *dl_se, s6* naturally thottled to once per period, avoiding high context switch * workloads from spamming the hrtimer program/cancel paths. */ +extern void dl_server_update_idle (struct sched_dl_entity *dl_se,s64 delta_exec);extern void dl_server_update (struct sched_dl_entity *dl_se,s64 delta_exec);extern void dl_server_start (struct sched_dl_entity *dl_se);extern void dl_server_stop (struct sched_dl_entity *dl_se);
@@ -412,8 +413,6 @@ extern void dl_server_init(struct sched_dl_entity *dl_se, struct rq *rq, dl_server_pick_f pick_task);extern void sched_init_dl_servers (void ); -extern void dl_server_update_idle_time (struct rq *rq, -struct task_struct *p);extern void fair_server_init (struct rq *rq);extern void __dl_server_attach_root (struct sched_dl_entity *dl_se,struct rq *rq); extern int dl_server_apply_params(struct sched_dl_entity *dl_se,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 26/990 sched/deadline: Fix dl_server stop condition
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit f5a538c07df26f5c601e41f7b9c7ade3e1e75803 ]
Gabriel reported that the dl_server doesn't stop as expected.
The problem was found to be the fact that idle time and fair runtime are treated equally. Both will count towards dl_server runtime and push the activation forwards when it is in the zero-laxity wait state.
Notably:
dl_server_update_idle()
update_curr_dl_se()
if (dl_defer && dl_throttled && dl_runtime_exceeded())
hrtimer_try_to_cancel(); // stop timer
replenish_dl_new_period()
deadline = now + dl_deadline; // fwd period
runtime = dl_runtime;
start_dl_timer(); // restart timerAnd while we do want idle time accounted towards the *current* activation of the dl_server -- after all, a fair task could've ran if we had any -- we don't necessarily want idle time to cause or push forward an activation.
Introduce dl_defer_idle to make this distinction. It will be set once idle time pushed the activation forward, once set idle time will only be allowed to consume any runtime but not push the activation. This will then cause dl_server_timer() to fire, which will stop the dl_server.
Any non-idle time accounting during this phase will clear dl_defer_idle, so only a full period of idle will cause the dl_server to stop.
--- include/linux/sched.h | 15 +++++++++------ kernel/sched/deadline.c | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 8 deletions(-)
include/linux/sched.h +9 -6
@@ -681,20 +681,22 @@ struct sched_dl_entity {* * @dl_server tells if this is a server entity. * -* @dl_defer tells if this is a deferred or regular server. For -* now only defer server exists. -* -* @dl_defer_armed tells if the deferrable server is waiting -* for the replenishment timer to activate it. -* * @dl_server_active tells if the dlserver is active(started). * dlserver is started on first cfs enqueue on an idle runqueue * and is stopped when a dequeue results in 0 cfs tasks on the * runqueue. In other words, dlserver is active only when cpu's * runqueue has atleast one cfs task. * +* @dl_defer tells if this is a deferred or regular server. For +* now only defer server exists. +* +* @dl_defer_armed tells if the deferrable server is waiting +* for the replenishment timer to activate it. +* * @dl_defer_running tells if the deferrable server is actually * running, skipping the defer phase. +* +* @dl_defer_idle tracks idle state */ unsigned int dl_throttled : 1; unsigned int dl_yielded : 1;
@@ -705,6 +707,7 @@ struct sched_dl_entity { unsigned int dl_defer : 1; unsigned int dl_defer_armed : 1; unsigned int dl_defer_running : 1; + unsigned int dl_defer_idle : 1;/* * Bandwidth enforcement timer. Each -deadline task has its
kernel/sched/deadline.c +38 -2
@@ -1178,6 +1178,11 @@ static enum hrtimer_restart dl_server_timer(struct hrtimer *timer, struct sched_*/ rq->donor->sched_class->update_curr (rq); +if (dl_se->dl_defer_idle) { +dl_server_stop (dl_se); +return HRTIMER_NORESTART ; + } +if (dl_se->dl_defer_armed) {/* * First check if the server could consume runtime in background.
@@ -1425,10 +1430,11 @@ s64 dl_scaled_delta_exec(struct rq *rq, struct sched_dl_entity *dl_se, s64 delta }static inline void -update_stats_dequeue_dl (struct dl_rq *dl_rq,struct sched_dl_entity *dl_se, -int flags); +update_stats_dequeue_dl (struct dl_rq *dl_rq,struct sched_dl_entity *dl_se,int flags); +static void update_curr_dl_se (struct rq *rq,struct sched_dl_entity *dl_se,s64 delta_exec) { +bool idle = rq->curr == rq->idle;s64 scaled_delta_exec;if (unlikely (delta_exec <=0 )) {
@@ -1449,6 +1455,9 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64 dl_se->runtime -= scaled_delta_exec; +if (dl_se->dl_defer_idle && !idle) + dl_se->dl_defer_idle =0 ; +/* * The fair server can consume its runtime while throttled (not queued/ * running as regular CFS).
@@ -1458,6 +1467,29 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64* starting a new period, pushing the activation. */ if (dl_se->dl_defer && dl_se->dl_throttled &&dl_runtime_exceeded (dl_se)) { +/* +* Non-servers would never get time accounted while throttled. +*/ +WARN_ON_ONCE (!dl_server (dl_se)); + +/* +* While the server is marked idle, do not push out the +* activation further, instead wait for the period timer +* to lapse and stop the server. +*/ +if (dl_se->dl_defer_idle && idle) { +/* +* The timer is at the zero-laxity point, this means +* dl_server_stop() / dl_server_start() can happen +* while now < deadline. This means update_dl_entity() +* will not replenish. Additionally start_dl_timer() +* will be set for 'deadline - runtime'. Negative +* runtime will not do. +*/ + dl_se->runtime =0 ; +return ; + } +/* * If the server was previously activated - the starving condition * took place, it this point it went away because the fair scheduler
@@ -1470,6 +1502,9 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64replenish_dl_new_period (dl_se, dl_se->rq); +if (idle) + dl_se->dl_defer_idle =1 ; +/* * Not being able to start the timer seems problematic. If it could not * be started for whatever reason, we need to "unthrottle" the DL server
@@ -1795,6 +1830,7 @@ void dl_server_stop(struct sched_dl_entity *dl_se)hrtimer_try_to_cancel (&dl_se->dl_timer); dl_se->dl_defer_armed =0 ; dl_se->dl_throttled =0 ; + dl_se->dl_defer_idle =0 ; dl_se->dl_server_active =0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 27/990 sched: Provide idle_rq() helper
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 1e0a2ba7afb1b60f02599093d84b72ce62ad11c0 ]
A fix for the dl_server 'requires' idle_cpu() usage, which made me note that it and available_idle_cpu() are extern function calls.
And while idle_cpu() is used outside of kernel/sched/, available_idle_cpu() is not.
This makes it hard to make idle_cpu() an inline helper, so provide idle_rq() and implement idle_cpu() and available_idle_cpu() using that.
--- include/linux/sched.h | 1 - kernel/sched/sched.h | 22 ++++++++++++++++++++++ kernel/sched/syscalls.c | 30 +----------------------------- 3 files changed, 23 insertions(+), 30 deletions(-)
include/linux/sched.h +0 -1
@@ -1915,7 +1915,6 @@ static inline int task_nice(const struct task_struct *p)extern int can_nice (const struct task_struct *p,const int nice);extern int task_curr (const struct task_struct *p);extern int idle_cpu (int cpu); -extern int available_idle_cpu (int cpu);extern int sched_setscheduler (struct task_struct *,int ,const struct sched_param *);extern int sched_setscheduler_nocheck (struct task_struct *,int ,const struct sched_param *);extern void sched_set_fifo (struct task_struct *p);
kernel/sched/sched.h +22 -0
@@ -1361,6 +1361,28 @@ static inline u32 sched_rng(void)#define cpu_curr (cpu) (cpu_rq(cpu)->curr)#define raw_rq () raw_cpu_ptr(&runqueues) +static inline bool idle_rq (struct rq *rq) +{ +return rq->curr == rq->idle && !rq->nr_running && !rq->ttwu_pending; +} + +/** +* available_idle_cpu - is a given CPU idle for enqueuing work. +* @cpu: the CPU in question. +* +* Return: 1 if the CPU is currently idle. 0 otherwise. +*/ +static inline bool available_idle_cpu (int cpu) +{ +if (!idle_rq (cpu_rq (cpu))) +return 0 ; + +if (vcpu_is_preempted (cpu)) +return 0 ; + +return 1 ; +} +#ifdef CONFIG_SCHED_PROXY_EXEC static inline void rq_set_donor (struct rq *rq,struct task_struct *t) {
kernel/sched/syscalls.c +1 -29
@@ -190,35 +190,7 @@ int task_prio(const struct task_struct *p)*/ int idle_cpu (int cpu) { -struct rq *rq =cpu_rq (cpu); - -if (rq->curr != rq->idle) -return 0 ; - -if (rq->nr_running) -return 0 ; - -if (rq->ttwu_pending) -return 0 ; - -return 1 ; -} - -/** -* available_idle_cpu - is a given CPU idle for enqueuing work. -* @cpu: the CPU in question. -* -* Return: 1 if the CPU is currently idle. 0 otherwise. -*/ -int available_idle_cpu (int cpu) -{ -if (!idle_cpu (cpu)) -return 0 ; - -if (vcpu_is_preempted (cpu)) -return 0 ; - -return 1 ; +return idle_rq (cpu_rq (cpu)); }/**
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 28/990 sched/deadline: Fix server stopping with runnable tasks
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriele Monaco <[email protected]>
[ Upstream commit ca1e8eede4fc68ce85a9fdce1a6c13ad64933318 ]
The deadline server can currently stop due to idle although fair tasks are runnable. This happens essentially when:
* the server is set to idle, a task wakes up, the server stops
* a task wakes up, the server sets itself to idle and stops right away
Address both cases by clearing the server idle flag whenever a fair task wakes up and accounting also for pending tasks in the definition of idle.
--- kernel/sched/deadline.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
kernel/sched/deadline.c +9 -4
@@ -1434,7 +1434,7 @@ update_stats_dequeue_dl(struct dl_rq *dl_rq, struct sched_dl_entity *dl_se, intstatic void update_curr_dl_se (struct rq *rq,struct sched_dl_entity *dl_se,s64 delta_exec) { -bool idle = rq->curr == rq->idle; +bool idle =idle_rq (rq);s64 scaled_delta_exec;if (unlikely (delta_exec <=0 )) {
@@ -1617,8 +1617,8 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)* | 8 | B:zero_laxity-wait | | | * | | | <---+ | * | +--------------------------------+ | -* | | ^ ^ 2 | -* | | 7 | 2 +--------------------+ +* | | ^ ^ 2 | +* | | 7 | 2, 1 +----------------+ * | v | * | +-------------+ | * +-- | C:idle-wait | -+
@@ -1663,8 +1663,11 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)* dl_defer_idle = 0 * * -* [1] A->B, A->D +* [1] A->B, A->D, C->B * dl_server_start() +* dl_defer_idle = 0; +* if (dl_server_active) +* return; // [B] * dl_server_active = 1; * enqueue_dl_entity() * update_dl_entity(WAKEUP)
@@ -1779,6 +1782,7 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)* "B:zero_laxity-wait" -> "C:idle-wait" [label="7:dl_server_update_idle"] * "B:zero_laxity-wait" -> "D:running" [label="3:dl_server_timer"] * "C:idle-wait" -> "A:init" [label="8:dl_server_timer"] +* "C:idle-wait" -> "B:zero_laxity-wait" [label="1:dl_server_start"] * "C:idle-wait" -> "B:zero_laxity-wait" [label="2:dl_server_update"] * "C:idle-wait" -> "C:idle-wait" [label="7:dl_server_update_idle"] * "D:running" -> "A:init" [label="4:pick_task_dl"]
@@ -1804,6 +1808,7 @@ void dl_server_start(struct sched_dl_entity *dl_se) {struct rq *rq = dl_se->rq; + dl_se->dl_defer_idle =0 ;if (!dl_server (dl_se) || dl_se->dl_server_active)return ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 29/990 xfs: only assert new size for datafork during truncate extents
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Long Li <[email protected]>
[ Upstream commit e942498385bf80f4d6d075b47174035545eb6a2e ]
The assertion functions properly because we currently only truncate the attr to a zero size. Any other new size of the attr is not preempted. Make this assertion is specific to the datafork, preparing for subsequent patches to truncate the attribute to a non-zero size.
--- fs/xfs/xfs_inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/xfs/xfs_inode.c +2 -1
@@ -1048,7 +1048,8 @@ xfs_itruncate_extents_flags(xfs_assert_ilocked (ip,XFS_ILOCK_EXCL );if (icount_read (VFS_I (ip)))xfs_assert_ilocked (ip,XFS_IOLOCK_EXCL ); -ASSERT (new_size <=XFS_ISIZE (ip)); +if (whichfork ==XFS_DATA_FORK ) +ASSERT (new_size <=XFS_ISIZE (ip));ASSERT (tp->t_flags &XFS_TRANS_PERM_LOG_RES );ASSERT (ip->i_itemp !=NULL );ASSERT (ip->i_itemp->ili_lock_flags ==0 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 30/990 fbdev: bound mode sysfs output to the sysfs buffer
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melbin K Mathew <[email protected]>
[ Upstream commit d15d51fb26e830af58f3f21964f1c09c239077ea ]
mode_string() uses snprintf() which can return a value larger than the remaining buffer space. show_modes() accumulates the return value into i without checking whether i has reached PAGE_SIZE, causing the offset to advance past the sysfs buffer if the modelist is long enough.
Add a size parameter to mode_string() and use scnprintf() to return only the bytes actually written. Add an early return when offset already exceeds the buffer. In show_modes(), stop accumulating once the buffer is full.
--- drivers/video/fbdev/core/fbsysfs.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbsysfs.c +10 -5
@@ -28,12 +28,15 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var)return 0 ; } -static int mode_string (char *buf,unsigned int offset, +static int mode_string (char *buf,size_t size,unsigned int offset,const struct fb_videomode *mode) {char m ='U' ;char v ='p' ; +if (offset >= size) +return 0 ; +if (mode->flag &FB_MODE_IS_DETAILED ) m ='D' ;if (mode->flag &FB_MODE_IS_VESA )
@@ -46,7 +49,7 @@ static int mode_string(char *buf, unsigned int offset,if (mode->vmode &FB_VMODE_DOUBLE ) v ='d' ; -return snprintf (&buf[offset],PAGE_SIZE - offset,"%c:%dx%d%c-%d\n" , +return scnprintf (&buf[offset], size - offset,"%c:%dx%d%c-%d\n" , m, mode->xres, mode->yres, v, mode->refresh); }
@@ -65,7 +68,7 @@ static ssize_t store_mode(struct device *device, struct device_attribute *attr,list_for_each_entry (modelist, &fb_info->modelist, list) { mode = &modelist->mode; - i =mode_string (mstr,0 , mode); + i =mode_string (mstr,sizeof (mstr),0 , mode);if (strncmp (mstr, buf,max (count, i)) ==0 ) { var = fb_info->var;
@@ -87,7 +90,7 @@ static ssize_t show_mode(struct device *device, struct device_attribute *attr,if (!fb_info->mode)return 0 ; -return mode_string (buf,0 , fb_info->mode); +return mode_string (buf,PAGE_SIZE ,0 , fb_info->mode); } static ssize_t store_modes(struct device *device,
@@ -137,7 +140,9 @@ static ssize_t show_modes(struct device *device, struct device_attribute *attr, i =0 ;list_for_each_entry (modelist, &fb_info->modelist, list) { mode = &modelist->mode; - i +=mode_string (buf, i, mode); + i +=mode_string (buf,PAGE_SIZE , i, mode); +if (i >=PAGE_SIZE -1 ) +break ; }return i; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 31/990 fbdev: clear fb_info->mode before deleting a videomode
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melbin K Mathew <[email protected]>
[ Upstream commit 95e647d2a5304a8fd11f1ba3c8502de700650131 ]
fb_set_var() can delete a mode from info->modelist when userspace passes FB_ACTIVATE_INV_MODE through FBIOPUT_VSCREENINFO. The code checks that the mode being deleted is not the current info->var and that fbcon is not using it, but it does not check fb_info->mode.
fb_info->mode may still point into the modelist entry being deleted. If the entry is freed, later mode sysfs reads through show_mode() can dereference a stale pointer.
Clear fb_info->mode before calling fb_delete_videomode() when it matches the mode being removed.
--- drivers/video/fbdev/core/fbmem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/video/fbdev/core/fbmem.c +4 -1
@@ -246,8 +246,11 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) ret =fb_mode_is_equal (&mode1, &mode2);if (!ret) { ret =fbcon_mode_deleted (info, &mode1); -if (!ret) +if (!ret) { +if (info->mode &&fb_mode_is_equal (info->mode, &mode1)) + info->mode =NULL ;fb_delete_videomode (&mode1, &info->modelist); + } }return ret ? -EINVAL :0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 32/990 fbdev: serialize mode sysfs access with lock_fb_info()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melbin K Mathew <[email protected]>
[ Upstream commit 061db6b7a910b8378f3b2df64f8c0a3ddc6e85f2 ]
show_mode(), show_modes(), and store_mode() access fb_info->modelist and fb_info->mode without holding lock_fb_info(). store_modes() takes lock_fb_info() while replacing the modelist and freeing the old one.
A concurrent reader or writer can load a pointer to an old modelist entry before store_modes() frees it, then dereference freed memory or store a stale freed pointer in fb_info->mode.
Take lock_fb_info() in show_mode(), show_modes(), and store_mode() to serialize with store_modes(). In show_mode(), copy the mode to the stack and format after dropping the lock. In store_mode(), split activate() into a _locked variant to avoid double-locking, and hold the locks for the modelist walk, mode conversion, activation, and fb_info->mode assignment together.
--- drivers/video/fbdev/core/fbsysfs.c | 46 ++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 8 deletions(-)
drivers/video/fbdev/core/fbsysfs.c +38 -8
@@ -13,19 +13,24 @@#include "fb_internal.h" #include "fbcon.h" +static int activate_locked (struct fb_info *fb_info, +struct fb_var_screeninfo *var) +{ + var->activate |=FB_ACTIVATE_FORCE ; +return fb_set_var_from_user (fb_info, var); +} +static int activate (struct fb_info *fb_info,struct fb_var_screeninfo *var) {int err; - var->activate |=FB_ACTIVATE_FORCE ;console_lock ();lock_fb_info (fb_info); - err =fb_set_var_from_user (fb_info, var); + err =activate_locked (fb_info, var);unlock_fb_info (fb_info);console_unlock (); -if (err) -return err; -return 0 ; + +return err; } static int mode_string(char *buf, size_t size, unsigned int offset,
@@ -66,6 +71,9 @@ static ssize_t store_mode(struct device *device, struct device_attribute *attr,memset (&var,0 ,sizeof (var)); +console_lock (); +lock_fb_info (fb_info); +list_for_each_entry (modelist, &fb_info->modelist, list) { mode = &modelist->mode; i =mode_string (mstr,sizeof (mstr),0 , mode);
@@ -73,12 +81,22 @@ static ssize_t store_mode(struct device *device, struct device_attribute *attr, var = fb_info->var;fb_videomode_to_var (&var, mode); -if ((err =activate (fb_info, &var))) + err =activate_locked (fb_info, &var); +if (err) { +unlock_fb_info (fb_info); +console_unlock ();return err; + } fb_info->mode = mode; +unlock_fb_info (fb_info); +console_unlock ();return count; } } + +unlock_fb_info (fb_info); +console_unlock (); +return -EINVAL ; }
@@ -86,11 +104,20 @@ static ssize_t show_mode(struct device *device, struct device_attribute *attr, char *buf) {struct fb_info *fb_info =dev_get_drvdata (device); +struct fb_videomode mode; +bool have_mode = false; -if (!fb_info->mode) +lock_fb_info (fb_info); +if (fb_info->mode) { + mode = *fb_info->mode; + have_mode = true; + } +unlock_fb_info (fb_info); + +if (!have_mode)return 0 ; -return mode_string (buf,PAGE_SIZE ,0 , fb_info->mode); +return mode_string (buf,PAGE_SIZE ,0 , &mode); } static ssize_t store_modes(struct device *device,
@@ -138,12 +165,15 @@ static ssize_t show_modes(struct device *device, struct device_attribute *attr,const struct fb_videomode *mode; i =0 ; +lock_fb_info (fb_info);list_for_each_entry (modelist, &fb_info->modelist, list) { mode = &modelist->mode; i +=mode_string (buf,PAGE_SIZE , i, mode);if (i >=PAGE_SIZE -1 )break ; } +unlock_fb_info (fb_info); +return i; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 33/990 Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 15465d681517c6180e709d749c50fba34c4ef419.
--- .../drm/nouveau/nvkm/subdev/devinit/gf100.c | 20 ------------------- 1 file changed, 20 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c +0 -20
@@ -27,7 +27,6 @@#include <subdev/bios/init.h> #include <subdev/bios/pll.h> #include <subdev/clk/pll.h> -#include <subdev/vga.h> int gf100_devinit_pll_set (struct nvkm_devinit *init,u32 type,u32 freq)
@@ -100,25 +99,6 @@ gf100_devinit_preinit(struct nvkm_devinit *base)* can use it as a reliable way to know whether we should run devinit. */ base->post = ((nvkm_rd32 (device,0x2240c ) &BIT (1 )) ==0 ); - -/* -* However some VBIOS init sequences miss this bit. So fall back to -* the nv50 method of checking if the bit is not set. Running the -* VBIOS multiple times may have detrimental effects. -*/ -if (base->post) { -u64 disable =nvkm_devinit_disable (base); -/* magic to detect whether or not x86 vbios code has -* executed the devinit scripts to initialise the -* board. only works if there's a display engine. -*/ -if (!(disable & (1ULL <<NVKM_ENGINE_DISP ))) { -if (nvkm_rdvgac (device,0 ,0x00 ) || -nvkm_rdvgac (device,0 ,0x1a )) { - base->post = false; - } - } - } } static const struct nvkm_devinit_func
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 34/990 netrom: send the unacknowledged frames again when T1 or T4 expires
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
When T1 expires in state 3, nr_t1timer_expiry() moves the frames of the ack queue back to the write queue with nr_requeue_frames(), but does not call nr_kick(). nr_kick() only runs when a frame comes in from the peer or when the application writes, so if the peer stays silent (one way transfer, last frame or its acknowledgment lost) nothing is sent
again: after N2 expiries the circuit is cleared with ETIMEDOUT without a single retransmission. The comment above nr_requeue_frames() says the frames are "picked up by nr_kick called from the timer", but no timer calls it.
T4 has the same gap: when the peer's busy condition times out, the frames held back while it was choked stay queued until something else calls nr_kick().
Call nr_kick() after nr_requeue_frames() in the T1 expiry, and after clearing NR_COND_PEER_RX_BUSY in the T4 expiry. nr_kick() already does nothing outside state 3 or while the peer is busy, and sends from V(A) once the ack queue is empty, so the T1 retransmission resends the window from the first unacknowledged frame. The N2 count and the time at which the circuit is cleared are unchanged.
Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a serial mkiss port: the guest under test runs netrom with T1 = 5 s, N2 = 3 and T4 = 3 s; the other guest plays a NET/ROM node from user space with an AX.25 socket and acknowledges nothing.
- three frames written on a circuit: before, each was sent once and the circuit was cleared 20.7 s later; after, the three are sent again at 5.4, 10.5 and 15.6 s and the circuit is still cleared 20.7 s later;
- the peer acknowledges the first frame with CHOKE, then a second frame is written: before, it was never sent; after, it goes out when T4 expires (3.1 s after the CHOKE), then again on T1.
No kernel report in either run.
--- net/netrom/nr_subr.c | 6 +++--- net/netrom/nr_timer.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-)
net/netrom/nr_subr.c +3 -3
@@ -61,9 +61,9 @@ void nr_frames_acked(struct sock *sk, unsigned short nr) }/* -* Requeue all the un-ack-ed frames on the output queue to be picked -* up by nr_kick called from the timer. This arrangement handles the -* possibility of an empty output queue. +* Requeue all the un-ack-ed frames on the output queue to be sent +* again by nr_kick(), which the T1 timer calls next. This arrangement +* handles the possibility of an empty output queue. */ void nr_requeue_frames (struct sock *sk) {
net/netrom/nr_timer.c +4 -0
@@ -171,6 +171,8 @@ static void nr_t4timer_expiry(struct timer_list *t)bh_lock_sock (sk);nr_sk (sk)->condition &= ~NR_COND_PEER_RX_BUSY ; +/* the peer is assumed ready again: send what was held back */ +nr_kick (sk);bh_unlock_sock (sk);sock_put (sk); }
@@ -238,6 +240,8 @@ static void nr_t1timer_expiry(struct timer_list *t) }else { nr->n2count++;nr_requeue_frames (sk); +/* nothing else sends them if the peer stays silent */ +nr_kick (sk); }break ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 35/990 ax25: drop a message being reassembled when a new one starts
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
ax25_rx_fragment() only accepts, while a message is being reassembled (fragno != 0), the segment numbered fragno - 1. A new first segment, or a segment with another number, falls through to "return 0" and is freed, but fragno keeps its value. Since every first segment is then refused, and no segment can ever match fragno - 1 again, every later segmented message of the connection is thrown away, until the connection is closed. The I frames carrying them have already been acknowledged, so the sender has no way to know.
This happens whenever the peer gives up a message half way, for instance a station on an older kernel that interleaves the segments of two messages, or one that fails to allocate a segment in the middle of a message.
When a segment does not continue the message being reassembled, purge the queue and reset fragno and fraglen. A first segment then starts a new message; any other segment is dropped as before.
Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a serial mkiss port; one guest builds the segments itself on an AX.25 socket with AX25_PIDINCL and sends: a 2 segment message, the first segment of a 3 segment message and nothing more, a 2 segment message, a 3 segment message without its second segment, a 2 segment message and an unsegmented one. Before, the receiver got the first message and the unsegmented one only; after, it gets the three complete segmented messages and the unsegmented one. No kernel report.
--- net/ax25/ax25_in.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
net/ax25/ax25_in.c +20 -10
@@ -87,16 +87,26 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)return 1 ; } } - }else { -/* First fragment received */ -if (*skb->data &AX25_SEG_FIRST ) { -skb_queue_purge (&ax25->frag_queue); - ax25->fragno = *skb->data &AX25_SEG_REM ; -skb_pull (skb,1 );/* skip fragno */ - ax25->fraglen = skb->len; -skb_queue_tail (&ax25->frag_queue, skb); -return 1 ; - } + +/* +* A new first segment, or a segment out of order: the message +* being reassembled can no longer be completed. Drop it, or +* fragno would never come back to 0 and every later segmented +* message of this connection would be thrown away as well. +*/ +skb_queue_purge (&ax25->frag_queue); + ax25->fragno =0 ; + ax25->fraglen =0 ; + } + +/* First fragment received */ +if (*skb->data &AX25_SEG_FIRST ) { +skb_queue_purge (&ax25->frag_queue); + ax25->fragno = *skb->data &AX25_SEG_REM ; +skb_pull (skb,1 );/* skip fragno */ + ax25->fraglen = skb->len; +skb_queue_tail (&ax25->frag_queue, skb); +return 1 ; }return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 36/990 rose: reset a call when a DATA packet arrives out of sequence
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
In state 3, rose_state3_machine() drops a DATA packet whose N(S) is not the expected V(R) and says nothing about it: the packet is not queued, and at most an RR with the unchanged N(R) goes out later. ROSE never sends a DATA packet again, so once a packet has been lost on the way (a relay dropped it, or a link was reset under it), every following packet is dropped as well, the window of the sender fills up and the call hangs until one side clears it.
X.25 resets the call when P(S) is not the one expected. Do the same:
acknowledge what arrived in sequence with rose_enquiry_response(), so that the sender frees those packets, then send RESET REQUEST and go to state 4, as the other error cases of this function already do. On the RESET, the sender sends again the packets it still holds, from N(S) 0.
Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a serial mkiss port. The calling guest runs a rose module changed for the bench only to drop the third DATA packet it sends, keeping it on its ack queue as if a relay had lost it; it writes d0 to d5 on the call. Before, the called guest received d0 and d1, and the caller still had 3840 bytes queued 25 s later; after, the called guest received d0 to d5 in order, without duplicates, and the caller's queue was empty. No kernel report.
--- net/rose/rose_in.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
net/rose/rose_in.c +21 -0
@@ -194,6 +194,27 @@ static int rose_state3_machine(struct sock *sk, struct sk_buff *skb, int frametyif (atomic_read (&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >>1 )) rose->condition |=ROSE_COND_OWN_RX_BUSY ; + }else { +/* +* A DATA packet was lost on the way: a relay dropped +* it, or a link was reset under it. ROSE never sends a +* DATA packet again, so the window of the sender would +* stay full and the call would hang. Acknowledge what +* arrived in sequence, then reset the call (X.25: +* invalid P(S)); the sender then sends its +* unacknowledged packets again. +*/ +rose_enquiry_response (sk); +rose_write_internal (sk,ROSE_RESET_REQUEST ); + rose->condition =0x00 ; + rose->vs =0 ; + rose->vr =0 ; + rose->va =0 ; + rose->vl =0 ; + rose->state =ROSE_STATE_4 ; +rose_start_t2timer (sk); +rose_stop_idletimer (sk); +break ; }/* * If the window is full, ack the frame, else start the
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 37/990 ax25: end a REJ recovery count once frames are acknowledged
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
Commit a3aa611e37d4 ("ax25: bound REJ-driven fast retransmits with the existing N2 counter") counts REJ-driven retransmits in n2count and relies on an I frame received in sequence to reset it. A station that only sends, such as a BBS forwarding mail, never receives I frames:
the peer acknowledges with RR. After a single REJ, n2count then stays above zero for the rest of the connection, with two effects:
- ax25_calculate_rtt() no longer updates the round trip time (it requires n2count == 0), and with the default linear backoff ax25_calculate_t1() keeps T1 at (2 + 2 * n2count) * rtt instead of 2 * rtt;
- isolated REJs, even hours apart, add up, and the N2-th one sends a healthy link into the state 4 enquiry.
An RR, RNR or REJ whose N(R) acknowledges new frames shows the link is getting data through, so reset n2count when it moves V(A). A REJ storm that makes no progress keeps the same N(R) and is still bounded by N2. The reset is done after the acknowledgment is processed, so the round trip of retransmitted frames is still not measured.
--- net/ax25/ax25_std_in.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
net/ax25/ax25_std_in.c +19 -4
@@ -190,7 +190,12 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frameif (type ==AX25_COMMAND && pf)ax25_std_enquiry_response (ax25);if (ax25_validate_nr (ax25, nr)) { +int progress = nr != ax25->va; +ax25_check_iframes_acked (ax25, nr); +/* Frames got through: end any REJ recovery count. */ +if (progress) + ax25->n2count =0 ; }else {ax25_std_nr_error_recovery (ax25); ax25->state =AX25_STATE_1 ;
@@ -202,8 +207,17 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frameif (type ==AX25_COMMAND && pf)ax25_std_enquiry_response (ax25);if (ax25_validate_nr (ax25, nr)) { +int progress = nr != ax25->va; +ax25_frames_acked (ax25, nr);ax25_calculate_rtt (ax25); +/* +* Only REJs that make no progress count towards N2: +* a REJ whose N(R) acknowledges new frames shows the +* link is getting data through. +*/ +if (progress) + ax25->n2count =0 ;/* * REJ triggers an immediate go-back-N retransmit, * deliberately bypassing the T1/N2 backoff that
@@ -224,10 +238,11 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frame* once N2 of them have failed to make it through, * fall back to the normal paced state 4 enquiry * (which will genuinely give up and disconnect after -* N2 further tries if the link stays bad). A single -* frame accepted in sequence resets the counter (see -* the AX25_I case below), so an isolated REJ during -* otherwise healthy traffic never gets close to N2. +* N2 further tries if the link stays bad). A frame +* accepted in sequence (see the AX25_I case below) or +* an RR/RNR/REJ that acknowledges new frames resets +* the counter, so an isolated REJ during otherwise +* healthy traffic never gets close to N2. */ if (ax25->n2count == ax25->n2) { ax25->n2count =1 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 38/990 netrom: keep T1 running after answering a NAK
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
When an INFO or INFOACK frame carries the NAK flag, nr_send_nak_frame() sends the frame at V(A) again and then stops T1, although that frame, and any sent after it, are still waiting for an acknowledgment.
If this copy is lost too, no timer is left: nothing is sent again, and the circuit is not cleared after N2 tries either. It stays stuck until the peer sends something or the idle timer, if set, closes it.
Restart T1 instead, as nr_check_iframes_acked() does when part of the window is acknowledged.
--- net/netrom/nr_out.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/netrom/nr_out.c +6 -1
@@ -135,7 +135,12 @@ void nr_send_nak_frame(struct sock *sk) nr->condition &= ~NR_COND_ACK_PENDING ; nr->vl = nr->vr; -nr_stop_t1timer (sk); +/* +* The frame just sent again, and any sent after it, still wait for +* an acknowledgment: keep T1 running so that losing this copy too +* is noticed. +*/ +nr_start_t1timer (sk); }void nr_kick (struct sock *sk)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 39/990 netrom: give the sysctl timer limits in milliseconds
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
Since commit 4d8937d0b113 ("[NETROM]: Eleminate HZ from NET/ROM kernel interfaces") the NET/ROM timer sysctls hold milliseconds, converted with msecs_to_jiffies() where they are used, but their limits were left in jiffies: 5 * HZ to 600 * HZ for the transport timeout, 1 * HZ to 60 * HZ for the acknowledge delay, 1 * HZ to 1000 * HZ for the busy delay, up to 65535 * HZ for the no activity timeout. They only match with HZ=1000.
With HZ=100 the largest transport timeout that can be written is 60 s while the default is 120 s, and the largest busy delay is 100 s while the default is 180 s: once changed, a default can no longer be put back. The smallest transport timeout accepted is 0.5 s instead of 5 s. With HZ=250 the acknowledge delay is limited to 15 s instead of 60 s.
Seen on a Raspberry Pi node (HZ=100): writing back the current values 120000 to transport_timeout and 180000 to transport_busy_delay fails with EINVAL, and 60000 is accepted.
Give the limits in milliseconds, as was done for ROSE. With HZ=1000 nothing changes.
--- net/netrom/sysctl_net_netrom.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
net/netrom/sysctl_net_netrom.c +9 -8
@@ -15,16 +15,17 @@static int min_quality[] = {0 }, max_quality[] = {255 };static int min_obs[] = {0 }, max_obs[] = {255 };static int min_ttl[] = {0 }, max_ttl[] = {255 }; -static int min_t1[] = {5 *HZ }; -static int max_t1[] = {600 *HZ }; +/* The timers are given in milliseconds */ +static int min_t1[] = {5 *MSEC_PER_SEC }; +static int max_t1[] = {600 *MSEC_PER_SEC };static int min_n2[] = {2 }, max_n2[] = {127 }; -static int min_t2[] = {1 *HZ }; -static int max_t2[] = {60 *HZ }; -static int min_t4[] = {1 *HZ }; -static int max_t4[] = {1000 *HZ }; +static int min_t2[] = {1 *MSEC_PER_SEC }; +static int max_t2[] = {60 *MSEC_PER_SEC }; +static int min_t4[] = {1 *MSEC_PER_SEC }; +static int max_t4[] = {1000 *MSEC_PER_SEC };static int min_window[] = {1 }, max_window[] = {127 }; -static int min_idle[] = {0 *HZ }; -static int max_idle[] = {65535 *HZ }; +static int min_idle[] = {0 *MSEC_PER_SEC }; +static int max_idle[] = {65535 *MSEC_PER_SEC };static int min_route[] = {0 }, max_route[] = {1 };static int min_fails[] = {1 }, max_fails[] = {10 };static int min_reset[] = {0 }, max_reset[] = {1 };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 40/990 mm/ksm: fix userfaultfd protection during merge and unmerge
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <[email protected]>
[ Upstream commit 990d6c2194a938a19a8cf94c6cfd75171345089b ]
KSM loses userfaultfd protection when replace_page() builds a new PTE from vma->vm_page_prot. Dropping its uffd bit lets a subsequent write go through ordinary COW instead of userfaultfd write protection handling. For RWP, a merged page also becomes readable without faulting.
Keeping the uffd bit and restoring PAGE_NONE fixes merging, but we also have to handle unmerging. An existing KSM page can be protected with RWP before MADV_UNMERGEABLE, so unmerging already needs fixing independently of preserving RWP during merging.
Unsharing replaces a shared page with a private one and should leave userfaultfd protection in place, as do_wp_page() already does for write protection. Currently, an unshare fault reaches do_uffd_rwp() before it can proceed to do_wp_page().
- With synchronous RWP, handle_userfault() returns VM_FAULT_SIGBUS. break_ksm() then reports success with a KSM page still merged.
- With asynchronous RWP, protection is cleared before unsharing.
Preserve the uffd bit when merging, and restore PAGE_NONE for RWP. Let FAULT_FLAG_UNSHARE skip RWP fault handling and keep PAGE_NONE on each private copy as well. Unsharing can then complete with RWP still armed for a subsequent access.
--- mm/ksm.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/ksm.c +4 -0
@@ -1419,6 +1419,10 @@ static int replace_page(struct vm_area_struct *vma, struct page *page,if (pte_soft_dirty (orig_pte)) newpte =pte_mksoft_dirty (newpte); +/* Preserve uffd-wp when replacing the page. */ +if (pte_uffd_wp (orig_pte)) + newpte =pte_mkuffd_wp (newpte); +flush_cache_page (vma, addr,pte_pfn (ptep_get (ptep)));/* * No need to notify as we are replacing a read only page with another
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 41/990 udf: validate VAT inode size for old VAT format
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit 5163e6ee1ea744d412fe516235bfd9cab15141dc ]
Validate VAT inode is large enough to contain at least the header for pre-2.00 UDF media format.
--- fs/udf/super.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/udf/super.c +5 -0
@@ -1319,6 +1319,11 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)if (map->s_partition_type ==UDF_VIRTUAL_MAP15 ) { map->s_type_specific.s_virtual.s_start_offset =0 ; +if (sbi->s_vat_inode->i_size <36 ) { +udf_err (sb,"Too short VAT inode size %lld\n" , + sbi->s_vat_inode->i_size); +return -EFSCORRUPTED ; + } map->s_type_specific.s_virtual.s_num_entries = (sbi->s_vat_inode->i_size -36 ) >>2 ; }else if (map->s_partition_type ==UDF_VIRTUAL_MAP20 ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 42/990 udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Peng <[email protected]>
[ Upstream commit 49f771d14578733a350c45e34e1bc6ad14f56952 ]
In udf_load_vat() (fs/udf/super.c), validate that vat20->lengthHeader is at least sizeof(struct virtualAllocationTable20) and does not exceed the mapped buffer or VAT inode size so computing the VAT table pointer and entry count cannot underflow or read out of bounds.
--- fs/udf/super.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
fs/udf/super.c +12 -2
@@ -1328,6 +1328,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) (sbi->s_vat_inode->i_size -36 ) >>2 ; }else if (map->s_partition_type ==UDF_VIRTUAL_MAP20 ) { vati =UDF_I (sbi->s_vat_inode); +if (sbi->s_vat_inode->i_size < +sizeof (struct virtualAllocationTable20 )) { +udf_err (sb,"Too short VAT inode size %lld\n" , + sbi->s_vat_inode->i_size); +return -EFSCORRUPTED ; + }if (vati->i_alloc_type !=ICBTAG_FLAG_AD_IN_ICB ) {int err =0 ;
@@ -1345,8 +1351,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) map->s_type_specific.s_virtual.s_start_offset =le16_to_cpu (vat20->lengthHeader); -if (map->s_type_specific.s_virtual.s_start_offset - > sbi->s_vat_inode->i_size) { +if (map->s_type_specific.s_virtual.s_start_offset < +sizeof (struct virtualAllocationTable20 ) || + map->s_type_specific.s_virtual.s_start_offset > + sb->s_blocksize || + map->s_type_specific.s_virtual.s_start_offset > + sbi->s_vat_inode->i_size) {udf_err (sb,"Corrupted VAT header length %u (VAT inode size %lld)\n" , map->s_type_specific.s_virtual.s_start_offset, sbi->s_vat_inode->i_size);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 43/990 io_uring/napi: dont end the single NAPI busy poll early on need_resched()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cinq Prairie <[email protected]>
Commit 39c7210e970200f8b17de3767c73efe64173a95f upstream.
With a single registered NAPI, io_napi_blocking_busy_loop() hands io_napi_busy_loop_should_end() to napi_busy_loop_rcu() as loop_end and runs its own loop once, relying on __napi_busy_loop() to spin until that predicate fires. napi_busy_loop_rcu() sets NAPI_F_END_ON_RESCHED, so __napi_busy_loop() also returns on the first need_resched(). io_uring treats the return as the end of the busy poll period and sleeps in schedule_hrtimeout() for the rest of the wait timeout.
With two or more NAPIs the inner loop is single-shot and io_uring's own loop runs until its predicate is met, so busy_poll_to is honoured. The same registration therefore behaves differently for one NAPI than for several.
Make the busy poll deadline absolute, stored in io_wait_queue, so that io_napi_busy_loop_should_end() no longer depends on the start_time the napi loop snapshots on every entry. The single NAPI loop can then be re-entered after an early need_resched() exit if there is budget left, and the loop condition drops the "run once" special case. The fast path that holds the NAPI across polls is kept.
Measured on io_uring-7.4 at 9c207aa58e54, x86-64, HZ=1000, PREEMPT_DYNAMIC (lazy), no CPU isolation, low RX traffic, r8169 with one RX queue, prefer_busy_poll, busy_poll_to = wait timeout = 10 ms. "waker" is a SCHED_FIFO task pinned to the polling CPU waking every 1 ms:
1 NAPI, waker, before: busy 0.5-1.5 ms per 10 ms wait, ~0.8M polls/s 1 NAPI, waker, after: busy 10 ms per 10 ms wait, ~16.2M polls/s 1 NAPI, idle, before: busy 10 ms per 10 ms wait, ~15.3M polls/s 1 NAPI, idle, after: busy 10 ms per 10 ms wait, ~16.2M polls/s
2 NAPIs, waker, before: busy 10 ms per 10 ms wait, ~7.2M polls/s
2 NAPIs, waker, after: busy 10 ms per 10 ms wait, ~7.1M polls/s
The held-NAPI fast path polls about twice as often as the single-shot path used for several NAPIs, which is why it is kept.
--- io_uring/io_uring.h | 1 + io_uring/napi.c | 31 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 17 deletions(-)
io_uring/io_uring.h +1 -0
@@ -113,6 +113,7 @@ struct io_wait_queue {#ifdef CONFIG_NET_RX_BUSY_POLL ktime_t napi_busy_poll_dt; +ktime_t napi_busy_poll_end;bool napi_prefer_busy_poll;#endif };
io_uring/napi.c +14 -17
@@ -128,19 +128,15 @@ static inline void io_napi_remove_stale(struct io_ring_ctx *ctx, bool is_stale)__io_napi_remove_stale (ctx); } -static inline bool io_napi_busy_loop_timeout (ktime_t start_time, -ktime_t bp) +static inline bool io_napi_busy_loop_timeout (struct io_wait_queue *iowq) { -if (bp) { -ktime_t end_time =ktime_add (start_time, bp); -ktime_t now =net_to_ktime (busy_loop_current_time ()); - -return ktime_after (now, end_time); - } - -return true; +if (!iowq->napi_busy_poll_dt) +return true; +return ktime_after (net_to_ktime (busy_loop_current_time ()), + iowq->napi_busy_poll_end); } +/* Uses an absolute deadline, so the napi loop can be re-entered */ static bool io_napi_busy_loop_should_end (void *data,unsigned long start_time) {
@@ -150,8 +146,7 @@ static bool io_napi_busy_loop_should_end(void *data,return true;if (io_should_wake (iowq) ||io_has_work (iowq->ctx))return true; -if (io_napi_busy_loop_timeout (net_to_ktime (start_time), - iowq->napi_busy_poll_dt)) +if (io_napi_busy_loop_timeout (iowq))return true;return false;
@@ -204,13 +199,16 @@ __io_napi_do_busy_loop(struct io_ring_ctx *ctx,static void io_napi_blocking_busy_loop (struct io_ring_ctx *ctx,struct io_wait_queue *iowq) { -unsigned long start_time =busy_loop_current_time (); +ktime_t now =net_to_ktime (busy_loop_current_time ());bool (*loop_end)(void *,unsigned long ) =NULL ;void *loop_end_arg =NULL ;bool is_stale = false; -/* Singular lists use a different napi loop end check function and are -* only executed once. + iowq->napi_busy_poll_end =ktime_add (now, iowq->napi_busy_poll_dt); + +/* +* A single NAPI is held by __napi_busy_loop() for the whole spin. It +* may return early on need_resched(), loop until our own deadline. */ if (list_is_singular (&ctx->napi_list)) { loop_end = io_napi_busy_loop_should_end;
@@ -221,8 +219,7 @@ static void io_napi_blocking_busy_loop(struct io_ring_ctx *ctx,do { is_stale =__io_napi_do_busy_loop (ctx, loop_end, loop_end_arg); - }while (!io_napi_busy_loop_should_end (iowq, start_time) && - !loop_end_arg); + }while (!io_napi_busy_loop_should_end (iowq,0 )); }io_napi_remove_stale (ctx, is_stale);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 44/990 io_uring: fail soft links on negative IOU_COMPLETE results
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiuwei <[email protected]>
Commit 9ed19503a7b34e1ffb2b81236843204c473b0ae0 upstream.
Handlers such as fsync return IOU_COMPLETE with a negative cqe.res. The old io_req_complete() path called req_set_fail() for res < 0. After completions moved into the core, that check was dropped, so IOSQE_IO_LINK dependents kept running after the head failed.
--- io_uring/io_uring.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
io_uring/io_uring.c +5 -3
@@ -1971,9 +1971,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags) ret =__io_issue_sqe (req, issue_flags, def);if (ret ==IOU_COMPLETE ) { -/* not all handlers take care of the internal restart codes */ -if (unlikely (req->cqe.res <= -ERESTARTSYS )) - req->cqe.res =io_fixup_restart_res (req->cqe.res); +if (unlikely (req->cqe.res <0 )) { +if (req->cqe.res <= -ERESTARTSYS ) + req->cqe.res =io_fixup_restart_res (req->cqe.res); +req_set_fail (req); + }if (issue_flags &IO_URING_F_COMPLETE_DEFER )io_req_complete_defer (req);else
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 45/990 io_uring/futex: fail soft links when cancelling a wait
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiuwei <[email protected]>
Commit 9a7cbe50dd95594d6fb3c57b8454ace58d8d8d0a upstream.
__io_futex_cancel() completes the request with -ECANCELED but does not call req_set_fail(). IOSQE_IO_LINK dependents then still run.
--- io_uring/futex.c | 1 + 1 file changed, 1 insertion(+)
io_uring/futex.c +1 -0
@@ -104,6 +104,7 @@ static bool __io_futex_cancel(struct io_kiocb *req) }hlist_del_init (&req->hash_node); +req_set_fail (req);io_req_set_res (req, -ECANCELED ,0 );io_req_task_work_add (req);return true;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 46/990 io_uring/rw: fail soft links on IOPOLL short or error IO
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiuwei <[email protected]>
Commit 4d3db66c5363dcf42c3d43ebaea330ac2d1888bb upstream.
io_complete_rw_iopoll() updates cqe.res when the transfer does not match the requested length, but it does not call req_set_fail(). Soft linked requests then still run after a short or failed IOPOLL read or write.
--- io_uring/rw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/rw.c +3 -1
@@ -618,8 +618,10 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)if (res == -EAGAIN &&io_rw_should_reissue (req)) req->flags |=REQ_F_REISSUE |REQ_F_BL_NO_RECYCLE ; -else if (unlikely (final_res != req->cqe.res)) +else if (unlikely (final_res != req->cqe.res)) { +req_set_fail (req); req->cqe.res = final_res; + }/* order with io_iopoll_complete() checking ->iopoll_completed */ smp_store_release (&req->iopoll_completed,1 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 47/990 io_uring/timeout: dont rearm a multishot timeout on cancel
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <[email protected]>
Commit 97d4a585db2b91d855f957be0a9f126068c5be93 upstream.
io_timeout_complete() does not check tw.cancel. When it runs from io_cancel_local_task_work(), a multishot timeout that has not reached its count still posts an IORING_CQE_F_MORE completion and rearms its timer. With a zero interval the timer expires again right away and queues new task work, so the drain keeps running it until posting a CQE fails.
Normally the CQ fills up quickly and the request then completes. But if userspace moves the CQ head far ahead of the tail, for example to cq.tail + 0x7fffffff, posting keeps succeeding and ring teardown is delayed for a long time.
Don't post another CQE or rearm the timer when tw.cancel is set, so the request completes through io_req_task_complete(), like the poll and linked timeout task work does when cancelled.
--- io_uring/timeout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/timeout.c +2 -1
@@ -76,7 +76,8 @@ static void io_timeout_complete(struct io_tw_req tw_req, io_tw_token_t tw)struct io_ring_ctx *ctx = req->ctx;if (!io_timeout_finish (timeout, data)) { -if (io_req_post_cqe (req, -ETIME ,IORING_CQE_F_MORE )) { +if (!tw.cancel && +io_req_post_cqe (req, -ETIME ,IORING_CQE_F_MORE )) {/* re-arm timer */ raw_spin_lock_irq (&ctx->timeout_lock);list_add (&timeout->list, ctx->timeout_list.prev);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 48/990 io_uring/rsrc: keep the old file when a file update fails
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <[email protected]>
Commit e5a346e4309d720c47fe8331a00068608fad47dd upstream.
__io_sqe_files_update() resets the slot before it calls fget() on the new fd. If fget() fails, the fd is an io_uring file, or the node allocation fails, the update stops and reports that entry as not done, but the old file has already been removed. Later requests that use the slot fail with -EBADF, and if the old file was registered with a tag, its tag CQE is posted as if it had been removed on purpose.
Reset the slot only after the new file has been checked and its node allocated, as io_install_fixed_file() does. Removal with fd == -1 still resets the slot right away.
[axboe: 6.18 doesn't clamp the slot index with array_index_nospec() in this function]
--- io_uring/rsrc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
io_uring/rsrc.c +4 -3
@@ -237,9 +237,6 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,continue ; i = up->offset + done; -if (io_reset_rsrc_node (ctx, &ctx->file_table.data, i)) -io_file_bitmap_clear (&ctx->file_table, i); -if (fd !=-1 ) {struct file *file =fget (fd);struct io_rsrc_node *node;
@@ -262,11 +259,15 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,fput (file);break ; } +if (io_reset_rsrc_node (ctx, &ctx->file_table.data, i)) +io_file_bitmap_clear (&ctx->file_table, i); ctx->file_table.data.nodes[i] = node;if (tag) node->tag = tag;io_fixed_file_set (node, file);io_file_bitmap_set (&ctx->file_table, i); + }else if (io_reset_rsrc_node (ctx, &ctx->file_table.data, i)) { +io_file_bitmap_clear (&ctx->file_table, i); } }return done ? done : err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 49/990 io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Siddharth Chintamaneni <[email protected]>
Commit b7322810d1870ccc0d293ad383d94ef583d5057b upstream.
io_buffers_select() passes &arg->out_len to io_provided_buffers_select() on the legacy provided-buffer path. Because callers initialize arg->max_len (from sqe->len) while leaving arg->out_len as 0, io_provided_buffers_select() sees *len == 0 and always selects the full buffer size buf->len, ignoring the user-specified sqe->len limit.
Initialize arg->out_len = arg->max_len before calling io_provided_buffers_select().
--- io_uring/kbuf.c | 1 + 1 file changed, 1 insertion(+)
io_uring/kbuf.c +1 -0
@@ -355,6 +355,7 @@ int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg, req->flags |=REQ_F_BUF_MORE ; } }else { + arg->out_len = arg->max_len; ret =io_provided_buffers_select (req, &arg->out_len, sel->buf_list, arg->iovs); } out_unlock:
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 50/990 io_uring/io-wq: apply the current cpuset to new workers
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Malyshev <[email protected]>
Commit 0659e44ce739ecd856164c75a5325b7959a2921d upstream.
Since commit 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in io worker"), io_wq_create() copies the cpuset of the creating task into wq->cpu_mask, and io_init_new_worker() gives each new worker that copy. A cpuset change, or a move of the task to another cgroup, updates the workers that exist but not the copy, so workers started later run on the CPUs the cgroup had when the io-wq was created, which may since have been given to other tasks. Workers come and go for the life of the io-wq, and a worker that cpuset moved is also retired at its next idle timeout and replaced on the old CPUs.
Keep wq->cpu_mask for the affinity of the io-wq itself, all CPUs or the mask set with IORING_REGISTER_IOWQ_AFF, and intersect it with the cpuset of the worker when the worker starts, falling back to the cpuset if the two do not intersect, as __set_cpus_allowed_ptr() does. Use the same mask in the idle exit test, and go back to all CPUs when the registered affinity is removed.
--- io_uring/io-wq.c | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-)
io_uring/io-wq.c +39 -5
@@ -731,6 +731,34 @@ static bool io_worker_retire(struct io_wq_acct *acct, struct io_worker *worker)return false; } +/* +* The CPUs a worker of @wq runs on: those of the io-wq affinity that the +* worker's cpuset allows, or the cpuset if they have none in common, as the +* scheduler does with a task's requested affinity when its cpuset changes. +* Read the cpuset each time: it can change while the io-wq exists. +*/ +static void io_wq_worker_cpus (struct io_wq *wq,struct task_struct *tsk, +struct cpumask *cpus) +{ +cpuset_cpus_allowed (tsk, cpus); +if (cpumask_intersects (cpus, wq->cpu_mask)) +cpumask_and (cpus, cpus, wq->cpu_mask); +} + +/* Is the current worker on a CPU that a new worker would not get? */ +static bool io_wq_worker_off_cpus (struct io_wq *wq) +{ +cpumask_var_t cpus; +bool off; + +if (!alloc_cpumask_var (&cpus,GFP_KERNEL )) +return false; +io_wq_worker_cpus (wq, current, cpus); + off = !cpumask_test_cpu (raw_smp_processor_id (), cpus); +free_cpumask_var (cpus); +return off; +} +static int io_wq_worker (void *data) {struct io_worker *worker = data;
@@ -809,8 +837,7 @@ static int io_wq_worker(void *data) }if (!ret) { last_timeout = true; - exit_mask = !cpumask_test_cpu (raw_smp_processor_id (), - wq->cpu_mask); + exit_mask =io_wq_worker_off_cpus (wq); } }
@@ -860,9 +887,16 @@ void io_wq_worker_sleeping(struct task_struct *tsk)static void io_init_new_worker (struct io_wq *wq,struct io_wq_acct *acct,struct io_worker *worker,struct task_struct *tsk) { +cpumask_var_t cpus; + tsk->worker_private = worker; worker->task = tsk; -set_cpus_allowed_ptr (tsk, wq->cpu_mask); +/* Without a mask, the worker keeps its creator's CPUs. */ +if (alloc_cpumask_var (&cpus,GFP_KERNEL )) { +io_wq_worker_cpus (wq, tsk, cpus); +set_cpus_allowed_ptr (tsk, cpus); +free_cpumask_var (cpus); + }raw_spin_lock (&acct->workers_lock);hlist_nulls_add_head_rcu (&worker->nulls_node, &acct->free_list);
@@ -1361,7 +1395,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)if (!alloc_cpumask_var (&wq->cpu_mask,GFP_KERNEL )) goto err; -cpuset_cpus_allowed (data->task, wq->cpu_mask); +cpumask_copy (wq->cpu_mask, cpu_possible_mask); wq->acct[IO_WQ_ACCT_BOUND ].max_workers = bounded; wq->acct[IO_WQ_ACCT_UNBOUND ].max_workers =task_rlimit (current,RLIMIT_NPROC );
@@ -1545,7 +1579,7 @@ int io_wq_cpu_affinity(struct io_uring_task *tctx, cpumask_var_t mask)else ret = -EINVAL ; }else { -cpumask_copy (tctx->io_wq->cpu_mask, allowed_mask); +cpumask_copy (tctx->io_wq->cpu_mask, cpu_possible_mask); }rcu_read_unlock ();
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 51/990 bnxt_en: Take RTNL before netif_close() when aborting FW reset
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryan Cochrane <[email protected]>
commit bf83b257423bb557b970df3d7ece32fbd85f3bd4 upstream.
netif_close() must be called with RTNL held in addition to the netdev instance lock: __dev_close_many() asserts it, and the NETDEV_GOING_DOWN and NETDEV_DOWN notifier chains it runs rely on it for serialization.
Commit 004b5008016a ("eth: bnxt: remove most dependencies on RTNL") replaced rtnl_lock() with netdev_lock() in bnxt_fw_reset_task() and bnxt_fw_reset(). That is sufficient for the paths that only tear the NIC down internally with __bnxt_close_nic(), but the abort paths close the netdev via bnxt_fw_reset_abort() -> netif_close(), and the error path in bnxt_fw_reset() calls netif_close() directly. Those now run without RTNL and trigger a WARN_ONCE() cascade when a firmware reset is aborted:
RTNL: assertion failed at net/core/dev.c (1740)
WARNING: net/core/dev.c:1740 at __dev_close_many+0x1be/0x1f0 Workqueue: bnxt_pf_wq bnxt_fw_reset_task [bnxt_en] Call Trace: netif_close_many+0xb5/0x190 netif_close+0xa2/0xd0 bnxt_fw_reset_task.cold+0x8d/0x213 [bnxt_en] process_one_work+0x19d/0x3a0 worker_thread+0x1af/0x320 kthread+0xe3/0x120
followed by the same assertion from call_netdevice_notifiers_info(), fib_rules_event(), inetdev_event(), rtnl_fill_ifinfo(), devlink_compat_phys_port_name_get() and ip_mc_down().
This was observed on a machine in real use with a BCM57504 (4 PFs, FW 236.1.153.0) running v7.1.6: the firmware crashed, announced a "Fatal firmware reset event" and then failed to come back within the advertised max wait, so bnxt_fw_reset_task() aborted the reset on all ports:
bnxt_en 0000:c1:00.1 eno16905np1: Firmware reset aborted bnxt_en 0000:c1:00.1 eno16905np1: fw_health_status 0x448100
Take RTNL (before the netdev instance lock, matching the OPENING state which already uses rtnl_trylock()) in the fw_reset_abort path of bnxt_fw_reset_task() and route the POLL_VF abort through that same path.
In bnxt_fw_reset(), only a PF can reach the bnxt_get_registered_vfs() error path that calls netif_close(), so take RTNL up front via bnxt_rtnl_lock_sp() when BNXT_PF(bp) is true and keep bnxt_lock_sp() on VFs. That avoids dropping the instance lock mid-reset (which would expose a transient BNXT_STATE_IN_FW_RESET and let a concurrent devlink health recover set BNXT_STATE_IN_SP_TASK), avoids racing with bnxt_sriov_configure() updating active_vfs outside RTNL, and keeps VFs from contending on RTNL during recovery while PFs already run on the single-threaded bnxt_pf_wq.
The bug was found by inspecting the kernel log of the affected machine and the driver source; the fix was prepared with the help of an AI coding assistant (Gemini based) and reviewed by the submitter. It is build tested (allmodconfig with W=1, plus the same change on top of v7.1.6 built as a module for the affected BCM57504 host). The aborted reset path itself only runs when the firmware fails to return from a reset, which could not be reproduced on demand.
[ bcochrane: backport to 6.18.y: 6.18 lacks bnxt_lock_sp() and
bnxt_unlock_sp(), so keep the existing inline BNXT_STATE_IN_SP_TASK + netdev_lock()/netdev_unlock() on the VF branch of bnxt_fw_reset() while using the existing bnxt_rtnl_lock_sp() / bnxt_rtnl_unlock_sp() on PFs. ]
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +15 -6
@@ -14567,8 +14567,12 @@ static int bnxt_get_registered_vfs(struct bnxt *bp)void bnxt_fw_reset (struct bnxt *bp) {bnxt_ulp_stop (bp); -clear_bit (BNXT_STATE_IN_SP_TASK , &bp->state); -netdev_lock (bp->dev); +if (BNXT_PF (bp)) { +bnxt_rtnl_lock_sp (bp); + }else { +clear_bit (BNXT_STATE_IN_SP_TASK , &bp->state); +netdev_lock (bp->dev); + }if (test_bit (BNXT_STATE_OPEN , &bp->state) && !test_bit (BNXT_STATE_IN_FW_RESET , &bp->state)) {struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
@@ -14614,8 +14618,12 @@ void bnxt_fw_reset(struct bnxt *bp)bnxt_queue_fw_reset_work (bp, tmo); } fw_reset_exit: -set_bit (BNXT_STATE_IN_SP_TASK , &bp->state); -netdev_unlock (bp->dev); +if (BNXT_PF (bp)) { +bnxt_rtnl_unlock_sp (bp); + }else { +set_bit (BNXT_STATE_IN_SP_TASK , &bp->state); +netdev_unlock (bp->dev); + } }static void bnxt_chk_missed_irq (struct bnxt *bp)
@@ -15268,9 +15276,8 @@ static void bnxt_fw_reset_task(struct work_struct *work) bp->fw_reset_timestamp = jiffies;netdev_lock (bp->dev);if (test_bit (BNXT_STATE_ABORT_ERR , &bp->state)) { -bnxt_fw_reset_abort (bp, rc);netdev_unlock (bp->dev); - goto ulp_start; + goto fw_reset_abort; }bnxt_fw_reset_close (bp);if (bp->fw_cap &BNXT_FW_CAP_ERR_RECOVER_RELOAD ) {
@@ -15403,9 +15410,11 @@ static void bnxt_fw_reset_task(struct work_struct *work)netdev_err (bp->dev,"fw_health_status 0x%x\n" , sts); } fw_reset_abort: +rtnl_lock ();netdev_lock (bp->dev);bnxt_fw_reset_abort (bp, rc);netdev_unlock (bp->dev); +rtnl_unlock (); ulp_start:if (!rc)bnxt_ulp_start (bp);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 52/990 bpqether: reserve the Ethernet devices own header room on transmit
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
bpq_xmit() makes sure the frame has AX25_BPQ_HEADER_LEN (16) bytes of headroom, then pushes the two length bytes and lets dev_hard_header() of the underlying device build the link layer header. That covers a plain Ethernet header, but not a longer one.
A VLAN device on top of an Ethernet device that cannot insert the tag in hardware, with reorder_hdr turned off, pushes an 18 byte header (VLAN tag, then the Ethernet header). A UI frame sent from an AX.25 datagram socket with 8 digipeaters reaches bpq_xmit() with 17 bytes of headroom once the KISS byte is dropped: skb_cow() leaves it alone, 15 bytes remain after the length bytes, and eth_header() underflows the skb:
skbuff: skb_under_panic: ... len:101 put:14 ... dev:eth0.5 kernel BUG at net/core/skbuff.c:209!
Call Trace: eth_header vlan_dev_hard_header dev_hard_start_xmit __dev_queue_xmit ax25_sendmsg __sys_sendto
No privilege is needed to open and bind such a socket, so any local user can crash a host that runs bpqether over this kind of VLAN.
Look up the Ethernet device first and ask skb_cow() for LL_RESERVED_SPACE() of that device plus the two length bytes.
Tested in a QEMU guest (6.12.94, KASAN) with bpq devices on eth0, on eth0.6 (reorder_hdr on) and on eth0.5 (reorder_hdr off), eth0 being a virtio-net port without VLAN tag insertion: UI frames with 0, 7 and 8 digipeaters on each. Before the change the 8 digipeater frame on eth0.5 panicked the guest with 15 bytes of headroom left; after it, 79 bytes are left and all frames are sent, with no kernel report.
--- drivers/net/hamradio/bpqether.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/net/hamradio/bpqether.c +14 -11
@@ -237,12 +237,24 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev)skb_pull (skb,1 );/* Drop KISS byte */ size = skb->len; + bpq =netdev_priv (dev); + + orig_dev = dev; + dev =bpq_get_ether_dev (dev); +if (!dev) { + orig_dev->stats.tx_dropped++; +kfree_skb (skb); +return NETDEV_TX_OK ; + } +/* * We're about to mess with the skb which may still shared with the * generic networking code so unshare and ensure it's got enough -* space for the BPQ headers. +* space for the length bytes and for the link layer header of the +* Ethernet device. That header can be longer than an Ethernet +* header, e.g. on a VLAN device that inserts the tag itself. */ -if (skb_cow (skb,AX25_BPQ_HEADER_LEN )) { +if (skb_cow (skb,LL_RESERVED_SPACE (dev) +2 )) {if (net_ratelimit ())pr_err ("bpqether: out of memory\n" );kfree_skb (skb);
@@ -255,15 +267,6 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev) *ptr++ = (size +5 ) %256 ; *ptr++ = (size +5 ) /256 ; - bpq =netdev_priv (dev); - - orig_dev = dev; -if ((dev =bpq_get_ether_dev (dev)) ==NULL ) { - orig_dev->stats.tx_dropped++; -kfree_skb (skb); -return NETDEV_TX_OK ; - } - skb->protocol =ax25_type_trans (skb, dev);skb_reset_network_header (skb);dev_hard_header (skb, dev,ETH_P_BPQ , bpq->dest_addr,NULL ,0 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 53/990 bpqether: set both addresses or none in SIOCSBPQETHADDR
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
SIOCSBPQETHADDR copies the destination address straight into the device, then the accepted source address. When the second copy faults, the ioctl returns -EFAULT but the destination address has already been changed, and copy_from_user() has zero-filled the part of the accepted address it could not read.
With the accepted address left as 00:00:00:00:00:00, bpq_rcv() drops every frame whose source is not that address: the device silently stops receiving although the ioctl reported a failure.
Copy the whole struct bpq_ethaddr to the stack first and only update the device once it has been read in full.
Tested in a QEMU guest (6.12.94, KASAN) by placing the struct so that its accept field falls in an unmapped page. Before the change /proc/net/bpqether showed the new destination and an accepted address of 00:00:00:00:00:00 after the -EFAULT; after it, both addresses are unchanged, and a valid call still sets them.
--- drivers/net/hamradio/bpqether.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/hamradio/bpqether.c +4 -4
@@ -299,8 +299,8 @@ static int bpq_set_mac_address(struct net_device *dev, void *addr)static int bpq_siocdevprivate (struct net_device *dev,struct ifreq *ifr,void __user *data,int cmd) { -struct bpq_ethaddr __user *ethaddr = data;struct bpqdev *bpq =netdev_priv (dev); +struct bpq_ethaddr ethaddr;struct bpq_req req;if (!capable (CAP_NET_ADMIN ))
@@ -320,10 +320,10 @@ static int bpq_siocdevprivate(struct net_device *dev, struct ifreq *ifr,break ;case SIOCSBPQETHADDR : -if (copy_from_user (bpq->dest_addr, ethaddr->destination,ETH_ALEN )) -return -EFAULT ; -if (copy_from_user (bpq->acpt_addr, ethaddr->accept,ETH_ALEN )) +if (copy_from_user (ðaddr, data,sizeof (ethaddr)))return -EFAULT ; +memcpy (bpq->dest_addr, ethaddr.destination,ETH_ALEN ); +memcpy (bpq->acpt_addr, ethaddr.accept,ETH_ALEN );break ;default :
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 54/990 bpqether: keep a bpq device in step with its Ethernet device
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <[email protected]>
When the Ethernet device goes down, bpq_device_event() closes the bpq device on top of it. Two things are left over:
- bpq_open() does not look at the Ethernet device, so the bpq device can be brought up again while the Ethernet device is still down. Every frame sent then counts in the bpq device's tx_packets while the Ethernet device drops it.
- when the Ethernet device comes back up, the bpq device stays down and the AX.25 port has to be brought up again by hand.
Refuse to open a bpq device whose Ethernet device is not running, with -ENETDOWN. Remember that a bpq device was closed because its Ethernet device went down, and open it again on NETDEV_UP. A bpq device that was already down, e.g. closed by the administrator, is left alone.
Tested in a QEMU guest (6.12.94, KASAN) with e1000 ports:
- bpq2 brought up with eth2 down: accepted before, and 5 frames counted in tx_packets of bpq2 while eth2 dropped them; -ENETDOWN after, nothing counted;
- eth3 down then up: bpq3 stayed down before, is up again after;
- bpq1 closed by hand, then eth1 down and up: bpq1 stays down, before and after.
No kernel report in either case.
--- drivers/net/hamradio/bpqether.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-)
drivers/net/hamradio/bpqether.c +25 -4
@@ -104,6 +104,7 @@ struct bpqdev {struct net_device *axdev;/* bpq device (bpq#) */ char dest_addr[6 ];/* ether destination address */ char acpt_addr[6 ];/* accept ether frames from this address only */ +bool reopen;/* closed because the ether device went down */ };static LIST_HEAD (bpq_devices);
@@ -338,6 +339,11 @@ static int bpq_siocdevprivate(struct net_device *dev, struct ifreq *ifr,*/ static int bpq_open (struct net_device *dev) { +struct bpqdev *bpq =netdev_priv (dev); + +if (!netif_running (bpq->ethdev)) +return -ENETDOWN ; +netif_start_queue (dev);return 0 ; }
@@ -513,6 +519,8 @@ static int bpq_device_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); +struct net_device *axdev; +struct bpqdev *bpq;if (!net_eq (dev_net (dev), &init_net))return NOTIFY_DONE ;
@@ -521,14 +529,27 @@ static int bpq_device_event(struct notifier_block *this,return NOTIFY_DONE ;switch (event) { -case NETDEV_UP :/* new ethernet device -> new BPQ interface */ -if (bpq_get_ax25_dev (dev) ==NULL ) +case NETDEV_UP : + axdev =bpq_get_ax25_dev (dev); +if (!axdev) {/* new ethernet device -> new BPQ interface */ bpq_new_device (dev); +break ; + } +/* reopen a BPQ interface closed when the device went down */ + bpq =netdev_priv (axdev); +if (bpq->reopen) { + bpq->reopen = false; +dev_open (axdev,NULL ); + }break ;case NETDEV_DOWN :/* ethernet device closed -> close BPQ interface */ -if ((dev =bpq_get_ax25_dev (dev)) !=NULL ) -dev_close (dev); + axdev =bpq_get_ax25_dev (dev); +if (axdev &&netif_running (axdev)) { +dev_close (axdev); + bpq =netdev_priv (axdev); + bpq->reopen = true; + }break ;case NETDEV_UNREGISTER :/* ethernet device removed -> free BPQ interface */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 55/990 Input: destroy force-feedback device on input unregistration
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
[ Upstream commit 2ae35f090d029d2d8491b0a7f98a04c5c05d0a44 ]
When an input device is unregistered while userspace holds an open file descriptor to its event node, input_dev_release() is deferred until the last file descriptor is closed. Because input_ff_destroy() was only called from input_dev_release(), force-feedback teardown (ff->destroy and freeing ff->private) could run after the parent driver had already unbound, freed its device state, or even been unloaded via rmmod, causing use-after-free errors or page faults in unmapped module text.
Commit ef166ce08801 ("Input: stop force-feedback timer when unregistering input devices") added a separate ff->stop callback for ff-memless, but left ff->destroy invoked from input_dev_release().
Once __input_unregister_device() has disconnected all input handlers (which flushes effects, closes the device, and marks evdev dead) and deleted the device from sysfs, nothing accesses dev->ff anymore. Call input_ff_destroy() directly in __input_unregister_device() so that ff->destroy() always runs synchronously while the driver and its module are still active, and remove the now-redundant ff->stop callback. Keep input_ff_destroy() in input_dev_release() (where it is a no-op once dev->ff is NULL) to handle input_free_device() on devices that were never registered.
--- drivers/input/ff-core.c | 2 +- drivers/input/ff-memless.c | 10 +--------- drivers/input/input.c | 2 ++ 3 files changed, 4 insertions(+), 10 deletions(-)
drivers/input/ff-core.c +1 -1
@@ -339,7 +339,7 @@ EXPORT_SYMBOL_GPL(input_ff_create);* * This function is only needed in error path as input core will * automatically free force feedback structures when device is -* destroyed. +* unregistered or destroyed. */ void input_ff_destroy (struct input_dev *dev) {
drivers/input/ff-memless.c +1 -9
@@ -483,15 +483,7 @@ static void ml_ff_destroy(struct ff_device *ff) {struct ml_device *ml = ff->private; -/* -* Even though we stop all playing effects when tearing down -* an input device (via input_device_flush() that calls into -* input_ff_flush() that stops and erases all effects), we -* do not actually stop the timer, and therefore we should -* do it here. -*/ -timer_delete_sync (&ml->timer); - +timer_shutdown_sync (&ml->timer);kfree (ml->private); }
drivers/input/input.c +2 -0
@@ -2196,6 +2196,8 @@ static void __input_unregister_device(struct input_dev *dev) }device_del (&dev->dev); + +input_ff_destroy (dev); }static void devm_input_device_unregister (struct device *dev,void *res)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 56/990 staging: media: atomisp: use array3_size() for overflow-safe allocation
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Ning <[email protected]>
commit d178c7ca8fefc28115d35b94c3b1f4d653e34182 upstream.
Replace open-coded width * height * sizeof() multiplications with array3_size() to prevent integer overflow in buffer allocations.
The atomisp driver computes DVS, morphing table, shading table and statistics buffer sizes using unchecked arithmetic. When dimensions are attacker-controlled or simply large, the product can silently wrap, causing kvmalloc() to allocate an undersized buffer.
array3_size() saturates to SIZE_MAX on overflow, so kvmalloc() returns NULL instead of succeeding with too few bytes.
--- .../media/atomisp/pci/sh_css_param_dvs.c | 11 +++--- .../media/atomisp/pci/sh_css_param_shading.c | 4 ++- .../staging/media/atomisp/pci/sh_css_params.c | 35 +++++++++++-------- 3 files changed, 31 insertions(+), 19 deletions(-)
drivers/staging/media/atomisp/pci/sh_css_param_dvs.c +7 -4
@@ -4,6 +4,7 @@* Copyright (c) 2015, Intel Corporation. */ +#include <linux/overflow.h> #include "sh_css_param_dvs.h" #include <assert_support.h> #include <type_support.h>
@@ -49,7 +50,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res, }/* Generate Y buffers */ - dvs_config->xcoords_y =kvmalloc (width_y * height_y *sizeof (uint32_t ), + dvs_config->xcoords_y =kvmalloc (array3_size (width_y, height_y,sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->xcoords_y) {IA_CSS_ERROR ("out of memory" );
@@ -57,7 +58,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res, goto exit; } - dvs_config->ycoords_y =kvmalloc (width_y * height_y *sizeof (uint32_t ), + dvs_config->ycoords_y =kvmalloc (array3_size (width_y, height_y,sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->ycoords_y) {IA_CSS_ERROR ("out of memory" );
@@ -68,7 +69,8 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,/* Generate UV buffers */ IA_CSS_LOG ("UV W %d H %d" , width_uv, height_uv); - dvs_config->xcoords_uv =kvmalloc (width_uv * height_uv *sizeof (uint32_t ), + dvs_config->xcoords_uv =kvmalloc (array3_size (width_uv, height_uv, +sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->xcoords_uv) {IA_CSS_ERROR ("out of memory" );
@@ -76,7 +78,8 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res, goto exit; } - dvs_config->ycoords_uv =kvmalloc (width_uv * height_uv *sizeof (uint32_t ), + dvs_config->ycoords_uv =kvmalloc (array3_size (width_uv, height_uv, +sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->ycoords_uv) {IA_CSS_ERROR ("out of memory" );
drivers/staging/media/atomisp/pci/sh_css_param_shading.c +3 -1
@@ -4,6 +4,7 @@* Copyright (c) 2015, Intel Corporation. */ +#include <linux/overflow.h> #include <linux/math.h> #include <linux/slab.h>
@@ -339,7 +340,8 @@ ia_css_shading_table_alloc( me->fraction_bits =0 ;for (i =0 ; i <IA_CSS_SC_NUM_COLORS ; i++) { me->data[i] = -kvmalloc (width * height *sizeof (*me->data[0 ]), +kvmalloc (array3_size (width, height, +sizeof (*me->data[0 ])),GFP_KERNEL );if (!me->data[i]) {unsigned int j;
drivers/staging/media/atomisp/pci/sh_css_params.c +21 -14
@@ -4,6 +4,7 @@* Copyright (c) 2015, Intel Corporation. */ +#include <linux/overflow.h> #include <linux/math.h> #include "gdc_device.h" /* gdc_lut_store(), ... */
@@ -1381,11 +1382,11 @@ struct ia_css_morph_table *ia_css_morph_table_allocate( }for (i =0 ; i <IA_CSS_MORPH_TABLE_NUM_PLANES ; i++) { - me->coordinates_x[i] =kvmalloc (height * width * -sizeof (*me->coordinates_x[i]), + me->coordinates_x[i] =kvmalloc (array3_size (height, width, +sizeof (*me->coordinates_x[i])),GFP_KERNEL ); - me->coordinates_y[i] =kvmalloc (height * width * -sizeof (*me->coordinates_y[i]), + me->coordinates_y[i] =kvmalloc (array3_size (height, width, +sizeof (*me->coordinates_y[i])),GFP_KERNEL ); if ((!me->coordinates_x[i]) ||
@@ -4206,13 +4207,17 @@ ia_css_dvs_statistics_allocate(const struct ia_css_dvs_grid_info *grid) goto err; me->grid = *grid; - me->hor_proj =kvmalloc (grid->height *IA_CSS_DVS_NUM_COEF_TYPES * -sizeof (*me->hor_proj),GFP_KERNEL ); + me->hor_proj =kvmalloc (array3_size (grid->height, +IA_CSS_DVS_NUM_COEF_TYPES , +sizeof (*me->hor_proj)), +GFP_KERNEL );if (!me->hor_proj) goto err; - me->ver_proj =kvmalloc (grid->width *IA_CSS_DVS_NUM_COEF_TYPES * -sizeof (*me->ver_proj),GFP_KERNEL ); + me->ver_proj =kvmalloc (array3_size (grid->width, +IA_CSS_DVS_NUM_COEF_TYPES , +sizeof (*me->ver_proj)), +GFP_KERNEL );if (!me->ver_proj) goto err;
@@ -4479,24 +4484,26 @@ ia_css_dvs2_6axis_config_allocate(const struct ia_css_stream *stream) params->pipe_dvs_6axis_config[IA_CSS_PIPE_ID_VIDEO ]->height_uv;IA_CSS_LOG ("table Y: W %d H %d" , width_y, height_y);IA_CSS_LOG ("table UV: W %d H %d" , width_uv, height_uv); - dvs_config->xcoords_y =kvmalloc (width_y * height_y *sizeof (uint32_t ), + dvs_config->xcoords_y =kvmalloc (array3_size (width_y, height_y, +sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->xcoords_y) goto err; - dvs_config->ycoords_y =kvmalloc (width_y * height_y *sizeof (uint32_t ), + dvs_config->ycoords_y =kvmalloc (array3_size (width_y, height_y, +sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->ycoords_y) goto err; - dvs_config->xcoords_uv =kvmalloc (width_uv * height_uv * -sizeof (uint32_t ), + dvs_config->xcoords_uv =kvmalloc (array3_size (width_uv, height_uv, +sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->xcoords_uv) goto err; - dvs_config->ycoords_uv =kvmalloc (width_uv * height_uv * -sizeof (uint32_t ), + dvs_config->ycoords_uv =kvmalloc (array3_size (width_uv, height_uv, +sizeof (uint32_t )),GFP_KERNEL );if (!dvs_config->ycoords_uv) goto err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 57/990 wifi: rtw89: usb: Avoid crash with dynamically added device ID
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
[ Upstream commit b1827227176821af9bba0cb643728d23328f3660 ]
Adding a device ID via sysfs causes a crash when the device is plugged in, because the driver_info pointer is null.
Check for null driver_info in rtw89_usb_probe() and add a wrapper in each driver to pass it a reasonable default value.
[ Dropped the hunks for rtw8852au.c, rtw8852cu.c and rtw8922au.c,
these drivers are not in 6.18. ]
--- drivers/net/wireless/realtek/rtw89/rtw8851bu.c | 8 +++++++- drivers/net/wireless/realtek/rtw89/rtw8852bu.c | 8 +++++++- drivers/net/wireless/realtek/rtw89/usb.c | 5 ++++- drivers/net/wireless/realtek/rtw89/usb.h | 3 ++- 4 files changed, 20 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/rtw8851bu.c +7 -1
@@ -32,10 +32,16 @@ static const struct usb_device_id rtw_8851bu_id_table[] = { };MODULE_DEVICE_TABLE (usb, rtw_8851bu_id_table); +static int rtw8851bu_probe (struct usb_interface *intf, +const struct usb_device_id *id) +{ +return rtw89_usb_probe (intf, id, &rtw89_8851bu_info); +} +static struct usb_driver rtw_8851bu_driver = { .name =KBUILD_MODNAME , .id_table = rtw_8851bu_id_table, - .probe = rtw89_usb_probe, + .probe = rtw8851bu_probe, .disconnect = rtw89_usb_disconnect, };module_usb_driver (rtw_8851bu_driver);
drivers/net/wireless/realtek/rtw89/rtw8852bu.c +7 -1
@@ -46,10 +46,16 @@ static const struct usb_device_id rtw_8852bu_id_table[] = { };MODULE_DEVICE_TABLE (usb, rtw_8852bu_id_table); +static int rtw8852bu_probe (struct usb_interface *intf, +const struct usb_device_id *id) +{ +return rtw89_usb_probe (intf, id, &rtw89_8852bu_info); +} +static struct usb_driver rtw_8852bu_driver = { .name =KBUILD_MODNAME , .id_table = rtw_8852bu_id_table, - .probe = rtw89_usb_probe, + .probe = rtw8852bu_probe, .disconnect = rtw89_usb_disconnect, };module_usb_driver (rtw_8852bu_driver);
drivers/net/wireless/realtek/rtw89/usb.c +4 -1
@@ -931,7 +931,8 @@ static void rtw89_usb_intf_deinit(struct rtw89_dev *rtwdev, }int rtw89_usb_probe (struct usb_interface *intf, -const struct usb_device_id *id) +const struct usb_device_id *id, +const struct rtw89_driver_info *default_info) {const struct rtw89_driver_info *info;struct rtw89_dev *rtwdev;
@@ -939,6 +940,8 @@ int rtw89_usb_probe(struct usb_interface *intf,int ret; info = (const struct rtw89_driver_info *)id->driver_info; +if (!info) + info = default_info; rtwdev = rtw89_alloc_ieee80211_hw(&intf->dev, sizeof(struct rtw89_usb),
drivers/net/wireless/realtek/rtw89/usb.h +2 -1
@@ -59,7 +59,8 @@ static inline struct rtw89_usb *rtw89_usb_priv(struct rtw89_dev *rtwdev) }int rtw89_usb_probe (struct usb_interface *intf, -const struct usb_device_id *id); +const struct usb_device_id *id, +const struct rtw89_driver_info *default_info);void rtw89_usb_disconnect (struct usb_interface *intf);#endif
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 58/990 fs/fs_parse: add back fsparam_u32hex
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <[email protected]>
[ Upstream commit 695f2ca1b4247724576d57eae7b74b90dc69ba3c ]
296b67059 removed fsparam_u32hex because there were no callers (yet) and it didn't build due to using the nonexistent symbol fs_param_is_u32_hex.
fs/9p will need this parser, so add it back with the appropriate fix (use fs_param_is_u32).
Message-ID: <[email protected]>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
--- include/linux/fs_parser.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/fs_parser.h +2 -0
@@ -120,6 +120,8 @@ static inline bool fs_validate_description(const char *name,#define fsparam_u32 (NAME ,OPT ) __fsparam(fs_param_is_u32, NAME, OPT, 0, NULL)#define fsparam_u32oct (NAME ,OPT ) \ __fsparam(fs_param_is_u32, NAME, OPT, 0, (void *)8) +#define fsparam_u32hex (NAME ,OPT ) \ + __fsparam(fs_param_is_u32, NAME, OPT, 0, (void *)16)#define fsparam_s32 (NAME ,OPT ) __fsparam(fs_param_is_s32, NAME, OPT, 0, NULL)#define fsparam_u64 (NAME ,OPT ) __fsparam(fs_param_is_u64, NAME, OPT, 0, NULL)#define fsparam_enum (NAME ,OPT , array) __fsparam(fs_param_is_enum, NAME, OPT, 0, array)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 59/990 net/9p: move structures and macros to header files
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <[email protected]>
[ Upstream commit c44393d84149d6fc91d94fa39321c9657e91b388 ]
With the new mount API all option parsing will need to happen in fs/v9fs.c, so move some existing data structures and macros to header files to facilitate this. Rename some to reflect the transport they are used for (rdma, fd, etc), for clarity.
Message-ID: <[email protected]>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
--- include/net/9p/client.h | 6 ++++++ include/net/9p/transport.h | 39 ++++++++++++++++++++++++++++++++++++++ net/9p/client.c | 6 ------ net/9p/trans_fd.c | 20 ++----------------- net/9p/trans_rdma.c | 25 ++---------------------- 5 files changed, 49 insertions(+), 47 deletions(-)
include/net/9p/client.h +6 -0
@@ -16,6 +16,12 @@/* Number of requests per row */ #define P9_ROW_MAXTAG 255 +/* DEFAULT MSIZE = 32 pages worth of payload + P9_HDRSZ + +* room for write (16 extra) or read (11 extra) operands. +*/ + +#define DEFAULT_MSIZE ((128 * 1024) + P9_IOHDRSZ) +/** enum p9_proto_versions - 9P protocol versions * @p9_proto_legacy: 9P Legacy mode, pre-9P2000.u * @p9_proto_2000u: 9P2000.u extension
include/net/9p/transport.h +39 -0
@@ -14,6 +14,45 @@#define P9_DEF_MIN_RESVPORT (665U)#define P9_DEF_MAX_RESVPORT (1023U) +#define P9_FD_PORT 564 + +#define P9_RDMA_PORT 5640 +#define P9_RDMA_SQ_DEPTH 32 +#define P9_RDMA_RQ_DEPTH 32 +#define P9_RDMA_TIMEOUT 30000/* 30 seconds */ + +/** +* struct p9_fd_opts - per-transport options for fd transport +* @rfd: file descriptor for reading (trans=fd) +* @wfd: file descriptor for writing (trans=fd) +* @port: port to connect to (trans=tcp) +* @privport: port is privileged +*/ + +struct p9_fd_opts { +int rfd; +int wfd; +u16 port; +bool privport; +}; + +/** +* struct p9_rdma_opts - Collection of mount options for rdma transport +* @port: port of connection +* @privport: Whether a privileged port may be used +* @sq_depth: The requested depth of the SQ. This really doesn't need +* to be any deeper than the number of threads used in the client +* @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth +* @timeout: Time to wait in msecs for CM events +*/ +struct p9_rdma_opts { +short port; +bool privport; +int sq_depth; +int rq_depth; +long timeout; +}; +/** * struct p9_trans_module - transport module interface * @list: used to maintain a list of currently available transports
net/9p/client.c +0 -6
@@ -29,12 +29,6 @@#define CREATE_TRACE_POINTS #include <trace/events/9p.h> -/* DEFAULT MSIZE = 32 pages worth of payload + P9_HDRSZ + -* room for write (16 extra) or read (11 extra) operands. -*/ - -#define DEFAULT_MSIZE ((128 * 1024) + P9_IOHDRSZ) -/* Client Option Parsing (code inspired by NFS code) * - a little lazy - parse all client options */
net/9p/trans_fd.c +2 -18
@@ -31,28 +31,12 @@#include <linux/syscalls.h> /* killme */ -#define P9_PORT 564#define MAX_SOCK_BUF (1024*1024)#define MAXPOLLWADDR 2static struct p9_trans_module p9_tcp_trans;static struct p9_trans_module p9_fd_trans; -/** -* struct p9_fd_opts - per-transport options -* @rfd: file descriptor for reading (trans=fd) -* @wfd: file descriptor for writing (trans=fd) -* @port: port to connect to (trans=tcp) -* @privport: port is privileged -*/ - -struct p9_fd_opts { -int rfd; -int wfd; -u16 port; -bool privport; -}; -/* * Option Parsing (code inspired by NFS code) * - a little lazy - parse all fd-transport options
@@ -742,7 +726,7 @@ static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req)static int p9_fd_show_options (struct seq_file *m,struct p9_client *clnt) {if (clnt->trans_mod == &p9_tcp_trans) { -if (clnt->trans_opts.tcp.port !=P9_PORT ) +if (clnt->trans_opts.tcp.port !=P9_FD_PORT )seq_printf (m,",port=%u" , clnt->trans_opts.tcp.port); }else if (clnt->trans_mod == &p9_fd_trans) {if (clnt->trans_opts.fd.rfd != ~0 )
@@ -768,7 +752,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)int option;char *options, *tmp_options; - opts->port =P9_PORT ; + opts->port =P9_FD_PORT ; opts->rfd = ~0 ; opts->wfd = ~0 ; opts->privport = false;
net/9p/trans_rdma.c +2 -23
@@ -32,14 +32,10 @@#include <rdma/ib_verbs.h> #include <rdma/rdma_cm.h> -#define P9_PORT 5640 -#define P9_RDMA_SQ_DEPTH 32 -#define P9_RDMA_RQ_DEPTH 32#define P9_RDMA_SEND_SGE 4#define P9_RDMA_RECV_SGE 4#define P9_RDMA_IRD 0#define P9_RDMA_ORD 0 -#define P9_RDMA_TIMEOUT 30000/* 30 seconds */ #define P9_RDMA_MAXSIZE (1024*1024)/* 1MB */ /**
@@ -110,23 +106,6 @@ struct p9_rdma_context { }; }; -/** -* struct p9_rdma_opts - Collection of mount options -* @port: port of connection -* @privport: Whether a privileged port may be used -* @sq_depth: The requested depth of the SQ. This really doesn't need -* to be any deeper than the number of threads used in the client -* @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth -* @timeout: Time to wait in msecs for CM events -*/ -struct p9_rdma_opts { -short port; -bool privport; -int sq_depth; -int rq_depth; -long timeout; -}; -/* * Option Parsing (code inspired by NFS code) */
@@ -151,7 +130,7 @@ static int p9_rdma_show_options(struct seq_file *m, struct p9_client *clnt) {struct p9_trans_rdma *rdma = clnt->trans; -if (rdma->port !=P9_PORT ) +if (rdma->port !=P9_RDMA_PORT )seq_printf (m,",port=%u" , rdma->port);if (rdma->sq_depth !=P9_RDMA_SQ_DEPTH )seq_printf (m,",sq=%u" , rdma->sq_depth);
@@ -178,7 +157,7 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)int option;char *options, *tmp_options; - opts->port =P9_PORT ; + opts->port =P9_RDMA_PORT ; opts->sq_depth =P9_RDMA_SQ_DEPTH ; opts->rq_depth =P9_RDMA_RQ_DEPTH ; opts->timeout =P9_RDMA_TIMEOUT ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 60/990 9p: create a v9fs_context structure to hold parsed options
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <[email protected]>
[ Upstream commit 075e8bd4127f007910fc302ad5c3c471d0be4799 ]
This patch creates a new v9fs_context structure which includes new p9_session_opts and p9_client_opts structures, as well as re-using the existing p9_fd_opts and p9_rdma_opts to store options during parsing. The new structure will be used in the next commit to pass all parsed options to the appropriate transports.
Message-ID: <[email protected]>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
--- include/net/9p/client.h | 90 ++++++++++++++++++++++++++++++++++++++ include/net/9p/transport.h | 32 -------------- 2 files changed, 90 insertions(+), 32 deletions(-)
include/net/9p/client.h +90 -0
@@ -132,6 +132,96 @@ struct p9_client {char name[__NEW_UTS_LEN +1 ]; }; +/** +* struct p9_fd_opts - holds client options during parsing +* @msize: maximum data size negotiated by protocol +* @prot-Oversion: 9P protocol version to use +* @trans_mod: module API instantiated with this client +* +* These parsed options get transferred into client in +* apply_client_options() +*/ +struct p9_client_opts { +unsigned int msize; +unsigned char proto_version; +struct p9_trans_module *trans_mod; +}; + +/** +* struct p9_fd_opts - per-transport options for fd transport +* @rfd: file descriptor for reading (trans=fd) +* @wfd: file descriptor for writing (trans=fd) +* @port: port to connect to (trans=tcp) +* @privport: port is privileged +*/ +struct p9_fd_opts { +int rfd; +int wfd; +u16 port; +bool privport; +}; + +/** +* struct p9_rdma_opts - Collection of mount options for rdma transport +* @port: port of connection +* @privport: Whether a privileged port may be used +* @sq_depth: The requested depth of the SQ. This really doesn't need +* to be any deeper than the number of threads used in the client +* @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth +* @timeout: Time to wait in msecs for CM events +*/ +struct p9_rdma_opts { +short port; +bool privport; +int sq_depth; +int rq_depth; +long timeout; +}; + +/** +* struct p9_session_opts - holds parsed options for v9fs_session_info +* @flags: session options of type &p9_session_flags +* @nodev: set to 1 to disable device mapping +* @debug: debug level +* @afid: authentication handle +* @cache: cache mode of type &p9_cache_bits +* @cachetag: the tag of the cache associated with this session +* @uname: string user name to mount hierarchy as +* @aname: mount specifier for remote hierarchy +* @dfltuid: default numeric userid to mount hierarchy as +* @dfltgid: default numeric groupid to mount hierarchy as +* @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy +* @session_lock_timeout: retry interval for blocking locks +* +* This strucure holds options which are parsed and will be transferred +* to the v9fs_session_info structure when mounted, and therefore largely +* duplicates struct v9fs_session_info. +*/ +struct p9_session_opts { +unsigned int flags; +unsigned char nodev; +unsigned short debug; +unsigned int afid; +unsigned int cache; +#ifdef CONFIG_9P_FSCACHE +char *cachetag; +#endif +char *uname; +char *aname; +kuid_t dfltuid; +kgid_t dfltgid; +kuid_t uid; +long session_lock_timeout; +}; + +/* Used by mount API to store parsed mount options */ +struct v9fs_context { +struct p9_client_opts client_opts; +struct p9_fd_opts fd_opts; +struct p9_rdma_opts rdma_opts; +struct p9_session_opts session_opts; +}; +/** * struct p9_fid - file system entity handle * @clnt: back pointer to instantiating &p9_client
include/net/9p/transport.h +0 -32
@@ -21,38 +21,6 @@#define P9_RDMA_RQ_DEPTH 32#define P9_RDMA_TIMEOUT 30000/* 30 seconds */ -/** -* struct p9_fd_opts - per-transport options for fd transport -* @rfd: file descriptor for reading (trans=fd) -* @wfd: file descriptor for writing (trans=fd) -* @port: port to connect to (trans=tcp) -* @privport: port is privileged -*/ - -struct p9_fd_opts { -int rfd; -int wfd; -u16 port; -bool privport; -}; - -/** -* struct p9_rdma_opts - Collection of mount options for rdma transport -* @port: port of connection -* @privport: Whether a privileged port may be used -* @sq_depth: The requested depth of the SQ. This really doesn't need -* to be any deeper than the number of threads used in the client -* @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth -* @timeout: Time to wait in msecs for CM events -*/ -struct p9_rdma_opts { -short port; -bool privport; -int sq_depth; -int rq_depth; -long timeout; -}; -/** * struct p9_trans_module - transport module interface * @list: used to maintain a list of currently available transports
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 61/990 9p: convert to the new mount API
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <[email protected]>
[ Upstream commit 1f3e4142c0eb178089ea0cbc97506a061470ad27 ]
Convert 9p to the new mount API. This patch consolidates all parsing into fs/9p/v9fs.c, which stores all results into a filesystem context which can be passed to the various transports as needed.
Some of the parsing helper functions such as get_cache_mode() have been eliminated in favor of using the new mount API's enum param type, for simplicity.
Message-ID: <[email protected]>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
--- fs/9p/v9fs.c | 552 +++++++++++++++++++------------------ fs/9p/v9fs.h | 7 +- fs/9p/vfs_super.c | 130 ++++++--- include/net/9p/client.h | 2 +- include/net/9p/transport.h | 2 +- net/9p/client.c | 148 +--------- net/9p/mod.c | 2 +- net/9p/trans_fd.c | 109 +------- net/9p/trans_rdma.c | 108 +------- net/9p/trans_usbg.c | 4 +- net/9p/trans_virtio.c | 8 +- net/9p/trans_xen.c | 4 +- 12 files changed, 424 insertions(+), 652 deletions(-)
fs/9p/v9fs.c +283 -269
@@ -13,7 +13,8 @@#include <linux/fs.h> #include <linux/sched.h> #include <linux/cred.h> -#include <linux/parser.h> +#include <linux/fs_parser.h> +#include <linux/fs_context.h> #include <linux/slab.h> #include <linux/seq_file.h> #include <linux/sysfs.h>
@@ -34,6 +35,10 @@ struct kmem_cache *v9fs_inode_cache;*/ enum { +/* Mount-point source, we need to handle this explicitly because +* the code below accepts unknown args and the vfs layer only handles +* source if we rejected it as EINVAL */ + Opt_source,/* Options that take integer arguments */ Opt_debug, Opt_dfltuid, Opt_dfltgid, Opt_afid,/* String options */
@@ -44,55 +49,81 @@ enum { Opt_access, Opt_posixacl,/* Lock timeout option */ Opt_locktimeout, -/* Error token */ - Opt_err + +/* Client options */ + Opt_msize, Opt_trans, Opt_legacy, Opt_version, + +/* fd transport options */ +/* Options that take integer arguments */ + Opt_rfdno, Opt_wfdno, +/* Options that take no arguments */ + +/* rdma transport options */ +/* Options that take integer arguments */ + Opt_rq_depth, Opt_sq_depth, Opt_timeout, + +/* Options for both fd and rdma transports */ + Opt_port, Opt_privport, }; -static const match_table_t tokens = { - {Opt_debug,"debug=%x" }, - {Opt_dfltuid,"dfltuid=%u" }, - {Opt_dfltgid,"dfltgid=%u" }, - {Opt_afid,"afid=%u" }, - {Opt_uname,"uname=%s" }, - {Opt_remotename,"aname=%s" }, - {Opt_nodevmap,"nodevmap" }, - {Opt_noxattr,"noxattr" }, - {Opt_directio,"directio" }, - {Opt_ignoreqv,"ignoreqv" }, - {Opt_cache,"cache=%s" }, - {Opt_cachetag,"cachetag=%s" }, - {Opt_access,"access=%s" }, - {Opt_posixacl,"posixacl" }, - {Opt_locktimeout,"locktimeout=%u" }, - {Opt_err,NULL } +static const struct constant_table p9_versions[] = { + {"9p2000" , p9_proto_legacy }, + {"9p2000.u" , p9_proto_2000u }, + {"9p2000.L" , p9_proto_2000L }, + {} }; -/* Interpret mount options for cache mode */ -static int get_cache_mode (char *s) -{ -int version = -EINVAL ; - -if (!strcmp (s,"loose" )) { - version =CACHE_SC_LOOSE ; -p9_debug (P9_DEBUG_9P ,"Cache mode: loose\n" ); - }else if (!strcmp (s,"fscache" )) { - version =CACHE_SC_FSCACHE ; -p9_debug (P9_DEBUG_9P ,"Cache mode: fscache\n" ); - }else if (!strcmp (s,"mmap" )) { - version =CACHE_SC_MMAP ; -p9_debug (P9_DEBUG_9P ,"Cache mode: mmap\n" ); - }else if (!strcmp (s,"readahead" )) { - version =CACHE_SC_READAHEAD ; -p9_debug (P9_DEBUG_9P ,"Cache mode: readahead\n" ); - }else if (!strcmp (s,"none" )) { - version =CACHE_SC_NONE ; -p9_debug (P9_DEBUG_9P ,"Cache mode: none\n" ); - }else if (kstrtoint (s,0 , &version) !=0 ) { - version = -EINVAL ; -pr_info ("Unknown Cache mode or invalid value %s\n" , s); - } -return version; -} +static const struct constant_table p9_cache_mode[] = { + {"loose" ,CACHE_SC_LOOSE }, + {"fscache" ,CACHE_SC_FSCACHE }, + {"mmap" ,CACHE_SC_MMAP }, + {"readahead" ,CACHE_SC_READAHEAD }, + {"none" ,CACHE_SC_NONE }, + {} +}; + +/* +* This structure contains all parameters used for the core code, +* the client, and all the transports. +*/ +const struct fs_parameter_spec v9fs_param_spec[] = { +fsparam_string ("source" , Opt_source), +fsparam_u32hex ("debug" , Opt_debug), +fsparam_uid ("dfltuid" , Opt_dfltuid), +fsparam_gid ("dfltgid" , Opt_dfltgid), +fsparam_u32 ("afid" , Opt_afid), +fsparam_string ("uname" , Opt_uname), +fsparam_string ("aname" , Opt_remotename), +fsparam_flag ("nodevmap" , Opt_nodevmap), +fsparam_flag ("noxattr" , Opt_noxattr), +fsparam_flag ("directio" , Opt_directio), +fsparam_flag ("ignoreqv" , Opt_ignoreqv), +fsparam_enum ("cache" , Opt_cache, p9_cache_mode), +fsparam_string ("cachetag" , Opt_cachetag), +fsparam_string ("access" , Opt_access), +fsparam_flag ("posixacl" , Opt_posixacl), +fsparam_u32 ("locktimeout" , Opt_locktimeout), + +/* client options */ +fsparam_u32 ("msize" , Opt_msize), +fsparam_flag ("noextend" , Opt_legacy), +fsparam_string ("trans" , Opt_trans), +fsparam_enum ("version" , Opt_version, p9_versions), + +/* fd transport options */ +fsparam_u32 ("rfdno" , Opt_rfdno), +fsparam_u32 ("wfdno" , Opt_wfdno), + +/* rdma transport options */ +fsparam_u32 ("sq" , Opt_sq_depth), +fsparam_u32 ("rq" , Opt_rq_depth), +fsparam_u32 ("timeout" , Opt_timeout), + +/* fd and rdma transprt options */ +fsparam_u32 ("port" , Opt_port), +fsparam_flag ("privport" , Opt_privport), + {} +};/* * Display the mount options in /proc/mounts.
@@ -154,267 +185,252 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) }/** -* v9fs_parse_options - parse mount options into session structure -* @v9ses: existing v9fs session information -* @opts: The mount option string +* v9fs_parse_param - parse a mount option into the filesystem context +* @fc: the filesystem context +* @param: the parameter to parse * * Return 0 upon success, -ERRNO upon failure. */ - -static int v9fs_parse_options (struct v9fs_session_info *v9ses,char *opts) +int v9fs_parse_param (struct fs_context *fc,struct fs_parameter *param) { -char *options, *tmp_options; -substring_t args[MAX_OPT_ARGS ]; -char *p; -int option =0 ; +struct v9fs_context *ctx = fc->fs_private; +struct fs_parse_result result;char *s; -int ret =0 ; - -/* setup defaults */ - v9ses->afid = ~0 ; - v9ses->debug =0 ; - v9ses->cache =CACHE_NONE ; -#ifdef CONFIG_9P_FSCACHE - v9ses->cachetag =NULL ; -#endif - v9ses->session_lock_timeout =P9_LOCK_TIMEOUT ; - -if (!opts) -return 0 ; +int r; +int opt; +struct p9_client_opts *clnt = &ctx->client_opts; +struct p9_fd_opts *fd_opts = &ctx->fd_opts; +struct p9_rdma_opts *rdma_opts = &ctx->rdma_opts; +struct p9_session_opts *session_opts = &ctx->session_opts; + + opt =fs_parse (fc, v9fs_param_spec, param, &result); +if (opt <0 ) { +/* +* We might like to report bad mount options here, but +* traditionally 9p has ignored unknown mount options +*/ +if (opt == -ENOPARAM ) +return 0 ; - tmp_options =kstrdup (opts,GFP_KERNEL ); -if (!tmp_options) { - ret = -ENOMEM ; - goto fail_option_alloc; +return opt; } - options = tmp_options; - -while ((p =strsep (&options,"," )) !=NULL ) { -int token, r; - -if (!*p) -continue ; - - token =match_token (p, tokens, args); -switch (token) { -case Opt_debug: - r =match_int (&args[0 ], &option); -if (r <0 ) { -p9_debug (P9_DEBUG_ERROR , -"integer field, but no integer?\n" ); - ret = r; - }else { - v9ses->debug = option; + +switch (opt) { +case Opt_source: +if (fc->source) { +pr_info ("p9: multiple sources not supported\n" ); +return -EINVAL ; + } + fc->source = param->string; + param->string =NULL ; +break ; +case Opt_debug: + session_opts->debug = result.uint_32;#ifdef CONFIG_NET_9P_DEBUG - p9_debug_level = option; + p9_debug_level = result.uint_32;#endif - } -break ; - -case Opt_dfltuid: - r =match_int (&args[0 ], &option); -if (r <0 ) { -p9_debug (P9_DEBUG_ERROR , -"integer field, but no integer?\n" ); - ret = r; -continue ; - } - v9ses->dfltuid =make_kuid (current_user_ns (), option); -if (!uid_valid (v9ses->dfltuid)) { -p9_debug (P9_DEBUG_ERROR , -"uid field, but not a uid?\n" ); - ret = -EINVAL ; - } -break ; -case Opt_dfltgid: - r =match_int (&args[0 ], &option); -if (r <0 ) { -p9_debug (P9_DEBUG_ERROR , -"integer field, but no integer?\n" ); - ret = r; -continue ; - } - v9ses->dfltgid =make_kgid (current_user_ns (), option); -if (!gid_valid (v9ses->dfltgid)) { -p9_debug (P9_DEBUG_ERROR , -"gid field, but not a gid?\n" ); - ret = -EINVAL ; - } -break ; -case Opt_afid: - r =match_int (&args[0 ], &option); -if (r <0 ) { -p9_debug (P9_DEBUG_ERROR , -"integer field, but no integer?\n" ); - ret = r; - }else { - v9ses->afid = option; - } -break ; -case Opt_uname: -kfree (v9ses->uname); - v9ses->uname =match_strdup (&args[0 ]); -if (!v9ses->uname) { - ret = -ENOMEM ; - goto free_and_return; - } -break ; -case Opt_remotename: -kfree (v9ses->aname); - v9ses->aname =match_strdup (&args[0 ]); -if (!v9ses->aname) { - ret = -ENOMEM ; - goto free_and_return; - } -break ; -case Opt_nodevmap: - v9ses->nodev =1 ; -break ; -case Opt_noxattr: - v9ses->flags |=V9FS_NO_XATTR ; -break ; -case Opt_directio: - v9ses->flags |=V9FS_DIRECT_IO ; -break ; -case Opt_ignoreqv: - v9ses->flags |=V9FS_IGNORE_QV ; -break ; -case Opt_cachetag: +break ; + +case Opt_dfltuid: + session_opts->dfltuid = result.uid; +break ; +case Opt_dfltgid: + session_opts->dfltgid = result.gid; +break ; +case Opt_afid: + session_opts->afid = result.uint_32; +break ; +case Opt_uname: +kfree (session_opts->uname); + session_opts->uname = param->string; + param->string =NULL ; +break ; +case Opt_remotename: +kfree (session_opts->aname); + session_opts->aname = param->string; + param->string =NULL ; +break ; +case Opt_nodevmap: + session_opts->nodev =1 ; +break ; +case Opt_noxattr: + session_opts->flags |=V9FS_NO_XATTR ; +break ; +case Opt_directio: + session_opts->flags |=V9FS_DIRECT_IO ; +break ; +case Opt_ignoreqv: + session_opts->flags |=V9FS_IGNORE_QV ; +break ; +case Opt_cachetag:#ifdef CONFIG_9P_FSCACHE -kfree (v9ses->cachetag); - v9ses->cachetag =match_strdup (&args[0 ]); -if (!v9ses->cachetag) { - ret = -ENOMEM ; - goto free_and_return; - } +kfree (session_opts->cachetag); + session_opts->cachetag = param->string; + param->string =NULL ;#endif -break ; -case Opt_cache: - s =match_strdup (&args[0 ]); -if (!s) { - ret = -ENOMEM ; -p9_debug (P9_DEBUG_ERROR , -"problem allocating copy of cache arg\n" ); - goto free_and_return; - } - r =get_cache_mode (s); -if (r <0 ) - ret = r; -else - v9ses->cache = r; - -kfree (s); -break ; - -case Opt_access: - s =match_strdup (&args[0 ]); -if (!s) { - ret = -ENOMEM ; -p9_debug (P9_DEBUG_ERROR , -"problem allocating copy of access arg\n" ); - goto free_and_return; +break ; +case Opt_cache: + session_opts->cache = result.uint_32; +p9_debug (P9_DEBUG_9P ,"Cache mode: %s\n" , param->string); +break ; +case Opt_access: + s = param->string; + session_opts->flags &= ~V9FS_ACCESS_MASK ; +if (strcmp (s,"user" ) ==0 ) { + session_opts->flags |=V9FS_ACCESS_USER ; + }else if (strcmp (s,"any" ) ==0 ) { + session_opts->flags |=V9FS_ACCESS_ANY ; + }else if (strcmp (s,"client" ) ==0 ) { + session_opts->flags |=V9FS_ACCESS_CLIENT ; + }else { +uid_t uid; + + session_opts->flags |=V9FS_ACCESS_SINGLE ; + r =kstrtouint (s,10 , &uid); +if (r) { +pr_info ("Unknown access argument %s: %d\n" , + param->string, r); +return r; } - - v9ses->flags &= ~V9FS_ACCESS_MASK ; -if (strcmp (s,"user" ) ==0 ) - v9ses->flags |=V9FS_ACCESS_USER ; -else if (strcmp (s,"any" ) ==0 ) - v9ses->flags |=V9FS_ACCESS_ANY ; -else if (strcmp (s,"client" ) ==0 ) { - v9ses->flags |=V9FS_ACCESS_CLIENT ; - }else { -uid_t uid; - - v9ses->flags |=V9FS_ACCESS_SINGLE ; - r =kstrtouint (s,10 , &uid); -if (r) { - ret = r; -pr_info ("Unknown access argument %s: %d\n" , - s, r); -kfree (s); -continue ; - } - v9ses->uid =make_kuid (current_user_ns (), uid); -if (!uid_valid (v9ses->uid)) { - ret = -EINVAL ; -pr_info ("Unknown uid %s\n" , s); - } + session_opts->uid =make_kuid (current_user_ns (), uid); +if (!uid_valid (session_opts->uid)) { +pr_info ("Unknown uid %s\n" , s); +return -EINVAL ; } + } +break ; -kfree (s); -break ; - -case Opt_posixacl: +case Opt_posixacl:#ifdef CONFIG_9P_FS_POSIX_ACL - v9ses->flags |=V9FS_POSIX_ACL ; + session_opts->flags |=V9FS_POSIX_ACL ;#else -p9_debug (P9_DEBUG_ERROR , -"Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n" ); +p9_debug (P9_DEBUG_ERROR , +"Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n" );#endif -break ; - -case Opt_locktimeout: - r =match_int (&args[0 ], &option); -if (r <0 ) { -p9_debug (P9_DEBUG_ERROR , -"integer field, but no integer?\n" ); - ret = r; -continue ; - } -if (option <1 ) { -p9_debug (P9_DEBUG_ERROR , -"locktimeout must be a greater than zero integer.\n" ); - ret = -EINVAL ; -continue ; - } - v9ses->session_lock_timeout = (long )option *HZ ; -break ; +break ; + +case Opt_locktimeout: +if (result.uint_32 <1 ) { +p9_debug (P9_DEBUG_ERROR , +"locktimeout must be a greater than zero integer.\n" ); +return -EINVAL ; + } + session_opts->session_lock_timeout = (long )result.uint_32 *HZ ; +break ; -default : -continue ; +/* Options for client */ +case Opt_msize: +if (result.uint_32 <4096 ) { +p9_debug (P9_DEBUG_ERROR ,"msize should be at least 4k\n" ); +return -EINVAL ; + } +if (result.uint_32 >INT_MAX ) { +p9_debug (P9_DEBUG_ERROR ,"msize too big\n" ); +return -EINVAL ; } + clnt->msize = result.uint_32; +break ; +case Opt_trans: +v9fs_put_trans (clnt->trans_mod); + clnt->trans_mod =v9fs_get_trans_by_name (param->string); +if (!clnt->trans_mod) { +pr_info ("Could not find request transport: %s\n" , + param->string); +return -EINVAL ; + } +break ; +case Opt_legacy: + clnt->proto_version = p9_proto_legacy; +break ; +case Opt_version: + clnt->proto_version = result.uint_32; +p9_debug (P9_DEBUG_9P ,"Protocol version: %s\n" , param->string); +break ; +/* Options for fd transport */ +case Opt_rfdno: + fd_opts->rfd = result.uint_32; +break ; +case Opt_wfdno: + fd_opts->wfd = result.uint_32; +break ; +/* Options for rdma transport */ +case Opt_sq_depth: + rdma_opts->sq_depth = result.uint_32; +break ; +case Opt_rq_depth: + rdma_opts->rq_depth = result.uint_32; +break ; +case Opt_timeout: + rdma_opts->timeout = result.uint_32; +break ; +/* Options for both fd and rdma transports */ +case Opt_port: + fd_opts->port = result.uint_32; + rdma_opts->port = result.uint_32; +break ; +case Opt_privport: + fd_opts->privport = true; + rdma_opts->port = true; +break ; } -free_and_return: -kfree (tmp_options); -fail_option_alloc: -return ret; +return 0 ; +} + +static void v9fs_apply_options (struct v9fs_session_info *v9ses, +struct fs_context *fc) +{ +struct v9fs_context *ctx = fc->fs_private; + + v9ses->debug = ctx->session_opts.debug; + v9ses->dfltuid = ctx->session_opts.dfltuid; + v9ses->dfltgid = ctx->session_opts.dfltgid; + v9ses->afid = ctx->session_opts.afid; + v9ses->uname = ctx->session_opts.uname; + ctx->session_opts.uname =NULL ; + v9ses->aname = ctx->session_opts.aname; + ctx->session_opts.aname =NULL ; + v9ses->nodev = ctx->session_opts.nodev; +/* +* Note that we must |= flags here as session_init already +* set basic flags. This adds in flags from parsed options. +*/ + v9ses->flags |= ctx->session_opts.flags; +#ifdef CONFIG_9P_FSCACHE + v9ses->cachetag = ctx->session_opts.cachetag; + ctx->session_opts.cachetag =NULL ; +#endif + v9ses->cache = ctx->session_opts.cache; + v9ses->uid = ctx->session_opts.uid; + v9ses->session_lock_timeout = ctx->session_opts.session_lock_timeout; }/** * v9fs_session_init - initialize session * @v9ses: session information structure -* @dev_name: device being mounted -* @data: options +* @fc: the filesystem mount context * */ struct p9_fid *v9fs_session_init (struct v9fs_session_info *v9ses, -const char *dev_name,char *data) +struct fs_context *fc) {struct p9_fid *fid;int rc = -ENOMEM ; - v9ses->uname =kstrdup (V9FS_DEFUSER ,GFP_KERNEL ); -if (!v9ses->uname) - goto err_names; - - v9ses->aname =kstrdup (V9FS_DEFANAME ,GFP_KERNEL ); -if (!v9ses->aname) - goto err_names;init_rwsem (&v9ses->rename_sem); - v9ses->uid =INVALID_UID ; - v9ses->dfltuid =V9FS_DEFUID ; - v9ses->dfltgid =V9FS_DEFGID ; - - v9ses->clnt =p9_client_create (dev_name, data); + v9ses->clnt =p9_client_create (fc);if (IS_ERR (v9ses->clnt)) { rc =PTR_ERR (v9ses->clnt);p9_debug (P9_DEBUG_ERROR ,"problem initializing 9p client\n" ); goto err_names; } +/* +* Initialize flags on the real v9ses. v9fs_apply_options below +* will |= the additional flags from parsed options. +*/ v9ses->flags =V9FS_ACCESS_USER ;if (p9_is_proto_dotl (v9ses->clnt)) {
@@ -424,9 +440,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses, v9ses->flags |=V9FS_PROTO_2000U ; } - rc =v9fs_parse_options (v9ses, data); -if (rc <0 ) - goto err_clnt; +v9fs_apply_options (v9ses, fc); v9ses->maxdata = v9ses->clnt->msize -P9_IOHDRSZ ;
@@ -472,7 +486,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,#ifdef CONFIG_9P_FSCACHE /* register the session for caching */ if (v9ses->cache &CACHE_FSCACHE ) { - rc =v9fs_cache_session_get_cookie (v9ses, dev_name); + rc =v9fs_cache_session_get_cookie (v9ses, fc->source);if (rc <0 ) goto err_clnt; }
fs/9p/v9fs.h +6 -1
@@ -10,6 +10,9 @@#include <linux/backing-dev.h> #include <linux/netfs.h> +#include <linux/fs_parser.h> +#include <net/9p/client.h> +#include <net/9p/transport.h> /** * enum p9_session_flags - option flags for each 9P session
@@ -163,11 +166,13 @@ static inline struct fscache_volume *v9fs_session_cache(struct v9fs_session_info#endif } +extern const struct fs_parameter_spec v9fs_param_spec[]; +extern int v9fs_parse_param (struct fs_context *fc,struct fs_parameter *param);extern int v9fs_show_options (struct seq_file *m,struct dentry *root);struct p9_fid *v9fs_session_init (struct v9fs_session_info *v9ses, -const char *dev_name,char *data); +struct fs_context *fc);extern void v9fs_session_close (struct v9fs_session_info *v9ses);extern void v9fs_session_cancel (struct v9fs_session_info *v9ses);extern void v9fs_session_begin_cancel (struct v9fs_session_info *v9ses);
fs/9p/vfs_super.c +91 -39
197 lines not on this page · raw message
include/net/9p/client.h +1 -1
@@ -279,7 +279,7 @@ int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, const char *name);int p9_client_renameat (struct p9_fid *olddirfid,const char *old_name,struct p9_fid *newdirfid,const char *new_name); -struct p9_client *p9_client_create (const char *dev_name,char *options); +struct p9_client *p9_client_create (struct fs_context *fc);void p9_client_destroy (struct p9_client *clnt);void p9_client_disconnect (struct p9_client *clnt);void p9_client_begin_disconnect (struct p9_client *clnt);
include/net/9p/transport.h +1 -1
@@ -53,7 +53,7 @@ struct p9_trans_module {int def;/* this transport should be default */ struct module *owner;int (*create)(struct p9_client *client, -const char *devname,char *args); +struct fs_context *fc);void (*close)(struct p9_client *client);int (*request)(struct p9_client *client,struct p9_req_t *req);int (*cancel)(struct p9_client *client,struct p9_req_t *req);
net/9p/client.c +12 -136
188 lines not on this page · raw message
net/9p/mod.c +1 -1
@@ -16,7 +16,6 @@#include <linux/moduleparam.h> #include <net/9p/9p.h> #include <linux/fs.h> -#include <linux/parser.h> #include <net/9p/client.h> #include <net/9p/transport.h> #include <linux/list.h>
@@ -171,6 +170,7 @@ void v9fs_put_trans(struct p9_trans_module *m)if (m)module_put (m->owner); } +EXPORT_SYMBOL (v9fs_put_trans);/** * init_p9 - Initialize module
net/9p/trans_fd.c +11 -98
156 lines not on this page · raw message
net/9p/trans_rdma.c +8 -100
142 lines not on this page · raw message
net/9p/trans_usbg.c +3 -1
@@ -27,6 +27,7 @@#include <linux/cleanup.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/fs_context.h> #include <linux/usb/composite.h> #include <linux/usb/func_utils.h>
@@ -392,8 +393,9 @@ enable_usb9pfs(struct usb_composite_dev *cdev, struct f_usb9pfs *usb9pfs)return ret; } -static int p9_usbg_create (struct p9_client *client,const char *devname,char *args) +static int p9_usbg_create (struct p9_client *client,struct fs_context *fc) { +const char *devname = fc->source;struct f_usb9pfs_dev *dev;struct f_usb9pfs *usb9pfs;int ret = -ENOENT ;
net/9p/trans_virtio.c +4 -4
@@ -26,7 +26,7 @@#include <linux/highmem.h> #include <linux/slab.h> #include <net/9p/9p.h> -#include <linux/parser.h> +#include <linux/fs_context.h> #include <net/9p/client.h> #include <net/9p/transport.h> #include <linux/scatterlist.h>
@@ -684,8 +684,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)/** * p9_virtio_create - allocate a new virtio channel * @client: client instance invoking this transport -* @devname: string identifying the channel to connect to (unused) -* @args: args passed from sys_mount() for per-transport options (unused) +* @fc: the filesystem context * * This sets up a transport channel for 9p communication. Right now * we only match the first available channel, but eventually we could look up
@@ -696,8 +695,9 @@ static int p9_virtio_probe(struct virtio_device *vdev)*/ static int -p9_virtio_create (struct p9_client *client,const char *devname,char *args) +p9_virtio_create (struct p9_client *client,struct fs_context *fc) { +const char *devname = fc->source;struct virtio_chan *chan;int ret = -ENOENT ;int found =0 ;
net/9p/trans_xen.c +3 -1
@@ -15,6 +15,7 @@#include <linux/module.h> #include <linux/spinlock.h> +#include <linux/fs_context.h> #include <net/9p/9p.h> #include <net/9p/client.h> #include <net/9p/transport.h>
@@ -66,8 +67,9 @@ static int p9_xen_cancel(struct p9_client *client, struct p9_req_t *req)return 1 ; } -static int p9_xen_create (struct p9_client *client,const char *addr,char *args) +static int p9_xen_create (struct p9_client *client,struct fs_context *fc) { +const char *addr = fc->source;struct xen_9pfs_front_priv *priv;if (addr ==NULL )
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 62/990 net/9p: Replace strlen() strcpy() pair with strscpy()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Laight <[email protected]>
[ Upstream commit cc8b15a2c435bd1caf19741ba85286846a115764 ]
Use the result of strscpy() for the overflow check.
Message-ID: <[email protected]>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
--- net/9p/trans_fd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/9p/trans_fd.c +2 -4
@@ -941,14 +941,12 @@ p9_fd_create_unix(struct p9_client *client, struct fs_context *fc)if (!addr || !strlen (addr))return -EINVAL ; -if (strlen (addr) >=UNIX_PATH_MAX ) { + sun_server.sun_family =PF_UNIX ; +if (strscpy (sun_server.sun_path, addr) <0 ) {pr_err ("%s (%d): address too long: %s\n" , __func__,task_pid_nr (current), addr);return -ENAMETOOLONG ; } - - sun_server.sun_family =PF_UNIX ; -strcpy (sun_server.sun_path, addr); err =__sock_create (current->nsproxy->net_ns,PF_UNIX ,SOCK_STREAM ,0 , &csocket,1 );if (err <0 ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 63/990 9p: use fc->net_ns for network namespace in RDMA and socket transports
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yizhou Zhao <[email protected]>
[ Upstream commit 37dce65a0b4356d7ec289a5d09cece5db241c302 ]
The 9p RDMA transport currently passes &init_net to rdma_create_id(). As a result, RDMA address resolution and connection setup are performed in the initial network namespace, even when the mount is initiated from a non-initial network namespace.
This differs from the socket-based 9p transports, which create sockets in current->nsproxy->net_ns. Use fc->net_ns for both the RDMA and socket transports instead, so that transport setup follows the VFS mount namespace context rather than depending on the calling process's current namespace.
This avoids surprising behaviour where a 9p RDMA mount from a container or other non-initial network namespace may use the host namespace for RDMA CM operations.
Message-ID: <[email protected]>
--- net/9p/trans_fd.c | 11 +++++------ net/9p/trans_rdma.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-)
net/9p/trans_fd.c +5 -6
@@ -888,8 +888,8 @@ p9_fd_create_tcp(struct p9_client *client, struct fs_context *fc)return -EINVAL ;sprintf (port_str,"%u" , opts.port); - err =inet_pton_with_scope (current->nsproxy->net_ns,AF_UNSPEC , addr, - port_str, &stor); + err =inet_pton_with_scope (fc->net_ns,AF_UNSPEC , addr, port_str, + &stor);if (err <0 )return err;
@@ -897,8 +897,8 @@ p9_fd_create_tcp(struct p9_client *client, struct fs_context *fc) client->trans_opts.tcp.port = opts.port; client->trans_opts.tcp.privport = opts.privport; - err =__sock_create (current->nsproxy->net_ns, stor.ss_family, -SOCK_STREAM ,IPPROTO_TCP , &csocket,1 ); + err =__sock_create (fc->net_ns, stor.ss_family,SOCK_STREAM , +IPPROTO_TCP , &csocket,1 );if (err) {pr_err ("%s (%d): problem creating socket\n" , __func__,task_pid_nr (current));
@@ -947,8 +947,7 @@ p9_fd_create_unix(struct p9_client *client, struct fs_context *fc) __func__, task_pid_nr(current), addr);return -ENAMETOOLONG ; } - err =__sock_create (current->nsproxy->net_ns,PF_UNIX , -SOCK_STREAM ,0 , &csocket,1 ); + err =__sock_create (fc->net_ns,PF_UNIX ,SOCK_STREAM ,0 , &csocket,1 );if (err <0 ) {pr_err ("%s (%d): problem creating socket\n" , __func__,task_pid_nr (current));
net/9p/trans_rdma.c +1 -1
@@ -556,7 +556,7 @@ rdma_create_trans(struct p9_client *client, struct fs_context *fc)return -ENOMEM ;/* Create the RDMA CM ID */ - rdma->cm_id =rdma_create_id (&init_net, p9_cm_event_handler, client, + rdma->cm_id =rdma_create_id (fc->net_ns, p9_cm_event_handler, client,RDMA_PS_TCP ,IB_QPT_RC );if (IS_ERR (rdma->cm_id)) goto error;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 64/990 net/9p/usbg: fix descriptor cleanup use-after-free
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yizhou Zhao <[email protected]>
[ Upstream commit 0955472fff1e9f9e410a0300136924ebc8bd7a16 ]
usb9pfs_free_func() frees the f_usb9pfs object before calling usb_free_all_descriptors(). The usb_function passed to the latter is embedded in the freed object, so removing the function from a gadget dereferences freed memory.
The failing teardown sequence is:
configfs unlink
usb9pfs_free_func()
kfree(usb9pfs)
usb_free_all_descriptors(f)
dereference the embedded usb_function
KASAN reported:
BUG: KASAN: slab-use-after-free in usb_free_all_descriptors+0x138/0x190 Read of size 8 at addr ffff888106a73088 by task poc/95 Call Trace: usb_free_all_descriptors+0x138/0x190 config_usb_cfg_unlink+0x1f0/0x2f0 configfs_unlink+0x321/0x6f0
Free the descriptors before freeing their containing object.
Message-ID: <[email protected]>
Message-ID: <[email protected]>
--- net/9p/trans_usbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/9p/trans_usbg.c +2 -2
@@ -753,8 +753,6 @@ static void usb9pfs_free_func(struct usb_function *f)struct f_usb9pfs *usb9pfs =func_to_usb9pfs (f);struct f_usb9pfs_opts *opts; -kfree (usb9pfs); - opts = container_of(f->fi, struct f_usb9pfs_opts, func_inst);mutex_lock (&opts->lock);
@@ -762,6 +760,8 @@ static void usb9pfs_free_func(struct usb_function *f)mutex_unlock (&opts->lock);usb_free_all_descriptors (f); + +kfree (usb9pfs); } static int usb9pfs_set_alt(struct usb_function *f,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 65/990 net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yizhou Zhao <[email protected]>
[ Upstream commit 5c69297356bf6d04d8222f52717c6c4aa73e5d2c ]
When p9_usbg_close() is called, it invokes usb9pfs_clear_tx() but does not clear usb9pfs->client nor usb9pfs->in_req->context afterwards. The 9p client core (p9_client_destroy) calls close() and then kfree(clnt), so after p9_usbg_close returns the client struct is freed.
If the USB gadget is later disabled (e.g., host disconnect), usb9pfs_disable calls usb9pfs_clear_tx again, which passes the dangling usb9pfs->client pointer to p9_client_cb. Inside p9_client_cb, p9_req_put(c, req) dereferences the freed client to access its reqs IDR, causing a use-after-free.
Additionally, usb9pfs_clear_tx does not clear usb9pfs->in_req->context after calling p9_client_cb, so a second invocation finds a stale request pointer and attempts double-completion, further compounding the UAF risk.
Fix by:
1. Clearing usb9pfs->in_req->context to NULL in usb9pfs_clear_tx() before checking usb9pfs->client, so that even if the client is gone the stale request pointer is consumed and cannot cause double-completion.
2. Adding a NULL check on usb9pfs->client in usb9pfs_clear_tx() to skip p9_client_cb() when the client has already been destroyed.
3. Setting usb9pfs->client = NULL in p9_usbg_close() after calling usb9pfs_clear_tx(), to prevent any subsequent call from dereferencing the freed client pointer.
Message-ID: <[email protected]>
--- net/9p/trans_usbg.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/9p/trans_usbg.c +6 -0
@@ -460,6 +460,11 @@ static void usb9pfs_clear_tx(struct f_usb9pfs *usb9pfs)if (!req || !client)return ; + usb9pfs->in_req->context =NULL ; + +if (!usb9pfs->client) +return ; +if (!req->t_err) req->t_err = -ECONNRESET ;
@@ -483,6 +488,7 @@ static void p9_usbg_close(struct p9_client *client) client->status = Disconnected;usb9pfs_clear_tx (usb9pfs); + usb9pfs->client =NULL ; opts =container_of (usb9pfs->function.fi, struct f_usb9pfs_opts, func_inst);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 66/990 9p: skip intermediate directory entry name copy in p9dirent_read()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haobin Wu <[email protected]>
[ Upstream commit 8bb0279930cc90975f03bad4d83282613e5f57fa ]
v9fs_dir_readdir_dotl() decodes each entry of a Rreaddir reply with p9dirent_read(), which parses it through p9pdu_readf("Qqbs"). The 's' conversion in p9pdu_vreadf() already allocates a NUL-terminated copy of the name from the wire buffer; p9dirent_read() then strscpy()s that copy into the fixed 256-byte p9_dirent::d_name and frees the original.
The wire format carries the name length in 16 bits, so a name longer than 255 bytes is valid on the wire and may well be valid on the server's filesystem, but it makes strscpy() return -E2BIG. v9fs_dir_readdir_dotl() turns that into -EIO and aborts getdents64(), so every entry after the long one disappears from the listing.
Drop the second copy: keep the string allocated by p9pdu_vreadf() in p9_dirent and let v9fs_dir_readdir_dotl(), its only user, free it once dir_emit() has consumed it. p9_dirent is a short-lived stack object, so the string's lifetime does not change.
Note that the VFS only rejects names of PATH_MAX bytes or more in verify_dirent_name(), so after this change a name between NAME_MAX and PATH_MAX is returned by getdents64() even though any later lookup on it fails with -ENAMETOOLONG. The next patch skips such entries.
Message-ID: <[email protected]>
--- fs/9p/vfs_dir.c | 6 +++++- include/net/9p/client.h | 2 +- net/9p/protocol.c | 12 ++---------- 3 files changed, 8 insertions(+), 12 deletions(-)
fs/9p/vfs_dir.c +5 -1
@@ -196,8 +196,12 @@ static int v9fs_dir_readdir_dotl(struct file *file, struct dir_context *ctx)if (!dir_emit (ctx, curdirent.d_name,strlen (curdirent.d_name),QID2INO (&curdirent.qid), - curdirent.d_type)) + curdirent.d_type)) { +kfree (curdirent.d_name);return 0 ; + } + +kfree (curdirent.d_name); ctx->pos = curdirent.d_off; rdir->head += err;
include/net/9p/client.h +1 -1
@@ -268,7 +268,7 @@ struct p9_dirent {struct p9_qid qid;u64 d_off;unsigned char d_type; -char d_name[256 ]; +char *d_name; };struct iov_iter ;
net/9p/protocol.c +2 -10
@@ -771,7 +771,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len, {struct p9_fcall fake_pdu;int ret; -char *nameptr; +char *nameptr =NULL ; fake_pdu.size = len; fake_pdu.capacity = len;
@@ -786,15 +786,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len,return ret; } - ret =strscpy (dirent->d_name, nameptr,sizeof (dirent->d_name)); -if (ret <0 ) { -p9_debug (P9_DEBUG_ERROR , -"On the wire dirent name too long: %s\n" , - nameptr); -kfree (nameptr); -return ret; - } -kfree (nameptr); + dirent->d_name = nameptr;return fake_pdu.offset; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 67/990 xfrm: zero-initialise km_event in the replay-notify path
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shubham Antil <[email protected]>
[ Upstream commit e35a12dffd5da67b6ca12bd23eebdd0570592205 ]
xfrm_replay_notify(), xfrm_replay_notify_bmp() and xfrm_replay_notify_esn() declare a struct km_event on the stack and initialise only its .event and .data.aevent fields, leaving .seq and .portid uninitialised. build_aevent() then builds the XFRM_MSG_NEWAE message with those fields:
nlmsg_put(skb, c->portid, c->seq, ...)
so the netlink header of a replay event carries uninitialised stack values rather than defined ones. This was confirmed at runtime rather than by inspection alone: the .seq and .portid carried in that header hold values that nothing in the replay path assigns.
The request-driven paths set these header fields from the requester (xfrm_get_ae() / xfrm_new_ae()); only the kernel-originated replay path leaves them unset. Zero-initialise the event so the header fields are 0, the correct value for a kernel-originated notification.
--- net/xfrm/xfrm_replay.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/xfrm/xfrm_replay.c +3 -3
@@ -40,7 +40,7 @@ static void xfrm_replay_notify_esn(struct xfrm_state *x, int event);void xfrm_replay_notify (struct xfrm_state *x,int event) { -struct km_event c; +struct km_event c = {};/* we send notify messages in case * 1. we updated on of the sequence numbers, and the seqno difference * is at least x->replay_maxdiff, in this case we also update the
@@ -304,7 +304,7 @@ static void xfrm_replay_advance_bmp(struct xfrm_state *x, __be32 net_seq)static void xfrm_replay_notify_bmp (struct xfrm_state *x,int event) { -struct km_event c; +struct km_event c = {};struct xfrm_replay_state_esn *replay_esn = x->replay_esn;struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
@@ -356,7 +356,7 @@ static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)static void xfrm_replay_notify_esn (struct xfrm_state *x,int event) {u32 seq_diff, oseq_diff; -struct km_event c; +struct km_event c = {};struct xfrm_replay_state_esn *replay_esn = x->replay_esn;struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 68/990 batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <[email protected]>
[ Upstream commit dfa953ba5366b0a80c303700dab2bbcbdc5c27e9 ]
batadv_orig_ifinfo_new() returns NULL only when its GFP_ATOMIC allocation fails, which is a normal runtime condition and not a bug. batadv_v_ogm_forward() already handles this the same way, simply checking for NULL without a WARN_ON.
Do the same in batadv_iv_ogm_update_seqnos() to avoid a spurious WARN_ON splat when the allocation fails (e.g. under fault injection).
--- net/batman-adv/bat_iv_ogm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/bat_iv_ogm.c +1 -1
@@ -1298,7 +1298,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,return BATADV_NO_DUP ; orig_ifinfo =batadv_orig_ifinfo_new (orig_node, if_outgoing); -if (WARN_ON (!orig_ifinfo)) { +if (!orig_ifinfo) {batadv_orig_node_put (orig_node);return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 69/990 wifi: wext: Limit notifier event flushes to the devices netns
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <[email protected]>
[ Upstream commit 48c0045366bec142d053f7cf76fb9dd7127cd231 ]
With mlx5 netdev instance locking enabled, registering an IPoIB netdev calls the WEXT notifier while holding the instance mutex. Its call to wireless_nlevent_flush() takes net_rwsem to walk every namespace, completing the following lockdep dependency cycle:
netdev instance mutex -> net_rwsem (read) -> GID table mutex
-> event_handler_rwsem (read) -> netdev instance mutex
RoCE GID enumeration takes the GID table mutex under net_rwsem. GID updates dispatch events under the table mutex, taking event_handler_rwsem. The IPoIB event handler takes the netdev instance mutex in ipoib_queue_work() to traverse child interfaces.
The all-namespace walk originated in the single global worker servicing per-namespace WEXT queues. The ordering fixes later reused that routine in netdevice notifiers to prevent delayed WEXT RTM_NEWLINK messages from following RTM_DELLINK or reporting stale interface flags. A notifier only needs to drain the affected device's namespace; there is no reason for it to walk and flush all namespaces.
Pass dev_net(dev) from both notifier callers and make the flush helper operate on that namespace. Keep the all-namespace walk and net_rwsem in the existing worker. This removes the instance-mutex -> net_rwsem dependency while retaining synchronous flushing from the notifiers.
It may seem strange that the fix for a lock cycle across multiple subsystems lies in a completely unrelated part of the code, but this seemed the most justified lock cycle edge to break.
--- include/net/iw_handler.h | 8 +++++--- net/wireless/core.c | 2 +- net/wireless/wext-core.c | 33 +++++++++++++++++---------------- 3 files changed, 23 insertions(+), 20 deletions(-)
include/net/iw_handler.h +5 -3
@@ -201,6 +201,8 @@#include <linux/wireless.h> /* IOCTL user space API */ #include <linux/if_ether.h> +struct net ; +/***************************** VERSION *****************************/ /* * This constant is used to know which version of the driver API is
@@ -411,10 +413,10 @@ struct iw_spy_data {void wireless_send_event (struct net_device *dev,unsigned int cmd,union iwreq_data *wrqu,const char *extra);#ifdef CONFIG_WEXT_CORE -/* flush all previous wext events - if work is done from netdev notifiers */ -void wireless_nlevent_flush (void ); +/* Flush previous wext events in this netns from netdev notifiers. */ +void wireless_nlevent_flush (struct net *net);#else -static inline void wireless_nlevent_flush (void ) {} +static inline void wireless_nlevent_flush (struct net *net) {}#endif /* We may need a function to send a stream of events to user space.
net/wireless/core.c +1 -1
@@ -1762,7 +1762,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,return NOTIFY_DONE ; } -wireless_nlevent_flush (); +wireless_nlevent_flush (dev_net (dev));return NOTIFY_OK ; }
net/wireless/wext-core.c +17 -16
@@ -343,32 +343,28 @@ static const int compat_event_type_size[] = {/* IW event code */ -void wireless_nlevent_flush (void ) +void wireless_nlevent_flush (struct net *net) {struct sk_buff *skb; -struct net *net; -down_read (&net_rwsem); -for_each_net (net) { -while ((skb =skb_dequeue (&net->wext_nlevents))) -rtnl_notify (skb, net,0 ,RTNLGRP_LINK ,NULL , -GFP_KERNEL ); - } -up_read (&net_rwsem); +while ((skb =skb_dequeue (&net->wext_nlevents))) +rtnl_notify (skb, net,0 ,RTNLGRP_LINK ,NULL ,GFP_KERNEL ); }EXPORT_SYMBOL_GPL (wireless_nlevent_flush);static int wext_netdev_notifier_call (struct notifier_block *nb,unsigned long state,void *ptr) { +struct net_device *dev =netdev_notifier_info_to_dev (ptr); +/* -* When a netdev changes state in any way, flush all pending messages -* to avoid them going out in a strange order, e.g. RTM_NEWLINK after -* RTM_DELLINK, or with IFF_UP after without IFF_UP during dev_close() -* or similar - all of which could otherwise happen due to delays from -* schedule_work(). +* When a netdev changes state in any way, flush all pending messages in +* its network namespace to avoid them going out in a strange order, +* e.g. RTM_NEWLINK after RTM_DELLINK, or with IFF_UP after without +* IFF_UP during dev_close() or similar - all of which could otherwise +* happen due to delays from schedule_work(). */ -wireless_nlevent_flush (); +wireless_nlevent_flush (dev_net (dev));return NOTIFY_OK ; }
@@ -411,7 +407,12 @@ subsys_initcall(wireless_nlevent_init);/* Process events generated by the wireless layer or the driver. */ static void wireless_nlevent_process (struct work_struct *work) { -wireless_nlevent_flush (); +struct net *net; + +down_read (&net_rwsem); +for_each_net (net) +wireless_nlevent_flush (net); +up_read (&net_rwsem); } static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 70/990 fsnotify: preserve 64-bit pre-content ranges
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <[email protected]>
[ Upstream commit 1dcf2be94b9be2d366a0d2b70c2b1c7ebccf1443 ]
vfs_fallocate() and remap_verify_area() pass 64-bit lengths to fsnotify_file_area_perm(), which truncates them to size_t on 32-bit systems.
Use 64 bit (unsigned) types throughout the entire pre-content notification chain to keep the full range. The userspace range field is already 64-bits.
--- fs/notify/fanotify/fanotify.h | 2 +- fs/notify/fsnotify.c | 2 +- include/linux/fsnotify.h | 4 ++-- include/linux/fsnotify_backend.h | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)
fs/notify/fanotify/fanotify.h +1 -1
@@ -443,7 +443,7 @@ struct fanotify_perm_event {struct fanotify_event fae;struct path path;loff_t pos;/* FANOTIFY_NO_RANGE if unavailable */ -size_t count; +u64 count;u32 response;/* userspace answer to the event */ unsigned short state;/* state of the event */ unsigned short watchdog_cnt;/* already scanned by watchdog? */
fs/notify/fsnotify.c +1 -1
@@ -210,7 +210,7 @@ static inline __u32 fsnotify_object_watched(struct inode *inode, __u32 mnt_mask,/* Report pre-content event with optional range info */ int fsnotify_pre_content (const struct path *path,const loff_t *ppos, -size_t count) +u64 count) {struct file_range range;
include/linux/fsnotify.h +2 -2
@@ -135,7 +135,7 @@ int fsnotify_open_perm_and_set_mode(struct file *file);* fsnotify_file_area_perm - permission hook before access to file range */ static inline int fsnotify_file_area_perm (struct file *file,int perm_mask, -const loff_t *ppos,size_t count) +const loff_t *ppos,u64 count) {/* * filesystem may be modified in the context of permission events
@@ -213,7 +213,7 @@ static inline int fsnotify_open_perm_and_set_mode(struct file *file) }static inline int fsnotify_file_area_perm (struct file *file,int perm_mask, -const loff_t *ppos,size_t count) +const loff_t *ppos,u64 count) {return 0 ; }
include/linux/fsnotify_backend.h +3 -3
@@ -322,7 +322,7 @@ struct fs_error_report {struct file_range {const struct path *path;loff_t pos; -size_t count; +u64 count; };static inline const struct path *file_range_path (const struct file_range *range)
@@ -922,12 +922,12 @@ static inline void fsnotify_init_event(struct fsnotify_event *event) INIT_LIST_HEAD(&event->list); }int fsnotify_pre_content (const struct path *path,const loff_t *ppos, -size_t count); +u64 count);#else static inline int fsnotify_pre_content (const struct path *path, -const loff_t *ppos,size_t count) +const loff_t *ppos,u64 count) {return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 71/990 wifi: ath9k_htc: start ANI when an AP interface begins to beacon
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mehmet Fide <[email protected]>
[ Upstream commit 5c1b202d67a212c87e7389aaa093ce77828fa98f ]
ath9k_htc_vif_reconfig() re-arms ANI after a channel change when an AP interface beacons. mac80211 configures the channel before it enables the beacon, so during a normal AP start that never triggers, and the start from add_interface that the previous patch removed was cancelled by the same channel configuration: with hostapd, ANI and the periodic calibration it drives did not run in AP mode until a later channel change.
Start ANI when the beacon is enabled. The channel and its calibration data are in place by then, which is the state vif_reconfig() re-arms it in, and remove_interface() already stops it with the last AP interface.
--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +3 -0
@@ -1554,6 +1554,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,ath9k_htc_set_tsfadjust (priv, vif); priv->cur_beacon_conf.enable_beacon =1 ;ath9k_htc_beacon_config (priv, vif); +if (priv->ah->opmode ==NL80211_IFTYPE_AP && + !test_bit (ATH_OP_ANI_RUN , &common->op_flags)) +ath9k_htc_start_ani (priv); }if ((changed &BSS_CHANGED_BEACON_ENABLED ) && !bss_conf->enable_beacon) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 72/990 scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Kaloz <[email protected]>
[ Upstream commit 9a2690eb4bbea8d7fbc3dfe478fca75fe956abb4 ]
The REQUEST SENSE length was taken from sg->len after the AHC_DMA_LAST_SEG flag was or-ed in and the value converted to little-endian, so the 8-bit field is 0x80 on big-endian hosts and the target is asked for 128 bytes into a 32-byte buffer. Use the buffer size, as aic79xx does. On an SGI O2 with a Fujitsu MAX3147NC, the sense data of its CHECK CONDITIONs during probe was lost.
--- drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +1 -1
@@ -1097,7 +1097,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) sc->byte2 =SCB_GET_LUN (scb) <<5 ; sc->unused[0 ] =0 ; sc->unused[1 ] =0 ; - sc->length = sg->len; + sc->length =ahc_get_sense_bufsize (ahc, scb); sc->control =0 ;/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 73/990 scsi: scsi_debug: Drain target cleanup before module exit
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Piscitelli <[email protected]>
[ Upstream commit 34c99ce2993971712d89010a948d2f650687b796 ]
Target destruction queues cleanup in an exclusive async domain. The module loader's async_synchronize_full() does not wait for exclusive domains. Wait for target cleanup after removing the hosts and before removing the debugfs root and returning from module exit.
--- drivers/scsi/scsi_debug.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/scsi_debug.c +1 -0
@@ -8713,6 +8713,7 @@ static void __exit scsi_debug_exit(void)sdebug_erase_all_stores (false);xa_destroy (per_store_ap); +async_synchronize_full_domain (&sdebug_async_domain);debugfs_remove (sdebug_debugfs_root); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 74/990 scsi: aha1542: Remove unneeded scsi_dma_unmap() call
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Whitehead <[email protected]>
[ Upstream commit 9ec6671b137de06f0345962fb8091466b7d56a96 ]
aha1542 never DMA maps the command's scatterlist. Data is bounced through a per-command buffer allocated with dma_alloc_coherent() in aha1542_init_cmd_priv(), the adapter is programmed with acmd->data_buffer_handle, and the payload is copied to and from the request segments in aha1542_queuecommand() and aha1542_free_cmd().
The scsi_dma_unmap() call left in aha1542_free_cmd() therefore unmaps a scatterlist that was never mapped. With CONFIG_DMA_API_DEBUG enabled this results in:
device driver tries to free DMA memory it has not allocated
[device address=0x0000000000000000] [size=0 bytes]
Remove the call.
Verified by testing on real hardware.
--- drivers/scsi/aha1542.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/aha1542.c +0 -2
@@ -271,8 +271,6 @@ static void aha1542_free_cmd(struct scsi_cmnd *cmd) buf += bv.bv_len; } } - -scsi_dma_unmap (cmd); }static irqreturn_t aha1542_interrupt (int irq,void *dev_id)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 75/990 9p: Enable symlink caching in page cache
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Remi Pommarel <[email protected]>
[ Upstream commit 712da38d134b6681946368dd5c9400b43eb772b0 ]
Currently, when cache=loose is enabled, file reads are cached in the page cache, but symlink reads are not. This patch allows the results of p9_client_readlink() to be stored in the page cache, eliminating the need for repeated 9P transactions on subsequent symlink accesses.
This change improves performance for workloads that involve frequent symlink resolution.
Message-ID: <982462d17c0c0d2856763266a25eb04d080c1dbb.1779355927.git.repk@triplefau.lt>
Stable-dep-of: a3a6212c7d67 ("9p: treat read return values of 0 as EOF")
--- fs/9p/vfs_addr.c | 38 ++++++++++++++++++++++++++--- fs/9p/vfs_inode.c | 6 +++-- fs/9p/vfs_inode_dotl.c | 54 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 88 insertions(+), 10 deletions(-)
fs/9p/vfs_addr.c +35 -3
@@ -97,11 +97,34 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq) {struct netfs_io_request *rreq = subreq->rreq;struct p9_fid *fid = rreq->netfs_priv; +char *target;unsigned long long pos = subreq->start + subreq->transferred; -int total, err; - - total =p9_client_read (fid, pos, &subreq->io_iter, &err); +int total =0 , err, len, n; + +if (S_ISLNK (rreq->inode->i_mode)) { +/* p9_client_readlink() must not be called for legacy protocols +* 9p2000 or 9p2000.u. +*/ +BUG_ON (!p9_is_proto_dotl (fid->clnt)); +if (WARN_ON_ONCE (pos)) { +/* reading a link at a non null offset should +* not happen +*/ + err = -EIO ; + goto fill_subreq; + } + err =p9_client_readlink (fid, &target); +if (err !=0 ) + goto fill_subreq; + len =strlen (target); + n =copy_to_iter (target, len, &subreq->io_iter); +kfree (target); + total = n; + }else { + total =p9_client_read (fid, pos, &subreq->io_iter, &err); + } +fill_subreq:/* if we just extended the file size, any portion not in * cache won't be on server and is zeroes */ if (subreq->rreq->origin != NETFS_UNBUFFERED_READ &&
@@ -126,6 +149,7 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)static int v9fs_init_request (struct netfs_io_request *rreq,struct file *file) {struct p9_fid *fid; +struct dentry *dentry; bool writing = (rreq->origin == NETFS_READ_FOR_WRITE || rreq->origin == NETFS_WRITETHROUGH || rreq->origin == NETFS_UNBUFFERED_WRITE ||
@@ -142,6 +166,14 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)if (!fid) goto no_fid;p9_fid_get (fid); + }else if (S_ISLNK (rreq->inode->i_mode)) { + dentry =d_find_any_alias (rreq->inode); +if (!dentry) + goto no_fid; + fid =v9fs_fid_lookup (dentry); +dput (dentry); +if (IS_ERR (fid)) + goto no_fid; }else { fid =v9fs_fid_find_inode (rreq->inode, writing,INVALID_UID , true);if (!fid)
fs/9p/vfs_inode.c +4 -2
@@ -302,10 +302,12 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, goto error; } -if (v9fs_proto_dotl (v9ses)) +if (v9fs_proto_dotl (v9ses)) { inode->i_op = &v9fs_symlink_inode_operations_dotl; -else +inode_nohighmem (inode); + }else { inode->i_op = &v9fs_symlink_inode_operations; + }break ;case S_IFDIR :
fs/9p/vfs_inode_dotl.c +49 -5
86 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 76/990 9p: treat read return values of 0 as EOF
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Barret Rhoden <[email protected]>
[ Upstream commit a3a6212c7d67baebebd0e4c2cf2ae1b75eb9231e ]
If your 9p server shares a synthetic file system such as sysfs, the file size from stat often disagrees with the actual file size.
Treat non-error reads of 0 as EOF, except in the case where the request was for 0 bytes.
Tested:
[email protected]:hugelgupf/p9.git, served "/" on 10.0.2.2 bash-5.3# mount -t 9p -o trans=tcp,port=12345,cache=none 10.0.2.2 /tmp/foo bash-5.3# cat /tmp/foo/sys/devices/system/cpu/online 0-47
Message-ID: <[email protected]>
--- fs/9p/vfs_addr.c | 3 +++ 1 file changed, 3 insertions(+)
fs/9p/vfs_addr.c +3 -0
@@ -100,6 +100,7 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)char *target;unsigned long long pos = subreq->start + subreq->transferred;int total =0 , err, len, n; +size_t to_read =iov_iter_count (&subreq->io_iter);if (S_ISLNK (rreq->inode->i_mode)) {/* p9_client_readlink() must not be called for legacy protocols
@@ -132,6 +133,8 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)__set_bit (NETFS_SREQ_CLEAR_TAIL , &subreq->flags);if (pos + total >=i_size_read (rreq->inode))__set_bit (NETFS_SREQ_HIT_EOF , &subreq->flags); +if (!err && !total && to_read) +__set_bit (NETFS_SREQ_HIT_EOF , &subreq->flags);if (!err && total) { subreq->transferred += total;__set_bit (NETFS_SREQ_MADE_PROGRESS , &subreq->flags);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 77/990 9p: Cache negative dentries for lookup performance
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Remi Pommarel <[email protected]>
[ Upstream commit f00e6c1d282578b077b87b88f42e701bc40f2fff ]
Not caching negative dentries can result in poor performance for workloads that repeatedly look up non-existent paths. Each such lookup triggers a full 9P transaction with the server, adding unnecessary overhead.
A typical example is source compilation, where multiple cc1 processes are spawned and repeatedly search for the same missing header files over and over again.
This change enables caching of negative dentries, so that lookups for known non-existent paths do not require a full 9P transaction. The cached negative dentries are retained for a configurable duration (expressed in milliseconds), as specified by the ndentry_timeout field in struct v9fs_session_info. If set to -1, negative dentries are cached indefinitely.
This optimization reduces lookup overhead and improves performance for workloads involving frequent access to non-existent paths.
Message-ID: <e542317dd03bbadb5249abd3ea6aecfdca692c19.1779355927.git.repk@triplefau.lt>
Stable-dep-of: d037e9c1b40c ("9p: fix kernel-doc warning for enum p9_session_flags")
--- fs/9p/fid.c | 11 +++-- fs/9p/v9fs.c | 1 + fs/9p/v9fs.h | 5 ++ fs/9p/v9fs_vfs.h | 15 ++++++ fs/9p/vfs_dentry.c | 105 ++++++++++++++++++++++++++++++++++------ fs/9p/vfs_inode.c | 12 +++-- fs/9p/vfs_super.c | 1 + include/net/9p/client.h | 2 + 8 files changed, 128 insertions(+), 24 deletions(-)
fs/9p/fid.c +6 -5
@@ -20,7 +20,9 @@static inline void __add_fid (struct dentry *dentry,struct p9_fid *fid) { -hlist_add_head (&fid->dlist, (struct hlist_head *)&dentry->d_fsdata); +struct v9fs_dentry *v9fs_dentry =to_v9fs_dentry (dentry); + +hlist_add_head (&fid->dlist, &v9fs_dentry->head); }
@@ -112,6 +114,7 @@ void v9fs_open_fid_add(struct inode *inode, struct p9_fid **pfid)static struct p9_fid *v9fs_fid_find (struct dentry *dentry,kuid_t uid,int any) { +struct v9fs_dentry *v9fs_dentry =to_v9fs_dentry (dentry);struct p9_fid *fid, *ret; p9_debug(P9_DEBUG_VFS, " dentry: %pd (%p) uid %d any %d\n",
@@ -119,11 +122,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any) any); ret =NULL ;/* we'll recheck under lock if there's anything to look in */ -if (dentry->d_fsdata) { -struct hlist_head *h = (struct hlist_head *)&dentry->d_fsdata; - +if (!hlist_empty (&v9fs_dentry->head)) {spin_lock (&dentry->d_lock); -hlist_for_each_entry (fid, h, dlist) { +hlist_for_each_entry (fid, &v9fs_dentry->head, dlist) {if (any ||uid_eq (fid->uid, uid)) { ret = fid;p9_fid_get (ret);
fs/9p/v9fs.c +1 -0
@@ -403,6 +403,7 @@ static void v9fs_apply_options(struct v9fs_session_info *v9ses, v9ses->cache = ctx->session_opts.cache; v9ses->uid = ctx->session_opts.uid; v9ses->session_lock_timeout = ctx->session_opts.session_lock_timeout; + v9ses->ndentry_timeout_ms = ctx->session_opts.ndentry_timeout_ms; }/**
fs/9p/v9fs.h +5 -0
@@ -91,6 +91,7 @@ enum p9_cache_bits {* @debug: debug level * @afid: authentication handle * @cache: cache mode of type &p9_cache_bits +* @ndentry_timeout: Negative dentry lookup cache retention time in ms * @cachetag: the tag of the cache associated with this session * @fscache: session cookie associated with FS-Cache * @uname: string user name to mount hierarchy as
@@ -101,6 +102,7 @@ enum p9_cache_bits {* @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy * @clnt: reference to 9P network client instantiated for this session * @slist: reference to list of registered 9p sessions +* @ndentry_timeout_ms: Negative dentry caching retention time * * This structure holds state for each session instance established during * a sys_mount() .
@@ -116,6 +118,7 @@ struct v9fs_session_info {unsigned short debug;unsigned int afid;unsigned int cache; +unsigned int ndentry_timeout_ms;#ifdef CONFIG_9P_FSCACHE char *cachetag;struct fscache_volume *fscache;
@@ -133,6 +136,8 @@ struct v9fs_session_info {long session_lock_timeout;/* retry interval for blocking locks */ }; +#define NDENTRY_TIMEOUT_NEVER (-1U) +/* cache_validity flags */ #define V9FS_INO_INVALID_ATTR 0x01
fs/9p/v9fs_vfs.h +15 -0
@@ -28,6 +28,19 @@/* flags for v9fs_stat2inode() & v9fs_stat2inode_dotl() */ #define V9FS_STAT2INODE_KEEP_ISIZE 1 +/** +* struct v9fs_dentry - v9fs specific dentry data +* @head: List of fid associated with this dentry +* @expire_time: Lookup cache expiration time for negative dentries +* @rcu: used by kfree_rcu to schedule clean up job +*/ +struct v9fs_dentry { +struct hlist_head head; +u64 expire_time; +struct rcu_head rcu; +}; +#define to_v9fs_dentry (d) ((struct v9fs_dentry *)((d)->d_fsdata)) +extern struct file_system_type v9fs_fs_type;extern const struct address_space_operations v9fs_addr_operations;extern const struct file_operations v9fs_file_operations;
@@ -35,6 +48,8 @@ extern const struct file_operations v9fs_file_operations_dotl;extern const struct file_operations v9fs_dir_operations;extern const struct file_operations v9fs_dir_operations_dotl;extern const struct dentry_operations v9fs_dentry_operations; +extern void v9fs_ndentry_refresh_timeout (struct dentry *dentry); +extern void v9fs_dentry_fid_remove (struct dentry *dentry);extern const struct dentry_operations v9fs_cached_dentry_operations;extern struct kmem_cache *v9fs_inode_cache;
fs/9p/vfs_dentry.c +91 -14
156 lines not on this page · raw message
fs/9p/vfs_inode.c +7 -5
@@ -568,7 +568,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags)/* invalidate all fids associated with dentry */ /* NOTE: This will not include open fids */ - dentry->d_op->d_release (dentry); +v9fs_dentry_fid_remove (dentry); }return retval; }
@@ -744,14 +744,16 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, name = dentry->d_name.name; fid =p9_client_walk (dfid,1 , &name,1 );p9_fid_put (dfid); -if (fid ==ERR_PTR (-ENOENT )) +if (fid ==ERR_PTR (-ENOENT )) { inode =NULL ; -else if (IS_ERR (fid)) +v9fs_ndentry_refresh_timeout (dentry); + }else if (IS_ERR (fid)) { inode =ERR_CAST (fid); -else if (v9ses->cache & (CACHE_META |CACHE_LOOSE )) + }else if (v9ses->cache & (CACHE_META |CACHE_LOOSE )) { inode =v9fs_get_inode_from_fid (v9ses, fid, dir->i_sb); -else + }else { inode =v9fs_get_new_inode_from_fid (v9ses, fid, dir->i_sb); + }/* * If we had a rename on the server and a parallel lookup * for the new name, then make sure we instantiate with
fs/9p/vfs_super.c +1 -0
@@ -327,6 +327,7 @@ static int v9fs_init_fs_context(struct fs_context *fc) ctx->session_opts.uid =INVALID_UID ; ctx->session_opts.dfltuid =V9FS_DEFUID ; ctx->session_opts.dfltgid =V9FS_DEFGID ; + ctx->session_opts.ndentry_timeout_ms =0 ;/* initialize client options */ ctx->client_opts.proto_version = p9_proto_2000L;
include/net/9p/client.h +2 -0
@@ -192,6 +192,7 @@ struct p9_rdma_opts {* @dfltgid: default numeric groupid to mount hierarchy as * @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy * @session_lock_timeout: retry interval for blocking locks +* @ndentry_timeout_ms: Negative dentry lookup cache retention time in ms * * This strucure holds options which are parsed and will be transferred * to the v9fs_session_info structure when mounted, and therefore largely
@@ -203,6 +204,7 @@ struct p9_session_opts {unsigned short debug;unsigned int afid;unsigned int cache; +unsigned int ndentry_timeout_ms;#ifdef CONFIG_9P_FSCACHE char *cachetag;#endif
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 78/990 9p: Add mount option for negative dentry cache retention
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Remi Pommarel <[email protected]>
[ Upstream commit 5670a84b5cda6b82016282accfd61ef36aceafbf ]
Introduce a new mount option, negtimeout, for v9fs that allows users to specify how long negative dentries are retained in the cache. The retention time can be set in milliseconds (e.g. negtimeout=10000 for a 10secs retention time) or a negative value (e.g. negtimeout=-1) to keep negative entries until the buffer cache management removes them.
For consistency reasons, this option should only be used in exclusive or read-only mount scenarios, aligning with the cache=loose usage.
Message-ID: <b2d66500aa5a2f6540347c4aa46a4be10dd01bc6.1779355927.git.repk@triplefau.lt>
Stable-dep-of: d037e9c1b40c ("9p: fix kernel-doc warning for enum p9_session_flags")
--- Documentation/filesystems/9p.rst | 5 +++++ fs/9p/v9fs.c | 16 +++++++++++++++- fs/9p/v9fs.h | 23 +++++++++++++---------- 3 files changed, 33 insertions(+), 11 deletions(-)
Documentation/filesystems/9p.rst +5 -0
@@ -238,6 +238,11 @@ Options cachetag cache tag to use the specified persistent cache. cache tags for existing cache sessions can be listed at /sys/fs/9p/caches. (applies only to cache=fscache) + + negtimeout the duration (in milliseconds) that negative dentries (paths + that do not actually exist) are retained in the cache. If + set to a negative value, those entries are kept indefinitely + until evicted by the buffer cache management system ============= =============================================================== Behavior
fs/9p/v9fs.c +15 -1
@@ -40,7 +40,7 @@ enum {* source if we rejected it as EINVAL */ Opt_source,/* Options that take integer arguments */ - Opt_debug, Opt_dfltuid, Opt_dfltgid, Opt_afid, + Opt_debug, Opt_dfltuid, Opt_dfltgid, Opt_afid, Opt_negtimeout,/* String options */ Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag, /* Options that take no arguments */
@@ -103,6 +103,7 @@ const struct fs_parameter_spec v9fs_param_spec[] = {fsparam_string ("access" , Opt_access),fsparam_flag ("posixacl" , Opt_posixacl),fsparam_u32 ("locktimeout" , Opt_locktimeout), +fsparam_s32 ("negtimeout" , Opt_negtimeout),/* client options */ fsparam_u32 ("msize", Opt_msize),
@@ -142,6 +143,9 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) from_kgid_munged(&init_user_ns, v9ses->dfltgid));if (v9ses->afid != ~0 )seq_printf (m,",afid=%u" , v9ses->afid); +if (v9ses->flags &V9FS_NDENTRY_TIMEOUT_SET ) +seq_printf (m,",negtimeout=%d" , + (int )v9ses->ndentry_timeout_ms);if (strcmp (v9ses->uname,V9FS_DEFUSER ) !=0 )seq_printf (m,",uname=%s" , v9ses->uname);if (strcmp (v9ses->aname,V9FS_DEFANAME ) !=0 )
@@ -318,6 +322,16 @@ int v9fs_parse_param(struct fs_context *fc, struct fs_parameter *param) session_opts->session_lock_timeout = (long )result.uint_32 *HZ ;break ; +case Opt_negtimeout: + session_opts->flags |=V9FS_NDENTRY_TIMEOUT_SET ; +if (result.int_32 <0 ) { + session_opts->ndentry_timeout_ms = +NDENTRY_TIMEOUT_NEVER ; + }else { + session_opts->ndentry_timeout_ms = result.int_32; + } +break ; +/* Options for client */ case Opt_msize:if (result.uint_32 <4096 ) {
fs/9p/v9fs.h +13 -10
@@ -24,6 +24,8 @@* @V9FS_ACCESS_ANY: use a single attach for all users * @V9FS_ACCESS_MASK: bit mask of different ACCESS options * @V9FS_POSIX_ACL: POSIX ACLs are enforced +* @V9FS_NDENTRY_TIMEOUT_SET: Has negative dentry timeout retention time been +* overridden by negtimeout mount option * * Session flags reflect options selected by users at mount time */
@@ -34,16 +36,17 @@#define V9FS_ACL_MASK V9FS_POSIX_ACLenum p9_session_flags { -V9FS_PROTO_2000U =0x01 , -V9FS_PROTO_2000L =0x02 , -V9FS_ACCESS_SINGLE =0x04 , -V9FS_ACCESS_USER =0x08 , -V9FS_ACCESS_CLIENT =0x10 , -V9FS_POSIX_ACL =0x20 , -V9FS_NO_XATTR =0x40 , -V9FS_IGNORE_QV =0x80 ,/* ignore qid.version for cache hints */ -V9FS_DIRECT_IO =0x100 , -V9FS_SYNC =0x200 +V9FS_PROTO_2000U =0x01 , +V9FS_PROTO_2000L =0x02 , +V9FS_ACCESS_SINGLE =0x04 , +V9FS_ACCESS_USER =0x08 , +V9FS_ACCESS_CLIENT =0x10 , +V9FS_POSIX_ACL =0x20 , +V9FS_NO_XATTR =0x40 , +V9FS_IGNORE_QV =0x80 ,/* ignore qid.version for cache hints */ +V9FS_DIRECT_IO =0x100 , +V9FS_SYNC =0x200 , +V9FS_NDENTRY_TIMEOUT_SET =0x400 , };/**
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 79/990 9p: fix kernel-doc warning for enum p9_session_flags
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omokefe Emmanuel Onanaroghene <[email protected]>
[ Upstream commit d037e9c1b40c28eb57ea10947141cad3781b91a7 ]
kernel-doc cannot parse enum p9_session_flags, since its documentation comment is followed by #define lines instead of the enum declaration:
fs/9p/v9fs.h:31 : error: Cannot parse enum!
Move the three #define lines below the enum whose values they are derived from, and give V9FS_ACCESS_ANY and V9FS_ACCESS_MASK their own kernel-doc comments with the descriptions they had in the enum comment.
Also document the four enum members that had no description, using the corresponding mount option wording from Documentation/filesystems/9p.rst.
Message-ID: <[email protected]>
--- Documentation/filesystems/9p.rst | 2 +- fs/9p/v9fs.h | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-)
Documentation/filesystems/9p.rst +1 -1
@@ -231,7 +231,7 @@ Options any v9fs does single attach and performs all operations as one user - clien + client ACL based access check on the 9p client side for access validation
fs/9p/v9fs.h +18 -8
@@ -21,20 +21,16 @@* @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy * @V9FS_ACCESS_USER: a new attach will be issued for every user (default) * @V9FS_ACCESS_CLIENT: Just like user, but access check is performed on client. -* @V9FS_ACCESS_ANY: use a single attach for all users -* @V9FS_ACCESS_MASK: bit mask of different ACCESS options * @V9FS_POSIX_ACL: POSIX ACLs are enforced +* @V9FS_NO_XATTR: do not offer xattr functions on this mount +* @V9FS_IGNORE_QV: ignore qid.version==0 as a marker to disable data cache +* @V9FS_DIRECT_IO: disable data read/write cache +* @V9FS_SYNC: disable data write cache * @V9FS_NDENTRY_TIMEOUT_SET: Has negative dentry timeout retention time been * overridden by negtimeout mount option * * Session flags reflect options selected by users at mount time */ -#define V9FS_ACCESS_ANY (V9FS_ACCESS_SINGLE | \ - V9FS_ACCESS_USER | \ - V9FS_ACCESS_CLIENT) -#define V9FS_ACCESS_MASK V9FS_ACCESS_ANY -#define V9FS_ACL_MASK V9FS_POSIX_ACL -enum p9_session_flags {V9FS_PROTO_2000U =0x01 ,V9FS_PROTO_2000L =0x02 ,
@@ -49,6 +45,20 @@ enum p9_session_flags { V9FS_NDENTRY_TIMEOUT_SET = 0x400, }; +/** +* V9FS_ACCESS_ANY - use a single attach for all users +*/ +#define V9FS_ACCESS_ANY (V9FS_ACCESS_SINGLE | \ + V9FS_ACCESS_USER | \ + V9FS_ACCESS_CLIENT) + +/** +* V9FS_ACCESS_MASK - bit mask of different ACCESS options +*/ +#define V9FS_ACCESS_MASK V9FS_ACCESS_ANY + +#define V9FS_ACL_MASK V9FS_POSIX_ACL +/** * enum p9_cache_shortcuts - human readable cache preferences * @CACHE_SC_NONE: disable all caches
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 80/990 9p: fall back to the normal open path for non-regular files
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuanfu Xie <[email protected]>
[ Upstream commit ff1baa01a6e1f24741f7428119e6f3a61b995604 ]
v9fs_vfs_atomic_open() and v9fs_vfs_atomic_open_dotl() call finish_open(file, dentry, generic_file_open) regardless of the file type the server reported for the created dentry. The supplied callback replaces f_op->open in do_dentry_open(), so blkdev_open() never runs for a server-reported device node: an open() with O_CREAT succeeds with f_op = def_blk_fops while f_mapping still points at the 9p inode, because the bdev mapping swap only happens inside blkdev_open(). The block file methods then derive their block_device from that inode with I_BDEV(); the loads land at the tail of a 656-byte v9fs_inode_cache object (offsets +624 and +632), which KASAN reports as slab-out-of-bounds, and the garbage they read is then dereferenced, so the first read(), write(), ioctl() or close() ends in a NULL pointer write and a panic. In the ioctl(BLKGETSIZE64) variant the value read this way is returned to userspace.
The server controls the file type reported for the create, so a malicious server can crash the client this way. KASAN report of the read() variant, on a build of linux-stable 2709dd5ae32f:
BUG: KASAN: slab-out-of-bounds in blkdev_read_iter+0x3cd/0x440 Read of size 8 at addr ffff88800828ceb0 by task repro/1 Call Trace: <TASK> dump_stack_lvl+0x7b/0xa0 print_report+0xd0/0x630 kasan_report+0xe5/0x120 blkdev_read_iter+0x3cd/0x440 vfs_read+0x718/0xa50 ksys_read+0x10f/0x200 do_syscall_64+0xdd/0x4a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f </TASK> The buggy address belongs to the object at ffff88800828cc40 which belongs to the cache v9fs_inode_cache of size 656
The buggy address is located 624 bytes inside of
allocated 656-byte region [ffff88800828cc40, ffff88800828ced0)
A plain open() without O_CREAT is not affected: it runs blkdev_open() and either maps the device correctly or fails with -ENXIO for an rdev with no registered device. When the created inode is not a regular file, clunk the fid the create opened. The unopened fid is already on the dentry. Set FMODE_CREATED and return finish_no_open(file, NULL) so the VFS keeps its dentry reference and calls the inode's ->open. Regular files still use finish_open() with generic_file_open.
Message-ID: <[email protected]>
--- fs/9p/vfs_inode.c | 10 ++++++++++ fs/9p/vfs_inode_dotl.c | 12 ++++++++++++ 2 files changed, 22 insertions(+)
fs/9p/vfs_inode.c +10 -0
@@ -811,6 +811,16 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,v9fs_invalidate_inode_attr (dir); inode =d_inode (dentry); v9inode =V9FS_I (inode); +if (!S_ISREG (inode->i_mode)) { +/* +* Not a regular file. v9fs_create() already stored the +* unopened fid on the dentry. Clunk the opened fid from +* the create and let the VFS call ->open. +*/ +p9_fid_put (fid); + file->f_mode |=FMODE_CREATED ; +return finish_no_open (file,NULL ); + } err =finish_open (file, dentry, generic_file_open);if (unlikely (err)) {p9_fid_put (fid);
fs/9p/vfs_inode_dotl.c +12 -0
@@ -313,6 +313,18 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,v9fs_fid_add (dentry, &fid);d_instantiate (dentry, inode); +if (!S_ISREG (inode->i_mode)) { +/* +* Not a regular file. The unopened fid is already on the +* dentry. Clunk the opened create fid and let the VFS call +* ->open. +*/ +p9_fid_put (ofid); + ofid =NULL ; + file->f_mode |=FMODE_CREATED ; + err =finish_no_open (file,NULL ); + goto out; + }/* Since we are opening a file, assign the open fid to the file */ err =finish_open (file, dentry, generic_file_open);if (err)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 81/990 9p: do not store the create fid on special files
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuanfu Xie <[email protected]>
[ Upstream commit 56894cadf21c34abbba7f74b8f5d78dabf69dd39 ]
v9fs_vfs_atomic_open_dotl() always stores the create fid in file->private_data after finish_open(). FIFO and device inodes already have type-specific file_operations that own that field. Overwriting it with the fid makes later read/write/close treat the p9_fid as a pipe_inode_info, which corrupts the fid and can use it after it has been clunked. The non-dotl atomic_open path does not assign the fid this way.
Only attach the fid for regular files and directories. Special files do not need the create fid; leave it for the existing p9_fid_put() on the out path so it is clunked before return.
KASAN report, linux-stable 4982d3552a3b:
BUG: KASAN: slab-use-after-free in anon_pipe_prefill_and_lock+0x376/0x3f0 Read of size 4 at addr ffff88800ab30538 by task repro/1 Call Trace: <TASK> anon_pipe_prefill_and_lock+0x376/0x3f0 anon_pipe_write+0x127/0x1600 fifo_pipe_write+0x24/0x300 vfs_write+0x659/0xd00 ksys_write+0x10f/0x200 do_syscall_64+0xdd/0x4a0 </TASK>
Message-ID: <[email protected]>
--- fs/9p/vfs_inode_dotl.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
fs/9p/vfs_inode_dotl.c +16 -8
@@ -329,16 +329,24 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, err =finish_open (file, dentry, generic_file_open);if (err) goto out; - file->private_data = ofid; +/* +* Special files have type-specific fops that own +* file->private_data. The create fid is unused +* there: leave it for p9_fid_put() on the out +* path so it is clunked before we return. +*/ +if (S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode)) { + file->private_data = ofid;#ifdef CONFIG_9P_FSCACHE -if (v9ses->cache &CACHE_FSCACHE ) { -struct v9fs_inode *v9inode =V9FS_I (inode); -fscache_use_cookie (v9fs_inode_cookie (v9inode), - file->f_mode &FMODE_WRITE ); - } +if (v9ses->cache &CACHE_FSCACHE ) { +struct v9fs_inode *v9inode =V9FS_I (inode); +fscache_use_cookie (v9fs_inode_cookie (v9inode), + file->f_mode &FMODE_WRITE ); + }#endif -v9fs_fid_add_modes (ofid, v9ses->flags, v9ses->cache, flags); -v9fs_open_fid_add (inode, &ofid); +v9fs_fid_add_modes (ofid, v9ses->flags, v9ses->cache, flags); +v9fs_open_fid_add (inode, &ofid); + } file->f_mode |=FMODE_CREATED ; out:p9_fid_put (dfid);
Signature · 1 line
2.53.0