6.6.145-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainercover 6.6.145-rc1 review
This is the start of the stable review cycle for the 6.6.145 release. There are 1266 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 Thu, 23 Jul 2026 15:23:00 +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.6.145-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.6.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.6.145-rc1
Danilo Krummrich <[email protected]>
driver core: Guard deferred probe timeout extension with delayed_work_pending()
Danilo Krummrich <[email protected]>
driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
Easwar Hariharan <[email protected]>
jiffies: Cast to unsigned long in secs_to_jiffies() conversion
Easwar Hariharan <[email protected]>
jiffies: Define secs_to_jiffies()
Baokun Li <[email protected]>
writeback: drop now-unnecessary rcu_barrier() in cgroup_writeback_umount()
Jan Kara <[email protected]>
writeback: Fix use after free in inode_switch_wbs_work_fn()
Darrick J. Wong <[email protected]>
xfs: fix stupid compiler warning
Arnd Bergmann <[email protected]>
Bluetooth: btmtk: remove #ifdef around declarations
Arnd Bergmann <[email protected]>
Bluetooth: btmtk: Fix btmtk.c undefined reference build error harder
Benjamin Tissoires <[email protected]>
selftests/hid: ensure CKI can compile our new tests on old kernels
Luiz Augusto von Dentz <[email protected]>
Bluetooth: 6lowpan: Fix using chan->conn as indication to no remote netdev
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix attempting to send HCI_Disconnect to BIS handle
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Remove check of BDADDR_ANY in hci_conn_hash_lookup_big_state
Gil Portnoy <[email protected]>
ksmbd: fix durable reconnect double-bind race in ksmbd_reopen_durable_fd
Randy Dunlap <[email protected]>
seqlock: fix scoped_seqlock_read kernel-doc
Marc Zyngier <[email protected]>
KVM: Move kvm_io_bus_get_dev() locking responsibilities to callers
Siwei Zhang <[email protected]>
Bluetooth: hci_conn: Fix null ptr deref in hci_abort_conn()
Cen Zhang <[email protected]>
Bluetooth: hci_sync: annotate data-races around hdev->req_status
Pauli Virtanen <[email protected]>
Bluetooth: separate CIS_LINK and BIS_LINK link types
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO
Qu Wenruo <[email protected]>
btrfs: fix incorrect buffered IO fallback for append direct writes
Qu Wenruo <[email protected]>
btrfs: fix false IO failure after falling back to buffered write
Rochan Avlur <[email protected]>
exfat: preserve benign secondary entries during rename and move
Yuezhang Mo <[email protected]>
exfat: move exfat_chain_set() out of __exfat_resolve_path()
Yuezhang Mo <[email protected]>
exfat: add exfat_get_dentry_set_by_ei() helper
Yuezhang Mo <[email protected]>
exfat: rename argument name for exfat_move_file and exfat_rename_file
Yuezhang Mo <[email protected]>
exfat: remove unnecessary read entry in __exfat_rename()
Yuezhang Mo <[email protected]>
exfat: move free cluster out of exfat_init_ext_entry()
Pedro Falcato <[email protected]>
mm: do file ownership checks with the proper mount idmap
Wentao Liang <[email protected]>
regulator: scmi: fix of_node refcount leak in scmi_regulator_probe()
Krzysztof Kozlowski <[email protected]>
regulator: scmi: Simplify with scoped for each OF child loop
Ricardo Robaina <[email protected]>
audit: fix potential integer overflow in audit_log_n_hex()
Ricardo Robaina <[email protected]>
audit: add audit_log_nf_skb helper function
Ahsan Atta <[email protected]>
crypto: qat - fix restarting state leak on allocation failure
Qu Wenruo <[email protected]>
btrfs: check and set EXTENT_DELALLOC_NEW before clearing EXTENT_DELALLOC
Neill Kapron <[email protected]>
usb: gadget: f_fs: Tie read_buffer lifetime to ffs_epfile
Tianchu Chen <[email protected]>
nvmet-auth: validate reply message payload bounds against transfer length
Hannes Reinecke <[email protected]>
nvmet: return DHCHAP status codes from nvmet_setup_auth()
Chaitanya Kulkarni <[email protected]>
nvmet: remove superfluous initialization
Tyler Baker <[email protected]>
usb: gadget: f_fs: initialize reset_work at allocation time
Thorsten Blum <[email protected]>
crypto: atmel-sha204a - drop hwrng quality reduction for ATSHA204A
Uwe Kleine-König <[email protected]>
crypto: atmel - Drop explicit initialization of struct i2c_device_id::driver_data to 0
Andy Yan <[email protected]>
usb: typec: tcpm: Fix VDM type for Enter Mode commands
Mauricio Faria de Oliveira <[email protected]>
usb: atm: ueagle-atm: wait for pre-firmware load in .disconnect()
Oliver Neukum <[email protected]>
usb: iowarrior: remove inherent race with minor number
Vlad Poenaru <[email protected]>
bpf: Allow LPM map access from sleepable BPF programs
Andrii Nakryiko <[email protected]>
bpf: Consistently use bpf_rcu_lock_held() everywhere
Tristan Madani <[email protected]>
hfs/hfsplus: fix u32 overflow in check_and_correct_requested_length
Viacheslav Dubeyko <[email protected]>
hfs/hfsplus: prevent getting negative values of offset/length
Andy Shevchenko <[email protected]>
serial: 8250_mid: Disable DMA for selected platforms
Ilpo Järvinen <[email protected]>
serial: 8250_mid: Remove 8250_pci usage
Manish Khadka <[email protected]>
HID: appleir: fix UAF on pending key_up_timer in remove()
Thomas Gleixner <[email protected]>
treewide: Switch/rename to timer_delete[_sync]()
Jann Horn <[email protected]>
proc: protect ptrace_may_access() with exec_update_lock (part 1)
Oleg Nesterov <[email protected]>
seqlock: Change do_task_stat() to use scoped_seqlock_read()
Peter Zijlstra <[email protected]>
seqlock: Introduce scoped_seqlock_read()
Vlastimil Babka (SUSE) <[email protected]>
mm/slab: do not limit zeroing to orig_size when only red zoning is enabled
Trung Nguyen <[email protected]>
HID: multitouch: fix out-of-bounds bit access on mt_io_flags
Angela Czubak <[email protected]>
HID: add haptics page defines
Zide Chen <[email protected]>
perf/x86/intel/uncore: Defer ADL global PMON enable to enable_box()
Baokun Li <[email protected]>
writeback: fix race between cgroup_writeback_umount() and inode_switch_wbs()
Jan Kara <[email protected]>
writeback: Avoid contention on wb->list_lock when switching inodes
Guangshuo Li <[email protected]>
cpufreq: qcom-cpufreq-hw: Fix possible double free
Lizhe <[email protected]>
cpufreq: Make cpufreq_driver->exit() return void
Viresh Kumar <[email protected]>
cpufreq: pcc: Remove empty exit() callback
Jann Horn <[email protected]>
proc: protect ptrace_may_access() with exec_update_lock (FD links)
Christoph Hellwig <[email protected]>
proc: rename proc_setattr to proc_nochmod_setattr
Namjae Jeon <[email protected]>
ksmbd: track the connection owning a byte-range lock
DaeMyung Kang <[email protected]>
ksmbd: centralize ksmbd_conn final release to plug transport leak
Namjae Jeon <[email protected]>
ksmbd: use opener credentials for FSCTL mutations
Michael Bommarito <[email protected]>
smb: client: resolve SWN tcon from live registrations
Markus Elfring <[email protected]>
smb: client: Improve unlocking of a mutex in cifs_get_swn_reg()
Siwei Zhang <[email protected]>
Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_new_connection_cb()
Pauli Virtanen <[email protected]>
Bluetooth: 6lowpan: fix cyclic locking warning on netdev unregister
Runyu Xiao <[email protected]>
Bluetooth: L2CAP: cancel pending_rx_work before taking conn->lock
Florian Westphal <[email protected]>
netfilter: ebtables: zero chainstack array
Qianfeng Rong <[email protected]>
netfilter: ebtables: Use vmalloc_array() to improve code
Xiaolei Wang <[email protected]>
media: nxp: imx8-isi: Fix use-after-free on remove
Frank Li <[email protected]>
media: nxp: imx8-isi: use devm_pm_runtime_enable() to simplify code
Uwe Kleine-König <[email protected]>
media: nxp: imx8-isi: Convert to platform remove callback returning void
Runyu Xiao <[email protected]>
gpio: sch: use raw_spinlock_t in the irq startup path
Runyu Xiao <[email protected]>
coresight: etb10: restore atomic_t for shared reading state
Shakeel Butt <[email protected]>
mm/shrinker: do not hold RCU lock in shrinker_debugfs_count_show()
Qi Zheng <[email protected]>
mm: shrinker: remove redundant shrinker_rwsem in debugfs operations
Marco Elver <[email protected]>
Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref
Giovanni Cabiddu <[email protected]>
crypto: qat - fix VF2PF work teardown race in adf_disable_sriov()
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB reads in rtw_get_sec_ie(), rtw_get_wapi_ie(), and rtw_get_wps_attr()
Nikolay Kulikov <[email protected]>
staging: rtl8723bs: fix spaces around binary operators
William Hansen-Baird <[email protected]>
staging: rtl8723bs: core: move constants to right side in comparison
Marco Nenciarini <[email protected]>
PCI: Skip Resizable BAR restore on read error
Ilpo Järvinen <[email protected]>
PCI: Move Resizable BAR code to rebar.c
Ilpo Järvinen <[email protected]>
PCI: Add kerneldoc for pci_resize_resource()
Ilpo Järvinen <[email protected]>
PCI: Fix restoring BARs on BAR resize rollback path
Ilpo Järvinen <[email protected]>
PCI: Free saved list without holding pci_bus_sem
Ilpo Järvinen <[email protected]>
PCI: Prevent resource tree corruption when BAR resize fails
Manivannan Sadhasivam <[email protected]>
PCI: mediatek: Fix IRQ domain leak when port fails to enable
Christian Marangi <[email protected]>
PCI: mediatek: Use generic MACRO for TPVPERL delay
Christian Marangi <[email protected]>
PCI: mediatek: Convert bool to single quirks entry and bitmap
Jiri Slaby (SUSE) <[email protected]>
PCI: controller: Use dev_fwnode() instead of of_fwnode_handle()
Richard Zhu <[email protected]>
PCI: imx6: Fix IMX6SX_GPR12_PCIE_TEST_POWERDOWN handling
Alex Williamson <[email protected]>
vfio/mlx5: Fix racy bitfields and tighten struct layout
Mahesh Vaidya <[email protected]>
PCI: altera: Fix resource leaks on probe failure
Zhao Dongdong <[email protected]>
ALSA: aoa: check snd_ctl_new1() return value
Herman van Hazendonk <[email protected]>
iio: common: st_sensors: honour channel endianness in read_axis_data
Alexander Lobakin <[email protected]>
bitops: make BYTES_TO_BITS() treewide-available
Biren Pandya <[email protected]>
iio: pressure: mpl115: fix runtime PM leak on read error
Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: fix timestamping by limiting FIFO reading
Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: stabilized timestamp in interrupt
Jean-Baptiste Maneyrol <[email protected]>
iio: invensense: fix timestamp glitches when switching frequency
Colin Ian King <[email protected]>
iio: invensense: remove redundant initialization of variable period
Zhang Lixu <[email protected]>
iio: hid-sensor-rotation: Fix stale or zero output when reading raw values
Runyu Xiao <[email protected]>
iio: imu: adis: add IRQF_NO_THREAD to non-FIFO trigger IRQ
Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Fix possible deadlock and missing notifications
Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Use devm_acpi_install_notify_handler()
Rafael J. Wysocki <[email protected]>
ACPI: bus: Introduce devm_acpi_install_notify_handler()
Rafael J. Wysocki <[email protected]>
ACPI: driver: Check ACPI_COMPANION() against NULL during probe
Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Fix acpi_nfit_init() error cleanup
Sandipan Das <[email protected]>
perf/x86/amd/brs: Fix kernel address leakage
Pengpeng Hou <[email protected]>
mtd: rawnand: lpc32xx_slc: fail DMA transfer on completion timeout
Pengpeng Hou <[email protected]>
mtd: rawnand: lpc32xx_mlc: fail DMA transfers on timeout
Pengpeng Hou <[email protected]>
mtd: rawnand: fsl_ifc: return errors for failed page reads
Runyu Xiao <[email protected]>
mmc: vub300: defer reset until cmd_mutex is unlocked
Pengpeng Hou <[email protected]>
mtd: mchp23k256: use SPI match data for chip caps
Pengpeng Hou <[email protected]>
mtd: onenand: samsung: report DMA completion timeouts
Rafael Beims <[email protected]>
wifi: mwifiex: fix permanently busy scans after multiple roam iterations
Zhiling Zou <[email protected]>
wifi: mac80211: free ack status frame on TX header build failure
Junrui Luo <[email protected]>
powerpc/spufs: fix out-of-bounds access in spufs_mem_mmap_access()
Zhao Dongdong <[email protected]>
reset: sunxi: fix memory region leak on ioremap failure
Robby Cai <[email protected]>
reset: imx7: Correct polarity of MIPI CSI resets on i.MX8MQ
Florian Westphal <[email protected]>
ipvs: reload ip header after head reallocation
Julian Anastasov <[email protected]>
ipvs: fix more places with wrong ipv6 transport offsets
Maoyi Xie <[email protected]>
memstick: ms_block: reject a card that reports too many blocks
James Raphael Tiovalen <[email protected]>
macsec: fix promiscuity refcount leak in macsec_dev_open()
Xuanqiang Luo <[email protected]>
llc: fix SAP refcount leak when creating incoming sockets
Laxman Acharya Padhya <[email protected]>
Bluetooth: btrtl: validate firmware patch bounds
Asim Viladi Oglu Manizada <[email protected]>
net: openvswitch: reject oversized nested action attrs
Abhishek Ojha <[email protected]>
regulator: ltc3676: Fix incorrect IRQSTAT bit offsets
Dawei Feng <[email protected]>
wifi: mac80211: fix memory leak in ieee80211_register_hw()
Runyu Xiao <[email protected]>
wifi: rt2x00: avoid full teardown before work setup in probe
Thorsten Blum <[email protected]>
powerpc/pseries: fix memory leak on krealloc failure in papr_init
Peng Fan <[email protected]>
pmdomain: imx: Fix i.MX8MP VC8000E power up sequence
Peng Fan <[email protected]>
pmdomain: imx: Fix i.MX8MP power notifier
Farhad Alemi <[email protected]>
cgroup/cpuset: rebind mm mempolicy to effective_mems, not mems_allowed
Crystal Wood <[email protected]>
tracing/osnoise: Call synchronize_rcu() when unregistering
Tao Liu <[email protected]>
riscv: Prevent NULL pointer dereference in machine_kexec_prepare()
Michael Bommarito <[email protected]>
drbd: reject data replies with an out-of-range payload size
Daehyeon Ko <[email protected]>
macsec: don't read an unset MAC header in macsec_encrypt()
Yizhou Zhao <[email protected]>
ipvs: reset full ip_vs_seq structs in ip_vs_conn_new
Yizhou Zhao <[email protected]>
ipvs: use parsed transport offset in SCTP state lookup
Shuangpeng Bai <[email protected]>
llc: fix SAP refcount leak in llc_ui_autobind()
Yousef Alhouseen <[email protected]>
mac802154: remove interfaces with RCU list deletion
Gerald Schaefer <[email protected]>
s390/monwriter: Reject buffer reuse with different data length
Martin Kaiser <[email protected]>
riscv: probes: save original sp in rethook trampoline
HyeongJun An <[email protected]>
hwmon: (asus_atk0110) Check package count before accessing element
Maoyi Xie <[email protected]>
net: wwan: iosm: bound device offsets in the MUX downlink decoder
Wentao Liang <[email protected]>
ata: pata_pxa: Fix DMA channel leak on probe error
Bryam Vargas <[email protected]>
orangefs: keep the readdir entry size 64-bit in fill_from_part()
Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix double addition of offset for @+FOFFSET
Bryam Vargas <[email protected]>
net/sched: sch_taprio: Replace direct dequeue call with peek and qdisc_dequeue_peeked
Bryam Vargas <[email protected]>
net/sched: sch_multiq: Replace direct dequeue call with peek and qdisc_dequeue_peeked
Andrea Righi <[email protected]>
net: lan743x: Initialize eth_syslock spinlock before use
Haoxiang Li <[email protected]>
fsl/fman: Free init resources on KeyGen failure in fman_init()
Runyu Xiao <[email protected]>
hwmon: (occ) unregister sysfs devices outside occ lock
Haoxiang Li <[email protected]>
net: liquidio: fix BAR resource leak on PF number failure
Pengpeng Hou <[email protected]>
hwmon: (w83793) remove vrm sysfs file on probe failure
Pengpeng Hou <[email protected]>
hwmon: (w83627hf) remove VID sysfs files on error and remove
Conor Dooley <[email protected]>
rtc: mpfs: fix counter upload completion condition
Abdun Nihaal <[email protected]>
bnx2x: fix potential memory leak in bnx2x_alloc_mem_bp()
Sabrina Dubroca <[email protected]>
espintcp: use sk_msg_free_partial to fix partial send
Hongchen Zhang <[email protected]>
LoongArch: Fix missing dirty page tracking in {pte,pmd}_wrprotect()
Sven Eckelmann <[email protected]>
batman-adv: clean untagged VLAN on netdev registration failure
Sven Eckelmann <[email protected]>
batman-adv: ensure minimal ethernet header on TX
Sven Eckelmann <[email protected]>
batman-adv: retrieve ethhdr after potential skb realloc on RX
Jamal Hadi Salim <[email protected]>
net/sched: sch_teql: move rcu_read_lock()/spin_lock() from _bh variants
Shitalkumar Gandhi <[email protected]>
ieee802154: ca8210: fix pointer truncation in kfifo on 64-bit
Shitalkumar Gandhi <[email protected]>
ieee802154: ca8210: fix cas_ctl leak on spi_async failure
Michael Bommarito <[email protected]>
ieee802154: allow legacy LLSEC ADD/DEL ops to pass strict validation
Michael Bommarito <[email protected]>
ieee802154: admin-gate legacy LLSEC dump operations
Maoyi Xie <[email protected]>
net: ip6_gre: require CAP_NET_ADMIN in the device netns for changelink
Maoyi Xie <[email protected]>
net: ipip: require CAP_NET_ADMIN in the device netns for changelink
Maoyi Xie <[email protected]>
net: ip_vti: require CAP_NET_ADMIN in the device netns for changelink
Maoyi Xie <[email protected]>
net: ip6_vti: require CAP_NET_ADMIN in the device netns for changelink
Dawei Feng <[email protected]>
net: ena: clean up XDP TX queues when regular TX setup fails
Zihan Xi <[email protected]>
net/sched: act_ct: preserve tc_skb_cb across defragmentation
Haoxiang Li <[email protected]>
net: ixp4xx_hss: fix duplicate HDLC netdev allocation
Haoxiang Li <[email protected]>
net: wwan: t7xx: destroy DMA pool on CLDMA late init failure
Maoyi Xie <[email protected]>
net: sit: require CAP_NET_ADMIN in the device netns for changelink
Andreas Kemnade <[email protected]>
gpios: palmas: add .get_direction() op
Paul Louvel <[email protected]>
gpio-f7188x: Add support for NCT6126D version B
Bradley Morgan <[email protected]>
cpu: hotplug: Bound hotplug states sysfs output
Bradley Morgan <[email protected]>
cpu: hotplug: Preserve per instance callback errors
Zhan Xusheng <[email protected]>
posix-cpu-timers: Use u64 multiplication in update_rlimit_cpu()
Doruk Tan Ozturk <[email protected]>
net/mlx5e: macsec: fix use-after-free of metadata_dst on RX SC delete
Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix type confusion in CDC union descriptor parsing
Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix race condition in reset_device sysfs callback
Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix potential infinite loop in CDC union descriptor parsing
Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix out-of-bounds read in ims_pcu_irq() debug logging
Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix DMA mapping violation in line setup
Dmitry Torokhov <[email protected]>
Input: ims-pcu - add response length checks
Dmitry Torokhov <[email protected]>
Input: ims-pcu - validate control endpoint type
Dmitry Torokhov <[email protected]>
Input: ims-pcu - release data interface on disconnect
Dmitry Torokhov <[email protected]>
Input: ims-pcu - fix use-after-free and double-free in disconnect
Haoxiang Li <[email protected]>
scsi: elx: efct: Fix I/O leak on unsupported additional CDB
WenTao Liang <[email protected]>
scsi: elx: efct: Fix refcount leak in efct_hw_io_abort()
Bryam Vargas <[email protected]>
scsi: target: core: Fix iSCSI ISID use-after-free in REGISTER AND MOVE
Bryam Vargas <[email protected]>
scsi: target: Bound PR-OUT TransportID parsing to the received buffer
Michael Bommarito <[email protected]>
scsi: xen: scsiback: Free unsubmitted command instead of double-putting it
Michael Bommarito <[email protected]>
scsi: xen: scsiback: Free the command tag on the TMR submit-failure path
Xu Rao <[email protected]>
scsi: sg: Report request-table problems when any status is set
Abdun Nihaal <[email protected]>
scsi: lpfc: Fix memory leak in lpfc_sli4_driver_resource_setup()
Haoxiang Li <[email protected]>
scsi: hpsa: Fix DMA mapping leak on IOACCEL2 reset path
Mikulas Patocka <[email protected]>
dm-verity: increase sprintf buffer size
Mikulas Patocka <[email protected]>
dm-verity: fix a possible NULL pointer dereference
Mikulas Patocka <[email protected]>
dm-integrity: don't increment hash_offset twice
Mikulas Patocka <[email protected]>
dm_early_create: fix freeing used table on dm_resume failure
Mikulas Patocka <[email protected]>
dm-stats: fix merge accounting
Mikulas Patocka <[email protected]>
dm-stats: fix dm_jiffies_to_msec64
Benjamin Marzinski <[email protected]>
dm-log: fix a bitset_size overflow on 32bit machines
Mikulas Patocka <[email protected]>
dm-ioctl: fix a possible overflow in list_version_get_info
Mikulas Patocka <[email protected]>
dm-bufio: fix wrong count calculation in dm_bufio_issue_discard
Samuel Moelius <[email protected]>
dm era: fix out-of-bounds memory access for non-zero start sector
Ming-Hung Tsai <[email protected]>
dm thin metadata: fix metadata snapshot consistency on commit failure
Genjian Zhang <[email protected]>
dm thin metadata: fix superblock refcount leak on snapshot shadow failure
Haoxiang Li <[email protected]>
net: sparx5: unregister blocking notifier on init failure
Jiri Olsa <[email protected]>
bpf: Add missing access_ok call to copy_user_syms
Jann Horn <[email protected]>
bpf,fork: wipe ->bpf_storage before bailouts that access it
Oliver Hartkopp <[email protected]>
can: bcm: add missing rcu list annotations and operations
Oliver Hartkopp <[email protected]>
can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failure
Lee Jones <[email protected]>
can: bcm: defer rx_op deallocation to workqueue to fix thrtimer UAF
Oliver Hartkopp <[email protected]>
can: isotp: use unconditional synchronize_rcu() in isotp_release()
Fan Wu <[email protected]>
can: esd_usb: kill anchored URBs before freeing netdevs
Bryam Vargas <[email protected]>
nvmet-rdma: handle inline data with a nonzero offset
Weiming Shi <[email protected]>
sctp: validate STALE_COOKIE cause length before reading staleness
Kunihiko Hayashi <[email protected]>
spi: uniphier: Fix completion initialization order before devm_request_irq()
Wang Yan <[email protected]>
time: Fix off-by-one in compat settimeofday() usec validation
Jaewon Yang <[email protected]>
tpm: Make the TPM character devices non-seekable
Thorsten Blum <[email protected]>
tpm: fix event_size output in tpm1_binary_bios_measurements_show
Maoyi Xie <[email protected]>
xfrm: xfrm_interface: require CAP_NET_ADMIN in the device netns for changelink
Sanman Pradhan <[email protected]>
xfrm: use compat translator only for u64 alignment mismatch
Wentao Liang <[email protected]>
xen/gntdev: fix error handling in ioctl
Paul Greenwalt <[email protected]>
ice: fix ice_init_link() error return preventing probe
Xuanqiang Luo <[email protected]>
i2c: mlxbf: Fix use-after-free in mlxbf_i2c_init_resource()
Roman Vivchar <[email protected]>
i2c: mediatek: fix WRRD for SoCs without auto_restart option
Joshua Crofts <[email protected]>
hwmon: (ltc2992) add missing 'select REGMAP_I2C' to Kconfig
Ibrahim Hashimov <[email protected]>
ksmbd: fix integer overflow in set_file_allocation_info()
Fredric Cover <[email protected]>
smb: client: use kvzalloc() for megabyte buffer in simple fallocate
Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Add delay_suspend module parameter
Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops
Daniel Gibson <[email protected]>
platform/x86/amd/pmc: Check for intermediate wakeup in function
Frank Li <[email protected]>
dmaengine: dw-edma: Add spinlock to protect DONE_INT_MASK and ABORT_INT_MASK
Kartik Rajput <[email protected]>
dmaengine: tegra: Fix burst size calculation
Jarkko Sakkinen <[email protected]>
tpm: tpm_tis_spi: Use wait_woken() in wait_for_tmp_stat()
Bhargav Joshi <[email protected]>
irqchip/crossbar: Use correct index in crossbar_domain_free()
Florian Fuchs <[email protected]>
mtd: maps: vmu-flash: fix NULL pointer dereference in initialization
Miquel Raynal <[email protected]>
mtd: spi-nor: swp: Improve locking user experience
Sebastian Alba Vives <[email protected]>
fpga: microchip-spi: fix zero header_size OOB read in mpf_ops_parse_header()
Maoyi Xie <[email protected]>
net: thunderbolt: Fix frags[] overflow by bounding frame_count
Manivannan Sadhasivam <[email protected]>
bus: mhi: ep: Protect mhi_ep_handle_syserr() in the error path
Sebastian Alba Vives <[email protected]>
fpga: dfl: add bounds check in dfh_get_param_size()
Michael Bommarito <[email protected]>
ocfs2: reject non-inline dinodes with i_size and zero i_clusters
Michael Bommarito <[email protected]>
ocfs2: reject dinodes whose i_rdev disagrees with the file type
Michael Bommarito <[email protected]>
ocfs2: reject dinodes with non-canonical i_mode type
Joseph Qi <[email protected]>
ocfs2: add journal NULL check in ocfs2_checkpoint_inode()
Ian Bridges <[email protected]>
ocfs2: fix NULL h_transaction deref in ocfs2_assure_trans_credits
Kyle Zeng <[email protected]>
ocfs2: avoid moving extents to occupied clusters
Arseniy Krasnov <[email protected]>
mtd: rawnand: fix condition in 'nand_select_target()'
Vasiliy Kovalev <[email protected]>
net/9p: fix infinite loop in p9_client_rpc on fatal signal
Bastien Curutchet <[email protected]>
mtd: rawnand: pl353: fix probe resource allocation
Tristan Madani <[email protected]>
ocfs2: use kzalloc for quota recovery bitmap allocation
Ionut Nechita <[email protected]>
scsi: sas: Skip opt_sectors when DMA reports no real optimization hint
Martin Wilck <[email protected]>
scsi: smartpqi: Use shost_to_hba() in pqi_scan_finished()
Breno Leitao <[email protected]>
9p: skip nlink update in cacheless mode to fix WARN_ON
Ruoyu Wang <[email protected]>
mtd: slram: remove failed entries from the device list
Muchun Song <[email protected]>
mm/mm_init: fix uninitialized struct pages for ZONE_DEVICE
Krzysztof Wilczyński <[email protected]>
proc: only bump parent nlink when registering directories
SeongJae Park <[email protected]>
mm/damon/sysfs-schemes: put stats for scheme_add_dirs() internal error
SeongJae Park <[email protected]>
mm/damon/sysfs-schemes: fix dir put orders in access_pattern_add_dirs()
Zishun Yi <[email protected]>
riscv: cacheinfo: Fix node reference leak in populate_cache_leaves
Aaron Tomlin <[email protected]>
mips: sched: Fix CPUMASK_OFFSTACK memory corruption
WenTao Liang <[email protected]>
power: supply: charger-manager: fix refcount leak in is_full_charged()
Tristan Madani <[email protected]>
ntfs3: fix out-of-bounds read in decompress_lznt
Michael Bommarito <[email protected]>
ntfs3: validate split-point offset in indx_insert_into_buffer
Michael Bommarito <[email protected]>
ntfs3: bound to_move in indx_insert_into_root before hdr_insert_head
Michael Bommarito <[email protected]>
ntfs3: cap RESTART_TABLE free-chain walker at rt->used
Michael Bommarito <[email protected]>
fs/ntfs3: bound NTFS_DE view.data_off in UpdateRecordData{Root,Allocation}Michael Bommarito <[email protected]>
fs/ntfs3: add depth limit to indx_find_buffer to prevent stack overflow
Konstantin Komarov <[email protected]>
fs/ntfs3: validate lcns_follow in log_replay conversion
Konstantin Komarov <[email protected]>
fs/ntfs3: bound attr_off in UpdateResidentValue against data_off
Michael Bommarito <[email protected]>
fs/ntfs3: bound copy_lcns dp->page_lcns[] index in analysis pass
Konstantin Komarov <[email protected]>
fs/ntfs3: bound DeleteIndexEntryAllocation memmove length
Zhan Xusheng <[email protected]>
fs/ntfs3: fix syncing wrong inode on DIRSYNC cross-directory rename
SeongJae Park <[email protected]>
mm/damon/core: make charge_addr_from aware of end-address exclusivity
Ma Ke <[email protected]>
power: supply: cpcap-battery: Fix missing nvmem_device_put() causing reference leak
Maciej W. Rozycki <[email protected]>
MIPS: DEC: Ensure 32-bit stack location for o32 prom_printf()
Johan Hovold <[email protected]>
MIPS: ip22-gio: fix device reference leak in probe
Johan Hovold <[email protected]>
MIPS: ip22-gio: fix kfree() of static object
Johan Hovold <[email protected]>
MIPS: ip22-gio: fix gio device memory leak
Wasim Nazir <[email protected]>
remoteproc: qcom: Fix leak when custom dump_segments addition fails
Chuck Lever <[email protected]>
SUNRPC: Bound-check xdr_buf_to_bvec() stores before writing
Chuck Lever <[email protected]>
lockd: Plug nlm_file refcount leak on cached nlm_do_fopen() failure
Chuck Lever <[email protected]>
lockd: Plug nlm_file leak when nlm_do_fopen() fails
Chuck Lever <[email protected]>
sunrpc: wait for in-flight TLS handshake callback when cancel loses race
Chris Mason <[email protected]>
sunrpc: pin svc_xprt across the asynchronous TLS handshake callback
Abdun Nihaal <[email protected]>
nvdimm/btt: Free arena sub-allocations on discover_arenas() error path
Abdun Nihaal <[email protected]>
nvdimm/btt: Free arenas on btt_init() error paths
Junrui Luo <[email protected]>
jbd2: fix integer underflow in jbd2_journal_initialize_fast_commit()
Pauli Virtanen <[email protected]>
Bluetooth: SCO: hold sk properly in sco_conn_ready
Pauli Virtanen <[email protected]>
Bluetooth: SCO: fix sleeping under spinlock in sco_conn_ready
Benoît Sevens <[email protected]>
HID: playstation: validate num_touch_reports in DualShock 4 reports
Bartosz Golaszewski <[email protected]>
mfd: tps6586x: Fix OF node refcount
Shyam Prasad N <[email protected]>
cifs: invalidate cfid on unlink/rename/rmdir
Sven Eckelmann <[email protected]>
batman-adv: tt: prevent TVLV OOB check overflow
Sven Eckelmann <[email protected]>
batman-adv: frag: fix primary_if leak on failed linearization
Sven Eckelmann <[email protected]>
batman-adv: frag: free unfragmentable packet
Sven Eckelmann <[email protected]>
batman-adv: fix VLAN priority offset
Sven Eckelmann <[email protected]>
batman-adv: tt: avoid request storms during pending request
Sven Eckelmann <[email protected]>
batman-adv: dat: fix tie-break for candidate selection
Sven Eckelmann <[email protected]>
batman-adv: dat: ensure accessible eth_hdr proto field
Sven Eckelmann <[email protected]>
batman-adv: bla: reacquire gw address after skb realloc
Sven Eckelmann <[email protected]>
batman-adv: dat: acquire ARP hw source only after skb realloc
Sven Eckelmann <[email protected]>
batman-adv: access unicast_ttvn skb->data only after skb realloc
Sven Eckelmann <[email protected]>
batman-adv: gw: acquire ethernet header only after skb realloc
Sumanth Korikkar <[email protected]>
s390/perf_cpum_cf: Add missing array_index_nospec() to __hw_perf_event_init()
Sandipan Das <[email protected]>
perf/x86/amd/lbr: Fix kernel address leakage
Thorsten Blum <[email protected]>
x86/boot: Reject too long acpi_rsdp= values
Thorsten Blum <[email protected]>
x86/boot: Validate console=uart8250 baud rate to fix early boot hang
Ali Ahmet MEMIS <[email protected]>
tools/power/x86/intel-speed-select: Harden daemon pidfile open
Guangshuo Li <[email protected]>
mfd: sm501: Fix reference leak on failed device registration
Armin Wolf <[email protected]>
leds: uleds: Fix potential buffer overread
Ondrej Mosnacek <[email protected]>
selinux: fix incorrect execmem checks on overlayfs
Stephen Smalley <[email protected]>
selinux: check connect-related permissions on TCP Fast Open
Wang Jun <[email protected]>
soc: fsl: qe: panic on ioremap() failure in qe_reset()
Siddharth Vadapalli <[email protected]>
soc: ti: k3-ringacc: Fix access mode for k3_ringacc_ring_pop_tail_io/proxy
Guangshuo Li <[email protected]>
gpu: host1x: Fix device reference leak in host1x_device_parse_dt() error path
Xiang Mei (Microsoft) <[email protected]>
netfilter: bridge: fix stale prevhdr pointer in br_ip6_fragment()
Wyatt Feng <[email protected]>
netfilter: xt_nat: reject unsupported target families
Yizhou Zhao <[email protected]>
netfilter: ecache: fix inverted time_after() check
Yizhou Zhao <[email protected]>
netfilter: nf_conncount: fix zone comparison in tuple dedup
Xiang Mei <[email protected]>
netfilter: nf_conntrack_reasm: guard mac_header adjustment after IPv6 defrag
Florian Westphal <[email protected]>
netfilter: nf_nat_sip: reload possible stale data pointer
Haoze Xie <[email protected]>
netfilter: nf_queue: pin bridge device while NFQUEUE holds fake dst
Wyatt Feng <[email protected]>
netfilter: xt_cluster: reject template conntracks in hash match
David Carlier <[email protected]>
netfilter: nfnl_cthelper: apply per-class values when updating policies
Muhammad Bilal <[email protected]>
netfilter: nf_conntrack_irc: fix parse_dcc() off-by-one OOB read
Srinivas Kandagatla <[email protected]>
ASoC: qcom: q6apm: fix NULL pointer dereference in graph_callback
Cássio Gabriel <[email protected]>
ASoC: mediatek: mt8183: Release reserved memory on cleanup
Cássio Gabriel <[email protected]>
ASoC: mediatek: mt8192: Release reserved memory on cleanup
Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Validate size in snd_sof_update_control
Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Fix heap overflow in bytes_ext put/get
Abdun Nihaal <[email protected]>
fbdev: tridentfb: fix potential memory leak in trident_pci_probe()
Abdun Nihaal <[email protected]>
fbdev: nvidia: fix potential memory leak in nvidiafb_probe()
Abdun Nihaal <[email protected]>
fbdev: vesafb: fix memory leak in vesafb_probe()
Abdun Nihaal <[email protected]>
fbdev: carminefb: fix potential memory leak in alloc_carmine_fb()
Abdun Nihaal <[email protected]>
fbdev: tdfxfb: fix potential memory leak in tdfxfb_probe()
Abdun Nihaal <[email protected]>
fbdev: uvesafb: fix potential memory leak in uvesafb_probe()
Abdun Nihaal <[email protected]>
fbdev: s3fb: fix potential memory leak in s3_pci_probe()
Abdun Nihaal <[email protected]>
fbdev: i740fb: fix potential memory leak in i740fb_probe()
Abdun Nihaal <[email protected]>
fbdev: radeon: fix potential memory leak in radeonfb_pci_register()
Li RongQing <[email protected]>
fbdev: sm712: Fix operator precedence in big_swap macro
Abdun Nihaal <[email protected]>
fbdev: hecubafb: fix potential memory leak in hecubafb_probe()
Abdun Nihaal <[email protected]>
fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe()
Abdun Nihaal <[email protected]>
fbdev: metronomefb: fix potential memory leak in metronomefb_probe()
Sean Christopherson <[email protected]>
KVM: x86: Ignore pending PV EOI if the vCPU has since disabled PV EOIs
Matthew Rosato <[email protected]>
KVM: s390: pci: Fix handling of AIF enable without AISB
Hyunwoo Kim <[email protected]>
KVM: arm64: vgic: Check the interrupt is still ours before migrating it
Haoxiang Li <[email protected]>
KVM: s390: pci: Fix GISC refcount leak on AIF enable failure
Nickolay Goppen <[email protected]>
arm64: dts: qcom: sdm630: describe adsp_mem region properly
Mark Rutland <[email protected]>
arm64: fpsimd: Fix type mismatch in sve_{save,load}_state()
Yong Wang <[email protected]>
net: ife: require ETH_HLEN to be pullable in ife_decode()
Zhengchuan Liang <[email protected]>
net: atm: reject out-of-range traffic classes in QoS validation
Michael Bommarito <[email protected]>
net: qrtr: fix 32-bit integer overflow in qrtr_endpoint_post()
Cássio Gabriel <[email protected]>
ASoC: SOF: topology: validate vendor array size before parsing
Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Fix TOCTOU in bytes_put and bytes_get
Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc3-control: Use overflow checks in control_update size calc
Peter Ujfalusi <[email protected]>
ASoC: SOF: ipc4-control: Fix TOCTOU in sof_ipc4_bytes_put
Zhang Tianci <[email protected]>
vduse: Fix race in vduse_dev_msg_sync and vduse_dev_read_iter
Wentao Liang <[email protected]>
mlxsw: fix refcount leak in mlxsw_sp_vrs_lpm_tree_replace()
Wentao Liang <[email protected]>
mlxsw: fix refcount leak in mlxsw_sp_port_lag_join()
Guangshuo Li <[email protected]>
smb: client: fix overflow in passthrough ioctl bounds check
Harman Kalra <[email protected]>
octeontx2-af: fix VF bringup affecting PF promiscuous state
Li RongQing <[email protected]>
net/mlx5: Fix L3 tunnel entropy refcount leak
Wang Yan <[email protected]>
selftests/net: fix EVP_MD_CTX leak in tcp_mmap
Timur Tabi <[email protected]>
regulator: core: regulator_lock_two() should test for EDEADLK not EDEADLOCK
Cao Guanghui <[email protected]>
dm era: fix NULL pointer dereference in metadata_open()
Chuck Lever <[email protected]>
SUNRPC: pin upper rpc_clnt across the TLS connect_worker
Chuck Lever <[email protected]>
SUNRPC: release lower rpc_clnt if killed waiting for XPRT_LOCKED
Guangshuo Li <[email protected]>
cifs: validate DFS referral string offsets
Rongguang Wei <[email protected]>
s390/zcrypt: Remove the empty file
Julian Anastasov <[email protected]>
ipvs: ensure inner headers in ICMP errors are in headroom
Yizhou Zhao <[email protected]>
ipvs: fix PMTU for GUE/GRE tunnel ICMP errors
Yizhou Zhao <[email protected]>
ipvs: use parsed transport offset in TCP state lookup
Yizhou Zhao <[email protected]>
ipvs: pass parsed transport offset to state handlers
Eric Dumazet <[email protected]>
ipv6: mcast: Fix potential UAF in MLD delayed work
Kuniyuki Iwashima <[email protected]>
ipv6: mcast: Replace locking comments with lockdep annotations.
Eric Dumazet <[email protected]>
ipv4: igmp: Fix potential UAF in igmp_gq_start_timer()
Suman Ghosh <[email protected]>
octeontx2-pf: check DMAC extraction support before filtering
Samuel Moelius <[email protected]>
net/sched: cake: reject overhead values that underflow length
Enrico Pozzobon <[email protected]>
net: usb: lan78xx: disable VLAN filter in promiscuous mode
Oleksij Rempel <[email protected]>
net: usb: lan78xx: move functions to avoid forward definitions
Chuck Lever <[email protected]>
net/tls: Consume empty data records in tls_sw_read_sock()
Hui Wang <[email protected]>
ring-buffer: Fix event length with forced 8-byte alignment
Weiming Shi <[email protected]>
Bluetooth: bpa10x: avoid OOB read of revision string in bpa10x_setup()
Pauli Virtanen <[email protected]>
Bluetooth: ISO: exclude RFU bits from ISO_SDU_Length
Cen Zhang <[email protected]>
Bluetooth: MGMT: Fix adv monitor add failure cleanup
Cen Zhang <[email protected]>
Bluetooth: 6lowpan: hold L2CAP conn across debugfs control
Eric Dumazet <[email protected]>
amt: fix size calculation in amt_get_size()
Xiang Mei <[email protected]>
net/smc: fix UAF in smc_cdc_rx_handler() by pinning the socket
Jamal Hadi Salim <[email protected]>
net/sched: act_pedit: fix TOCTOU heap OOB write in tc offload
Xiang Mei <[email protected]>
net: qualcomm: rmnet: validate MAP frame length before ingress parsing
Shigeru Yoshida <[email protected]>
qede: fix off-by-one in BD ring consumption on build_skb failure
Jens Emil Schulz Østergaard <[email protected]>
net: microchip: vcap: fix races on the shared Super VCAP block
Feng Liu <[email protected]>
net/mlx5e: Fix HV VHCA stats agent registration race
Feng Liu <[email protected]>
net/mlx5e: Fix HV VHCA stats zero-sized buffer allocation
Wyatt Feng <[email protected]>
netfilter: xt_connmark: reject invalid shift parameters
Zhixing Chen <[email protected]>
netfilter: ip6tables: mark malformed IPv6 extension headers for hotdrop
Feng Wu <[email protected]>
netfilter: xt_rateest: fix u64 truncation in xt_rateest_mt()
Wyatt Feng <[email protected]>
netfilter: xt_u32: reject invalid shift counts
Qihang <[email protected]>
gue: validate REMCSUM private option length
Xiang Mei <[email protected]>
net: usb: net1080: validate packet_len before pad-byte access in rx_fixup
Yiyang Chen <[email protected]>
selftests/hid: Cover hid_bpf_get_data() size overflow
Benjamin Tissoires <[email protected]>
selftests/hid: convert the hid_bpf selftests with struct_ops
Benjamin Tissoires <[email protected]>
selftests/hid: force using our compiled libbpf headers
Benjamin Tissoires <[email protected]>
selftests/hid: do not manually call headers_install
Benjamin Tissoires <[email protected]>
selftests/hid: ensure we can compile the tests on kernels pre-6.3
Anshuman Khandual <[email protected]>
arm64/mm: Optimize TLB flush in unmap_hotplug_[pmd|pud]_range()
Ryan Roberts <[email protected]>
arm64/mm: convert ptep_clear() to ptep_get_and_clear()
Ryan Roberts <[email protected]>
arm64/mm: convert set_pte_at() to set_ptes(..., 1)
Ryan Roberts <[email protected]>
arm64/mm: convert READ_ONCE(*ptep) to ptep_get(ptep)
Lee Jones <[email protected]>
HID: core: Fix OOB read in hid_get_report for numbered reports
Georgiy Osokin <[email protected]>
HID: picolcd: prevent NULL pointer dereference in picolcd_send_and_wait()
Myeonghun Pak <[email protected]>
ata: sata_gemini: unwind clocks on IDE pinctrl errors
Michael Bommarito <[email protected]>
minix: avoid overflow in bitmap block count calculation
David Howells <[email protected]>
afs: Fix unchecked-length string display in debug statement
David Howells <[email protected]>
afs: Fix the volume AFS_VOLUME_RM_TREE is set on
David Howells <[email protected]>
afs: Fix vllist leak
David Howells <[email protected]>
afs: Fix callback service message parsers to pass through -EAGAIN
Zilin Guan <[email protected]>
afs: use kvfree() to free memory allocated by kvcalloc()
Dan Carpenter <[email protected]>
afs: Fix error code in afs_extract_vl_addrs()
Christian Brauner <[email protected]>
fs: refuse O_TMPFILE creation with an unmapped fsuid or fsgid
Samuel Moelius <[email protected]>
net/sched: hhf: clear heavy-hitter state on reset
Viacheslav Bocharov <[email protected]>
pinctrl: meson: restore non-sleeping GPIO access
Vladimir Zapolskiy <[email protected]>
gpio: timberdale: Return -ENOMEM on dynamic memory allocation in probe
Gil Portnoy <[email protected]>
ksmbd: fix use-after-free of fp->owner.name in durable handle owner check
ZhangGuoDong <[email protected]>
smb: move some duplicate definitions to common/cifsglob.h
Haofeng Li <[email protected]>
ksmbd: reject undersized DACLs before parsing ACEs
Sechang Lim <[email protected]>
net/sched: act_bpf: use rcu_dereference_bh() to read the filter
Gleb Markov <[email protected]>
cxgb4: Fix decode strings dump for T6 adapters
Longjun Tang <[email protected]>
virtio_net: disable cb when NAPI is busy-polled
Qingshuang Fu <[email protected]>
irqchip/ts4800: Fix missing chained handler cleanup on remove
Yuho Choi <[email protected]>
irqchip/gic-v3-its: Fix OF node reference leak
Martin Kaiser <[email protected]>
tracing: eprobe: read the complete FILTER_PTR_STRING pointer
Masami Hiramatsu (Google) <[email protected]>
tracing/events: Fix to check the simple_tsk_fn creation
Ido Schimmel <[email protected]>
bridge: stp: Fix a potential use-after-free when deleting a bridge
Jamal Hadi Salim <[email protected]>
net/sched: sch_teql: Introduce slaves_lock to avoid race condition and UAF
Rosen Penev <[email protected]>
net: gianfar: dispose irq mappings on probe failure and device removal
Petr Wozniak <[email protected]>
net: phy: sfp: free mii_bus in sfp_i2c_mdiobus_destroy
Xiang Mei <[email protected]>
usbnet: gl620a: fix out-of-bounds read in genelink_rx_fixup()
Guenter Roeck <[email protected]>
hwmon: (pmbus) Fix passing events to regulator core
Matti Vaittinen <[email protected]>
hwmon: adm1275: Prevent reading uninitialized stack
Maciej W. Rozycki <[email protected]>
MIPS: DEC: Ensure RTC platform device deregistration upon failure
Yousef Alhouseen <[email protected]>
sctp: fix SCTP_RESET_STREAMS stream list length limit
Wei Fang <[email protected]>
net: enetc: check the number of BDs needed for xdp_frame
Matvey Kovalev <[email protected]>
qede: fix out-of-bounds check for cqe->len_list[]
Nuoqi Gui <[email protected]>
seg6: validate SRH length before reading fixed fields
Pengpeng Hou <[email protected]>
gpio: htc-egpio: use managed gpiochip registration
Pengpeng Hou <[email protected]>
gpio: mvebu: fail probe if gpiochip registration fails
Pengpeng Hou <[email protected]>
spi: sh-msiof: abort transfers when reset times out
Martin Kaiser <[email protected]>
tracing: probes: fix typo in a log message
Rob Herring (Arm) <[email protected]>
dt-bindings: net: renesas,ether: Drop example "ethernet-phy-ieee802.3-c22" fallback
Shengjiu Wang <[email protected]>
ASoC: fsl_asrc_dma: fix eDMA maxburst misalignment with channel count
Shitalkumar Gandhi <[email protected]>
net: ethernet: sunplus: spl2sw: fix phy_node refcount leak in remove
Ruoyu Wang <[email protected]>
net: sungem: fix probe error cleanup
Yun Zhou <[email protected]>
net: mvneta: re-enable percpu interrupt on resume
Haoxiang Li <[email protected]>
rtc: cmos: unregister HPET IRQ handler on probe failure
Fredrik M Olsson <[email protected]>
rtc: ds1307: Fix off-by-one issue with wday for rx8130
Huiwen He <[email protected]>
smb/client: preserve errors from smb2_set_sparse()
Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in disable_policy sysctl
Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in forwarding sysctl
Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in ignore_routes_with_linkdown sysctl
Fernando Fernandez Mancera <[email protected]>
ipv6: fix error handling in disable_ipv6 sysctl
Jamal Hadi Salim <[email protected]>
net/sched: cls_api: Handle TC_ACT_CONSUMED in tcf_qevent_handle
Eric Dumazet <[email protected]>
veth: fix NAPI leak in XDP enable error path
Aleksandrova Alyona <[email protected]>
net: dsa: sja1105: round up PTP perout pin duration
Xiang Mei <[email protected]>
net, bpf: check master for NULL in xdp_master_redirect()
Krzysztof Wilczyński <[email protected]>
alpha/PCI: Fix __pci_mmap_fits() overflow for zero-length BARs
Krzysztof Wilczyński <[email protected]>
alpha/PCI: Add security_locked_down() check to pci_mmap_resource()
Koichiro Den <[email protected]>
NTB: epf: Fix doorbell bitmask and IRQ vector handling
Koichiro Den <[email protected]>
NTB: epf: Report 0-based doorbell vector via ntb_db_event()
Koichiro Den <[email protected]>
NTB: epf: Make db_valid_mask cover only real doorbell bits
Florian Westphal <[email protected]>
netfilter: nft_compat: ebtables emulation must reject non-bridge targets
Runyu Xiao <[email protected]>
netfilter: nft_synproxy: stop bypassing the priv->info snapshot
Fernando Fernandez Mancera <[email protected]>
netfilter: nf_conncount: prevent connlimit drops for early confirmed ct
Mathias Krause <[email protected]>
netfilter: nf_nat: avoid invalid nat_net pointer use on failed nf_nat_init()
Bradley Morgan <[email protected]>
bpf: Disable xfrm_decode_session hook attachment
Xu Kuohai <[email protected]>
bpf, lsm: Add disabled BPF LSM hook list
Kuniyuki Iwashima <[email protected]>
ipv4: fib: Don't ignore error route in local/main tables.
Xiang Mei <[email protected]>
ipv6: Fix null-ptr-deref in fib6_nh_mtu_change().
Gil Portnoy <[email protected]>
ksmbd: fix use-after-free of conn->preauth_info in concurrent SMB2 NEGOTIATE
Stepan Ionichev <[email protected]>
rtc: msc313: fix NULL deref in shared IRQ handler at probe
Mohamed Khalfella <[email protected]>
i40e: Fix i40e_debug() to use struct i40e_hw argument
Lukasz Czapnik <[email protected]>
ice: fix AQ error code comparison in ice_set_pauseparam()
Dawid Osuchowski <[email protected]>
ice: fix FDIR CTRL VSI resource leak in ice_reset_all_vfs()
Manivannan Sadhasivam <[email protected]>
PCI: endpoint: pci-epf-ntb: Add check to detect 'db_count' value of 0
Manivannan Sadhasivam <[email protected]>
PCI: endpoint: pci-epf-vntb: Add check to detect 'db_count' value of 0
Xiang Mei <[email protected]>
drm/edid: fix OOB read in drm_parse_tiled_block()
Amery Hung <[email protected]>
bpf: Fix effective prog array index with BPF_F_PREORDER
Avinash Duduskar <[email protected]>
bpf: zero-initialize the fib lookup flow struct
Nuoqi Gui <[email protected]>
bpf: Fix stack slot index in nospec checks
Ronan Dalton <[email protected]>
rtc: ds1307: handle oscillator stop flag for ds1337/ds1339/ds3231
Antoni Pokusinski <[email protected]>
rtc: abx80x: fix the RTC_VL_CLR clearing all status flags
Geetha sowjanya <[email protected]>
octeontx2-pf: mcs: Fix mcs resources free on PF shutdown
Subbaraya Sundeep <[email protected]>
octeontx2-pf: Clear stats of all resources when freeing resources
Geetha sowjanya <[email protected]>
octeontx2-af: mcs: Fix unsupported secy stats read
Wayen Yan <[email protected]>
net: ethernet: mtk_ppe: Fix rhashtable leak in mtk_ppe_init error paths
Weiming Shi <[email protected]>
tipc: fix use-after-free of the discoverer in tipc_disc_rcv()
Ruoyu Wang <[email protected]>
net: marvell: prestera: initialize err in prestera_port_sfp_bind
Aboorva Devarajan <[email protected]>
selftests/mm: fix exclusive_cow test fork() handling
Sayali Patil <[email protected]>
selftests/mm: allow PUD-level entries in compound testcase of hmm tests
Sayali Patil <[email protected]>
selftests/mm: clarify alternate unmapping in compaction_test
Bhargav Joshi <[email protected]>
irqchip/crossbar: Fix parent domain resource leak
Florian Westphal <[email protected]>
netfilter: nft_meta_bridge: fix NFT_META_BRI_IIFPVID stack leak
Florian Westphal <[email protected]>
netfilter: nf_reject: skip iphdr options when looking for icmp header
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: fix order of kfree_rcu() and rcu_assign_pointer()
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Don't use test_bit() in lockless RCU readers in hash types
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: annotate "pos" for concurrent readers/writers
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Fix data race between add and dump in all hash types
Abd-Alrhman Masalkhi <[email protected]>
md/raid1: free r1_bio when REQ_NOWAIT is set and read would block on retry
Aleksandr Nogikh <[email protected]>
ieee802154: fix kernel-infoleak in dgram_recvmsg()
Ivan Abramov <[email protected]>
ieee802154: Remove WARN_ON() in cfg802154_pernet_exit()
Xu Rao <[email protected]>
ACPI: IPMI: Fix inverted interface check in ipmi_bmc_gone()
Andy Shevchenko <[email protected]>
ACPI: resource: Amend kernel-doc style
Ricardo Neri <[email protected]>
thermal: intel: Fix dangling resources on thermal_throttle_online() failure
Breno Leitao <[email protected]>
arm64/hw_breakpoint: reject unaligned watchpoints that would truncate BAS
Cen Zhang <[email protected]>
ALSA: usb-audio: Kill MIDI 2.0 URBs before freeing endpoints
Yun Zhou <[email protected]>
flow_dissector: check device type before reading ETH_ADDRS
Cosmin Ratiu <[email protected]>
devlink: Fix parent ref leak in devl_rate_node_create()
Ioana Ciornei <[email protected]>
dpaa2-switch: fix VLAN upper check not rejecting bridge join
Xiang Mei <[email protected]>
virtio-net: fix len check in receive_big()
Quang Nguyen <[email protected]>
spi: rpc-if: Use correct device for hardware reinitialization on resume
Mark Tomlinson <[email protected]>
PCI: iproc: Restore .map_irq() for the platform bus driver
Xin Long <[email protected]>
sctp: hold socket lock when dumping endpoints in sctp_diag
Jakub Kicinski <[email protected]>
net: psample: fix info leak in PSAMPLE_ATTR_DATA
Ratheesh Kannoth <[email protected]>
octeontx2-pf: Fix leak of SQ timestamp buffer on teardown
Thadeu Lima de Souza Cascardo <[email protected]>
drm/amdgpu: initialize irq.lock spinlock earlier
Mario Limonciello <[email protected]>
drm/amdkfd: fix list_del corruption in kfd_criu_resume_svm
Yunxiang Li <[email protected]>
drm/amdkfd: Avoid double-unpin of DOORBELL/MMIO BOs on free
Sen Wang <[email protected]>
ASoC: tlv320aic3x: restrict CLKDIV bypass Q values in dual-rate mode
Arnaldo Carvalho de Melo <[email protected]>
perf cs-etm: Require full global header in auxtrace_info size check
Arnaldo Carvalho de Melo <[email protected]>
perf cs-etm: Validate num_cpu before metadata allocation
Arnaldo Carvalho de Melo <[email protected]>
perf machine: Use snprintf() for guestmount path construction
Eric Dumazet <[email protected]>
xfrm: validate selector family and prefixlen during match
Eric Dumazet <[email protected]>
xfrm: annotate data-races around xfrm_policy_count[] and xfrm_policy_default[]
Mike Yu <[email protected]>
xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO path
Steffen Klassert <[email protected]>
xfrm: Use the XFRM_GRO to indicate a GRO call on input
Jisheng Zhang <[email protected]>
spi: dw: fix wrong BAUDR setting after resume
Pengpeng Hou <[email protected]>
gpio: mlxbf3: fail probe if gpiochip registration fails
Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Bounds-check array offsets in bpil_offs_to_addr()
Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Validate func_info_rec_size and sub_id in synthesize_bpf_prog_name()
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use snprintf() for root_dir path construction
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Break infinite loop on zero-filled notes in sysfs__read_build_id()
Pengpeng Hou <[email protected]>
sparc: led: avoid trimming a newline from empty writes
John Johansen <[email protected]>
apparmor: fix label can not be immediately before a declaration
Adrian Hunter <[email protected]>
i3c: master: Prevent reuse of dynamic address on device add failure
Zygmunt Krynicki <[email protected]>
apparmor: put secmark label after secid lookup
Zygmunt Krynicki <[email protected]>
apparmor: aa_getprocattr free procattr leak on format failure
Maxime Bélair <[email protected]>
apparmor: fix potential UAF in aa_replace_profiles
Ryan Lee <[email protected]>
apparmor: grab ns lock and refresh when looking up changehat child profiles
John Johansen <[email protected]>
apparmor: fix rawdata_f_data implicit flex array
Zygmunt Krynicki <[email protected]>
apparmor: aa_label_alloc use aa_label_free on alloc failure
Ruoyu Wang <[email protected]>
apparmor: check label build before no_new_privs test
Andrew Morton <[email protected]>
security/apparmor/apparmorfs.c: conditionally compile get_loaddata_common_ref()
Yuanhe Shu <[email protected]>
Revert "PCI/MSI: Unmap MSI-X region on error"
Manivannan Sadhasivam <[email protected]>
PCI: mediatek: Use actual physical address instead of virt_to_phys()
Ryder Lee <[email protected]>
PCI: mediatek: Fix possible truncation in mtk_pcie_parse_port()
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Add bounds checks to read_build_id() note iteration in minimal build
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Add bounds checks to elf_read_build_id() note iteration
Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Add NULL check for btf__type_by_id() in synthesize_bpf_prog_name()
Arnaldo Carvalho de Melo <[email protected]>
tools lib api: Fix mount_overload() snprintf truncation and toupper range
Arnaldo Carvalho de Melo <[email protected]>
tools lib api: Fix filename__write_int() writing uninitialized stack data
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Bounds-check descsz in sysfs__read_build_id() GNU fallback
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Fix thread__set_comm_from_proc() on empty comm file
Arnaldo Carvalho de Melo <[email protected]>
perf intel-pt: Fix snprintf size tracking bug in insn decoder
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Bounds-check .gnu_debuglink section data
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Fix signed overflow in sysfs__read_build_id() size check
Arnaldo Carvalho de Melo <[email protected]>
tools lib api: Fix missing null termination in filename__read_int/ull()
Arnaldo Carvalho de Melo <[email protected]>
perf pmu: Fix perf_pmu__parse_scale/unit() OOB access on empty sysfs file
Arnaldo Carvalho de Melo <[email protected]>
perf pmu: Fix pmu_id() heap underwrite on empty identifier file
James Clark <[email protected]>
perf cs-etm: Queue context packets for frontend
James Clark <[email protected]>
perf cs-etm: Create decoders after both AUX and HW_ID search passes
Besar Wicaksono <[email protected]>
perf cs-etm: Fix incorrect or missing decoder for raw trace
Chuck Lever <[email protected]>
xprtrdma: Return sendctx slot after Send preparation failure
Chuck Lever <[email protected]>
xprtrdma: Repost Receive buffers for malformed replies
Chuck Lever <[email protected]>
xprtrdma: Sanitize the reply credit grant after parsing
Chris Mason <[email protected]>
xprtrdma: Fix bcall rep leak and unbounded peek
Chuck Lever <[email protected]>
xprtrdma: Resize reply buffers before reposting receives
Chuck Lever <[email protected]>
xprtrdma: Document and assert reply-handler invariants
Chuck Lever <[email protected]>
xprtrdma: Check frwr_wp_create() during connect
Arnaldo Carvalho de Melo <[email protected]>
perf hists: Fix snprintf() in hists__scnprintf_title() UID filter path
Arnaldo Carvalho de Melo <[email protected]>
perf bpf: Use scnprintf() in snprintf_hex() and synthesize_bpf_prog_name()
Arnaldo Carvalho de Melo <[email protected]>
perf sched: Fix idle-hist callchain display using wrong rb_first variant
Lad Prabhakar <[email protected]>
PCI: rcar-host: Remove unused LIST_HEAD(res)
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use perf_env__get_cpu_topology() in machine__resolve()
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Use scnprintf() in cpu_map__snprint() to prevent overflow
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Fix get_max_num() size_t underflow on empty sysfs file
Jamie Nguyen <[email protected]>
fs/ntfs3: resize log->one_page_buf when adopting on-disk page size
Shuvam Pandey <[email protected]>
PCI: meson: Propagate devm_add_action_or_reset() failure
Li RongQing <[email protected]>
PCI: mediatek: Fix operator precedence in PCIE_FTS_NUM_L0 macro
Mike Snitzer <[email protected]>
NFSv4/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS in pg_get_mirror_count_write
Mike Snitzer <[email protected]>
NFSv4/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS on fatal DS connect errors
Clark Wang <[email protected]>
nfs: keep PG_UPTODATE clear after read errors in page groups
Dai Ngo <[email protected]>
NFSv4/pnfs: defer return_range callbacks until after inode unlock
Chuck Lever <[email protected]>
xprtrdma: Decouple req recycling from RPC completion
Chuck Lever <[email protected]>
xprtrdma: Use sendctx DMA state for Send signaling
Chuck Lever <[email protected]>
xprtrdma: Post receive buffers after RPC completion
Chuck Lever <[email protected]>
xprtrdma: Close lost-wakeup race in xprt_rdma_alloc_slot
Chuck Lever <[email protected]>
xprtrdma: Avoid 250 ms delay on backlog wakeup
Chuck Lever <[email protected]>
xprtrdma: Remove temp allocation of rpcrdma_rep objects
Sagi Grimberg <[email protected]>
pNFS/filelayout: fix cheking if a layout is striped
Phillip Varney <[email protected]>
clk: qcom: a53: Corrected frequency multiplier for 1152MHz
Nuno Sá <[email protected]>
dmaengine: Fix possible use after free
Icenowy Zheng <[email protected]>
dmaengine: qcom: gpi: set DMA_PRIVATE capability
Arnaldo Carvalho de Melo <[email protected]>
perf c2c: Fix use-after-free in he__get_c2c_hists() error path
Arnaldo Carvalho de Melo <[email protected]>
perf mmap: Fix NULL deref in aio cleanup on alloc failure
Arnaldo Carvalho de Melo <[email protected]>
perf sched: Replace BUG_ON and add NULL checks in replay event helpers
Arnaldo Carvalho de Melo <[email protected]>
perf sched: Clean up idle_threads entry on init failure
Arnaldo Carvalho de Melo <[email protected]>
perf c2c: Bounds-check CPU and node IDs before bitmap and array access
Arnaldo Carvalho de Melo <[email protected]>
perf mmap: Guard cpu__get_node() return in aio_bind()
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Add bounds check to cpu__get_node()
Arnaldo Carvalho de Melo <[email protected]>
perf sched: Fix NULL dereference in latency_runtime_event
Arnaldo Carvalho de Melo <[email protected]>
perf sched: Replace BUG_ON on invalid CPU with graceful skip
Arnaldo Carvalho de Melo <[email protected]>
perf tools: Guard test_bit from out-of-bounds sample CPU
Rui Qi <[email protected]>
perf: Fix off-by-one stack buffer overflow in kallsyms__parse()
Shengjiu Wang <[email protected]>
dmaengine: imx-sdma: Refine spba bus searching in probe
Srinivasan Shanmugam <[email protected]>
drm/amd/display: Add missing kdoc for ALLM parameters
Jamie Nguyen <[email protected]>
fs/ntfs3: fix mount failure on 64K page-size kernels
Konstantin Komarov <[email protected]>
fs/ntfs3: add bounds check to run_get_highest_vcn()
Rosen Penev <[email protected]>
HID: logitech-hidpp: remove excess kernel-doc member in hidpp_scroll_counter
Yuho Choi <[email protected]>
clk: at91: keep securam node alive while mapping it
Aldo Conte <[email protected]>
iio: tcs3472: power down chip on probe failure
Sanjay Chitroda <[email protected]>
iio: accel: mma8452: handle I2C read error(s) in mma8452_read()
Guilherme Ivo Bozi <[email protected]>
iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event handling
Joshua Crofts <[email protected]>
iio: magnetometer: ak8975: fix potential kernel stack memory leak
Joshua Crofts <[email protected]>
iio: light: si1133: prevent race condition on timeout
Joshua Crofts <[email protected]>
iio: light: si1133: reset counter to prevent race condition
Arnaldo Carvalho de Melo <[email protected]>
perf header: Sanity check HEADER_EVENT_DESC attr.size before swap
James Kim <[email protected]>
char: tlclk: fix use-after-free in tlclk_cleanup()
Seungjin Bae <[email protected]>
usb: host: max3421: Reject hub port requests for non-existent ports
Seungjin Bae <[email protected]>
usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control()
Guangshuo Li <[email protected]>
staging: most: video: avoid double free on video register failure
Sergey Senozhatsky <[email protected]>
mailbox: mtk-adsp: fix UAF during device teardown
Leo Yan <[email protected]>
perf pmu: Skip test on Arm64 when #slots is zero
Andy Shevchenko <[email protected]>
phy: phy-can-transceiver: Check driver match and driver data against NULL
Sumit Kumar <[email protected]>
bus: mhi: ep: Fix potential deadlock in mhi_ep_reset_worker()
Rong Zhang <[email protected]>
PCI: loongson: Do not ignore downstream devices on external bridges
Ian Rogers <[email protected]>
perf sched: Add missing mmap2 handler in timehist
Rafael J. Wysocki <[email protected]>
platform/x86: xo15-ebook: Fix wakeup source and GPE handling
Rafael J. Wysocki <[email protected]>
x86/platform/olpc: xo15: Drop wakeup source on driver removal
Guixin Liu <[email protected]>
PCI: Check ROM header and data structure addr before accessing
Guixin Liu <[email protected]>
PCI: Introduce named defines for PCI ROM
Carlos Bilbao <[email protected]>
PCI/ASPM: Don't reconfigure ASPM entering low-power state
Leo Yan <[email protected]>
coresight: etm4x: Correct TRCVMIDCCTLR1 save and restore
Yingchao Deng <[email protected]>
coresight: cti: Fix DT filter signals silently ignored
Alexandru Hossu <[email protected]>
staging: nvec: fix use-after-free in nvec_rx_completed()
Yizhou Zhao <[email protected]>
net/9p: fix race condition on rdma->state in trans_rdma.c
Aleksandr Nogikh <[email protected]>
ocfs2: fix circular locking dependency in ocfs2_dio_end_io_write
Charles Keepax <[email protected]>
mfd: cs42l43: Sanity check firmware size
Guangshuo Li <[email protected]>
ksmbd: fix use-after-free in same_client_has_lease()
Brett Creeley <[email protected]>
ionic: Fix check in ionic_get_link_ext_stats
Eric Dumazet <[email protected]>
tcp: ipv6: clamp default adverting MSS to avoid GSO_BY_FRAGS (0xFFFF)
Eric Dumazet <[email protected]>
tipc: fix UAF in tipc_l2_send_msg()
Gui-Dong Han <[email protected]>
KEYS: Use acquire when reading state in keyring search
Aboorva Devarajan <[email protected]>
powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpus
Aboorva Devarajan <[email protected]>
powerpc/powernv: fix preempt count leak in pnv_kexec_wait_secondaries_down
Aboorva Devarajan <[email protected]>
powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del
Yadan Fan <[email protected]>
MIPS: mm: Fix out-of-bounds write in maar_res_walk()
Sechang Lim <[email protected]>
bpf, sockmap: fix integer overflow in bpf_msg_pop_data() bounds check
Weiming Shi <[email protected]>
bpf, sockmap: reject overflowing copy + len in bpf_msg_push_data()
Leon Hwang <[email protected]>
bpf: Fix bpf_get/setsockopt to tos for ipv4-mapped ipv6 socket
Leo Yan <[email protected]>
selftests/bpf: Initialize operation name before use
Huiwen He <[email protected]>
smb/client: always return a value for FS_IOC_GETFLAGS
Jian Zhang <[email protected]>
cifs: remove all cifs files before kill super
Takashi Iwai <[email protected]>
ALSA: core: Fix unintuitive behavior of snd_power_ref_and_wait()
Florian Westphal <[email protected]>
netfilter: nf_conncount: callers must hold rcu read lock
Runyu Xiao <[email protected]>
kcm: use WRITE_ONCE() when changing lower socket callbacks
Ovidiu Panait <[email protected]>
net: bcmgenet: Use weighted round-robin TX DMA arbitration
Ruoyu Wang <[email protected]>
net: wwan: t7xx: check skb_clone in control TX
Dragos Tatulea <[email protected]>
net/mlx5: Check max_macs devlink param value against max capability
Sun Jian <[email protected]>
bpf: Run generic devmap egress prog on private skb
Aditya Garg <[email protected]>
net: mana: guard TX wq object destroy with INVALID_MANA_HANDLE check
Aditya Garg <[email protected]>
net: mana: initialize gdma queue id to INVALID_QUEUE_ID
Victor Nogueira <[email protected]>
net/sched: sch_codel: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen
Victor Nogueira <[email protected]>
net/sched: sch_fq_codel: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen
Chuck Lever <[email protected]>
handshake: Require admin permission for DONE command
Lucas Tsai <[email protected]>
power: supply: core: fix supplied_from allocations
Guangshuo Li <[email protected]>
ASoC: adau1372: Clear PLL_EN on failed PLL lock without reset GPIO
Lars Pöschel <[email protected]>
spi: xilinx: use FIFO occupancy register to determine buffer size
Herbert Xu <[email protected]>
crypto: rng - Free default RNG on module exit
Felix Gu <[email protected]>
crypto: cavium/cpt - fix DMA cleanup using wrong loop index
Felix Gu <[email protected]>
crypto: marvell/octeontx - fix DMA cleanup using wrong loop index
Dave Jiang <[email protected]>
cxl/test: Add check after kzalloc() memory in alloc_mock_res()
Michael Bommarito <[email protected]>
tipc: reject inverted service ranges from peer bindings
Michael Bommarito <[email protected]>
tipc: prevent snt_unacked underflow on CONN_ACK
Michael Bommarito <[email protected]>
tipc: require net admin for TIPCv2 netlink mutators
Victor Nogueira <[email protected]>
net/sched: sch_hfsc: Don't make class passive twice
Xin Long <[email protected]>
sctp: validate embedded address parameter length
Xiang Mei <[email protected]>
bridge: cfm: reject invalid CCM interval at configuration time
Kuniyuki Iwashima <[email protected]>
net: fib_rules: Don't dump dying fib_rule in fib_rules_dump().
Jamal Hadi Salim <[email protected]>
net/sched: cls_flow: Dont expose folded kernel pointers
HyeongJun An <[email protected]>
ASoC: tegra: tegra210_ahub: Validate written enum value
HyeongJun An <[email protected]>
ASoC: fsl: fsl_audmix: Validate written enum values
HyeongJun An <[email protected]>
ASoC: codecs: hdac_hdmi: Validate written enum value
Leon Romanovsky <[email protected]>
RDMA/mlx5: Release the HW‑provided UAR index rather than the SW one
Maher Sanalla <[email protected]>
RDMA/mlx5: Fix undefined shift of user RQ WQE size
Patrisious Haddad <[email protected]>
RDMA/mlx5: Remove raw RSS QP restrack tracking
Maxwell Doose <[email protected]>
fs: efs: remove unneeded debug prints
Samuel Moelius <[email protected]>
Bluetooth: vhci: validate devcoredump state before side effects
Samuel Moelius <[email protected]>
Bluetooth: hci: validate codec capability element length
Zijun Hu <[email protected]>
Bluetooth: hci_qca: fix NULL pointer dereference in qca_dmp_hdr() for non-serdev device
Heiko Carstens <[email protected]>
s390/process: Fix kernel thread function pointer type
Daniel Borkmann <[email protected]>
bpf: Tighten cgroup storage cookie checks for prog arrays
Sergey Shtylyov <[email protected]>
of: cpu: add check in __of_find_n_match_cpu_property()
Dave Jiang <[email protected]>
cxl/test: Zero out LSA backing memory to avoid leaking to user
Dave Jiang <[email protected]>
cxl/test: Fix integer overflow in mock LSA bounds checks
Yonghong Song <[email protected]>
selftests/bpf: Fix bpf_iter/task_vma test
Aditya Prakash Srivastava <[email protected]>
ext4: fix kernel BUG in ext4_write_inline_data_end
Louis Scalbert <[email protected]>
bonding: 3ad: fix mux port state on oper down
Richard Fitzgerald <[email protected]>
ASoC: cs35l56: Don't leave parent IRQ disabled if system_suspend fails
Richard Fitzgerald <[email protected]>
ASoC: cs35l56: Fix missing calls to wm_adsp2_remove()
longlong yan <[email protected]>
tools/virtio: check mmap return value in vringh_test
Qing Ming <[email protected]>
vhost/net: complete zerocopy ubufs only once
Zhang Tianci <[email protected]>
vduse: Requeue failed read to send_list head
Qihang Tang <[email protected]>
vhost/vdpa: validate virtqueue index in mmap and fault paths
Qihang Tang <[email protected]>
vduse: hold vduse_lock across IDR lookup in open path
Val Packett <[email protected]>
ASoC: codecs: aw88261: fix incorrect masks for boost regs
Ruoyu Wang <[email protected]>
spi: meson-spifc: fix runtime PM leak on remove
Jason Gunthorpe <[email protected]>
IB/mlx4: Fill in the access_flags if IB_MR_REREG_ACCESS is not specified
Johannes Thumshirn <[email protected]>
btrfs: zoned: don't account data relocation space-info in statfs free space
Nikita Zhandarovich <[email protected]>
hwmon: (it87) Clamp negative values to zero in set_fan()
David Laight <[email protected]>
fbdev: sm501fb: Fix buffer errors in OF binding code
Filipe Manana <[email protected]>
btrfs: fix invalid pointer dereference in __btrfs_run_delayed_refs()
Ryder Lee <[email protected]>
wifi: mt76: mt7921: fix potential tx_retries underflow
Ryder Lee <[email protected]>
wifi: mt76: mt7915: fix potential tx_retries underflow
Bjoern A. Zeeb <[email protected]>
wifi: mt76: fix argument to ieee80211_is_first_frag()
Hongyan Xia <[email protected]>
sched/fair: Fix cpu_util runnable_avg arithmetic
Wolfram Sang <[email protected]>
hwspinlock: qcom: avoid uninitialized struct members
Hui Zhu <[email protected]>
vmalloc: fix NULL pointer dereference in is_vm_area_hugepages()
Luca Leonardo Scorcia <[email protected]>
pinctrl: mediatek: mt8167: Fix Schmitt trigger register offset of pins 34-39
Luca Leonardo Scorcia <[email protected]>
pinctrl: mediatek: mt8516: Fix Schmitt trigger register offset of pins 34-39
Mike Christie <[email protected]>
scsi: target: Remove tcm_loop target reset handling
David Disseldorp <[email protected]>
scsi: target: Fix hexadecimal CHAP_I handling
Yuho Choi <[email protected]>
watchdog: unregister PM notifier on watchdog unregister
Al Viro <[email protected]>
configfs: fix lockless traversals of ->s_children
Dmitry Vyukov <[email protected]>
firmware_loader: Fix recursive lock in device_cache_fw_images()
Felix Gu <[email protected]>
spi: ep93xx: fix double-free of zeropage on DMA setup failure
Jason Gunthorpe <[email protected]>
IB/mlx5: Properly support implicit ODP rereg_mr
Jason Gunthorpe <[email protected]>
IB/mlx5: Don't take the rereg_mr fallback without a new translation
Pengjie Zhang <[email protected]>
cpufreq: Documentation: fix conservative governor freq_step description
Yuho Choi <[email protected]>
ACPI: IPMI: Fix message kref handling on dead device
Kyle Zeng <[email protected]>
ALSA: seq: Clear variable event pointer on read
Rui Qi <[email protected]>
riscv: stacktrace: Remove bogus -0x4 offset in non-FP walk_stackframe
HyeongJun An <[email protected]>
ALSA: seq: Fix partial userptr event expansion
Tristan Madani <[email protected]>
wifi: wcn36xx: fix OOB read from short trigger BA firmware response
Tristan Madani <[email protected]>
wifi: wcn36xx: fix OOB read from firmware count in PRINT_REG_INFO indication
Tristan Madani <[email protected]>
wifi: wcn36xx: fix heap overflow from oversized firmware HAL response
Leon Hwang <[email protected]>
bpf: Update transport_header when encapsulating UDP tunnel in lwt
Leon Hwang <[email protected]>
bpf: Check tail zero of bpf_prog_info
Alexander Stein <[email protected]>
arm64: dts: tqma8mpql-mba8mpxl: configure sai clock in audio codec as well
Jacob Moroni <[email protected]>
RDMA/irdma: Initialize iwmr->access during MR registration
Jacob Moroni <[email protected]>
RDMA/irdma: Fix OOB read during CQ MR registration
Jason Gunthorpe <[email protected]>
IB/cm: Fix av cm device leak on an error path in cm_init_av_by_path()
Pablo Neira Ayuso <[email protected]>
netfilter: conntrack: call nf_ct_gre_keymap_destroy() if master helper is pptp
Pablo Neira Ayuso <[email protected]>
netfilter: conntrack: revert ct extension genid infrastructure
Fernando Fernandez Mancera <[email protected]>
netfilter: synproxy: protect nf_ct_seqadj_init() with conntrack lock
Fernando Fernandez Mancera <[email protected]>
netfilter: nfnetlink_osf: fix mss parsing on big-endian architectures
Joseph Qi <[email protected]>
ocfs2: fix race between ocfs2_control_install_private() and ocfs2_control_release()
Zhang Cen <[email protected]>
ocfs2/dlm: require a ref for locking_state debugfs open
Zhang Cen <[email protected]>
ocfs2: reject FITRIM ranges shorter than a cluster
Dmitry Antipov <[email protected]>
ocfs2: fix buffer head management in ocfs2_read_blocks()
Zhang Cen <[email protected]>
ocfs2: rebase copied fsdlm LVB pointers in locking_state
Sandipan Das <[email protected]>
perf/x86/amd/core: Always use the NMI latency mitigation
Woojin Ji <[email protected]>
bpftool: Use libbpf error code for flow dissector query
Yunxiang Li <[email protected]>
drm/amdgpu: set sub_block_index for mca ras sub-blocks
Al Viro <[email protected]>
configfs_lookup(): don't leave ->s_dentry dangling on failure
Alexander Potapenko <[email protected]>
lib/test_meminit: use && for bools
Guanyou.Chen <[email protected]>
sched: restore timer_slack_ns when resetting RT policy on fork
Danila Chernetsov <[email protected]>
ext2: fix ignored return value of generic_write_sync()
Sang-Heon Jeon <[email protected]>
mm/fake-numa: fix under-allocation detection in uniform split
Deepanshu Kartikey <[email protected]>
bpf: fix UAF by restoring RCU-delayed inode freeing in bpffs
Chanwoo Lee <[email protected]>
scsi: ufs: Fix wrong value printed in unexpected UPIU response case
Dan Carpenter <[email protected]>
scsi: pm8001: Fix error code in non_fatal_log_show()
Martin Wilck <[email protected]>
scsi: Revert "scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans"
Alison Schofield <[email protected]>
nvdimm/btt: Handle preemption in BTT lane acquisition
Yuho Choi <[email protected]>
ARM: imx31: Fix IIM mapping leak in revision check
Bart Van Assche <[email protected]>
ata: libata: Fix ata_exec_internal()
J. Neuschäfer <[email protected]>
HID: wiimote: Fix table layout and whitespace errors
Yuho Choi <[email protected]>
ARM: imx3: Fix CCM node reference leak
John Madieu <[email protected]>
ASoC: rsnd: Fix RSND_SOC_MASK width to single nibble
Zhang Yi <[email protected]>
ext4: fix LOGFLUSH shutdown ordering to allow ordered-mode data writeback
Chen Cheng <[email protected]>
md/raid10: reset read_slot when reusing r10bio for discard
Danilo Krummrich <[email protected]>
rpmsg: use generic driver_override infrastructure
Renjiang Han <[email protected]>
media: qcom: venus: relax encoder frame/blur step size on v6
Renjiang Han <[email protected]>
media: qcom: venus: relax encoder frame/blur dimension steps on v4
Renjiang Han <[email protected]>
media: qcom: venus: drop extra padding in NV12 raw size calculation
Tristan Madani <[email protected]>
RDMA/rxe: Copy WQE to local buffer in non-SRQ receive path
Tristan Madani <[email protected]>
RDMA/rxe: Fix TOCTOU heap overflow in get_srq_wqe
zhoumin <[email protected]>
EDAC/{skx_common,skx}: Fix UBSAN shift-out-of-bounds in skx_get_dimm_info
Jessica Zhang <[email protected]>
drm/msm/dp: Fix the ISR_* enum values
Jessica Zhang <[email protected]>
drm/msm/dp: fix HPD state status bit shift value
Weili Qian <[email protected]>
crypto: hisilicon/qm - disable error report before flr
Tetsuo Handa <[email protected]>
ocfs2: kill osb->system_file_mutex lock
ZhengYuan Huang <[email protected]>
ocfs2: don't BUG_ON an invalid journal dinode
Dan Carpenter <[email protected]>
rapidio/tsi721: prevent a bad dereference in tsi721_db_dpc()
Davidlohr Bueso <[email protected]>
dax/kmem: account for partial discontiguous resource upon removal
Carlos Llamas <[email protected]>
libbpf: Fix UAF in strset__add_str()
Michael Bommarito <[email protected]>
libbpf: Harden parse_vma_segs() path parsing
Timur Tabi <[email protected]>
drm/nouveau/bios: specify correct display fuse register for Ampere and Ada
Mikko Perttunen <[email protected]>
drm/tegra: Fix iommu_map_sgtable() return value check
Mikko Perttunen <[email protected]>
gpu: host1x: Fix iommu_map_sgtable() return value check
Felix Gu <[email protected]>
drm/tegra: dc: Fix device node reference leak in tegra_dc_has_output()
Mikko Perttunen <[email protected]>
gpu: host1x: Allow entries in BO caches to be freed
Ion Agorria <[email protected]>
drm/tegra: gr2d/gr3d: Contain PM in the gr*d_probe/gr*d_remove
Svyatoslav Ryhel <[email protected]>
drm/tegra: gr2d/gr3d: Initialize address register map before HOST1X client is registered
Jiayuan Chen <[email protected]>
net/sched: cls_bpf: prevent unbounded recursion in offload rollback
Eric Dumazet <[email protected]>
ipv6: guard against possible NULL deref in __in6_dev_stats_get()
Breno Leitao <[email protected]>
workqueue: drop spurious '*' from print_worker_info() fn declaration
Nilay Shroff <[email protected]>
nvme-multipath: fix flex array size in struct nvme_ns_head
Charles Keepax <[email protected]>
pinctrl: cs42l43: Fix polarity on debounce
Zhang Cen <[email protected]>
ALSA: seq: midi: Serialize output teardown with event_input
Miquel Raynal <[email protected]>
mtd: spi-nor: Drop duplicate Kconfig dependency
Rosen Penev <[email protected]>
mips: n64: add __iomem for writel call
Rosen Penev <[email protected]>
mips: ralink: mt7621: add missing __iomem
Maciej W. Rozycki <[email protected]>
MIPS: DEC: Remove do_IRQ() call indirection
Maciej W. Rozycki <[email protected]>
MIPS: Fix big-endian stack argument fetching in o32 wrapper
Jiakai Xu <[email protected]>
PM: sleep: Use complete() in device_pm_sleep_init()
Tao Cui <[email protected]>
RDMA/counter: Fix incorrect port index in rdma_counter_init() error cleanup
Lianfa Weng <[email protected]>
RDMA/hns: Fix warning in poll cq direct mode
Guangshuo Li <[email protected]>
IB/mlx4: Fix refcount leak in add_port() error path
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix a use-after-free problem in rxe_mmap
Jacob Moroni <[email protected]>
RDMA/irdma: Fix out-of-bounds write in irdma_copy_user_pgaddrs
Samuel Holland <[email protected]>
bus: sunxi-rsb: Always check register address validity
Ronaldo Nunez <[email protected]>
pwm: imx27: Fix variable truncation in .apply()
Lifeng Zheng <[email protected]>
cpufreq: conservative: Simplify frequency limit handling
Pengjie Zhang <[email protected]>
cpufreq: Documentation: fix sampling_down_factor range
Saravana Kannan <[email protected]>
Revert "treewide: Fix probing of devices in DT overlays"
Zhang Yuwei <[email protected]>
driver core: Use mod_delayed_work to prevent lost deferred probe work
Stepan Ionichev <[email protected]>
device property: fix fwnode reference leak in fwnode_graph_get_endpoint_by_id()
Pengpeng Hou <[email protected]>
tracing: Bound synthetic-field strings with seq_buf
Harshal Dev <[email protected]>
arm64: dts: qcom: sm8450: Add power-domain and iface clk for ice node
Geert Uytterhoeven <[email protected]>
firmware: arm_scmi: Fix OOB in scmi_power_name_get()
Sven Püschel <[email protected]>
media: rockchip: rga: fix too small buffer size
Eric Dumazet <[email protected]>
net/sched: sch_drr: annotate data-races around cl->deficit
Chen-Yu Tsai <[email protected]>
regulator: dt-bindings: mt6359: Drop regulator-name pattern restrictions
Randy Dunlap <[email protected]>
bitops: use common function parameter names
Greg Kroah-Hartman <[email protected]>
sysfs: clamp show() return value in sysfs_kf_read()
Sudeep Holla <[email protected]>
firmware: arm_scmi: Read sensor config as 32-bit value
Zilin Guan <[email protected]>
media: atomisp: Fix memory leak in atomisp_fixed_pattern_table()
Sara Venkatesh <[email protected]>
RDMA/srpt: fix integer overflow in immediate data length check
Prathamesh Deshpande <[email protected]>
RDMA/mlx5: Fix devx subscribe-event unwind NULL dereference
Alexander Chesnokov <[email protected]>
RDMA/hns: Fix arithmetic overflow in calc_hem_config()
Prathamesh Deshpande <[email protected]>
IB/mlx5: Fix transport-domain rollback and initialize lb mutex earlier
Linmao Li <[email protected]>
ipv6: addrconf: bail out of dad_failure when state is no longer POSTDAD
Eric Dumazet <[email protected]>
net/sched: sch_htb: annotate data-races (I)
Eric Dumazet <[email protected]>
net/sched: sch_htb: do not change sch->flags in htb_dump()
Qiang Ma <[email protected]>
spi: hisi-kunpeng: Use dev_err_probe() for host registration failure
Sean Christopherson <[email protected]>
crypto: ccp - Treat zero-length cert chain as query for blob lengths
Eric Dumazet <[email protected]>
net/sched: sch_hfsc: annotate data-races in hfsc_dump_class_stats()
Stepan Ionichev <[email protected]>
clk: scpi: Unregister child clock providers on remove
Rafael J. Wysocki <[email protected]>
thermal: hwmon: Fix critical temperature attribute removal
Pengpeng Hou <[email protected]>
evm: terminate and bound the evm_xattrs read buffer
Lin He <[email protected]>
drm/hisilicon/hibmc: use clock to look up the PLL value
Lin He <[email protected]>
drm/hisilicon/hibmc: move display contrl config to hibmc_probe()
Kuldeep Singh <[email protected]>
arm64: dts: qcom: sm8450: Fix ICE reg size
Cristian Marussi <[email protected]>
clk: scmi: Fix clock rate rounding
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8192-asurada: Move PCIe DMA bounce buffer to host
Sean Christopherson <[email protected]>
iommu/amd: Fix a stale comment about which legacy mode is user visible
Shuangpeng Bai <[email protected]>
nilfs2: fix backing_dev_info reference leak
Alexander Aring <[email protected]>
dlm: fix add msg handle in send_queue ordered
Weiming Shi <[email protected]>
crypto: asymmetric_keys - fix OOB read in pefile_digest_pe_contents
Thorsten Blum <[email protected]>
crypto: ecrdsa - fix unknown OID check in ecrdsa_param_curve
Lothar Rubusch <[email protected]>
crypto: atmel-sha204a - fix blocking and non-blocking rng logic
Kuniyuki Iwashima <[email protected]>
vxlan: Fix potential null-ptr-deref in vxlan_gro_prepare_receive().
Peng Fan <[email protected]>
arm64: dts: imx8x-colibri: Correct SODIMM PAD settings
Weixin Guo <[email protected]>
arm64: dts: rockchip: fix rk809 interrupt pin on rk3566-roc-pc
Felix Gu <[email protected]>
pinctrl: sunxi: fix regulator leak in sunxi_pmx_request() error path
Nas Chung <[email protected]>
media: v4l2-common: Add YUV24 format info
Samuel Holland <[email protected]>
media: cedrus: Fix failure to clean up hardware on probe failure
Felix Gu <[email protected]>
watchdog: sprd_wdt: Remove redundant sprd_wdt_disable() on register failure
Balakrishnan Sambath <[email protected]>
watchdog: sama5d4_wdt: Fix WDDIS detection on SAM9X60 and SAMA7G5
Yingjie Gao <[email protected]>
watchdog: sp5100_tco: Use EFCH MMIO for newer Hygon FCH
Jihed Chaibi <[email protected]>
ARM: dts: am335x-sl50: Fix audio bitclock and frame master endpoint
Tristan Madani <[email protected]>
wifi: ath9k: fix OOB access from firmware tx status queue ID
Xingjing Deng <[email protected]>
kconfig: fix potential NULL pointer dereference in conf_askvalue
Tristan Madani <[email protected]>
wifi: rtw88: fix OOB read from firmware RX descriptor exceeding DMA buffer
Shin-Yi Lin <[email protected]>
wifi: rtw89: Correct data type for scan index to avoid infinite loop
Danilo Krummrich <[email protected]>
driver core: use READ_ONCE() for dev->driver in dev_has_sync_state()
Srinivasan Shanmugam <[email protected]>
drm/amdkfd: Validate CRIU-restored IDs before idr_alloc
Krzysztof Kozlowski <[email protected]>
dt-bindings: pinctrl: nvidia,tegra234: Add missing required block
Jon Hunter <[email protected]>
arm64: tegra: Fix Tegra234 MGBE PTP clock
Louis Kotze <[email protected]>
wifi: cfg80211: fix grammar in MLO group key error message
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-mezzanine: Fix camss ports unit_address_vs_reg warning
Diederik de Haas <[email protected]>
arm64: dts: rockchip: Fix gmac0 reset pin for NanoPi R5S
Baolin Liu <[email protected]>
Documentation: proc: fix section numbering in table of contents
Aaron Tomlin <[email protected]>
libbpf: Report error when a negative kprobe offset is specified
Yuho Choi <[email protected]>
drm/radeon: fix memory leak in radeon_ring_restore() on lock failure
Werner Kasselman <[email protected]>
drm/radeon: fix integer overflow in radeon_align_pitch()
Werner Kasselman <[email protected]>
drm/amdgpu: fix integer overflow in amdgpu_gem_align_pitch()
Tomi Valkeinen <[email protected]>
drm/tidss: Drop extra drm_mode_config_reset() call
Thomas Zimmermann <[email protected]>
drm/rockchip: Test for imported buffers with drm_gem_is_imported()
Chen Ni <[email protected]>
clocksource/drivers/sun5i: Handle error returns from devm_reset_control_get_optional_exclusive()
Ian Bridges <[email protected]>
fbcon: fix NULL pointer dereference for a console without vc_data
David Howells <[email protected]>
afs: Fix further netns teardown to cancel the preallocation charger
Matvey Kovalev <[email protected]>
afs: fix NULL pointer dereference in afs_get_tree()
David Howells <[email protected]>
afs: Fix netns teardown to cancel the preallocation charger
David Howells <[email protected]>
rxrpc: Fix leak of released call in recvmsg(MSG_PEEK)
Jeffrey Altman <[email protected]>
rxrpc: rxrpc_verify_data ensure rx_dec_buffer alloc
Matthias Feser <[email protected]>
serial: 8250_omap: clear rx_running on zero-length DMA completes
Stephan Gerhold <[email protected]>
serial: msm: Disable DMA for kernel console UART
Guoniu Zhou <[email protected]>
dt-bindings: power: imx93: Add MIPI PHY power domain
Chen-Yu Tsai <[email protected]>
dt-bindings: media: sun4i-a10-video-engine: Add interconnect properties
Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix sequence number when no EOF
Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix buffer sequence in frame gaps
Ricardo Ribalda <[email protected]>
media: uvcvideo: Avoid partial metadata buffers
Pawan Gupta <[email protected]>
bpf: Prefer dirty packs for eBPF allocations
Pawan Gupta <[email protected]>
bpf: Prefer packs that won't trigger an IBPB flush on allocation
Pawan Gupta <[email protected]>
bpf: Skip redundant IBPB in pack allocator
Pawan Gupta <[email protected]>
bpf: Restrict JIT predictor flush to cBPF
Pawan Gupta <[email protected]>
x86/bugs: Enable IBPB flush on BPF JIT allocation
Pawan Gupta <[email protected]>
bpf: Support for hardening against JIT spraying
Eric Biggers <[email protected]>
crypto: hisi-trng - Remove crypto_rng interface
Eric Biggers <[email protected]>
crypto: crypto4xx - Remove insecure and unused rng_alg
Herbert Xu <[email protected]>
crypto: crypto4xx - Remove ahash-related code
Stephen Dolan <[email protected]>
x86/mm: Fix check/use ordering in switch_mm_irqs_off()
Eric Biggers <[email protected]>
crypto: sun4i-ss - Remove insecure and unused rng_alg
Sagi Grimberg <[email protected]>
nvmet-tcp: Fix potential UAF when ddgst mismatch
Shivam Kumar <[email protected]>
nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in digest error path
Hyunwoo Kim <[email protected]>
KVM: arm64: Clear __hyp_running_vcpu when flushing the pKVM hyp vCPU
Hyunwoo Kim <[email protected]>
KVM: arm64: Bound used_lrs when flushing the pKVM hyp vCPU
Muhammet Kaan KILINÇ <[email protected]>
crypto: algif_skcipher - force synchronous processing on trees without ctx->state
Adam Li <[email protected]>
sched/fair: Only update stats for allowed CPUs when looking for dst group
Chao Shi <[email protected]>
block: skip sync_blockdev() on surprise removal in bdev_mark_dead()
ChenXiaoSong <[email protected]>
smb/server: do not require delete access for non-replacing links
Darrick J. Wong <[email protected]>
xfs: resample the data fork mapping after cycling ILOCK
Weiming Shi <[email protected]>
xfs: fail recovery on a committed log item with no regions
Shoichiro Miyamoto <[email protected]>
smb: client: reject overlapping data areas in SMB2 responses
Joanne Koong <[email protected]>
fuse: re-lock request before returning from fuse_ref_folio()
Alberto Ruiz <[email protected]>
fuse: fix device node leak in cuse_process_init_reply()
Michael Bommarito <[email protected]>
RDMA/siw: bound Read Response placement to the RREAD length
Zhenhao Wan <[email protected]>
RDMA/rtrs-srv: Bound RDMA-Write length to chunk size in rdma_write_sg
Dmitry Torokhov <[email protected]>
Input: maplecontrol - set driver data before registering input device
Dmitry Torokhov <[email protected]>
Input: maplemouse - set driver data before registering input device
Dmitry Torokhov <[email protected]>
Input: maple_keyb - set driver data before registering input device
Dmitry Torokhov <[email protected]>
Input: mms114 - fix multi-touch slot corruption
Florian Fuchs <[email protected]>
Input: maplemouse - fix NULL pointer dereference in open()
Bryam Vargas <[email protected]>
Input: mms114 - reject an oversized device packet size
Bryam Vargas <[email protected]>
Input: touchwin - reset the packet index on every complete packet
Dmitry Torokhov <[email protected]>
Input: mms114 - fix touch indexing for MMS134S and MMS136
Bryam Vargas <[email protected]>
Input: iforce - bound the device-reported force-feedback effect index
Bryam Vargas <[email protected]>
Input: goodix - clamp the device-reported contact count
Ranjan Kumar <[email protected]>
Input: elan_i2c - prevent division by zero and arithmetic underflow
Bryam Vargas <[email protected]>
Input: synaptics-rmi4 - bound the F30 keymap to the GPIO/LED count
Bryam Vargas <[email protected]>
Input: synaptics-rmi4 - bound the F3A keymap to the GPIO count
Haoxiang Li <[email protected]>
Input: synaptics-rmi4 - unregister function handlers on physical driver registration failure
Guillermo Rodríguez <[email protected]>
i2c: stm32f7: truncate clock period instead of rounding it
Andy Shevchenko <[email protected]>
i2c: mpc: Fix timeout calculations
Johan Hovold <[email protected]>
i2c: core: fix adapter deregistration race
Mikhail Gavrilov <[email protected]>
udmabuf: fix DMA direction mismatch in release_udmabuf()
Sean Christopherson <[email protected]>
KVM: VMX: Grab vmcs12 on CR8 interception update iff vCPU is in guest mode
Sean Christopherson <[email protected]>
KVM: VMX: Refresh GUEST_PENDING_DBG_EXCEPTIONS.BS on all injected #DBs
Koichiro Den <[email protected]>
NTB: epf: Fix request_irq() unwind in ntb_epf_init_isr()
Bryam Vargas <[email protected]>
exfat: bound uniname advance in exfat_find_dir_entry()
Andrii Kuchmenko <[email protected]>
module: decompress: check return value of module_extend_max_pages()
Benjamin Coddington <[email protected]>
NFSv4: include MAY_WRITE in open permission mask for O_TRUNC
Huihui Huang <[email protected]>
tracing: Prevent out-of-bounds read in glob matching
Janne Grunau <[email protected]>
watchdog: apple: Add "apple,t8103-wdt" compatible
Vasily Khoruzhick <[email protected]>
EDAC/i10nm: Don't fail probing if ADXL is missing
Carlos Song <[email protected]>
spi: fsl-lpspi: terminate the RX channel on TX prepare failure path
Carlos Song <[email protected]>
spi: fsl-lpspi: replace dmaengine_terminate_all() with dmaengine_terminate_sync()
Mark Rutland <[email protected]>
arm64: fpsimd: Fix type mismatch in sme_{save,load}_state()
Paul Louvel <[email protected]>
crypto: talitos/hash - fix SEC2 64k - 1 ahash request limitation
Paul Louvel <[email protected]>
crypto: talitos/hash - remove useless wrapper
Paul Louvel <[email protected]>
crypto: talitos/hash - rename first_desc/last_desc to first_request/last_request
Paul Louvel <[email protected]>
crypto: talitos/hash - drop workqueue mechanism for SEC1
Paul Louvel <[email protected]>
crypto: talitos/hash - use descriptor chaining for SEC1 instead of workqueue
Paul Louvel <[email protected]>
crypto: talitos/hash - prepare SEC1 descriptor chaining, remove additional descriptor
Paul Louvel <[email protected]>
crypto: talitos - move code in current_desc_hdr() into a standalone function
Paul Louvel <[email protected]>
crypto: talitos - move dma mapping code in talitos_submit() into a standalone dma_map_request() function
Paul Louvel <[email protected]>
crypto: talitos - move dma unmapping code in flush_channel() into a standalone dma_unmap_request() function
Paul Louvel <[email protected]>
crypto: talitos - add chaining of arbitrary number of descriptor for the SEC1
Paul Louvel <[email protected]>
crypto: talitos - use dma_sync_single_for_cpu() before reading descriptor header
Giovanni Cabiddu <[email protected]>
crypto: qat - validate RSA CRT component lengths
Eric Biggers <[email protected]>
crypto: drbg - Fix the fips_enabled priority boost
Eric Biggers <[email protected]>
crypto: drbg - Fix drbg_max_addtl() on 64-bit kernels
Eric Biggers <[email protected]>
crypto: drbg - Fix returning success on failure in CTR_DRBG
Ruijie Li <[email protected]>
crypto: pcrypt - restore callback for non-parallel fallback
Anastasia Tishchenko <[email protected]>
crypto: ecc - Fix carry overflow in vli multiplication
Thorsten Blum <[email protected]>
crypto: caam - use print_hex_dump_devel to guard key hex dumps again
Thorsten Blum <[email protected]>
crypto: caam - use print_hex_dump_devel to guard key hex dumps
Eric Biggers <[email protected]>
crypto: af_alg - Remove zero-copy support from skcipher and aead
Bryam Vargas <[email protected]>
isofs: bound Rock Ridge symlink components to the SL record
Bryam Vargas <[email protected]>
partitions: aix: bound the pp_count scan to the ppe array
Qu Wenruo <[email protected]>
btrfs: do not trim a device which is not writeable
Achkinazi, Igor <[email protected]>
nvme-multipath: set BIO_REMAPPED on bios remapped to per-path namespace disks
Mikulas Patocka <[email protected]>
dm-ioctl: report an error if a device has no table
Wentao Liang <[email protected]>
hwrng: jh7110 - fix refcount leak in starfive_trng_read()
Bryam Vargas <[email protected]>
udf: validate sparing table length as an entry count, not a byte count
Bryam Vargas <[email protected]>
udf: validate VAT header length against the VAT inode size
Michael Bommarito <[email protected]>
udf: validate free block extents against the partition length
Maciej W. Rozycki <[email protected]>
PCI: Always lift 2.5GT/s restriction in PCIe failed link retraining
Liviu Stan <[email protected]>
iio: temperature: ltc2983: Fix n_wires default bypassing rotation check
Paul Menzel <[email protected]>
usb: typec: ucsi: cancel pending work on system suspend
Fan Wu <[email protected]>
usb: typec: ucsi: ccg: Fix use-after-free of ucsi on remove
Madhu M <[email protected]>
usb: typec: ucsi: Pass full DP config payload in SET_NEW_CAM for DP alt mode
Andrei Kuchynski <[email protected]>
usb: typec: ucsi: Invert DisplayPort role assignment
Badhri Jagan Sridharan <[email protected]>
usb: typec: tcpm: Validate SVID index in svdm_consume_modes()
Shuangpeng Bai <[email protected]>
usb: typec: class: drop PD lookup reference
Myeonghun Pak <[email protected]>
usb: typec: anx7411: use devm_pm_runtime_enable()
Sam Day <[email protected]>
usbip: vudc: fix NULL deref in vep_dequeue()
Yichong Chen <[email protected]>
usbip: tools: support SuperSpeedPlus devices
Xu Rao <[email protected]>
USB: usb-storage: ene_ub6250: restore media-ready check
Johan Hovold <[email protected]>
USB: ulpi: fix memory leak on registration failure
Johan Hovold <[email protected]>
USB: serial: digi_acceleport: fix write buffer corruption
Johan Hovold <[email protected]>
USB: serial: digi_acceleport: fix hard lockup on disconnect
Johan Hovold <[email protected]>
USB: serial: digi_acceleport: fix broken rx after throttle
Fabio Porcedda <[email protected]>
USB: serial: option: add Telit Cinterion FE990D50 compositions
Johan Hovold <[email protected]>
USB: serial: keyspan_pda: fix information leak
Haoxiang Li <[email protected]>
usb: mtu3: unmap request DMA on queue failure
Myeonghun Pak <[email protected]>
USB: misc: uss720: unregister parport on probe failure
Xu Rao <[email protected]>
USB: storage: include US_FL_NO_SAME in quirks mask
Myeonghun Pak <[email protected]>
usb: sl811-hcd: disable controller wakeup on remove
Johan Hovold <[email protected]>
USB: legousbtower: fix use-after-free on disconnect race
Erich E. Hoover <[email protected]>
USB: quirks: add NO_LPM for the Samsung T5 EVO Portable SSD
Johan Hovold <[email protected]>
USB: iowarrior: fix use-after-free on disconnect
Johan Hovold <[email protected]>
USB: ldusb: fix use-after-free on disconnect race
Johan Hovold <[email protected]>
USB: idmouse: fix use-after-free on disconnect race
Xu Rao <[email protected]>
usb: gadget: f_printer: take kref only for successful open
Jimmy Hu <[email protected]>
usb: gadget: udc: Fix use-after-free in gadget_match_driver
Maoyi Xie <[email protected]>
usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler
Dawei Feng <[email protected]>
usb: free iso schedules on failed submit
WenTao Liang <[email protected]>
usb: dwc3: meson-g12a: fix refcount leak in dwc3_meson_g12a_resume()
Rodrigo Lugathe da Conceição Alves <[email protected]>
USB: core: add USB_QUIRK_NO_LPM for VIA Labs USB 2.0 hub
Haoxiang Li <[email protected]>
usb: cdnsp: fix stream context array leak in cdnsp_alloc_stream_info()
Jared Baldridge <[email protected]>
usb: cdc_acm: Add quirk for Uniden BC125AT scanner
Maoyi Xie <[email protected]>
net: usb: kalmia: bound RX frame length in kalmia_rx_fixup()
Dawei Feng <[email protected]>
bpf: Restore sysctl new-value from 1 to 0
Zhao Zhang <[email protected]>
bpf: Reject fragmented frames in devmap
Alexey Nepomnyashih <[email protected]>
xfs: fix unreachable BIGTIME check in dquot flush validation
Yousef Alhouseen <[email protected]>
xfs: use null daddr for unset first bad log block
Louis-Alexis Eyraud <[email protected]>
media: mtk-jpeg: cancel workqueue on release for supported platforms only
Deepanshu Kartikey <[email protected]>
nilfs2: reject CLEAN_SEGMENTS ioctl with out-of-range segment numbers
Tristan Madani <[email protected]>
hfs/hfsplus: zero-initialize buffer in hfs_bnode_read
Srinivas Pandruvada <[email protected]>
HID: sensor-hub: Add sensor_hub_input_attr_read_values() for multi-byte reads
Maoyi Xie <[email protected]>
HID: lg-g15: cancel pending work on remove to fix a use-after-free
Manish Khadka <[email protected]>
HID: letsketch: fix UAF on inrange_timer at driver unbind
Myeonghun Pak <[email protected]>
HID: wacom: stop hardware after post-start probe failures
Yichong Chen <[email protected]>
tools/mm/slabinfo: fix total_objects attribute name
Xuewen Wang <[email protected]>
tools/mm/slabinfo: Fix trace disable logic inversion
Lukas Wunner <[email protected]>
X.509: Fix validation of ASN.1 certificate header
Kartik Rajput <[email protected]>
clocksource/drivers/timer-tegra186: Fix support for multiple watchdog instances
WenTao Liang <[email protected]>
posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() error path
Yuho Choi <[email protected]>
cpufreq: pcc: fix use-after-free and double free in _OSC evaluation
Tianxiang Chen <[email protected]>
cpufreq: Fix hotplug-suspend race during reboot
Steven Rostedt <[email protected]>
sched/rt: Have RT_PUSH_IPI be default off for non PREEMPT_RT
Fushuai Wang <[email protected]>
cpufreq: intel_pstate: Sync policy->cur during CPU offline
Guangshuo Li <[email protected]>
firmware_loader: fix device reference leak in firmware_upload_register()
Abdun Nihaal <[email protected]>
OPP: of: Fix potential memory leak in opp_parse_supplies()
Norbert Manthey <[email protected]>
smb: client: mask server-provided mode to 07777 in modefromsid
Zihan Xi <[email protected]>
smb: client: harden POSIX SID length parsing
Zihan Xi <[email protected]>
smb: client: use unaligned reads in parse_posix_ctxt()
Haoxiang Li <[email protected]>
smb: client: Fix next buffer leak in receive_encrypted_standard()
Henrique Carvalho <[email protected]>
smb: client: fix double-free in SMB2_close() replay
Henrique Carvalho <[email protected]>
smb: client: fix double-free in SMB2_open() replay
Zhao Zhang <[email protected]>
smb: client: fix double-free in SMB2_flush() replay
Henrique Carvalho <[email protected]>
smb: client: fix change notify replay double-free
Henrique Carvalho <[email protected]>
smb: client: fix double-free in SMB2_ioctl() replay
Henrique Carvalho <[email protected]>
smb: client: fix query_info() replay double-free
Henrique Carvalho <[email protected]>
smb: client: fix query directory replay double-free
Namjae Jeon <[email protected]>
ksmbd: use opener credentials for delete-on-close
Gil Portnoy <[email protected]>
ksmbd: add per-handle permission check to FILE_LINK_INFORMATION
Gil Portnoy <[email protected]>
ksmbd: enforce FILE_READ_ATTRIBUTES on SMB_FIND_FILE_POSIX_INFORMATION
Namjae Jeon <[email protected]>
ksmbd: run set info with opener credentials
Gil Portnoy <[email protected]>
ksmbd: add a WRITE_DAC/WRITE_OWNER check to SMB2 SET_INFO SECURITY
Namjae Jeon <[email protected]>
ksmbd: require source read access for duplicate extents
Davide Ornaghi <[email protected]>
ksmbd: fix UAF of struct file_lock in SMB2_LOCK deferred-lock cancellation
Namjae Jeon <[email protected]>
ksmbd: serialize QUERY_DIRECTORY requests per file
Gil Portnoy <[email protected]>
ksmbd: add a permission check for FSCTL_SET_ZERO_DATA
Gil Portnoy <[email protected]>
ksmbd: add permission checks for FSCTL_DUPLICATE_EXTENTS_TO_FILE
Dan Carpenter <[email protected]>
smb/client: Fix error code in smb2_aead_req_alloc()
Junrui Luo <[email protected]>
coresight: ultrasoc-smb: Fix OOB write in smb_sync_perf_buffer()
Deepanshu Kartikey <[email protected]>
fs/ntfs3: fix missing run load for vcn0 in attr_data_get_block_locked()
Konstantin Komarov <[email protected]>
fs/ntfs3: zero-fill folios beyond i_valid in ntfs_read_folio()
Konstantin Komarov <[email protected]>
fs/ntfs3: handle attr_set_size() errors when truncating files
Konstantin Komarov <[email protected]>
fs/ntfs3: fsync files by syncing parent inodes
Muhammad Bilal <[email protected]>
Bluetooth: L2CAP: validate option length before reading conf opt value
Yousef Alhouseen <[email protected]>
Bluetooth: fix UAF in bt_accept_dequeue()
Maoyi Xie <[email protected]>
Bluetooth: btnxpuart: Fix out-of-bounds firmware read in nxp_recv_fw_req_v3()
Yousef Alhouseen <[email protected]>
Bluetooth: bnep: pin L2CAP connection during netdev registration
Sergey Senozhatsky <[email protected]>
Bluetooth: btmtksdio: fix infinite loop in btmtksdio_txrx_work()
Xiang Mei <[email protected]>
netfilter: ebtables: terminate table name before find_table_lock()
Florian Westphal <[email protected]>
netfilter: ebtables: module names must be null-terminated
Pratham Gupta <[email protected]>
netfilter: ctnetlink: use nf_ct_exp_net() in expectation dump
Qi Zheng <[email protected]>
mm: shrinker: fix NULL pointer dereference in debugfs
Andrei Kuchynski <[email protected]>
mfd: cros_ec: Delay dev_set_drvdata() until probe success
Wyatt Feng <[email protected]>
net: ipv4: bound TCP reordering sysctl writes and MTU probe sizes
Yuyang Huang <[email protected]>
ipv4: igmp: remove multicast group from hash table on device destruction
Runyu Xiao <[email protected]>
io_uring/io-wq: re-check IO_WQ_BIT_EXIT for each linked work item
Runyu Xiao <[email protected]>
gpio: eic-sprd: use raw_spinlock_t in the irq startup path
Koichiro Den <[email protected]>
NTB: epf: Avoid calling pci_irq_vector() from hardirq context
Yunpeng Tian <[email protected]>
fs/ntfs3: validate Dirty Page Table capacity in log_replay copy_lcns
Thomas Gleixner <[email protected]>
debugobjects: Plug race against a concurrent OOM disable
Samuel Page <[email protected]>
Bluetooth: MGMT: Fix UAF of hci_conn_params in add_device_complete
Chi Wang <[email protected]>
audit: Fix data races of skb_queue_len() readers on audit_queue
Zijing Yin <[email protected]>
net: af_key: initialize alg_key_len for IPComp states
Gil Portnoy <[email protected]>
ksmbd: fix use-after-free of a deferred file_lock on SMB2_CLOSE then SMB2_CANCEL
Dawei Feng <[email protected]>
crypto: amlogic - avoid double cleanup in meson_crypto_probe()
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB write in HT_caps_handler()
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB reads in is_ap_in_tkip() IE loop
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB reads in IE loops in issue_assocreq() and join_cmd_hdl()
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB read in update_beacon_info() IE loop
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix OOB read in OnAssocRsp() IE loop
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix WEP length underflow and OOB read in OnAuth()
Alexandru Hossu <[email protected]>
staging: rtl8723bs: fix heap buffer overflow in rtw_cfg80211_set_wpa_ie()
Arnd Bergmann <[email protected]>
staging: media: atomisp: reduce load_primary_binaries() stack usage
Ricardo Ribalda <[email protected]>
media: staging: ipu3-imgu: Add range check for imgu_css_cfg_acc_stripe
Hao-Qun Huang <[email protected]>
staging: vme_user: fix location monitor leak in tsi148 bridge
Hao-Qun Huang <[email protected]>
staging: vme_user: fix location monitor leak in fake bridge
Shoichiro Miyamoto <[email protected]>
smb: client: restrict implied bcc[0] exemption to responses without data area
Michael Tautschnig <[email protected]>
staging: vme_user: bound slave read/write to the kern_buf size
Samuel Page <[email protected]>
tipc: fix out-of-bounds read in broadcast Gap ACK blocks
Yizhou Zhao <[email protected]>
6lowpan: fix NHC entry use-after-free on error path
Runyu Xiao <[email protected]>
usb: dwc3: run gadget disconnect from sleepable suspend context
Alan Stern <[email protected]>
USB: chaoskey: Fix slab-use-after-free in chaoskey_release()
Michael Bommarito <[email protected]>
hwrng: virtio: clamp device-reported used.len at copy_data()
Johan Hovold <[email protected]>
virtio-mmio: fix device release warning on module unload
Xiang Mei <[email protected]>
netfilter: ipset: fix race between dump and ip_set_list resize
SeongJae Park <[email protected]>
mm/damon/ops-common: handle extreme intervals in damon_hot_score()
Ratheesh Kannoth <[email protected]>
PCI: host-common: Request bus reassignment when not probe-only
Mahesh Vaidya <[email protected]>
PCI: altera: Do not dispose parent IRQ mapping
Myeonghun Pak <[email protected]>
usb: typec: tcpci_rt1711h: unregister TCPCI port with devres
胡连勤 <[email protected]>
usb: xhci: Fix sleep in atomic context in xhci_free_streams()
Carlos Llamas <[email protected]>
binder: fix UAF in binder_free_transaction()
Carlos Llamas <[email protected]>
binder: fix UAF in binder_thread_release()
Johan Hovold <[email protected]>
Bluetooth: btusb: fix wakeup source leak on probe failure
Johan Hovold <[email protected]>
Bluetooth: btusb: fix use-after-free on marvell probe failure
Johan Hovold <[email protected]>
Bluetooth: btusb: fix use-after-free on registration failure
Zenm Chen <[email protected]>
Bluetooth: btusb: Add USB ID 2c4e:0128 for Mercusys MA60XNB
Junrui Luo <[email protected]>
vfio: prevent infinite loop in vfio_mig_get_next_state() on blocked arc
Alex Williamson <[email protected]>
vfio/pci: Fix racy bitfields and tighten struct layout
Alex Williamson <[email protected]>
vfio/pci: Release the VGA arbiter client on register_device() failure
Alex Williamson <[email protected]>
vfio/pci: Latch disable_idle_d3 per device
Raghavendra Rao Ananta <[email protected]>
vfio/pci: Use a private flag to prevent power state change with VFs
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Update US-16x08 EQ/comp shadow state after successful writes
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Update Babyface Pro control caches only after successful writes
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Roll back quirk control caches on write errors
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Propagate US-16x08 write errors in route/mix EQ-switch put callbacks
Cássio Gabriel <[email protected]>
ALSA: usb-audio: Propagate errors in scarlett_ctl_enum_put()
Darvell Long <[email protected]>
ALSA: usb-audio: avoid kobject path lookup in DualSense match
HyeongJun An <[email protected]>
ALSA: seq: Fix uninitialised heap leak in snd_seq_event_dup()
Zhao Dongdong <[email protected]>
ALSA: ice1712: check snd_ctl_new1() return value
Zhao Dongdong <[email protected]>
ALSA: gus: check snd_ctl_new1() return value
Maoyi Xie <[email protected]>
ALSA: firewire: isight: bound the sample count to the packet payload
Zhao Dongdong <[email protected]>
ALSA: es1938: check snd_ctl_new1() return value
Zhao Dongdong <[email protected]>
ALSA: cmipci: check snd_ctl_new1() return value
Maoyi Xie <[email protected]>
ALSA: caiaq: fix out-of-bounds read in the Traktor Kontrol S4 input parser
Zhao Dongdong <[email protected]>
ALSA: ymfpci: check snd_ctl_new1() return value
Cássio Gabriel <[email protected]>
ALSA: virtio: Add missing 384 kHz PCM rate mapping
Liviu Stan <[email protected]>
iio: temperature: ltc2983: Fix reinit_completion() called after conversion start
Andy Shevchenko <[email protected]>
iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() call
Javier Carrasco <[email protected]>
iio: light: veml6030: fix channel type when pushing events
Stepan Ionichev <[email protected]>
iio: light: tsl2591: return actual error from probe IRQ failure
Joshua Crofts <[email protected]>
iio: light: opt3001: fix missing state reset on timeout
Biren Pandya <[email protected]>
iio: light: gp2ap002: fix runtime PM leak on read error
Vidhu Sarwal <[email protected]>
iio: light: al3010: fix incorrect scale for the highest gain range
Andreas Kempe <[email protected]>
iio: imu: st_lsm6dsx: deselect shub page before reading whoami
Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: fix timestamp clock period by using lower value
Runyu Xiao <[email protected]>
iio: imu: bmi160: add IRQF_NO_THREAD to data-ready trigger IRQ
Stepan Ionichev <[email protected]>
iio: gyro: bmg160: wait full startup time after mode change at probe
Stepan Ionichev <[email protected]>
iio: gyro: bmg160: bail out when bandwidth/filter is not in table
Lars-Peter Clausen <[email protected]>
iio: event: Fix event FIFO reset race
Maxwell Doose <[email protected]>
iio: chemical: scd30: Cleanup initializations and fix sign-extension bug
Pengpeng Hou <[email protected]>
iio: adc: ti-ads124s08: Return reset GPIO lookup errors
Maxwell Doose <[email protected]>
iio: adc: spear: Initialize completion before requesting IRQ
Maxwell Doose <[email protected]>
iio: adc: lpc32xx: Initialize completion before requesting IRQ
Biren Pandya <[email protected]>
iio: accel: kxsd9: fix runtime PM imbalance on write_raw() error
Bryam Vargas <[email protected]>
iio: accel: bmc150: clamp the device-reported FIFO frame count
Griffin Kroah-Hartman <[email protected]>
usb: gadget: function: rndis: add length check for header
Griffin Kroah-Hartman <[email protected]>
usb: gadget: function: rndis: add length check to response query
Jonas Jelonek <[email protected]>
MIPS: smp: report dying CPU to RCU in stop_this_cpu()
Sebastian Andrzej Siewior <[email protected]>
net: Drop the lock in skb_may_tx_timestamp()
Huacai Chen <[email protected]>
LoongArch: Add PIO for early access before ACPI PCI root register
Philo Lu <[email protected]>
virtio_net: Support dynamic rss indirection table size
Fuad Tabba <[email protected]>
arm64: sysreg: Correct sign definitions for EIESB and DoubleLock
Marc Zyngier <[email protected]>
arm64: Revamp HCR_EL2.E2H RES1 detection
Ahmed Genidi <[email protected]>
KVM: arm64: Initialize SCTLR_EL1 in __kvm_hyp_init_cpu()
Mark Rutland <[email protected]>
KVM: arm64: Initialize HCR_EL2.E2H early
Marc Zyngier <[email protected]>
arm64: Fix early handling of FEAT_E2H0 not being implemented
Marc Zyngier <[email protected]>
arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is negative
Marc Zyngier <[email protected]>
arm64: sysreg: Add layout for ID_AA64MMFR4_EL1
Paul Louvel <[email protected]>
crypto: talitos - rename first/last to first_desc/last_desc
Paul Louvel <[email protected]>
crypto: talitos - fix SEC1 32k ahash request limitation
Eric Biggers <[email protected]>
crypto: talitos - stop using crypto_ahash::init
Goetz Goerisch <[email protected]>
Revert "crypto: talitos - fix SEC1 32k ahash request limitation"
Goetz Goerisch <[email protected]>
Revert "crypto: talitos - rename first/last to first_desc/last_desc"
Taeyang Lee <[email protected]>
perf/core: Detach event groups during remove_on_exec
Alice Ryhl <[email protected]>
rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER
Rafael J. Wysocki <[email protected]>
ACPI: NFIT: core: Fix possible NULL pointer dereference
Jeremy Linton <[email protected]>
ACPI: CPPC: Suppress UBSAN warning caused by field misuse
Florian Fainelli <[email protected]>
perf trace beauty fcntl: Fix build with older kernel headers
Claudia Draghicescu <[email protected]>
Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID
Darrick J. Wong <[email protected]>
xfs: move ->iop_recover to xfs_defer_op_type
Darrick J. Wong <[email protected]>
xfs: use xfs_defer_finish_one to finish recovered work items
Darrick J. Wong <[email protected]>
xfs: dump the recovered xattri log item if corruption happens
Darrick J. Wong <[email protected]>
xfs: recreate work items when recovering intent items
Jiayuan Chen <[email protected]>
mm/vmscan: flush deferred TLB before freeing large folios
Jiayuan Chen <[email protected]>
team: fix header_ops type confusion with non-Ethernet ports
Eric Dumazet <[email protected]>
bonding: prevent potential infinite loop in bond_header_parse()
Jiayuan Chen <[email protected]>
bonding: fix type confusion in bond_setup_by_slave()
Hangbin Liu <[email protected]>
bonding: fix xfrm offload feature setup on active-backup mode
Hangbin Liu <[email protected]>
bonding: use common function to compute the features
Hangbin Liu <[email protected]>
net: add a common function to compute features for upper devices
Cosmin Ratiu <[email protected]>
bonding: Correctly support GSO ESP offload
Jianbo Liu <[email protected]>
bonding: add ESP offload features when slaves support
Daniel Borkmann <[email protected]>
bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features
Daniel Borkmann <[email protected]>
net, team, bonding: Add netdev_base_features helper
Hangbin Liu <[email protected]>
net: team: rename team to team_core for linking
NeilBrown <[email protected]>
nfsd: change nfs4_client_to_reclaim() to allocate data
NeilBrown <[email protected]>
nfsd: move name lookup out of nfsd4_list_rec_dir()
John Johansen <[email protected]>
apparmor: advertise the tcp fast open fix is applied
Trond Myklebust <[email protected]>
nfsd: Don't reset the write verifier on a commit EAGAIN
Michael Bommarito <[email protected]>
NFSv4/flexfiles: reject zero filehandle version count
Mingyu Wang <[email protected]>
fbdev: fbcon: fix out-of-bounds read in err_out of fbcon_do_set_font()
Johan Hovold <[email protected]>
i2c: core: fix adapter registration race
Johan Hovold <[email protected]>
i2c: core: fix adapter debugfs creation
Johan Hovold <[email protected]>
i2c: core: fix NULL-deref on adapter registration failure
Johan Hovold <[email protected]>
i2c: core: fix hang on adapter registration failure
Johan Hovold <[email protected]>
i2c: core: fix irq domain leak on adapter registration failure
Denis Arefev <[email protected]>
block: Avoid mounting the bdev pseudo-filesystem in userspace
Sean Christopherson <[email protected]>
KVM: Replace guest-triggerable BUG_ON() in ioeventfd datamatch with get_unaligned()
Keshav Verma <[email protected]>
f2fs: fix listxattr handling of corrupted xattr entries
Chao Yu <[email protected]>
f2fs: fix potential deadlock in gc_merge path of f2fs_balance_fs()
Ruipeng Qi <[email protected]>
f2fs: fix potential deadlock in f2fs_balance_fs()
Bryam Vargas <[email protected]>
f2fs: bound i_inline_xattr_size for non-inline-xattr inodes
Chao Yu <[email protected]>
f2fs: atomic: fix UAF issue on f2fs_inode_info.atomic_inode
Wenjie Qi <[email protected]>
f2fs: validate orphan inode entry count
Bartosz Golaszewski <[email protected]>
device property: initialize the remaining fields of fwnode_handle in fwnode_init()
Maoyi Xie <[email protected]>
net: ip_gre: require CAP_NET_ADMIN in the device netns for changelink
Tiezhu Yang <[email protected]>
drm/amd: Fix set but not used warnings
Bjorn Andersson <[email protected]>
slimbus: qcom-ngd-ctrl: Register callbacks after creating the ngd
Uwe Kleine-König <[email protected]>
slimbus: Convert to platform remove callback returning void
Bjorn Andersson <[email protected]>
slimbus: qcom-ngd-ctrl: Correct PDR and SSR cleanup ownership
Bjorn Andersson <[email protected]>
slimbus: qcom-ngd-ctrl: Fix probe error path ordering
Chris Lu <[email protected]>
Bluetooth: btmtk: Fix btmtk.c undefined reference build error
Wentao Guan <[email protected]>
perf: Fix dangling cgroup pointer in cpuctx backport
Kiryl Shutsemau <[email protected]>
userfaultfd: gate must_wait writability check on pte_present()
Jiande Lu <[email protected]>
Bluetooth: btmtk: Fix wait_on_bit_timeout interruption during shutdown
Chris Lu <[email protected]>
Bluetooth: btmtk: Fix failed to send func ctrl for MediaTek devices.
Chris Lu <[email protected]>
Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c
Chris Lu <[email protected]>
Bluetooth: btusb: mediatek: return error for failed reg access
Chris Lu <[email protected]>
Bluetooth: btusb: mediatek: remove the unnecessary goto tag
Hao Qin <[email protected]>
Bluetooth: btusb: mediatek: add MT7922 subsystem reset
Hao Qin <[email protected]>
Bluetooth: btusb: mediatek: reset the controller before downloading the fw
Sean Wang <[email protected]>
Bluetooth: btmtk: apply the common btmtk_fw_get_filename
Huacai Chen <[email protected]>
LoongArch: Report dying CPU to RCU in stop_this_cpu()
Baokun Li <[email protected]>
ext4: get rid of ppath in get_ext_path()
Jeff Layton <[email protected]>
nfsd: reset write verifier on deferred writeback errors
Chris Mason <[email protected]>
nfsd: release layout stid on setlease failure
Daniel Borkmann <[email protected]>
bpf, arm64: Reject out-of-range B.cond targets
-------------
Diffstat:
Documentation/admin-guide/pm/cpufreq.rst | 6 +-
Documentation/crypto/userspace-if.rst | 31 +-
.../media/allwinner,sun4i-a10-video-engine.yaml | 10 +
.../devicetree/bindings/net/renesas,ether.yaml | 3 +-
.../pinctrl/nvidia,tegra234-pinmux-aon.yaml | 4 +
.../bindings/pinctrl/nvidia,tegra234-pinmux.yaml | 4 +
.../bindings/regulator/mt6359-regulator.yaml | 43 --
Documentation/driver-api/nvdimm/btt.rst | 5 +-
Documentation/driver-api/pci/pci.rst | 3 +
Documentation/filesystems/proc.rst | 14 +-
Documentation/netlink/specs/handshake.yaml | 1 +
Makefile | 7 +-
arch/alpha/kernel/pci-sysfs.c | 13 +-
arch/arm/boot/dts/ti/omap/am335x-sl50.dts | 4 +-
arch/arm/configs/sunxi_defconfig | 1 -
arch/arm/mach-imx/cpu-imx31.c | 9 +-
arch/arm/mach-imx/mm-imx3.c | 2 +
.../dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts | 3 +
arch/arm64/boot/dts/freescale/imx8x-colibri.dtsi | 4 +-
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 2 +-
arch/arm64/boot/dts/nvidia/tegra234.dtsi | 8 +-
arch/arm64/boot/dts/qcom/sdm630.dtsi | 9 +-
.../qcom/sdm845-db845c-navigation-mezzanine.dtso | 5 +
arch/arm64/boot/dts/qcom/sm8450.dtsi | 8 +-
arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts | 2 +-
arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 6 +-
arch/arm64/include/asm/el2_setup.h | 56 +-
arch/arm64/include/asm/kvm_hyp.h | 1 +
arch/arm64/include/asm/pgtable.h | 14 +-
arch/arm64/kernel/efi.c | 2 +-
arch/arm64/kernel/entry-fpsimd.S | 16 +-
arch/arm64/kernel/head.S | 20 +-
arch/arm64/kernel/hw_breakpoint.c | 9 +
arch/arm64/kernel/mte.c | 2 +-
arch/arm64/kvm/arm.c | 2 +
arch/arm64/kvm/guest.c | 2 +-
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 3 +-
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 12 +
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 3 +
arch/arm64/kvm/vgic/vgic-its.c | 2 +
arch/arm64/kvm/vgic/vgic.c | 11 +-
arch/arm64/lib/insn.c | 2 +
arch/arm64/mm/fault.c | 6 +-
arch/arm64/mm/hugetlbpage.c | 18 +-
arch/arm64/mm/kasan_init.c | 2 +-
arch/arm64/mm/mmu.c | 23 +-
arch/arm64/mm/pageattr.c | 4 +-
arch/arm64/mm/trans_pgd.c | 2 +-
arch/arm64/tools/sysreg | 39 +-
arch/loongarch/include/asm/acpi.h | 2 +
arch/loongarch/include/asm/pgtable.h | 4 +
arch/loongarch/kernel/acpi.c | 28 +
arch/loongarch/kernel/setup.c | 2 +
arch/loongarch/kernel/smp.c | 1 +
arch/loongarch/pci/acpi.c | 2 +
arch/mips/dec/int-handler.S | 2 +-
arch/mips/dec/platform.c | 6 +-
arch/mips/dec/prom/init.c | 6 +-
arch/mips/dec/setup.c | 6 -
arch/mips/fw/lib/call_o32.S | 2 +-
arch/mips/include/asm/dec/prom.h | 15 +-
arch/mips/kernel/mips-mt-fpaff.c | 28 +-
arch/mips/kernel/smp.c | 2 +
arch/mips/mm/init.c | 12 +-
arch/mips/n64/init.c | 2 +-
arch/mips/ralink/mt7621.c | 2 +-
arch/mips/sgi-ip22/ip22-gio.c | 7 +-
arch/powerpc/kexec/core_64.c | 4 +-
arch/powerpc/perf/core-fsl-emb.c | 3 +-
arch/powerpc/platforms/cell/spufs/file.c | 6 +-
arch/powerpc/platforms/powernv/setup.c | 3 +-
.../platforms/pseries/papr_platform_attributes.c | 8 +-
arch/riscv/kernel/cacheinfo.c | 2 +-
arch/riscv/kernel/machine_kexec.c | 3 +
arch/riscv/kernel/probes/rethook_trampoline.S | 3 +
arch/riscv/kernel/stacktrace.c | 2 +-
arch/riscv/net/bpf_jit_core.c | 3 +-
arch/s390/kernel/perf_cpum_cf.c | 3 +
arch/s390/kernel/process.c | 2 +-
arch/s390/kvm/pci.c | 12 +-
arch/sparc/kernel/led.c | 2 +-
arch/x86/boot/compressed/acpi.c | 7 +-
arch/x86/boot/early_serial_console.c | 11 +-
arch/x86/events/amd/brs.c | 10 +-
arch/x86/events/amd/core.c | 6 +-
arch/x86/events/amd/lbr.c | 3 +-
arch/x86/events/intel/uncore_snb.c | 7 -
arch/x86/include/asm/nospec-branch.h | 4 +
arch/x86/kernel/cpu/bugs.c | 50 +-
arch/x86/kvm/lapic.c | 8 +-
arch/x86/kvm/vmx/vmx.c | 38 +-
arch/x86/mm/numa_emulation.c | 17 +-
arch/x86/mm/tlb.c | 16 +-
arch/x86/net/bpf_jit_comp.c | 3 +-
arch/x86/platform/olpc/olpc-xo15-sci.c | 1 +
block/bdev.c | 11 +-
block/partitions/aix.c | 9 +
crypto/af_alg.c | 69 +--
crypto/algif_aead.c | 8 +-
crypto/algif_skcipher.c | 49 +-
crypto/asymmetric_keys/verify_pefile.c | 2 +
crypto/asymmetric_keys/x509_loader.c | 2 +-
crypto/drbg.c | 4 +-
crypto/ecc.c | 31 +-
crypto/ecrdsa.c | 2 +-
crypto/pcrypt.c | 4 +
crypto/rng.c | 11 +
drivers/acpi/acpi_ipmi.c | 4 +-
drivers/acpi/acpi_tad.c | 6 +-
drivers/acpi/bus.c | 70 +++
drivers/acpi/cppc_acpi.c | 11 +-
drivers/acpi/nfit/core.c | 89 +++-
drivers/acpi/pfr_telemetry.c | 6 +-
drivers/acpi/pfr_update.c | 6 +-
drivers/acpi/resource.c | 6 +-
drivers/acpi/thermal.c | 2 +-
drivers/android/binder.c | 19 +-
drivers/ata/libata-core.c | 19 +-
drivers/ata/pata_pxa.c | 1 +
drivers/ata/sata_gemini.c | 2 +-
drivers/base/dd.c | 7 +-
drivers/base/firmware_loader/main.c | 3 +-
drivers/base/firmware_loader/sysfs_upload.c | 8 +-
drivers/base/power/main.c | 6 +-
drivers/base/property.c | 4 +-
drivers/block/drbd/drbd_receiver.c | 5 +
drivers/bluetooth/Kconfig | 2 +
drivers/bluetooth/bpa10x.c | 8 +-
drivers/bluetooth/btmtk.c | 470 ++++++++++++++++-
drivers/bluetooth/btmtk.h | 23 +-
drivers/bluetooth/btmtksdio.c | 5 +-
drivers/bluetooth/btnxpuart.c | 6 +
drivers/bluetooth/btrtl.c | 5 +-
drivers/bluetooth/btusb.c | 418 ++-------------
drivers/bluetooth/hci_qca.c | 2 +-
drivers/bluetooth/hci_vhci.c | 10 +
drivers/bus/imx-weim.c | 6 -
drivers/bus/mhi/ep/main.c | 9 +-
drivers/bus/sunxi-rsb.c | 3 +
drivers/char/hw_random/jh7110-trng.c | 13 +-
drivers/char/hw_random/virtio-rng.c | 23 +-
drivers/char/tlclk.c | 4 +
drivers/char/tpm/eventlog/tpm1.c | 4 +-
drivers/char/tpm/tpm-dev.c | 2 +-
drivers/char/tpm/tpm_tis_core.c | 35 +-
drivers/char/tpm/tpmrm-dev.c | 2 +-
drivers/clk/at91/pmc.c | 2 +-
drivers/clk/clk-scmi.c | 4 +-
drivers/clk/clk-scpi.c | 2 +-
drivers/clk/qcom/a53-pll.c | 2 +-
drivers/clocksource/timer-sun5i.c | 3 +
drivers/clocksource/timer-tegra186.c | 3 +-
drivers/cpufreq/acpi-cpufreq.c | 4 +-
drivers/cpufreq/amd-pstate.c | 7 +-
drivers/cpufreq/apple-soc-cpufreq.c | 4 +-
drivers/cpufreq/bmips-cpufreq.c | 4 +-
drivers/cpufreq/cppc_cpufreq.c | 3 +-
drivers/cpufreq/cpufreq-dt.c | 3 +-
drivers/cpufreq/cpufreq.c | 2 +
drivers/cpufreq/cpufreq_conservative.c | 12 +-
drivers/cpufreq/e_powersaver.c | 3 +-
drivers/cpufreq/intel_pstate.c | 14 +-
drivers/cpufreq/mediatek-cpufreq-hw.c | 4 +-
drivers/cpufreq/mediatek-cpufreq.c | 4 +-
drivers/cpufreq/omap-cpufreq.c | 3 +-
drivers/cpufreq/pasemi-cpufreq.c | 6 +-
drivers/cpufreq/pcc-cpufreq.c | 8 +-
drivers/cpufreq/powernow-k6.c | 5 +-
drivers/cpufreq/powernow-k7.c | 3 +-
drivers/cpufreq/powernow-k8.c | 6 +-
drivers/cpufreq/powernv-cpufreq.c | 4 +-
drivers/cpufreq/ppc_cbe_cpufreq.c | 3 +-
drivers/cpufreq/qcom-cpufreq-hw.c | 5 +-
drivers/cpufreq/qoriq-cpufreq.c | 4 +-
drivers/cpufreq/scmi-cpufreq.c | 4 +-
drivers/cpufreq/scpi-cpufreq.c | 4 +-
drivers/cpufreq/sh-cpufreq.c | 4 +-
drivers/cpufreq/sparc-us2e-cpufreq.c | 3 +-
drivers/cpufreq/sparc-us3-cpufreq.c | 3 +-
drivers/cpufreq/speedstep-centrino.c | 10 +-
drivers/cpufreq/tegra194-cpufreq.c | 4 +-
drivers/cpufreq/vexpress-spc-cpufreq.c | 5 +-
drivers/crypto/allwinner/Kconfig | 8 -
drivers/crypto/allwinner/sun4i-ss/Makefile | 1 -
drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 36 --
drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 69 ---
drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h | 20 -
drivers/crypto/amcc/crypto4xx_alg.c | 106 ----
drivers/crypto/amcc/crypto4xx_core.c | 130 +----
drivers/crypto/amcc/crypto4xx_core.h | 11 -
drivers/crypto/amcc/crypto4xx_reg_def.h | 11 -
drivers/crypto/amlogic/amlogic-gxl-core.c | 2 +-
drivers/crypto/atmel-ecc.c | 2 +-
drivers/crypto/atmel-sha204a.c | 29 +-
drivers/crypto/caam/caamalg.c | 12 +-
drivers/crypto/caam/caamalg_qi.c | 12 +-
drivers/crypto/caam/caamalg_qi2.c | 12 +-
drivers/crypto/caam/caamhash.c | 4 +-
drivers/crypto/caam/key_gen.c | 4 +-
drivers/crypto/cavium/cpt/cptvf_reqmanager.c | 4 +-
drivers/crypto/ccp/sev-dev.c | 3 +-
drivers/crypto/hisilicon/Kconfig | 1 -
drivers/crypto/hisilicon/qm.c | 4 +-
drivers/crypto/hisilicon/trng/trng.c | 298 +----------
.../intel/qat/qat_common/adf_accel_devices.h | 2 +
drivers/crypto/intel/qat/qat_common/adf_aer.c | 7 +-
.../crypto/intel/qat/qat_common/adf_common_drv.h | 2 +
drivers/crypto/intel/qat/qat_common/adf_isr.c | 39 ++
drivers/crypto/intel/qat/qat_common/adf_sriov.c | 20 +-
.../crypto/intel/qat/qat_common/qat_asym_algs.c | 10 +-
drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c | 4 +-
drivers/crypto/talitos.c | 576 +++++++++++----------
drivers/crypto/talitos.h | 12 +
drivers/dax/kmem.c | 6 +
drivers/dma-buf/udmabuf.c | 5 +-
drivers/dma/dmaengine.c | 3 +-
drivers/dma/dw-edma/dw-edma-core.h | 2 +-
drivers/dma/dw-edma/dw-edma-v0-core.c | 6 +
drivers/dma/imx-sdma.c | 4 +-
drivers/dma/qcom/gpi.c | 1 +
drivers/dma/tegra186-gpc-dma.c | 7 +
drivers/edac/i10nm_base.c | 14 +-
drivers/edac/skx_common.c | 3 +
drivers/firewire/net.c | 5 +-
drivers/firmware/arm_scmi/power.c | 6 +-
drivers/firmware/arm_scmi/sensors.c | 2 +-
drivers/fpga/dfl.c | 2 +
drivers/fpga/microchip-spi.c | 3 +
drivers/gpio/gpio-eic-sprd.c | 8 +-
drivers/gpio/gpio-f7188x.c | 6 +-
drivers/gpio/gpio-htc-egpio.c | 6 +-
drivers/gpio/gpio-mlxbf3.c | 3 +-
drivers/gpio/gpio-mvebu.c | 5 +-
drivers/gpio/gpio-palmas.c | 19 +
drivers/gpio/gpio-sch.c | 32 +-
drivers/gpio/gpio-timberdale.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 16 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 25 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 -
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 3 +
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 3 +-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_events.c | 5 +
drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 1 +
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 +-
.../amd/display/modules/info_packet/info_packet.c | 2 +
drivers/gpu/drm/drm_edid.c | 8 +
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 78 +--
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 11 +
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 22 -
drivers/gpu/drm/i915/gt/intel_region_lmem.c | 2 +-
drivers/gpu/drm/msm/dp/dp_display.c | 4 +-
drivers/gpu/drm/msm/dp/dp_reg.h | 4 +-
.../gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c | 3 +-
drivers/gpu/drm/radeon/radeon_gem.c | 13 +-
drivers/gpu/drm/radeon/radeon_ring.c | 4 +-
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +-
drivers/gpu/drm/tegra/dc.c | 4 +-
drivers/gpu/drm/tegra/gem.c | 22 +-
drivers/gpu/drm/tegra/gr2d.c | 19 +-
drivers/gpu/drm/tegra/gr3d.c | 19 +-
drivers/gpu/drm/tegra/submit.c | 3 +-
drivers/gpu/drm/tidss/tidss_kms.c | 2 -
drivers/gpu/host1x/bus.c | 62 ++-
drivers/gpu/host1x/job.c | 10 +-
drivers/hid/hid-appleir.c | 45 +-
drivers/hid/hid-core.c | 7 +
drivers/hid/hid-letsketch.c | 36 +-
drivers/hid/hid-lg-g15.c | 16 +
drivers/hid/hid-logitech-hidpp.c | 1 -
drivers/hid/hid-multitouch.c | 32 +-
drivers/hid/hid-picolcd_core.c | 3 +-
drivers/hid/hid-playstation.c | 12 +
drivers/hid/hid-sensor-hub.c | 77 ++-
drivers/hid/hid-wiimote-modules.c | 58 +--
drivers/hid/wacom_sys.c | 12 +-
drivers/hwmon/Kconfig | 1 +
drivers/hwmon/asus_atk0110.c | 3 +
drivers/hwmon/it87.c | 3 +
drivers/hwmon/occ/common.c | 34 +-
drivers/hwmon/occ/common.h | 1 +
drivers/hwmon/pmbus/adm1275.c | 2 +-
drivers/hwmon/pmbus/pmbus_core.c | 13 +-
drivers/hwmon/w83627hf.c | 4 +
drivers/hwmon/w83793.c | 1 +
drivers/hwspinlock/qcom_hwspinlock.c | 5 +-
.../hwtracing/coresight/coresight-cti-platform.c | 1 +
drivers/hwtracing/coresight/coresight-etb10.c | 6 +-
drivers/hwtracing/coresight/coresight-etm4x-core.c | 4 +-
drivers/hwtracing/coresight/ultrasoc-smb.c | 1 +
drivers/i2c/busses/i2c-mlxbf.c | 4 +-
drivers/i2c/busses/i2c-mpc.c | 2 +-
drivers/i2c/busses/i2c-mt65xx.c | 2 +-
drivers/i2c/busses/i2c-stm32f7.c | 9 +-
drivers/i2c/i2c-core-base.c | 85 +--
drivers/i2c/i2c-core-of.c | 5 -
drivers/i3c/master.c | 19 +-
drivers/iio/accel/bmc150-accel-core.c | 2 +
drivers/iio/accel/kxsd9.c | 5 +-
drivers/iio/accel/mma8452.c | 2 +
drivers/iio/adc/lpc32xx_adc.c | 4 +-
drivers/iio/adc/spear_adc.c | 3 +-
drivers/iio/adc/ti-ads124s08.c | 3 +-
drivers/iio/adc/xilinx-ams.c | 5 +
drivers/iio/chemical/scd30_core.c | 19 +-
.../iio/common/inv_sensors/inv_sensors_timestamp.c | 26 +-
drivers/iio/common/st_sensors/st_sensors_core.c | 23 +-
drivers/iio/gyro/bmg160_core.c | 16 +-
drivers/iio/imu/adis_trigger.c | 2 +-
drivers/iio/imu/bmi160/bmi160_core.c | 3 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 4 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 44 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 3 +
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 1 +
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 4 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 2 +-
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 21 +-
drivers/iio/industrialio-event.c | 5 +-
drivers/iio/light/al3010.c | 2 +-
drivers/iio/light/gp2ap002.c | 2 +-
drivers/iio/light/opt3001.c | 6 +-
drivers/iio/light/si1133.c | 14 +-
drivers/iio/light/tcs3472.c | 38 +-
drivers/iio/light/tsl2591.c | 6 +-
drivers/iio/light/veml6030.c | 8 +-
drivers/iio/magnetometer/ak8975.c | 15 +
drivers/iio/orientation/hid-sensor-rotation.c | 40 +-
drivers/iio/pressure/mpl115.c | 8 +-
drivers/iio/temperature/ltc2983.c | 5 +-
drivers/infiniband/core/cm.c | 13 +-
drivers/infiniband/core/counters.c | 2 +-
drivers/infiniband/hw/hns/hns_roce_hem.c | 8 +-
drivers/infiniband/hw/hns/hns_roce_main.c | 2 +-
drivers/infiniband/hw/irdma/verbs.c | 19 +-
drivers/infiniband/hw/irdma/verbs.h | 1 -
drivers/infiniband/hw/mlx4/mlx4_ib.h | 1 +
drivers/infiniband/hw/mlx4/mr.c | 9 +-
drivers/infiniband/hw/mlx4/sysfs.c | 45 +-
drivers/infiniband/hw/mlx5/devx.c | 30 +-
drivers/infiniband/hw/mlx5/main.c | 17 +-
drivers/infiniband/hw/mlx5/mr.c | 17 +-
drivers/infiniband/hw/mlx5/qp.c | 12 +-
drivers/infiniband/sw/rxe/rxe_mmap.c | 19 +-
drivers/infiniband/sw/rxe/rxe_resp.c | 33 +-
drivers/infiniband/sw/siw/siw_qp_rx.c | 9 +
drivers/infiniband/ulp/rtrs/rtrs-srv.c | 5 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 5 +-
drivers/input/joystick/iforce/iforce-packets.c | 18 +-
drivers/input/joystick/maplecontrol.c | 3 +-
drivers/input/keyboard/maple_keyb.c | 4 +-
drivers/input/misc/ims-pcu.c | 117 ++++-
drivers/input/mouse/elan_i2c_core.c | 36 +-
drivers/input/mouse/maplemouse.c | 9 +-
drivers/input/rmi4/rmi_bus.c | 4 +-
drivers/input/rmi4/rmi_f30.c | 2 +-
drivers/input/rmi4/rmi_f3a.c | 2 +-
drivers/input/touchscreen/goodix.c | 3 +-
drivers/input/touchscreen/mms114.c | 26 +-
drivers/input/touchscreen/touchwin.c | 15 +-
drivers/iommu/amd/amd_iommu_types.h | 11 +-
drivers/irqchip/irq-crossbar.c | 10 +-
drivers/irqchip/irq-gic-v3-its.c | 6 +-
drivers/irqchip/irq-ts4800.c | 10 +
drivers/leds/uleds.c | 3 +-
drivers/mailbox/mtk-adsp-mailbox.c | 9 +-
drivers/md/dm-bufio.c | 4 +-
drivers/md/dm-era-target.c | 10 +-
drivers/md/dm-integrity.c | 3 -
drivers/md/dm-ioctl.c | 9 +-
drivers/md/dm-log.c | 3 +
drivers/md/dm-stats.c | 10 +-
drivers/md/dm-thin-metadata.c | 67 +--
drivers/md/dm-verity-loadpin.c | 2 +-
drivers/md/dm-verity-target.c | 2 +-
drivers/md/raid1.c | 6 +
drivers/md/raid10.c | 1 +
.../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 3 +-
.../media/platform/nxp/imx8-isi/imx8-isi-core.c | 24 +-
drivers/media/platform/qcom/venus/helpers.c | 4 +-
.../media/platform/qcom/venus/hfi_platform_v4.c | 20 +-
.../media/platform/qcom/venus/hfi_platform_v6.c | 16 +-
drivers/media/platform/rockchip/rga/rga-hw.c | 2 +-
drivers/media/platform/rockchip/rga/rga-hw.h | 2 +-
drivers/media/usb/uvc/uvc_video.c | 122 +++--
drivers/media/v4l2-core/v4l2-common.c | 1 +
drivers/memstick/core/ms_block.c | 4 +
drivers/mfd/cros_ec_dev.c | 3 +-
drivers/mfd/cs42l43.c | 2 +-
drivers/mfd/sm501.c | 4 +-
drivers/mfd/tps6586x.c | 2 +-
drivers/mmc/host/vub300.c | 26 +-
drivers/mtd/devices/mchp23k256.c | 2 +-
drivers/mtd/devices/slram.c | 22 +-
drivers/mtd/maps/vmu-flash.c | 1 +
drivers/mtd/nand/onenand/onenand_samsung.c | 7 +-
drivers/mtd/nand/raw/fsl_ifc_nand.c | 9 +-
drivers/mtd/nand/raw/lpc32xx_mlc.c | 12 +-
drivers/mtd/nand/raw/lpc32xx_slc.c | 12 +-
drivers/mtd/nand/raw/nand_base.c | 2 +-
drivers/mtd/nand/raw/pl35x-nand-controller.c | 2 +-
drivers/mtd/spi-nor/Kconfig | 1 -
drivers/mtd/spi-nor/swp.c | 11 +-
drivers/net/amt.c | 6 +-
drivers/net/bonding/bond_3ad.c | 1 +
drivers/net/bonding/bond_main.c | 133 ++---
drivers/net/bonding/bond_netlink.c | 16 +-
drivers/net/can/usb/esd_usb.c | 5 +-
drivers/net/dsa/sja1105/sja1105_ptp.c | 2 +-
drivers/net/ethernet/amazon/ena/ena_netdev.c | 23 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 23 +-
.../ethernet/cavium/liquidio/cn23xx_pf_device.c | 18 +-
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 8 -
.../net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +-
drivers/net/ethernet/freescale/enetc/enetc.c | 7 +
drivers/net/ethernet/freescale/fman/fman.c | 4 +-
drivers/net/ethernet/freescale/gianfar.c | 16 +-
drivers/net/ethernet/intel/i40e/i40e_debug.h | 2 +-
drivers/net/ethernet/intel/ice/ice_common.c | 1 -
drivers/net/ethernet/intel/ice/ice_ethtool.c | 12 +-
drivers/net/ethernet/intel/ice/ice_main.c | 16 +-
drivers/net/ethernet/intel/ice/ice_vf_lib.c | 2 +-
drivers/net/ethernet/marvell/mvneta.c | 3 +
drivers/net/ethernet/marvell/octeontx2/af/mcs.c | 6 +-
.../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 3 +-
.../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 4 +-
.../ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 10 +-
.../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 44 +-
.../net/ethernet/marvell/prestera/prestera_main.c | 2 +-
drivers/net/ethernet/mediatek/mtk_ppe.c | 4 +-
.../ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c | 29 +-
.../ethernet/mellanox/mlx5/core/en_accel/macsec.c | 47 +-
.../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c | 8 +-
.../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h | 6 +-
.../net/ethernet/mellanox/mlx5/core/lib/port_tun.c | 3 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 12 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 1 +
drivers/net/ethernet/microchip/lan743x_main.c | 2 +-
.../ethernet/microchip/lan966x/lan966x_vcap_impl.c | 5 +-
.../ethernet/microchip/sparx5/sparx5_switchdev.c | 4 +-
.../ethernet/microchip/sparx5/sparx5_vcap_impl.c | 5 +-
drivers/net/ethernet/microchip/vcap/vcap_api.c | 72 +--
drivers/net/ethernet/microchip/vcap/vcap_api.h | 3 +-
.../net/ethernet/microchip/vcap/vcap_api_debugfs.c | 8 +-
.../microchip/vcap/vcap_api_debugfs_kunit.c | 3 +-
.../net/ethernet/microchip/vcap/vcap_api_kunit.c | 3 +-
.../net/ethernet/microchip/vcap/vcap_api_private.h | 3 +
drivers/net/ethernet/microsoft/mana/gdma_main.c | 2 +
drivers/net/ethernet/microsoft/mana/mana_en.c | 3 +-
.../net/ethernet/pensando/ionic/ionic_ethtool.c | 11 +-
drivers/net/ethernet/qlogic/qede/qede_fp.c | 9 +-
.../net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 5 +-
drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 1 +
.../net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 78 +--
drivers/net/ethernet/sun/sungem.c | 13 +-
drivers/net/ethernet/sunplus/spl2sw_phy.c | 6 +-
drivers/net/ieee802154/ca8210.c | 9 +-
drivers/net/macsec.c | 9 +-
drivers/net/phy/sfp.c | 1 +
drivers/net/team/Makefile | 1 +
drivers/net/team/{team.c => team_core.c} | 68 ++-
drivers/net/thunderbolt/main.c | 8 +-
drivers/net/usb/gl620a.c | 6 +-
drivers/net/usb/kalmia.c | 8 +
drivers/net/usb/lan78xx.c | 318 ++++++------
drivers/net/usb/net1080.c | 2 +-
drivers/net/veth.c | 2 +
drivers/net/virtio_net.c | 55 +-
drivers/net/vxlan/vxlan_core.c | 8 +-
drivers/net/wan/ixp4xx_hss.c | 4 +-
drivers/net/wireless/ath/ath9k/xmit.c | 5 +
drivers/net/wireless/ath/wcn36xx/smd.c | 13 +
drivers/net/wireless/cisco/airo.c | 4 +-
drivers/net/wireless/intersil/hostap/hostap_main.c | 1 +
drivers/net/wireless/marvell/mwifiex/join.c | 1 -
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 10 +-
drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 5 +-
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 12 +-
drivers/net/wireless/realtek/rtw88/pci.c | 5 +
drivers/net/wireless/realtek/rtw89/fw.c | 2 +-
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 40 +-
drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 3 +
drivers/net/wwan/t7xx/t7xx_port_wwan.c | 2 +
drivers/ntb/hw/epf/ntb_hw_epf.c | 89 ++--
drivers/nvdimm/btt.c | 14 +-
drivers/nvdimm/nd.h | 11 +-
drivers/nvdimm/region_devs.c | 66 +--
drivers/nvme/host/core.c | 2 +-
drivers/nvme/host/multipath.c | 6 +
drivers/nvme/target/auth.c | 20 +-
drivers/nvme/target/fabrics-cmd-auth.c | 60 ++-
drivers/nvme/target/fabrics-cmd.c | 15 +-
drivers/nvme/target/nvmet.h | 8 +-
drivers/nvme/target/rdma.c | 18 +-
drivers/nvme/target/tcp.c | 5 +-
drivers/of/cpu.c | 2 +-
drivers/of/dynamic.c | 1 -
drivers/of/platform.c | 5 -
drivers/opp/of.c | 3 +-
drivers/pci/Makefile | 2 +-
drivers/pci/controller/dwc/pci-imx6.c | 4 +-
drivers/pci/controller/dwc/pci-meson.c | 4 +-
drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
.../pci/controller/mobiveil/pcie-mobiveil-host.c | 8 +-
drivers/pci/controller/pci-host-common.c | 4 +
drivers/pci/controller/pci-loongson.c | 31 +-
drivers/pci/controller/pcie-altera-msi.c | 2 +-
drivers/pci/controller/pcie-altera.c | 32 +-
drivers/pci/controller/pcie-iproc-bcma.c | 2 +-
drivers/pci/controller/pcie-iproc-platform.c | 2 +-
drivers/pci/controller/pcie-iproc.c | 1 -
drivers/pci/controller/pcie-iproc.h | 2 -
drivers/pci/controller/pcie-mediatek-gen3.c | 4 +-
drivers/pci/controller/pcie-mediatek.c | 132 +++--
drivers/pci/controller/pcie-rcar-host.c | 1 -
drivers/pci/controller/pcie-xilinx-nwl.c | 2 +-
drivers/pci/endpoint/functions/pci-epf-ntb.c | 21 +-
drivers/pci/endpoint/functions/pci-epf-vntb.c | 9 +-
drivers/pci/msi/msi.c | 4 +-
drivers/pci/pci-sysfs.c | 14 +-
drivers/pci/pci.c | 139 -----
drivers/pci/pci.h | 4 +
drivers/pci/quirks.c | 51 +-
drivers/pci/rebar.c | 218 ++++++++
drivers/pci/rom.c | 149 +++++-
drivers/pci/setup-bus.c | 104 ++--
drivers/pci/setup-res.c | 53 --
drivers/phy/phy-can-transceiver.c | 3 +
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 2 +-
drivers/pinctrl/mediatek/pinctrl-mt8167.c | 2 +-
drivers/pinctrl/mediatek/pinctrl-mt8516.c | 2 +-
drivers/pinctrl/meson/pinctrl-meson.c | 2 +-
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
drivers/platform/x86/amd/pmc/pmc-quirks.c | 39 ++
drivers/platform/x86/amd/pmc/pmc.c | 60 ++-
drivers/platform/x86/amd/pmc/pmc.h | 1 +
drivers/platform/x86/xo15-ebook.c | 7 +-
drivers/pmdomain/imx/imx8m-blk-ctrl.c | 46 +-
drivers/power/supply/charger-manager.c | 6 +-
drivers/power/supply/cpcap-battery.c | 11 +-
drivers/power/supply/power_supply_core.c | 11 +-
drivers/pwm/pwm-imx27.c | 8 +-
drivers/rapidio/devices/tsi721.c | 3 +-
drivers/regulator/core.c | 4 +-
drivers/regulator/ltc3676.c | 10 +-
drivers/regulator/scmi-regulator.c | 6 +-
drivers/remoteproc/qcom_common.c | 14 +-
drivers/reset/reset-imx7.c | 6 +
drivers/reset/reset-sunxi.c | 4 +-
drivers/rpmsg/qcom_glink_native.c | 2 -
drivers/rpmsg/rpmsg_core.c | 43 +-
drivers/rpmsg/virtio_rpmsg_bus.c | 1 -
drivers/rtc/rtc-abx80x.c | 3 +-
drivers/rtc/rtc-cmos.c | 6 +
drivers/rtc/rtc-ds1307.c | 30 +-
drivers/rtc/rtc-mpfs.c | 2 +-
drivers/rtc/rtc-msc313.c | 4 +-
drivers/s390/char/monwriter.c | 3 +
drivers/s390/crypto/zcrypt_cex2a.c | 0
drivers/s390/crypto/zcrypt_cex2a.h | 0
drivers/s390/crypto/zcrypt_cex2c.c | 0
drivers/s390/crypto/zcrypt_cex2c.h | 0
drivers/scsi/elx/efct/efct_hw.c | 2 +
drivers/scsi/elx/efct/efct_unsol.c | 1 +
drivers/scsi/hpsa.c | 4 +
drivers/scsi/lpfc/lpfc_init.c | 3 +-
drivers/scsi/pm8001/pm8001_ctl.c | 5 +-
drivers/scsi/scsi_scan.c | 2 +-
drivers/scsi/scsi_transport_sas.c | 101 ++--
drivers/scsi/sg.c | 7 +-
drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
drivers/slimbus/qcom-ctrl.c | 5 +-
drivers/slimbus/qcom-ngd-ctrl.c | 62 +--
drivers/soc/fsl/qe/qe.c | 3 +
drivers/soc/ti/k3-ringacc.c | 4 +-
drivers/spi/spi-dw.h | 1 +
drivers/spi/spi-ep93xx.c | 1 +
drivers/spi/spi-fsl-lpspi.c | 18 +-
drivers/spi/spi-hisi-kunpeng.c | 6 +-
drivers/spi/spi-meson-spifc.c | 1 +
drivers/spi/spi-rpc-if.c | 6 +-
drivers/spi/spi-sh-msiof.c | 10 +-
drivers/spi/spi-uniphier.c | 4 +-
drivers/spi/spi-xilinx.c | 11 +-
drivers/spi/spi.c | 5 -
drivers/staging/media/atomisp/pci/atomisp_cmd.c | 6 +-
drivers/staging/media/atomisp/pci/sh_css.c | 6 +-
drivers/staging/media/ipu3/ipu3-css-params.c | 8 +-
drivers/staging/media/sunxi/cedrus/cedrus.c | 4 +-
drivers/staging/most/video/video.c | 7 +-
drivers/staging/nvec/nvec.c | 4 +-
drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 93 ++--
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 20 +-
drivers/staging/rtl8723bs/core/rtw_security.c | 2 +-
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 23 +-
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 8 +
drivers/staging/vme_user/vme_fake.c | 8 +
drivers/staging/vme_user/vme_tsi148.c | 8 +
drivers/staging/vme_user/vme_user.c | 22 +
drivers/target/iscsi/iscsi_target_auth.c | 6 +-
drivers/target/loopback/tcm_loop.c | 64 ---
drivers/target/target_core_fabric_lib.c | 89 +++-
drivers/target/target_core_internal.h | 3 +-
drivers/target/target_core_pr.c | 12 +-
drivers/thermal/intel/therm_throt.c | 7 +-
drivers/thermal/thermal_hwmon.c | 5 +-
drivers/tty/serial/8250/8250_mid.c | 31 +-
drivers/tty/serial/8250/8250_omap.c | 3 +-
drivers/tty/serial/msm_serial.c | 3 +-
drivers/ufs/core/ufshcd.c | 2 +-
drivers/usb/atm/ueagle-atm.c | 36 +-
drivers/usb/cdns3/cdnsp-mem.c | 2 +
drivers/usb/class/cdc-acm.c | 3 +
drivers/usb/common/ulpi.c | 23 +-
drivers/usb/core/quirks.c | 6 +
drivers/usb/dwc3/dwc3-meson-g12a.c | 14 +-
drivers/usb/dwc3/gadget.c | 43 +-
drivers/usb/fotg210/fotg210-hcd.c | 6 +-
drivers/usb/gadget/composite.c | 5 +-
drivers/usb/gadget/function/f_fs.c | 5 +-
drivers/usb/gadget/function/f_printer.c | 3 +-
drivers/usb/gadget/function/rndis.c | 20 +-
drivers/usb/gadget/udc/core.c | 29 +-
drivers/usb/host/ehci-sched.c | 11 +-
drivers/usb/host/max3421-hcd.c | 8 +
drivers/usb/host/sl811-hcd.c | 1 +
drivers/usb/host/xhci.c | 11 +-
drivers/usb/misc/chaoskey.c | 1 -
drivers/usb/misc/idmouse.c | 45 +-
drivers/usb/misc/iowarrior.c | 21 +-
drivers/usb/misc/ldusb.c | 38 +-
drivers/usb/misc/legousbtower.c | 37 +-
drivers/usb/misc/uss720.c | 5 +-
drivers/usb/mtu3/mtu3_gadget.c | 1 +
drivers/usb/serial/digi_acceleport.c | 43 +-
drivers/usb/serial/keyspan_pda.c | 2 +-
drivers/usb/serial/option.c | 16 +
drivers/usb/storage/ene_ub6250.c | 3 +-
drivers/usb/storage/usb.c | 2 +-
drivers/usb/typec/anx7411.c | 4 +-
drivers/usb/typec/class.c | 1 +
drivers/usb/typec/tcpm/tcpci_rt1711h.c | 13 +-
drivers/usb/typec/tcpm/tcpm.c | 7 +-
drivers/usb/typec/ucsi/displayport.c | 7 +-
drivers/usb/typec/ucsi/ucsi.c | 20 +
drivers/usb/typec/ucsi/ucsi.h | 1 +
drivers/usb/typec/ucsi/ucsi_acpi.c | 10 +-
drivers/usb/typec/ucsi/ucsi_ccg.c | 2 +-
drivers/usb/usbip/vudc.h | 1 -
drivers/usb/usbip/vudc_dev.c | 4 +-
drivers/vdpa/vdpa_user/vduse_dev.c | 72 ++-
drivers/vfio/pci/mlx5/cmd.h | 13 +-
drivers/vfio/pci/vfio_pci_core.c | 37 +-
drivers/vfio/vfio_main.c | 3 +-
drivers/vhost/net.c | 15 +-
drivers/vhost/vdpa.c | 29 +-
drivers/video/fbdev/aty/radeon_base.c | 1 +
drivers/video/fbdev/broadsheetfb.c | 8 +-
drivers/video/fbdev/carminefb.c | 1 +
drivers/video/fbdev/core/fbcon.c | 14 +-
drivers/video/fbdev/hecubafb.c | 6 +-
drivers/video/fbdev/i740fb.c | 1 +
drivers/video/fbdev/metronomefb.c | 8 +-
drivers/video/fbdev/nvidia/nvidia.c | 1 +
drivers/video/fbdev/s3fb.c | 1 +
drivers/video/fbdev/sm501fb.c | 16 +-
drivers/video/fbdev/sm712.h | 2 +-
drivers/video/fbdev/tdfxfb.c | 1 +
drivers/video/fbdev/tridentfb.c | 1 +
drivers/video/fbdev/uvesafb.c | 4 +-
drivers/video/fbdev/vesafb.c | 1 +
drivers/virtio/virtio_mmio.c | 26 +-
drivers/watchdog/apple_wdt.c | 1 +
drivers/watchdog/sama5d4_wdt.c | 48 +-
drivers/watchdog/sp5100_tco.c | 3 +-
drivers/watchdog/sprd_wdt.c | 5 +-
drivers/watchdog/watchdog_core.c | 3 +
drivers/xen/gntdev.c | 8 +-
drivers/xen/xen-scsiback.c | 30 +-
fs/9p/vfs_inode.c | 9 +
fs/afs/cell.c | 2 +
fs/afs/cmservice.c | 2 -
fs/afs/fs_operation.c | 2 +-
fs/afs/rxrpc.c | 11 +-
fs/afs/super.c | 3 +-
fs/afs/vl_list.c | 10 +-
fs/afs/volume.c | 2 +-
fs/btrfs/btrfs_inode.h | 2 +
fs/btrfs/extent-tree.c | 17 +-
fs/btrfs/file.c | 12 +-
fs/btrfs/inode.c | 138 +++--
fs/btrfs/ordered-data.c | 12 +
fs/btrfs/ordered-data.h | 2 +
fs/btrfs/reflink.c | 5 +-
fs/btrfs/super.c | 3 +-
fs/configfs/dir.c | 57 +-
fs/dlm/midcomms.c | 4 +-
fs/efs/file.c | 21 +-
fs/exfat/dir.c | 61 ++-
fs/exfat/exfat_fs.h | 7 +-
fs/exfat/inode.c | 2 +-
fs/exfat/namei.c | 331 ++++++------
fs/ext2/file.c | 9 +-
fs/ext4/extents.c | 5 +-
fs/ext4/inode.c | 3 +-
fs/ext4/ioctl.c | 12 +-
fs/ext4/move_extent.c | 34 +-
fs/f2fs/checkpoint.c | 14 +-
fs/f2fs/data.c | 29 ++
fs/f2fs/f2fs.h | 1 +
fs/f2fs/gc.c | 50 +-
fs/f2fs/inode.c | 30 +-
fs/f2fs/segment.c | 8 +
fs/f2fs/xattr.c | 6 +-
fs/fs-writeback.c | 133 +++--
fs/fuse/cuse.c | 4 +-
fs/fuse/dev.c | 2 +-
fs/hfs/bfind.c | 2 +-
fs/hfs/bnode.c | 56 +-
fs/hfs/brec.c | 2 +-
fs/hfs/btree.c | 2 +-
fs/hfs/btree.h | 71 +--
fs/hfs/hfs_fs.h | 88 ++--
fs/hfs/inode.c | 3 +-
fs/hfsplus/bfind.c | 2 +-
fs/hfsplus/bnode.c | 62 +--
fs/hfsplus/brec.c | 2 +-
fs/hfsplus/btree.c | 2 +-
fs/hfsplus/hfsplus_fs.h | 40 +-
fs/isofs/rock.c | 11 +
fs/jbd2/journal.c | 2 +
fs/lockd/svcsubs.c | 4 +-
fs/minix/minix.h | 2 +-
fs/namei.c | 4 +
fs/nfs/callback_proc.c | 9 +-
fs/nfs/dir.c | 2 +
fs/nfs/filelayout/filelayout.c | 2 +
fs/nfs/flexfilelayout/flexfilelayout.c | 33 ++
fs/nfs/flexfilelayout/flexfilelayout.h | 16 +
fs/nfs/pnfs.c | 4 +-
fs/nfs/read.c | 25 +-
fs/nfsd/nfs4layouts.c | 4 +-
fs/nfsd/nfs4recover.c | 120 ++---
fs/nfsd/nfs4state.c | 22 +-
fs/nfsd/vfs.c | 42 +-
fs/nilfs2/segment.c | 22 +
fs/nilfs2/super.c | 2 -
fs/ntfs3/attrib.c | 14 +
fs/ntfs3/dir.c | 2 +-
fs/ntfs3/file.c | 48 +-
fs/ntfs3/frecord.c | 51 ++
fs/ntfs3/fslog.c | 131 ++++-
fs/ntfs3/index.c | 45 +-
fs/ntfs3/inode.c | 8 +
fs/ntfs3/lznt.c | 2 +-
fs/ntfs3/namei.c | 2 +-
fs/ntfs3/ntfs_fs.h | 5 +-
fs/ntfs3/run.c | 9 +-
fs/ocfs2/alloc.c | 2 +-
fs/ocfs2/aops.c | 13 +-
fs/ocfs2/buffer_head_io.c | 7 +-
fs/ocfs2/dlm/dlmdebug.c | 16 +-
fs/ocfs2/dlmglue.c | 17 +
fs/ocfs2/inode.c | 150 +++++-
fs/ocfs2/journal.c | 13 +-
fs/ocfs2/journal.h | 3 +
fs/ocfs2/move_extents.c | 4 +-
fs/ocfs2/ocfs2.h | 2 -
fs/ocfs2/quota_local.c | 2 +-
fs/ocfs2/stack_user.c | 10 +-
fs/ocfs2/super.c | 2 -
fs/ocfs2/sysfile.c | 9 +-
fs/orangefs/dir.c | 7 +-
fs/proc/array.c | 15 +-
fs/proc/base.c | 184 +++----
fs/proc/fd.c | 31 +-
fs/proc/generic.c | 9 +-
fs/proc/internal.h | 6 +-
fs/proc/namespaces.c | 16 +-
fs/proc/proc_net.c | 2 +-
fs/smb/client/cifs_swn.c | 329 +++++++++---
fs/smb/client/cifsacl.c | 2 +-
fs/smb/client/cifsglob.h | 19 +-
fs/smb/client/connect.c | 3 +
fs/smb/client/inode.c | 30 +-
fs/smb/client/ioctl.c | 12 +-
fs/smb/client/misc.c | 8 +
fs/smb/client/smb2misc.c | 52 +-
fs/smb/client/smb2ops.c | 56 +-
fs/smb/client/smb2pdu.c | 22 +-
fs/smb/client/trace.h | 2 +
fs/smb/common/cifsglob.h | 30 ++
fs/smb/server/connection.c | 101 +++-
fs/smb/server/connection.h | 6 +
fs/smb/server/oplock.c | 13 +-
fs/smb/server/server.c | 12 +
fs/smb/server/smb2pdu.c | 146 ++++--
fs/smb/server/smb_common.h | 14 +-
fs/smb/server/smbacl.c | 7 +-
fs/smb/server/vfs.c | 29 +-
fs/smb/server/vfs_cache.c | 119 ++++-
fs/smb/server/vfs_cache.h | 3 +
fs/sysfs/file.c | 4 +
fs/udf/balloc.c | 5 +-
fs/udf/super.c | 11 +-
fs/userfaultfd.c | 14 +-
fs/xfs/libxfs/xfs_defer.c | 22 +-
fs/xfs/libxfs/xfs_defer.h | 14 +
fs/xfs/libxfs/xfs_log_recover.h | 4 +-
fs/xfs/xfs_attr_item.c | 115 ++--
fs/xfs/xfs_bmap_item.c | 92 ++--
fs/xfs/xfs_dquot.c | 16 +-
fs/xfs/xfs_extfree_item.c | 117 ++---
fs/xfs/xfs_log_recover.c | 52 +-
fs/xfs/xfs_refcount_item.c | 127 ++---
fs/xfs/xfs_reflink.c | 36 ++
fs/xfs/xfs_rmap_item.c | 151 +++---
fs/xfs/xfs_trans.h | 4 -
include/acpi/acpi_bus.h | 2 +
include/asm-generic/bitops/lock.h | 22 +-
include/crypto/drbg.h | 18 +-
include/dt-bindings/power/fsl,imx93-power.h | 1 +
include/linux/audit.h | 8 +
include/linux/backing-dev-defs.h | 4 +
include/linux/bitops.h | 2 +
include/linux/bpf.h | 3 +
include/linux/bpf_local_storage.h | 3 -
include/linux/cpufreq.h | 2 +-
include/linux/damon.h | 8 +-
include/linux/device.h | 5 +-
include/linux/etherdevice.h | 3 +-
include/linux/f2fs_fs.h | 1 +
include/linux/filter.h | 15 +-
include/linux/fs.h | 5 +
include/linux/fwnode.h | 2 +
include/linux/glob.h | 1 +
include/linux/hid-sensor-hub.h | 25 +
include/linux/hid.h | 29 ++
include/linux/host1x.h | 7 +
include/linux/if_ether.h | 3 +-
include/linux/iio/common/inv_sensors_timestamp.h | 3 +-
include/linux/inetdevice.h | 5 +
include/linux/jiffies.h | 13 +
include/linux/netdev_features.h | 25 +
include/linux/netdevice.h | 7 +-
include/linux/nfs_page.h | 1 +
include/linux/pci.h | 4 +-
include/linux/rpmsg.h | 4 -
include/linux/seqlock.h | 110 ++++
include/linux/sunrpc/clnt.h | 1 +
include/linux/sunrpc/xprt.h | 2 +
include/linux/vfio_pci_core.h | 15 +-
include/linux/vmalloc.h | 4 +-
include/linux/writeback.h | 2 +
include/net/addrconf.h | 10 +-
include/net/bluetooth/hci.h | 21 +-
include/net/bluetooth/hci_core.h | 39 +-
include/net/bluetooth/l2cap.h | 11 +-
include/net/bonding.h | 1 +
include/net/fib_rules.h | 5 +
include/net/gue.h | 2 +-
include/net/ip_fib.h | 7 +-
include/net/ip_vs.h | 3 +-
include/net/netfilter/nf_conntrack_extend.h | 12 -
include/net/netfilter/nf_queue.h | 1 +
include/net/rtnetlink.h | 2 +
include/net/sctp/sctp.h | 3 +-
include/net/sock.h | 2 +-
include/net/tc_act/tc_pedit.h | 18 +-
include/net/xfrm.h | 15 +-
include/uapi/linux/bpf.h | 1 +
io_uring/io-wq.c | 2 +-
kernel/audit.c | 85 ++-
kernel/bpf/bpf_lsm.c | 34 +-
kernel/bpf/cgroup.c | 110 ++--
kernel/bpf/core.c | 70 ++-
kernel/bpf/devmap.c | 19 +
kernel/bpf/dispatcher.c | 2 +-
kernel/bpf/hashtab.c | 21 +-
kernel/bpf/helpers.c | 12 +-
kernel/bpf/inode.c | 13 +-
kernel/bpf/lpm_trie.c | 10 +-
kernel/bpf/syscall.c | 5 +-
kernel/bpf/verifier.c | 3 +-
kernel/cgroup/cpuset.c | 7 +-
kernel/cpu.c | 20 +-
kernel/events/core.c | 19 +-
kernel/fork.c | 9 +-
kernel/module/decompress.c | 2 +
kernel/sched/core.c | 1 +
kernel/sched/fair.c | 25 +-
kernel/sched/features.h | 8 +
kernel/time/posix-cpu-timers.c | 3 +-
kernel/time/time.c | 2 +-
kernel/trace/bpf_trace.c | 11 +-
kernel/trace/ring_buffer.c | 3 +-
kernel/trace/trace_eprobe.c | 2 +-
kernel/trace/trace_events_filter.c | 6 +-
kernel/trace/trace_events_hist.c | 41 +-
kernel/trace/trace_osnoise.c | 4 +-
kernel/trace/trace_probe.c | 3 +-
kernel/trace/trace_probe.h | 2 +-
kernel/workqueue.c | 2 +-
lib/debugobjects.c | 17 +
lib/glob.c | 31 +-
lib/test_meminit.c | 2 +-
mm/backing-dev.c | 5 +
mm/damon/core.c | 2 +-
mm/damon/ops-common.c | 1 +
mm/damon/sysfs-schemes.c | 17 +-
mm/filemap.c | 2 +-
mm/madvise.c | 3 +-
mm/mincore.c | 3 +-
mm/mm_init.c | 13 +-
mm/shrinker_debug.c | 30 +-
mm/slab.h | 17 +-
mm/vmscan.c | 6 +-
net/6lowpan/nhc.c | 2 +-
net/9p/client.c | 2 +
net/9p/trans_rdma.c | 19 +-
net/atm/common.c | 2 +
net/batman-adv/distributed-arp-table.c | 30 +-
net/batman-adv/fragmentation.c | 8 +-
net/batman-adv/gateway_client.c | 3 +-
net/batman-adv/main.c | 13 +-
net/batman-adv/routing.c | 3 +-
net/batman-adv/soft-interface.c | 17 +-
net/batman-adv/soft-interface.h | 2 +
net/batman-adv/translation-table.c | 5 +-
net/bluetooth/6lowpan.c | 74 +--
net/bluetooth/af_bluetooth.c | 17 +-
net/bluetooth/bnep/core.c | 27 +-
net/bluetooth/hci_codec.c | 2 +-
net/bluetooth/hci_conn.c | 56 +-
net/bluetooth/hci_core.c | 83 ++-
net/bluetooth/hci_event.c | 29 +-
net/bluetooth/hci_sync.c | 197 +++++--
net/bluetooth/iso.c | 20 +-
net/bluetooth/l2cap_core.c | 159 ++++--
net/bluetooth/l2cap_sock.c | 107 ++--
net/bluetooth/mgmt.c | 8 +-
net/bluetooth/msft.c | 2 +-
net/bluetooth/rfcomm/tty.c | 4 +-
net/bluetooth/sco.c | 62 ++-
net/bluetooth/smp.c | 27 +-
net/bridge/br_cfm.c | 6 +
net/bridge/br_cfm_netlink.c | 4 +-
net/bridge/br_if.c | 3 +
net/bridge/br_stp.c | 3 +-
net/bridge/netfilter/ebtables.c | 22 +-
net/bridge/netfilter/nft_meta_bridge.c | 4 +-
net/can/bcm.c | 127 ++++-
net/can/isotp.c | 9 +-
net/core/dev.c | 88 ++++
net/core/fib_rules.c | 6 +-
net/core/filter.c | 28 +-
net/core/flow_dissector.c | 12 +-
net/core/lwt_bpf.c | 12 +
net/core/rtnetlink.c | 8 +
net/core/skbuff.c | 23 +-
net/devlink/rate.c | 10 +-
net/ethernet/eth.c | 9 +-
net/handshake/genl.c | 2 +-
net/ieee802154/core.c | 2 +-
net/ieee802154/header_ops.c | 9 +-
net/ieee802154/ieee802154.h | 17 +
net/ieee802154/netlink.c | 36 +-
net/ife/ife.c | 2 +-
net/ipv4/esp4_offload.c | 2 +-
net/ipv4/igmp.c | 15 +-
net/ipv4/ip_gre.c | 9 +-
net/ipv4/ip_vti.c | 3 +
net/ipv4/ipip.c | 3 +
net/ipv4/netfilter/nf_reject_ipv4.c | 2 +-
net/ipv4/sysctl_net_ipv4.c | 10 +-
net/ipv4/tcp_output.c | 4 +-
net/ipv6/addrconf.c | 23 +-
net/ipv6/esp6_offload.c | 2 +-
net/ipv6/ip6_gre.c | 6 +
net/ipv6/ip6_vti.c | 3 +
net/ipv6/mcast.c | 165 +++---
net/ipv6/netfilter.c | 4 +-
net/ipv6/netfilter/ip6t_ah.c | 5 +
net/ipv6/netfilter/ip6t_hbh.c | 1 +
net/ipv6/netfilter/ip6t_rt.c | 3 +-
net/ipv6/netfilter/nf_conntrack_reasm.c | 3 +-
net/ipv6/route.c | 9 +-
net/ipv6/seg6.c | 3 +
net/ipv6/sit.c | 3 +
net/kcm/kcmsock.c | 8 +-
net/key/af_key.c | 1 +
net/llc/af_llc.c | 1 +
net/llc/llc_conn.c | 1 -
net/mac80211/main.c | 3 +-
net/mac80211/tx.c | 17 +-
net/mac802154/iface.c | 6 +-
net/netfilter/ipset/ip_set_core.c | 12 +-
net/netfilter/ipset/ip_set_hash_gen.h | 67 ++-
net/netfilter/ipvs/ip_vs_app.c | 10 +-
net/netfilter/ipvs/ip_vs_conn.c | 4 +-
net/netfilter/ipvs/ip_vs_core.c | 36 +-
net/netfilter/ipvs/ip_vs_proto_sctp.c | 18 +-
net/netfilter/ipvs/ip_vs_proto_tcp.c | 11 +-
net/netfilter/ipvs/ip_vs_proto_udp.c | 3 +-
net/netfilter/ipvs/ip_vs_xmit.c | 6 +-
net/netfilter/nf_conncount.c | 23 +-
net/netfilter/nf_conntrack_core.c | 79 +--
net/netfilter/nf_conntrack_ecache.c | 2 +-
net/netfilter/nf_conntrack_extend.c | 32 +-
net/netfilter/nf_conntrack_irc.c | 6 +-
net/netfilter/nf_conntrack_netlink.c | 2 +-
net/netfilter/nf_conntrack_seqadj.c | 2 +
net/netfilter/nf_nat_core.c | 10 +
net/netfilter/nf_nat_sip.c | 11 +
net/netfilter/nf_queue.c | 14 +
net/netfilter/nfnetlink_cthelper.c | 4 +-
net/netfilter/nfnetlink_osf.c | 6 +-
net/netfilter/nfnetlink_queue.c | 3 +
net/netfilter/nft_compat.c | 24 +-
net/netfilter/nft_log.c | 58 +--
net/netfilter/nft_synproxy.c | 9 +-
net/netfilter/xt_AUDIT.c | 58 +--
net/netfilter/xt_cluster.c | 2 +-
net/netfilter/xt_connmark.c | 14 +-
net/netfilter/xt_nat.c | 9 +
net/netfilter/xt_rateest.c | 2 +-
net/netfilter/xt_u32.c | 12 +-
net/openvswitch/conntrack.c | 2 +-
net/openvswitch/flow_netlink.c | 201 +++++--
net/phonet/af_phonet.c | 5 +-
net/psample/psample.c | 6 +-
net/qrtr/af_qrtr.c | 2 +-
net/rxrpc/recvmsg.c | 5 +-
net/sched/act_api.c | 13 +-
net/sched/act_bpf.c | 2 +-
net/sched/act_ct.c | 7 +-
net/sched/act_pedit.c | 13 +-
net/sched/cls_api.c | 25 +-
net/sched/cls_bpf.c | 10 +-
net/sched/cls_flow.c | 12 +-
net/sched/sch_cake.c | 5 +-
net/sched/sch_codel.c | 48 +-
net/sched/sch_drr.c | 8 +-
net/sched/sch_fq_codel.c | 41 +-
net/sched/sch_hfsc.c | 24 +-
net/sched/sch_hhf.c | 27 +
net/sched/sch_htb.c | 14 +-
net/sched/sch_multiq.c | 2 +-
net/sched/sch_taprio.c | 2 +-
net/sched/sch_teql.c | 126 +++--
net/sctp/diag.c | 67 ++-
net/sctp/sm_make_chunk.c | 10 +-
net/sctp/sm_statefuns.c | 23 +-
net/sctp/socket.c | 38 +-
net/smc/smc_cdc.c | 15 +-
net/socket.c | 2 +-
net/sunrpc/clnt.c | 19 +-
net/sunrpc/svcsock.c | 10 +
net/sunrpc/xdr.c | 14 +-
net/sunrpc/xprt.c | 16 +
net/sunrpc/xprtrdma/backchannel.c | 5 +-
net/sunrpc/xprtrdma/frwr_ops.c | 2 +-
net/sunrpc/xprtrdma/rpc_rdma.c | 172 ++++--
net/sunrpc/xprtrdma/transport.c | 85 ++-
net/sunrpc/xprtrdma/verbs.c | 167 ++++--
net/sunrpc/xprtrdma/xprt_rdma.h | 7 +-
net/sunrpc/xprtsock.c | 16 +-
net/tipc/bcast.c | 22 +-
net/tipc/bcast.h | 2 +-
net/tipc/bearer.c | 1 +
net/tipc/core.c | 5 +
net/tipc/discover.c | 14 +-
net/tipc/name_distr.c | 13 +-
net/tipc/netlink.c | 12 +
net/tipc/node.c | 15 +-
net/tipc/socket.c | 3 +
net/tls/tls_sw.c | 11 +
net/wireless/nl80211.c | 2 +-
net/xfrm/espintcp.c | 34 +-
net/xfrm/xfrm_input.c | 6 +-
net/xfrm/xfrm_interface_core.c | 3 +
net/xfrm/xfrm_policy.c | 32 +-
net/xfrm/xfrm_state.c | 2 +-
net/xfrm/xfrm_user.c | 20 +-
samples/trace_events/trace-events-sample.c | 4 +
scripts/kconfig/conf.c | 6 +-
security/apparmor/apparmorfs.c | 9 +-
security/apparmor/domain.c | 58 ++-
security/apparmor/label.c | 2 +-
security/apparmor/net.c | 2 +
security/apparmor/policy.c | 5 +-
security/apparmor/procattr.c | 2 +
security/integrity/evm/evm_secfs.c | 16 +-
security/keys/keyring.c | 2 +-
security/selinux/hooks.c | 61 ++-
sound/aoa/fabrics/layout.c | 6 +
sound/core/init.c | 11 +-
sound/core/seq/seq_clientmgr.c | 1 +
sound/core/seq/seq_memory.c | 4 +-
sound/core/seq/seq_midi.c | 55 +-
sound/firewire/isight.c | 3 +-
sound/isa/gus/gus_pcm.c | 2 +
sound/pci/cmipci.c | 6 +
sound/pci/es1938.c | 2 +
sound/pci/ice1712/aureon.c | 2 +
sound/pci/ice1712/ice1712.c | 8 +
sound/pci/ice1712/ice1724.c | 6 +
sound/pci/ymfpci/ymfpci_main.c | 6 +
sound/soc/codecs/adau1372.c | 5 +
sound/soc/codecs/aw88261.c | 12 +-
sound/soc/codecs/cs35l56.c | 14 +-
sound/soc/codecs/hdac_hdmi.c | 4 +-
sound/soc/codecs/tlv320aic3x.c | 25 +-
sound/soc/fsl/fsl_asrc_dma.c | 20 +
sound/soc/fsl/fsl_audmix.c | 6 +
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 11 +
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 9 +
sound/soc/qcom/qdsp6/q6apm.c | 8 +
sound/soc/sh/rcar/rsnd.h | 2 +-
sound/soc/sof/ipc3-control.c | 79 ++-
sound/soc/sof/ipc4-control.c | 11 +-
sound/soc/sof/topology.c | 5 +-
sound/soc/tegra/tegra210_ahub.c | 4 +-
sound/usb/caiaq/input.c | 2 +-
sound/usb/midi2.c | 5 +
sound/usb/mixer_quirks.c | 101 ++--
sound/usb/mixer_scarlett.c | 4 +-
sound/usb/mixer_us16x08.c | 127 +++--
sound/virtio/virtio_pcm.c | 3 +-
sound/virtio/virtio_pcm_ops.c | 3 +-
tools/bpf/bpftool/net.c | 4 +-
tools/include/linux/bitops.h | 2 +
tools/include/uapi/linux/bpf.h | 1 +
tools/lib/api/fs/fs.c | 19 +-
tools/lib/bpf/libbpf.c | 9 +-
tools/lib/bpf/strset.c | 62 ++-
tools/lib/bpf/usdt.c | 16 +-
tools/lib/symbol/kallsyms.c | 5 +-
tools/mm/slabinfo.c | 6 +-
tools/perf/builtin-annotate.c | 3 +-
tools/perf/builtin-c2c.c | 20 +-
tools/perf/builtin-diff.c | 3 +-
tools/perf/builtin-report.c | 3 +-
tools/perf/builtin-sched.c | 69 ++-
tools/perf/tests/pmu-events.c | 24 +-
tools/perf/trace/beauty/fcntl.c | 16 +
tools/perf/util/bpf-event.c | 18 +-
tools/perf/util/bpf-utils.c | 16 +
tools/perf/util/cpumap.c | 28 +-
tools/perf/util/cs-etm-base.c | 4 +-
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 21 +-
tools/perf/util/cs-etm.c | 522 ++++++++++++-------
tools/perf/util/cs-etm.h | 8 +-
tools/perf/util/event.c | 15 +-
tools/perf/util/header.c | 54 ++
tools/perf/util/hist.c | 7 +-
.../util/intel-pt-decoder/intel-pt-insn-decoder.c | 11 +-
tools/perf/util/machine.c | 10 +-
tools/perf/util/mmap.c | 18 +-
tools/perf/util/pmu.c | 10 +-
tools/perf/util/probe-finder.c | 4 +-
tools/perf/util/symbol-elf.c | 48 +-
tools/perf/util/symbol-minimal.c | 11 +-
tools/perf/util/symbol.c | 2 +-
tools/perf/util/thread.c | 5 +
tools/power/x86/intel-speed-select/isst-daemon.c | 9 +-
tools/testing/cxl/test/cxl.c | 8 +-
tools/testing/cxl/test/mem.c | 6 +-
.../selftests/bpf/prog_tests/verifier_log.c | 1 +
.../selftests/bpf/progs/bpf_iter_task_vma.c | 2 +-
tools/testing/selftests/hid/Makefile | 10 +-
tools/testing/selftests/hid/hid_bpf.c | 70 ++-
tools/testing/selftests/hid/progs/hid.c | 94 +++-
.../testing/selftests/hid/progs/hid_bpf_helpers.h | 84 ++-
tools/testing/selftests/mm/compaction_test.c | 3 +
tools/testing/selftests/mm/hmm-tests.c | 63 ++-
tools/testing/selftests/net/tcp_mmap.c | 4 +
tools/usb/usbip/libsrc/usbip_common.c | 2 +
tools/usb/usbip/libsrc/usbip_device_driver.c | 4 +
tools/usb/usbip/libsrc/vhci_driver.c | 1 +
tools/virtio/vringh_test.c | 5 +
virt/kvm/eventfd.c | 12 +-
virt/kvm/kvm_main.c | 16 +-
1187 files changed, 14330 insertions(+), 8071 deletions(-)Greg Kroah-Hartman
maintainerPATCH 1/1266 bpf, arm64: Reject out-of-range B.cond targets
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit 48d83d94930eb4db4c93d2de44838b9455cff626 ]
aarch64_insn_gen_cond_branch_imm() calls label_imm_common() to compute a 19-bit signed byte offset for a conditional branch, but unlike its siblings aarch64_insn_gen_branch_imm() and aarch64_insn_gen_comp_branch_imm(), it does not check whether label_imm_common() returned its out-of-range sentinel (range) before feeding the value to aarch64_insn_encode_immediate().
aarch64_insn_encode_immediate() unconditionally masks the value with the 19-bit field mask, so an offset that was rejected by label_imm_common() gets silently truncated. With the sentinel value SZ_1M, the resulting field ends up with bit 18 (the sign bit of the 19-bit signed displacement) set, and the CPU decodes it as a ~1 MiB *backward* branch, producing an incorrectly targeted B.cond instruction. For code-gen locations like the emit_bpf_tail_call() this function is the only barrier between an overflowing displacement and a silently miscompiled branch.
Fix it by returning AARCH64_BREAK_FAULT when the offset is out of range, so callers see a loud failure instead of a silently misencoded branch. validate_code() scans the generated image for any AARCH64_BREAK_FAULT and then lets the JIT fail.
--- arch/arm64/lib/insn.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/lib/insn.c +2 -0
@@ -338,6 +338,8 @@ u32 aarch64_insn_gen_cond_branch_imm(unsigned long pc, unsigned long addr,long offset; offset =label_imm_common (pc, addr,SZ_1M ); +if (offset >=SZ_1M ) +return AARCH64_BREAK_FAULT ; insn =aarch64_insn_get_bcond_value ();
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2/1266 nfsd: release layout stid on setlease failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <[email protected]>
commit 30d55c8aabb261bc3f427d6b9aae7ef6206063f9 upstream.
nfs4_alloc_stid() publishes the new stid into cl->cl_stateids via idr_alloc_cyclic() under cl_lock before returning to nfsd4_alloc_layout_stateid(). When nfsd4_layout_setlease() then fails, the error path frees the layout stateid directly with kmem_cache_free() without ever calling idr_remove(), leaving the IDR slot pointing at freed slab memory. Any subsequent IDR walker (states_show, client teardown) dereferences the dangling pointer.
The correct teardown for an IDR-published stid is nfs4_put_stid(), which removes the IDR slot under cl_lock, dispatches sc_free (nfsd4_free_layout_stateid) to release ls->ls_file via nfsd4_close_layout(), and drops the nfs4_file reference in its tail.
A second issue blocks that switch: nfsd4_free_layout_stateid() unconditionally inspects ls->ls_fence_work via delayed_work_pending() under ls_lock, but INIT_DELAYED_WORK(&ls->ls_fence_work, ...) currently runs only after the setlease call. On the setlease-failure path the destructor would touch an uninitialized delayed_work.
nfsd4_alloc_layout_stateid()
nfs4_alloc_stid() /* idr_alloc_cyclic under cl_lock */
nfsd4_layout_setlease() /* fails */
nfs4_put_stid()
nfsd4_free_layout_stateid()
delayed_work_pending(&ls->ls_fence_work) /* needs INIT */
nfsd4_close_layout() /* nfsd_file_put(ls->ls_file) */
put_nfs4_file()Fix by hoisting the ls_fenced / ls_fence_delay / INIT_DELAYED_WORK initialization above the nfsd4_layout_setlease() call, and replace the manual nfsd_file_put + put_nfs4_file + kmem_cache_free cleanup with a single nfs4_put_stid(stp).
--- fs/nfsd/nfs4layouts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfsd/nfs4layouts.c +1 -3
@@ -242,9 +242,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,BUG_ON (!ls->ls_file);if (nfsd4_layout_setlease (ls)) { -nfsd_file_put (ls->ls_file); -put_nfs4_file (fp); -kmem_cache_free (nfs4_layout_stateid_cache, ls); +nfs4_put_stid (stp);return NULL ; }
Signature · 1 line
2.53.0
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.145 release. There are 1266 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 Thu, 23 Jul 2026 15:23:00 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.145-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Same perf build error on 6.6.145-rc1 as reported for 6.1.178-rc1:
In file included from builtin-sched.c:27:builtin-sched.c: In function 'latency_switch_event':
builtin-sched.c:1182:34: error: 'struct perf_sample' has no member named 'file_offset'
1182 | sample->file_offset, cpu);
| ^~util/debug.h:24:44: note: in definition of macro 'pr_warning'
24 | eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~builtin-sched.c: In function 'latency_runtime_event':
builtin-sched.c:1260:34: error: 'struct perf_sample' has no member named 'file_offset'
1260 | sample->file_offset, cpu);
| ^~util/debug.h:24:44: note: in definition of macro 'pr_warning'
24 | eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~builtin-sched.c: In function 'map_switch_event':
builtin-sched.c:1637:34: error: 'struct perf_sample' has no member named 'file_offset'
1637 | sample->file_offset, this_cpu.cpu);
| ^~util/debug.h:24:44: note: in definition of macro 'pr_warning'
24 | eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
make[5]: *** [/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/build/Makefile.build:97: /local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/builtin-sched.o] Error 1
Signature · 1 line
Florian
Greg Kroah-Hartman
maintainerPATCH 3/1266 nfsd: reset write verifier on deferred writeback errors
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit 2090b05803faab8a9fa62fbff871007862cac1b7 upstream.
nfsd_vfs_write() and nfsd_commit() both call filemap_check_wb_err() to detect deferred writeback errors, but neither rotates the server's write verifier (nn->writeverf) when this check fails. Every other durable-storage-failure path in these functions calls commit_reset_write_verifier() before returning an error.
The missing rotation means clients holding UNSTABLE write data under the current verifier will COMMIT, receive the unchanged verifier back, and conclude their data is durable — silently dropping data that failed writeback. This violates the UNSTABLE+COMMIT durability contract (RFC 1813 §3.3.7, RFC 8881 §18.32).
Add commit_reset_write_verifier() calls at both filemap_check_wb_err() error sites, matching the pattern used by adjacent error paths in the same functions. The helper already filters -EAGAIN and -ESTALE internally, so the calls are unconditionally safe.
[ cel: 6.6.y predates the commit_reset_write_verifier() helper (v6.7);
open-coded nfsd_reset_write_verifier() and the reset tracepoint at both sites, matching the other reset paths in these functions ]
--- fs/nfsd/vfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/nfsd/vfs.c +8 -1
@@ -1185,8 +1185,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,nfsd_stats_io_write_add (nn, exp, *cnt);fsnotify_modify (file); host_err =filemap_check_wb_err (file->f_mapping, since); -if (host_err <0 ) +if (host_err <0 ) { +nfsd_reset_write_verifier (nn); +trace_nfsd_writeverf_reset (nn, rqstp, host_err); goto out_nfserr; + }if (stable && use_wgather) { host_err =wait_for_concurrent_writes (file);
@@ -1330,6 +1333,10 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,nfsd_copy_write_verifier (verf, nn); err2 =filemap_check_wb_err (nf->nf_file->f_mapping, since); +if (err2 <0 ) { +nfsd_reset_write_verifier (nn); +trace_nfsd_writeverf_reset (nn, rqstp, err2); + } err =nfserrno (err2);break ;case -EINVAL :
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 4/1266 ext4: get rid of ppath in get_ext_path()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 6b854d552711aa33f59eda334e6d94a00d8825bb ]
The use of path and ppath is now very confusing, so to make the code more readable, pass path between functions uniformly, and get rid of ppath.
After getting rid of ppath in get_ext_path(), its caller may pass an error pointer to ext4_free_ext_path(), so it needs to teach ext4_free_ext_path() and ext4_ext_drop_refs() to skip the error pointer. No functional changes.
--- fs/ext4/extents.c | 5 +++-- fs/ext4/move_extent.c | 34 +++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-)
fs/ext4/extents.c +3 -2
@@ -114,7 +114,7 @@ static void ext4_ext_drop_refs(struct ext4_ext_path *path) {int depth, i; -if (!path) +if (IS_ERR_OR_NULL (path))return ; depth = path->p_depth;for (i =0 ; i <= depth; i++, path++) {
@@ -125,6 +125,8 @@ static void ext4_ext_drop_refs(struct ext4_ext_path *path)void ext4_free_ext_path (struct ext4_ext_path *path) { +if (IS_ERR_OR_NULL (path)) +return ;ext4_ext_drop_refs (path);kfree (path); }
@@ -4242,7 +4244,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, path =ext4_find_extent (inode, map->m_lblk,NULL ,0 );if (IS_ERR (path)) { err =PTR_ERR (path); - path =NULL ; goto out; }
fs/ext4/move_extent.c +17 -17
@@ -17,27 +17,23 @@* get_ext_path() - Find an extent path for designated logical block number. * @inode: inode to be searched * @lblock: logical block number to find an extent path -* @ppath: pointer to an extent path pointer (for output) +* @path: pointer to an extent path * -* ext4_find_extent wrapper. Return 0 on success, or a negative error value -* on failure. +* ext4_find_extent wrapper. Return an extent path pointer on success, +* or an error pointer on failure. */ -static inline int +static inline struct ext4_ext_path *get_ext_path (struct inode *inode,ext4_lblk_t lblock, -struct ext4_ext_path **ppath) +struct ext4_ext_path *path) { -struct ext4_ext_path *path = *ppath; - - *ppath =NULL ; path =ext4_find_extent (inode, lblock, path,EXT4_EX_NOCACHE );if (IS_ERR (path)) -return PTR_ERR (path); +return path;if (path[ext_depth (inode)].p_ext ==NULL ) {ext4_free_ext_path (path); -return -ENODATA ; +return ERR_PTR (-ENODATA ); } - *ppath = path; -return 0 ; +return path; }/**
@@ -95,9 +91,11 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,int ret =0 ;ext4_lblk_t last = from + count;while (from < last) { - *err =get_ext_path (inode, from, &path); -if (*err) - goto out; + path =get_ext_path (inode, from, path); +if (IS_ERR (path)) { + *err =PTR_ERR (path); +return ret; + } ext = path[ext_depth (inode)].p_ext;if (unwritten !=ext4_ext_is_unwritten (ext)) goto out;
@@ -634,9 +632,11 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,int offset_in_page;int unwritten, cur_len; - ret =get_ext_path (orig_inode, o_start, &path); -if (ret) + path =get_ext_path (orig_inode, o_start, path); +if (IS_ERR (path)) { + ret =PTR_ERR (path); goto out; + } ex = path[path->p_depth].p_ext; cur_blk =le32_to_cpu (ex->ee_block); cur_len =ext4_ext_get_actual_len (ex);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 5/1266 LoongArch: Report dying CPU to RCU in stop_this_cpu()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit f2539c56c74691e7a88af6372ba2b48c06ed2fe4 upstream.
This is a port of MIPS commit 9f3f3bdc6d9dac1 ("MIPS: smp: report dying CPU to RCU in stop_this_cpu()"). smp_send_stop() parks all secondary CPUs in stop_this_cpu(). And the function marks the CPU offline for the scheduler via set_cpu_online(false) but never informs RCU, so RCU keeps expecting a quiescent state from CPUs that are now spinning forever with interrupts disabled.
As long as nothing waits for an RCU grace period after smp_send_stop() this is harmless, which is why it went unnoticed. However, since commit 91840be8f710370 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT"), irq_work_sync() calls synchronize_rcu() on architectures without an irq_work self-IPI, i.e. where arch_irq_work_has_interrupt() returns false. Any irq_work_sync() issued in the reboot/shutdown/halt path after smp_send_stop() then blocks on a grace period that can never complete, hanging the reboot:
WARNING: CPU: 0 PID: 15 at kernel/irq_work.c:144 irq_work_queue_on ... rcu: INFO: rcu_sched detected stalls on CPUs/tasks: rcu: Offline CPU 1 blocking current GP. rcu: Offline CPU 2 blocking current GP. rcu: Offline CPU 3 blocking current GP.
This issue needs some hacks to reproduce, and it was not noticed on LoongArch because arch_irq_work_has_interrupt() usually returns true.
Call rcutree_report_cpu_dead() once interrupts are disabled, mirroring the generic CPU-hotplug offline path, so RCU stops waiting on the parked CPUs and grace periods can still complete. LoongArch shuts down all CPUs here without going through the CPU-hotplug mechanism, so this report is not otherwise issued.
--- arch/loongarch/kernel/smp.c | 1 + 1 file changed, 1 insertion(+)
arch/loongarch/kernel/smp.c +1 -0
@@ -613,6 +613,7 @@ static void stop_this_cpu(void *dummy)set_cpu_online (smp_processor_id (), false);calculate_cpu_foreign_map ();local_irq_disable (); +rcu_report_dead (smp_processor_id ());while (true); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 6/1266 Bluetooth: btmtk: apply the common btmtk_fw_get_filename
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Wang <[email protected]>
[ Upstream commit 7f935b21bee4d8a9f26b57ae6c3682161b247809 ]
Apply the common btmtk_fw_get_filename to avoid the similar coding in each driver.
Stable-dep-of: 5c5e8c52e3ca ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c")
--- drivers/bluetooth/btmtksdio.c | 3 +++ drivers/bluetooth/btusb.c | 10 ++-------- 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/bluetooth/btmtksdio.c +3 -0
@@ -1111,6 +1111,9 @@ static int btmtksdio_setup(struct hci_dev *hdev)return err; } +btmtk_fw_get_filename (fwname,sizeof (fwname), dev_id, + fw_version,0 ); +snprintf (fwname,sizeof (fwname),"mediatek/BT_RAM_CODE_MT%04x_1_%x_hdr.bin" , dev_id &0xffff , (fw_version &0xff ) +1 );
drivers/bluetooth/btusb.c +2 -8
@@ -2940,14 +2940,8 @@ static int btusb_mtk_setup(struct hci_dev *hdev)case 0x7922 :case 0x7961 :case 0x7925 : -if (dev_id ==0x7925 ) -snprintf (fw_bin_name,sizeof (fw_bin_name), -"mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin" , - dev_id &0xffff , dev_id &0xffff , (fw_version &0xff ) +1 ); -else -snprintf (fw_bin_name,sizeof (fw_bin_name), -"mediatek/BT_RAM_CODE_MT%04x_1_%x_hdr.bin" , - dev_id &0xffff , (fw_version &0xff ) +1 ); +btmtk_fw_get_filename (fw_bin_name,sizeof (fw_bin_name), dev_id, + fw_version,0 ); err =btmtk_setup_firmware_79xx (hdev, fw_bin_name, btmtk_usb_hci_wmt_sync);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 7/1266 Bluetooth: btusb: mediatek: reset the controller before downloading the fw
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Qin <[email protected]>
[ Upstream commit ccfc8948d7e4d93cab341a99774b24586717d89a ]
Reset the controller before downloading the firmware to improve its reliability. This includes situations like cold or warm reboots, ensuring the controller is in its initial state before starting the firmware download.
Stable-dep-of: 5c5e8c52e3ca ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c")
--- drivers/bluetooth/btusb.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/bluetooth/btusb.c +10 -0
@@ -2940,6 +2940,13 @@ static int btusb_mtk_setup(struct hci_dev *hdev)case 0x7922 :case 0x7961 :case 0x7925 : +/* Reset the device to ensure it's in the initial state before +* downloading the firmware to ensure. +*/ + +if (!test_bit (BTUSB_FIRMWARE_LOADED , &data->flags)) +btusb_mtk_subsys_reset (hdev, dev_id); +btmtk_fw_get_filename (fw_bin_name,sizeof (fw_bin_name), dev_id, fw_version,0 );
@@ -2947,9 +2954,12 @@ static int btusb_mtk_setup(struct hci_dev *hdev) btmtk_usb_hci_wmt_sync);if (err <0 ) {bt_dev_err (hdev,"Failed to set up firmware (%d)" , err); +clear_bit (BTUSB_FIRMWARE_LOADED , &data->flags);return err; } +set_bit (BTUSB_FIRMWARE_LOADED , &data->flags); +/* It's Device EndPoint Reset Option Register */ btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,MTK_EP_RST_IN_OUT_OPT );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 8/1266 Bluetooth: btusb: mediatek: add MT7922 subsystem reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Qin <[email protected]>
[ Upstream commit 064aee501012eaeeeb40a2acb991598e0a89fac9 ]
Add the support of MT7922 bluetooth subsystem reset that was called the auto revert to self-recover from the fatal error in the controller like the host encounters HCI cmd timeout or the controller crashes.
Stable-dep-of: 5c5e8c52e3ca ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c")
--- drivers/bluetooth/btusb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/bluetooth/btusb.c +13 -1
@@ -2811,7 +2811,16 @@ static int btusb_mtk_subsys_reset(struct hci_dev *hdev, u32 dev_id)u32 val;int err; -if (dev_id ==0x7925 ) { +if (dev_id ==0x7922 ) { +btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); + val |=0x00002020 ; +btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST , val); +btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,0x00010001 ); +btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); + val |=BIT (0 ); +btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST , val); +msleep (100 ); + }else if (dev_id ==0x7925 ) {btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); val |= (1 <<5 );btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val);
@@ -2851,6 +2860,9 @@ static int btusb_mtk_subsys_reset(struct hci_dev *hdev, u32 dev_id)if (err <0 )bt_dev_err (hdev,"Reset timeout" ); +if (dev_id ==0x7922 ) +btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); +btusb_mtk_id_get (data,0x70010200 , &val);if (!val)bt_dev_err (hdev,"Can't get device id, subsys reset fail." );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 9/1266 Bluetooth: btusb: mediatek: remove the unnecessary goto tag
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit be71dfb9ad2042bba713975ef50c3a5b0429f1d2 ]
Remove the unnecessary goto tag whether there is an error or not, we have to free the buffer at the end of the function.
Stable-dep-of: 5c5e8c52e3ca ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c")
--- drivers/bluetooth/btusb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/bluetooth/btusb.c +1 -4
@@ -2725,12 +2725,9 @@ static int btusb_mtk_uhw_reg_write(struct btusb_data *data, u32 reg, u32 val)0x5E , reg >>16 , reg &0xffff , buf, 4, USB_CTRL_SET_TIMEOUT); -if (err <0 ) { +if (err <0 )bt_dev_err (hdev,"Failed to write uhw reg(%d)" , err); - goto err_free_buf; - } -err_free_buf:kfree (buf);return err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 10/1266 Bluetooth: btusb: mediatek: return error for failed reg access
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit 3dcb122b30643444352ff4b9aa16367dd24d7571 ]
Update the code to immediately return an error code if accessing a related register fails. This ensures that our desired logic for subsequent register operations is maintained and allows us to promptly catch any unexpected errors.
Stable-dep-of: 5c5e8c52e3ca ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c")
--- drivers/bluetooth/btusb.c | 114 ++++++++++++++++++++++++++++---------- 1 file changed, 84 insertions(+), 30 deletions(-)
drivers/bluetooth/btusb.c +84 -30
@@ -2809,47 +2809,98 @@ static int btusb_mtk_subsys_reset(struct hci_dev *hdev, u32 dev_id)int err;if (dev_id ==0x7922 ) { -btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); + err =btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); +if (err <0 ) +return err; val |=0x00002020 ; -btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST , val); -btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,0x00010001 ); -btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST , val); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,0x00010001 ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); +if (err <0 ) +return err; val |=BIT (0 ); -btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST , val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST , val); +if (err <0 ) +return err;msleep (100 ); }else if (dev_id ==0x7925 ) { -btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); + err =btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); +if (err <0 ) +return err; val |= (1 <<5 ); -btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val); -btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); +if (err <0 ) +return err; val &=0xFFFF00FF ; +if (err <0 ) +return err; val |= (1 <<13 ); -btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val); -btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,0x00010001 ); -btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,0x00010001 ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_BT_RESET_REG_CONNV3 , &val); +if (err <0 ) +return err; val |= (1 <<0 ); -btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val); -btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); -btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT , &val); -btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT1 ,0x000000FF ); -btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT1 , &val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_RESET_REG_CONNV3 , val); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT , &val); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT1 ,0x000000FF ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT1 , &val); +if (err <0 ) +return err;msleep (100 ); }else {/* It's Device EndPoint Reset Option Register */ bt_dev_dbg (hdev,"Initiating reset mechanism via uhw" ); -btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,MTK_EP_RST_IN_OUT_OPT ); -btusb_mtk_uhw_reg_read (data,MTK_BT_WDT_STATUS , &val); - + err =btusb_mtk_uhw_reg_write (data,MTK_EP_RST_OPT ,MTK_EP_RST_IN_OUT_OPT ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_BT_WDT_STATUS , &val); +if (err <0 ) +return err;/* Reset the bluetooth chip via USB interface. */ -btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST ,1 ); -btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); -btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT , &val); -btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT1 ,0x000000FF ); -btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT1 , &val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST ,1 ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT , &val); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT1 ,0x000000FF ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_UDMA_INT_STA_BT1 , &val); +if (err <0 ) +return err;/* MT7921 need to delay 20ms between toggle reset bit */ msleep (20 ); -btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST ,0 ); -btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); + err =btusb_mtk_uhw_reg_write (data,MTK_BT_SUBSYS_RST ,0 ); +if (err <0 ) +return err; + err =btusb_mtk_uhw_reg_read (data,MTK_BT_SUBSYS_RST , &val); +if (err <0 ) +return err; } err = readx_poll_timeout(btusb_mtk_reset_done, hdev, val,
@@ -2857,11 +2908,14 @@ static int btusb_mtk_subsys_reset(struct hci_dev *hdev, u32 dev_id)if (err <0 )bt_dev_err (hdev,"Reset timeout" ); -if (dev_id ==0x7922 ) -btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (dev_id ==0x7922 ) { + err =btusb_mtk_uhw_reg_write (data,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (err <0 ) +return err; + } -btusb_mtk_id_get (data,0x70010200 , &val); -if (!val) + err =btusb_mtk_id_get (data,0x70010200 , &val); +if (err <0 || !val)bt_dev_err (hdev,"Can't get device id, subsys reset fail." );return err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 11/1266 Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit 5c5e8c52e3cafaa6f71efd44a42a674271e5b3ad ]
Move btusb_mtk_[setup, shutdown] and related function from btusb.c to btmtk.c which holds vendor specific stuff and would make btusb.c clean.
--- drivers/bluetooth/btmtk.c | 454 +++++++++++++++++++++++++++++++++++++- drivers/bluetooth/btmtk.h | 23 +- drivers/bluetooth/btusb.c | 446 ++----------------------------------- 3 files changed, 484 insertions(+), 439 deletions(-)
drivers/bluetooth/btmtk.c +451 -3
@@ -5,6 +5,8 @@#include <linux/module.h> #include <linux/firmware.h> #include <linux/usb.h> +#include <linux/iopoll.h> +#include <asm/unaligned.h> #include <net/bluetooth/bluetooth.h> #include <net/bluetooth/hci_core.h>
@@ -573,8 +575,8 @@ static int btmtk_usb_submit_wmt_recv_urb(struct hci_dev *hdev)return err; } -int btmtk_usb_hci_wmt_sync (struct hci_dev *hdev, -struct btmtk_hci_wmt_params *wmt_params) +static int btmtk_usb_hci_wmt_sync (struct hci_dev *hdev, +struct btmtk_hci_wmt_params *wmt_params) {struct btmtk_data *data =hci_get_priv (hdev);struct btmtk_hci_wmt_evt_funcc *wmt_evt_funcc;
@@ -711,7 +713,453 @@ int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,kfree (wc);return err; } -EXPORT_SYMBOL_GPL (btmtk_usb_hci_wmt_sync); + +static int btmtk_usb_func_query (struct hci_dev *hdev) +{ +struct btmtk_hci_wmt_params wmt_params; +int status, err; +u8 param =0 ; + +/* Query whether the function is enabled */ + wmt_params.op =BTMTK_WMT_FUNC_CTRL ; + wmt_params.flag =4 ; + wmt_params.dlen =sizeof (param); + wmt_params.data = ¶m; + wmt_params.status = &status; + + err =btmtk_usb_hci_wmt_sync (hdev, &wmt_params); +if (err <0 ) { +bt_dev_err (hdev,"Failed to query function status (%d)" , err); +return err; + } + +return status; +} + +static int btmtk_usb_uhw_reg_write (struct hci_dev *hdev,u32 reg,u32 val) +{ +struct btmtk_data *data =hci_get_priv (hdev); +int pipe, err; +void *buf; + + buf =kzalloc (4 ,GFP_KERNEL ); +if (!buf) +return -ENOMEM ; + +put_unaligned_le32 (val, buf); + + pipe =usb_sndctrlpipe (data->udev,0 ); + err =usb_control_msg (data->udev, pipe,0x02 , +0x5E , + reg >>16 , reg &0xffff , + buf,4 ,USB_CTRL_SET_TIMEOUT ); +if (err <0 ) +bt_dev_err (hdev,"Failed to write uhw reg(%d)" , err); + +kfree (buf); + +return err; +} + +static int btmtk_usb_uhw_reg_read (struct hci_dev *hdev,u32 reg,u32 *val) +{ +struct btmtk_data *data =hci_get_priv (hdev); +int pipe, err; +void *buf; + + buf =kzalloc (4 ,GFP_KERNEL ); +if (!buf) +return -ENOMEM ; + + pipe =usb_rcvctrlpipe (data->udev,0 ); + err =usb_control_msg (data->udev, pipe,0x01 , +0xDE , + reg >>16 , reg &0xffff , + buf,4 ,USB_CTRL_GET_TIMEOUT ); +if (err <0 ) { +bt_dev_err (hdev,"Failed to read uhw reg(%d)" , err); + goto err_free_buf; + } + + *val =get_unaligned_le32 (buf); +bt_dev_dbg (hdev,"reg=%x, value=0x%08x" , reg, *val); + +err_free_buf: +kfree (buf); + +return err; +} + +static int btmtk_usb_reg_read (struct hci_dev *hdev,u32 reg,u32 *val) +{ +struct btmtk_data *data =hci_get_priv (hdev); +int pipe, err, size =sizeof (u32); +void *buf; + + buf =kzalloc (size,GFP_KERNEL ); +if (!buf) +return -ENOMEM ; + + pipe =usb_rcvctrlpipe (data->udev,0 ); + err =usb_control_msg (data->udev, pipe,0x63 , +USB_TYPE_VENDOR |USB_DIR_IN , + reg >>16 , reg &0xffff , + buf, size,USB_CTRL_GET_TIMEOUT ); +if (err <0 ) + goto err_free_buf; + + *val =get_unaligned_le32 (buf); + +err_free_buf: +kfree (buf); + +return err; +} + +static int btmtk_usb_id_get (struct hci_dev *hdev,u32 reg,u32 *id) +{ +return btmtk_usb_reg_read (hdev, reg, id); +} + +static u32 btmtk_usb_reset_done (struct hci_dev *hdev) +{ +u32 val =0 ; + +btmtk_usb_uhw_reg_read (hdev,MTK_BT_MISC , &val); + +return val &MTK_BT_RST_DONE ; +} + +int btmtk_usb_subsys_reset (struct hci_dev *hdev,u32 dev_id) +{ +u32 val; +int err; + +if (dev_id ==0x7922 ) { + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_SUBSYS_RST , &val); +if (err <0 ) +return err; + val |=0x00002020 ; + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_SUBSYS_RST , val); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_write (hdev,MTK_EP_RST_OPT ,0x00010001 ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_SUBSYS_RST , &val); +if (err <0 ) +return err; + val |=BIT (0 ); + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_SUBSYS_RST , val); +if (err <0 ) +return err; +msleep (100 ); + }else if (dev_id ==0x7925 ) { + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_RESET_REG_CONNV3 , &val); +if (err <0 ) +return err; + val |= (1 <<5 ); + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_RESET_REG_CONNV3 , val); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_RESET_REG_CONNV3 , &val); +if (err <0 ) +return err; + val &=0xFFFF00FF ; + val |= (1 <<13 ); + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_RESET_REG_CONNV3 , val); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_write (hdev,MTK_EP_RST_OPT ,0x00010001 ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_RESET_REG_CONNV3 , &val); +if (err <0 ) +return err; + val |= (1 <<0 ); + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_RESET_REG_CONNV3 , val); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_write (hdev,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_UDMA_INT_STA_BT , &val); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_write (hdev,MTK_UDMA_INT_STA_BT1 ,0x000000FF ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_UDMA_INT_STA_BT1 , &val); +if (err <0 ) +return err; +msleep (100 ); + }else { +/* It's Device EndPoint Reset Option Register */ +bt_dev_dbg (hdev,"Initiating reset mechanism via uhw" ); + err =btmtk_usb_uhw_reg_write (hdev,MTK_EP_RST_OPT ,MTK_EP_RST_IN_OUT_OPT ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_WDT_STATUS , &val); +if (err <0 ) +return err; +/* Reset the bluetooth chip via USB interface. */ + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_SUBSYS_RST ,1 ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_write (hdev,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_UDMA_INT_STA_BT , &val); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_write (hdev,MTK_UDMA_INT_STA_BT1 ,0x000000FF ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_UDMA_INT_STA_BT1 , &val); +if (err <0 ) +return err; +/* MT7921 need to delay 20ms between toggle reset bit */ +msleep (20 ); + err =btmtk_usb_uhw_reg_write (hdev,MTK_BT_SUBSYS_RST ,0 ); +if (err <0 ) +return err; + err =btmtk_usb_uhw_reg_read (hdev,MTK_BT_SUBSYS_RST , &val); +if (err <0 ) +return err; + } + + err =readx_poll_timeout (btmtk_usb_reset_done, hdev, val, + val &MTK_BT_RST_DONE ,20000 ,1000000 ); +if (err <0 ) +bt_dev_err (hdev,"Reset timeout" ); + +if (dev_id ==0x7922 ) { + err =btmtk_usb_uhw_reg_write (hdev,MTK_UDMA_INT_STA_BT ,0x000000FF ); +if (err <0 ) +return err; + } + + err =btmtk_usb_id_get (hdev,0x70010200 , &val); +if (err <0 || !val) +bt_dev_err (hdev,"Can't get device id, subsys reset fail." ); + +return err; +} +EXPORT_SYMBOL_GPL (btmtk_usb_subsys_reset); + +int btmtk_usb_setup (struct hci_dev *hdev) +{ +struct btmtk_data *btmtk_data =hci_get_priv (hdev); +struct btmtk_hci_wmt_params wmt_params; +ktime_t calltime, delta, rettime; +struct btmtk_tci_sleep tci_sleep; +unsigned long long duration; +struct sk_buff *skb; +const char *fwname; +int err, status; +u32 dev_id =0 ; +char fw_bin_name[64 ]; +u32 fw_version =0 , fw_flavor =0 ; +u8 param; + + calltime =ktime_get (); + + err =btmtk_usb_id_get (hdev,0x80000008 , &dev_id); +if (err <0 ) { +bt_dev_err (hdev,"Failed to get device id (%d)" , err); +return err; + } + +if (!dev_id || dev_id !=0x7663 ) { + err =btmtk_usb_id_get (hdev,0x70010200 , &dev_id); +if (err <0 ) { +bt_dev_err (hdev,"Failed to get device id (%d)" , err); +return err; + } + err =btmtk_usb_id_get (hdev,0x80021004 , &fw_version); +if (err <0 ) { +bt_dev_err (hdev,"Failed to get fw version (%d)" , err); +return err; + } + err =btmtk_usb_id_get (hdev,0x70010020 , &fw_flavor); +if (err <0 ) { +bt_dev_err (hdev,"Failed to get fw flavor (%d)" , err); +return err; + } + fw_flavor = (fw_flavor &0x00000080 ) >>7 ; + } + + btmtk_data->dev_id = dev_id; + + err =btmtk_register_coredump (hdev, btmtk_data->drv_name, fw_version); +if (err <0 ) +bt_dev_err (hdev,"Failed to register coredump (%d)" , err); + +switch (dev_id) { +case 0x7663 : + fwname =FIRMWARE_MT7663 ; +break ; +case 0x7668 : + fwname =FIRMWARE_MT7668 ; +break ; +case 0x7922 : +case 0x7961 : +case 0x7925 : +/* Reset the device to ensure it's in the initial state before +* downloading the firmware to ensure. +*/ + +if (!test_bit (BTMTK_FIRMWARE_LOADED , &btmtk_data->flags)) +btmtk_usb_subsys_reset (hdev, dev_id); + +btmtk_fw_get_filename (fw_bin_name,sizeof (fw_bin_name), dev_id, + fw_version, fw_flavor); + + err =btmtk_setup_firmware_79xx (hdev, fw_bin_name, + btmtk_usb_hci_wmt_sync); +if (err <0 ) { +bt_dev_err (hdev,"Failed to set up firmware (%d)" , err); +clear_bit (BTMTK_FIRMWARE_LOADED , &btmtk_data->flags); +return err; + } + +set_bit (BTMTK_FIRMWARE_LOADED , &btmtk_data->flags); + +/* It's Device EndPoint Reset Option Register */ + err =btmtk_usb_uhw_reg_write (hdev,MTK_EP_RST_OPT , +MTK_EP_RST_IN_OUT_OPT ); +if (err <0 ) +return err; + +/* Enable Bluetooth protocol */ + param =1 ; + wmt_params.op =BTMTK_WMT_FUNC_CTRL ; + wmt_params.flag =0 ; + wmt_params.dlen =sizeof (param); + wmt_params.data = ¶m; + wmt_params.status =NULL ; + + err =btmtk_usb_hci_wmt_sync (hdev, &wmt_params); +if (err <0 ) { +bt_dev_err (hdev,"Failed to send wmt func ctrl (%d)" , err); +return err; + } + +hci_set_msft_opcode (hdev,0xFD30 ); +hci_set_aosp_capable (hdev); + + goto done; +default : +bt_dev_err (hdev,"Unsupported hardware variant (%08x)" , + dev_id); +return -ENODEV ; + } + +/* Query whether the firmware is already download */ + wmt_params.op =BTMTK_WMT_SEMAPHORE ; + wmt_params.flag =1 ; + wmt_params.dlen =0 ; + wmt_params.data =NULL ; + wmt_params.status = &status; + + err =btmtk_usb_hci_wmt_sync (hdev, &wmt_params); +if (err <0 ) { +bt_dev_err (hdev,"Failed to query firmware status (%d)" , err); +return err; + } + +if (status ==BTMTK_WMT_PATCH_DONE ) { +bt_dev_info (hdev,"firmware already downloaded" ); + goto ignore_setup_fw; + } + +/* Setup a firmware which the device definitely requires */ + err =btmtk_setup_firmware (hdev, fwname, + btmtk_usb_hci_wmt_sync); +if (err <0 ) +return err; + +ignore_setup_fw: + err =readx_poll_timeout (btmtk_usb_func_query, hdev, status, + status <0 || status !=BTMTK_WMT_ON_PROGRESS , +2000 ,5000000 ); +/* -ETIMEDOUT happens */ +if (err <0 ) +return err; + +/* The other errors happen in btmtk_usb_func_query */ +if (status <0 ) +return status; + +if (status ==BTMTK_WMT_ON_DONE ) { +bt_dev_info (hdev,"function already on" ); + goto ignore_func_on; + } + +/* Enable Bluetooth protocol */ + param =1 ; + wmt_params.op =BTMTK_WMT_FUNC_CTRL ; + wmt_params.flag =0 ; + wmt_params.dlen =sizeof (param); + wmt_params.data = ¶m; + wmt_params.status =NULL ; + + err =btmtk_usb_hci_wmt_sync (hdev, &wmt_params); +if (err <0 ) { +bt_dev_err (hdev,"Failed to send wmt func ctrl (%d)" , err); +return err; + } + +ignore_func_on: +/* Apply the low power environment setup */ + tci_sleep.mode =0x5 ; + tci_sleep.duration =cpu_to_le16 (0x640 ); + tci_sleep.host_duration =cpu_to_le16 (0x640 ); + tci_sleep.host_wakeup_pin =0 ; + tci_sleep.time_compensation =0 ; + + skb =__hci_cmd_sync (hdev,0xfc7a ,sizeof (tci_sleep), &tci_sleep, +HCI_INIT_TIMEOUT ); +if (IS_ERR (skb)) { + err =PTR_ERR (skb); +bt_dev_err (hdev,"Failed to apply low power setting (%d)" , err); +return err; + } +kfree_skb (skb); + +done: + rettime =ktime_get (); + delta =ktime_sub (rettime, calltime); + duration = (unsigned long long )ktime_to_ns (delta) >>10 ; + +bt_dev_info (hdev,"Device setup in %llu usecs" , duration); + +return 0 ; +} +EXPORT_SYMBOL_GPL (btmtk_usb_setup); + +int btmtk_usb_shutdown (struct hci_dev *hdev) +{ +struct btmtk_hci_wmt_params wmt_params; +u8 param =0 ; +int err; + +/* Disable the device */ + wmt_params.op =BTMTK_WMT_FUNC_CTRL ; + wmt_params.flag =0 ; + wmt_params.dlen =sizeof (param); + wmt_params.data = ¶m; + wmt_params.status =NULL ; + + err =btmtk_usb_hci_wmt_sync (hdev, &wmt_params); +if (err <0 ) { +bt_dev_err (hdev,"Failed to send wmt func ctrl (%d)" , err); +return err; + } + +return 0 ; +} +EXPORT_SYMBOL_GPL (btmtk_usb_shutdown);MODULE_AUTHOR ("Sean Wang <[email protected]>" );MODULE_AUTHOR ("Mark Chen <[email protected]>" );
drivers/bluetooth/btmtk.h +19 -4
@@ -140,6 +140,8 @@ struct btmtk_hci_wmt_params {enum {BTMTK_TX_WAIT_VND_EVT , +BTMTK_FIRMWARE_LOADED , +BTMTK_HW_RESET_ACTIVE , };typedef int (*btmtk_reset_sync_func_t )(struct hci_dev *,void *);
@@ -152,6 +154,7 @@ struct btmtk_coredump_info { };struct btmtk_data { +const char *drv_name;unsigned long flags;u32 dev_id;btmtk_reset_sync_func_t reset_sync;
@@ -186,8 +189,11 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb);void btmtk_fw_get_filename (char *buf,size_t size,u32 dev_id,u32 fw_ver,u32 fw_flavor); -int btmtk_usb_hci_wmt_sync (struct hci_dev *hdev, -struct btmtk_hci_wmt_params *wmt_params); +int btmtk_usb_subsys_reset (struct hci_dev *hdev,u32 dev_id); + +int btmtk_usb_setup (struct hci_dev *hdev); + +int btmtk_usb_shutdown (struct hci_dev *hdev);#else static inline int btmtk_set_bdaddr(struct hci_dev *hdev,
@@ -228,8 +234,17 @@ static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, { } -static int btmtk_usb_hci_wmt_sync (struct hci_dev *hdev, -struct btmtk_hci_wmt_params *wmt_params) +static int btmtk_usb_subsys_reset (struct hci_dev *hdev,u32 dev_id) +{ +return -EOPNOTSUPP ; +} + +static int btmtk_usb_setup (struct hci_dev *hdev) +{ +return -EOPNOTSUPP ; +} + +static int btmtk_usb_shutdown (struct hci_dev *hdev) {return -EOPNOTSUPP ; }
drivers/bluetooth/btusb.c +14 -432
478 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 12/1266 Bluetooth: btmtk: Fix failed to send func ctrl for MediaTek devices.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit 67dba2c28fe0af7e25ea1aeade677162ed05310a ]
Use usb_autopm_get_interface() and usb_autopm_put_interface() in btmtk_usb_shutdown(), it could send func ctrl after enabling autosuspend.
Bluetooth: btmtk_usb_hci_wmt_sync() hci0: Execution of wmt command
timed out
Bluetooth: btmtk_usb_shutdown() hci0: Failed to send wmt func ctrl
(-110)
--- drivers/bluetooth/btmtk.c | 7 +++++++ net/bluetooth/rfcomm/tty.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/bluetooth/btmtk.c +7 -0
@@ -1140,10 +1140,15 @@ EXPORT_SYMBOL_GPL(btmtk_usb_setup);int btmtk_usb_shutdown (struct hci_dev *hdev) { +struct btmtk_data *data =hci_get_priv (hdev);struct btmtk_hci_wmt_params wmt_params;u8 param =0 ;int err; + err =usb_autopm_get_interface (data->intf); +if (err <0 ) +return err; +/* Disable the device */ wmt_params.op =BTMTK_WMT_FUNC_CTRL ; wmt_params.flag =0 ;
@@ -1154,9 +1159,11 @@ int btmtk_usb_shutdown(struct hci_dev *hdev) err =btmtk_usb_hci_wmt_sync (hdev, &wmt_params);if (err <0 ) {bt_dev_err (hdev,"Failed to send wmt func ctrl (%d)" , err); +usb_autopm_put_interface (data->intf);return err; } +usb_autopm_put_interface (data->intf);return 0 ; }EXPORT_SYMBOL_GPL (btmtk_usb_shutdown);
net/bluetooth/rfcomm/tty.c +2 -2
@@ -201,14 +201,14 @@ static ssize_t address_show(struct device *tty_dev, struct device_attribute *attr, char *buf) { struct rfcomm_dev *dev = dev_get_drvdata(tty_dev); -return sprintf (buf,"%pMR\n" , &dev->dst); +return sysfs_emit (buf,"%pMR\n" , &dev->dst); }static ssize_t channel_show (struct device *tty_dev,struct device_attribute *attr,char *buf) {struct rfcomm_dev *dev =dev_get_drvdata (tty_dev); -return sprintf (buf,"%d\n" , dev->channel); +return sysfs_emit (buf,"%d\n" , dev->channel); }static DEVICE_ATTR_RO (address);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 13/1266 Bluetooth: btmtk: Fix wait_on_bit_timeout interruption during shutdown
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiande Lu <[email protected]>
[ Upstream commit 099799fa9b76c5c02b49e07005a85117a25b01ea ]
During the shutdown process, an interrupt occurs that prematurely terminates the wait for the expected event. This change replaces TASK_INTERRUPTIBLE with TASK_UNINTERRUPTIBLE in the wait_on_bit_timeout call to ensure the shutdown process completes as intended without being interrupted by signals.
--- drivers/bluetooth/btmtk.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/bluetooth/btmtk.c +1 -6
@@ -640,12 +640,7 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,* WMT command. */ err =wait_on_bit_timeout (&data->flags,BTMTK_TX_WAIT_VND_EVT , -TASK_INTERRUPTIBLE ,HCI_INIT_TIMEOUT ); -if (err == -EINTR ) { -bt_dev_err (hdev,"Execution of wmt command interrupted" ); -clear_bit (BTMTK_TX_WAIT_VND_EVT , &data->flags); - goto err_free_wc; - } +TASK_UNINTERRUPTIBLE ,HCI_INIT_TIMEOUT );if (err) {bt_dev_err (hdev,"Execution of wmt command timed out" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 14/1266 userfaultfd: gate must_wait writability check on pte_present()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kiryl Shutsemau <[email protected]>
[ Upstream commit 8e80af52db652fbc41320eee45a4f73bc029faf2 ]
userfaultfd_must_wait() and userfaultfd_huge_must_wait() read the PTE without taking the page table lock and then apply pte_write() / huge_pte_write() to it. Those accessors decode bits from the present encoding only; on a swap or migration entry they read the offset bits that happen to share the same position and return an undefined result.
The intent of the check is "is this fault still WP-blocked?". A non-marker swap entry means the page is in transit -- the userfault context the original fault delivered against is no longer the same, and the swap-in or migration completion path will re-deliver a fresh fault if userspace still needs to handle it. Worst case under the current code the garbage write bit says "wait", and the thread stays asleep until a UFFDIO_WAKE that may never arrive.
Gate the writability check on pte_present() so the lockless re-check only inspects present-PTE bits when the entry is actually present. The non-present, non-marker case returns "don't wait" and lets the fault path retry.
[ kas: apply to fs/userfaultfd.c and fold the pte_present()/
huge_pte_present() gate into the existing writability checks; this tree predates the marker/return-style refactor of these functions ]
--- fs/userfaultfd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
fs/userfaultfd.c +12 -2
@@ -300,7 +300,12 @@ static inline bool userfaultfd_huge_must_wait(struct userfaultfd_ctx *ctx,*/ if (huge_pte_none_mostly (pte)) ret = true; -if (!huge_pte_write (pte) && (reason &VM_UFFD_WP )) +/* +* Gate the writability check on pte_present(): huge_pte_write() on a +* non-present migration entry decodes random offset bits. The +* migration completion path re-delivers the fault if still needed. +*/ +if (pte_present (pte) && !huge_pte_write (pte) && (reason &VM_UFFD_WP )) ret = true; out:return ret;
@@ -375,7 +380,12 @@ static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx, ptent =ptep_get (pte);if (pte_none_mostly (ptent)) ret = true; -if (!pte_write (ptent) && (reason &VM_UFFD_WP )) +/* +* Gate the writability check on pte_present(): pte_write() on a +* non-present swap/migration entry decodes random offset bits. The +* page-in path re-delivers the fault if it still needs userspace. +*/ +if (pte_present (ptent) && !pte_write (ptent) && (reason &VM_UFFD_WP )) ret = true;pte_unmap (pte);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 15/1266 perf: Fix dangling cgroup pointer in cpuctx backport
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Guan <[email protected]>
recently backport of ("perf: Fix dangling cgroup pointer in cpuctx") use a middle version, so aligned with the upstream commit:
commit 3b7a34aebbdf ("perf: Fix dangling cgroup pointer in cpuctx")
This is a fix for stable v6.6.143 backport commit, so no upstream commit.
--- kernel/events/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/events/core.c +2 -3
@@ -2384,10 +2384,9 @@ __perf_remove_from_context(struct perf_event *event,*/ if (flags &DETACH_EXIT ) state =PERF_EVENT_STATE_EXIT ; -if (flags &DETACH_DEAD ) { - event->pending_disable =1 ; +if (flags &DETACH_DEAD ) state =PERF_EVENT_STATE_DEAD ; - } +event_sched_out (event, ctx);if (event->state >PERF_EVENT_STATE_OFF )
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 16/1266 Bluetooth: btmtk: Fix btmtk.c undefined reference build error
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit f0c83a23fcbb424fdff5b38fbcdda3c04003a210 ]
MediaTek moved some usb interface related function to btmtk.c which may cause build failed if BT USB Kconfig wasn't enabled. Fix undefined reference by adding config check.
btmtk.c:(.text+0x89c): undefined reference to usb_alloc_urb' btmtk.c:(.text+0x8e3): undefined reference to usb_free_urb' btmtk.c:(.text+0x956): undefined reference to usb_free_urb' btmtk.c:(.text+0xa0e): undefined reference to usb_anchor_urb' btmtk.c:(.text+0xb43): undefined reference to usb_autopm_get_interface' btmtk.c:(.text+0xb7e): undefined reference to usb_autopm_put_interface' btmtk.c:(.text+0xf70): undefined reference to usb_disable_autosuspend' btmtk.c:(.text+0x133a): undefined reference to usb_control_msg'
--- drivers/bluetooth/btmtk.c | 2 ++ drivers/bluetooth/btmtk.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/bluetooth/btmtk.c +2 -0
@@ -438,6 +438,7 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb) }EXPORT_SYMBOL_GPL (btmtk_process_coredump); +#if IS_ENABLED (CONFIG_BT_HCIBTUSB_MTK )static void btmtk_usb_wmt_recv (struct urb *urb) {struct hci_dev *hdev = urb->context;
@@ -1162,6 +1163,7 @@ int btmtk_usb_shutdown(struct hci_dev *hdev) return 0; }EXPORT_SYMBOL_GPL (btmtk_usb_shutdown); +#endif MODULE_AUTHOR ("Sean Wang <[email protected]>" );MODULE_AUTHOR ("Mark Chen <[email protected]>" );
drivers/bluetooth/btmtk.h +2 -0
@@ -189,11 +189,13 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb);void btmtk_fw_get_filename (char *buf,size_t size,u32 dev_id,u32 fw_ver,u32 fw_flavor); +#if IS_ENABLED (CONFIG_BT_HCIBTUSB_MTK )int btmtk_usb_subsys_reset (struct hci_dev *hdev,u32 dev_id);int btmtk_usb_setup (struct hci_dev *hdev);int btmtk_usb_shutdown (struct hci_dev *hdev); +#endif #else static inline int btmtk_set_bdaddr(struct hci_dev *hdev,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 17/1266 slimbus: qcom-ngd-ctrl: Fix probe error path ordering
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
[ Upstream commit 2c22ff152d380ec3d3af099fa05d0ac5ca9b4c1e ]
qcom_slim_ngd_ctrl_probe() first registers the SSR callback then allocates the PDR context, as such the error path needs to come in opposite order to allow us to unroll each step.
--- drivers/slimbus/qcom-ngd-ctrl.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +5 -6
@@ -1663,22 +1663,21 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)if (IS_ERR (ctrl->pdr)) { ret =dev_err_probe (dev,PTR_ERR (ctrl->pdr),"Failed to init PDR handle\n" ); - goto err_pdr_alloc; + goto err_unregister_ssr; } pds =pdr_add_lookup (ctrl->pdr,"avs/audio" ,"msm/adsp/audio_pd" );if (IS_ERR (pds) &&PTR_ERR (pds) != -EALREADY ) { ret =dev_err_probe (dev,PTR_ERR (pds),"pdr add lookup failed\n" ); - goto err_pdr_lookup; + goto err_pdr_release; }return of_qcom_slim_ngd_register (dev, ctrl); -err_pdr_alloc: -qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb); - -err_pdr_lookup: +err_pdr_release:pdr_handle_release (ctrl->pdr); +err_unregister_ssr: +qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb);return ret; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 18/1266 slimbus: qcom-ngd-ctrl: Correct PDR and SSR cleanup ownership
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
[ Upstream commit 960b53a3f76fa214c2fc493734ae7b3c5e713bbf ]
PDR and SSR callbacks are registred from the controller probe function, but currently released from the child device's remove function.
The remove() function should only be unwinding what was done in the same device's probe() function.
--- drivers/slimbus/qcom-ngd-ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +3 -2
@@ -1686,6 +1686,9 @@ static int qcom_slim_ngd_ctrl_remove(struct platform_device *pdev) {struct qcom_slim_ngd_ctrl *ctrl =platform_get_drvdata (pdev); +pdr_handle_release (ctrl->pdr); +qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb); +qcom_slim_ngd_unregister (ctrl);return 0 ;
@@ -1697,8 +1700,6 @@ static int qcom_slim_ngd_remove(struct platform_device *pdev)pm_runtime_dont_use_autosuspend (&pdev->dev);pm_runtime_disable (&pdev->dev); -pdr_handle_release (ctrl->pdr); -qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb);qcom_slim_ngd_enable (ctrl, false);qcom_slim_ngd_exit_dma (ctrl);qcom_slim_ngd_qmi_svc_event_deinit (&ctrl->qmi);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 19/1266 slimbus: Convert to platform remove callback returning void
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
[ Upstream commit 880b33b0580c8ac9d0202b6e592cb116c99d1b65 ]
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove().
Trivially convert the slimbus drivers from always returning zero in the remove callback to the void returning variant.
Stable-dep-of: 2a9d50e9ea40 ("slimbus: qcom-ngd-ctrl: Register callbacks after creating the ngd")
--- drivers/slimbus/qcom-ctrl.c | 5 ++--- drivers/slimbus/qcom-ngd-ctrl.c | 11 ++++------- 2 files changed, 6 insertions(+), 10 deletions(-)
drivers/slimbus/qcom-ctrl.c +2 -3
@@ -626,7 +626,7 @@ static int qcom_slim_probe(struct platform_device *pdev)return ret; } -static int qcom_slim_remove (struct platform_device *pdev) +static void qcom_slim_remove (struct platform_device *pdev) {struct qcom_slim_ctrl *ctrl =platform_get_drvdata (pdev);
@@ -635,7 +635,6 @@ static int qcom_slim_remove(struct platform_device *pdev)clk_disable_unprepare (ctrl->rclk);clk_disable_unprepare (ctrl->hclk);destroy_workqueue (ctrl->rxwq); -return 0 ; }/*
@@ -721,7 +720,7 @@ static const struct of_device_id qcom_slim_dt_match[] = {static struct platform_driver qcom_slim_driver = { .probe = qcom_slim_probe, - .remove = qcom_slim_remove, + .remove_new = qcom_slim_remove, .driver = { .name ="qcom_slim_ctrl" , .of_match_table = qcom_slim_dt_match,
drivers/slimbus/qcom-ngd-ctrl.c +4 -7
@@ -1682,7 +1682,7 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)return ret; } -static int qcom_slim_ngd_ctrl_remove (struct platform_device *pdev) +static void qcom_slim_ngd_ctrl_remove (struct platform_device *pdev) {struct qcom_slim_ngd_ctrl *ctrl =platform_get_drvdata (pdev);
@@ -1690,11 +1690,9 @@ static int qcom_slim_ngd_ctrl_remove(struct platform_device *pdev)qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb);qcom_slim_ngd_unregister (ctrl); - -return 0 ; } -static int qcom_slim_ngd_remove (struct platform_device *pdev) +static void qcom_slim_ngd_remove (struct platform_device *pdev) {struct qcom_slim_ngd_ctrl *ctrl =platform_get_drvdata (pdev);
@@ -1708,7 +1706,6 @@ static int qcom_slim_ngd_remove(struct platform_device *pdev)kfree (ctrl->ngd); ctrl->ngd =NULL ; -return 0 ; }static int __maybe_unused qcom_slim_ngd_runtime_idle (struct device *dev)
@@ -1751,7 +1748,7 @@ static const struct dev_pm_ops qcom_slim_ngd_dev_pm_ops = {static struct platform_driver qcom_slim_ngd_ctrl_driver = { .probe = qcom_slim_ngd_ctrl_probe, - .remove = qcom_slim_ngd_ctrl_remove, + .remove_new = qcom_slim_ngd_ctrl_remove, .driver = { .name ="qcom,slim-ngd-ctrl" , .of_match_table = qcom_slim_ngd_dt_match,
@@ -1760,7 +1757,7 @@ static struct platform_driver qcom_slim_ngd_ctrl_driver = {static struct platform_driver qcom_slim_ngd_driver = { .probe = qcom_slim_ngd_probe, - .remove = qcom_slim_ngd_remove, + .remove_new = qcom_slim_ngd_remove, .driver = { .name =QCOM_SLIM_NGD_DRV_NAME , .pm = &qcom_slim_ngd_dev_pm_ops,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 20/1266 slimbus: qcom-ngd-ctrl: Register callbacks after creating the ngd
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
[ Upstream commit 2a9d50e9ea406e0c8735938484adc20515ef1b47 ]
When the remoteproc starts in parallel with the NGD driver being probed, or the remoteproc is already up when the PDR lookup is being registered, or in the theoretical event that we get an interrupt from the hardware, these callbacks will operate on uninitialized data. This result in issues to boot the affected boards.
One such example can be seen in the following fault, where qcom_slim_ngd_ssr_pdr_notify() schedules work on the NULL ngd_up_work.
[ 21.858578] ------------[ cut here ]------------ [ 21.858745] WARNING: kernel/workqueue.c:2338 at __queue_work+0x5e0/0x790, CPU#2: kworker/2:2/116 ... [ 21.859251] Call trace: [ 21.859255] __queue_work+0x5e0/0x790 (P) [ 21.859265] queue_work_on+0x6c/0xf0 [ 21.859273] qcom_slim_ngd_ssr_pdr_notify+0x110/0x150 [slim_qcom_ngd_ctrl] [ 21.859304] qcom_slim_ngd_ssr_notify+0x24/0x40 [slim_qcom_ngd_ctrl] [ 21.859318] notifier_call_chain+0xa4/0x230 [ 21.859329] srcu_notifier_call_chain+0x64/0xb8 [ 21.859338] ssr_notify_start+0x40/0x78 [qcom_common] [ 21.859355] rproc_start+0x130/0x230 [ 21.859367] rproc_boot+0x3d4/0x518
...
Move the enablement of interrupts, and the registration of SSR and PDR until after the NGD device has been registered.
This could be further refined by moving initialization to the control driver probe and by removing the platform driver model from the picture.
--- drivers/slimbus/qcom-ngd-ctrl.c | 45 +++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 19 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +26 -19
@@ -1612,6 +1612,7 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct qcom_slim_ngd_ctrl *ctrl; +int irq;int ret;struct pdr_service *pds;
@@ -1625,20 +1626,16 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)if (IS_ERR (ctrl->base))return PTR_ERR (ctrl->base); - ret =platform_get_irq (pdev,0 ); -if (ret <0 ) -return ret; + irq =platform_get_irq (pdev,0 ); +if (irq <0 ) +return irq; - ret =devm_request_irq (dev, ret, qcom_slim_ngd_interrupt, -IRQF_TRIGGER_HIGH ,"slim-ngd" , ctrl); + ret =devm_request_irq (dev, irq, qcom_slim_ngd_interrupt, +IRQF_TRIGGER_HIGH |IRQF_NO_AUTOEN , +"slim-ngd" , ctrl);if (ret)return dev_err_probe (&pdev->dev, ret,"request IRQ failed\n" ); - ctrl->nb.notifier_call = qcom_slim_ngd_ssr_notify; - ctrl->notifier =qcom_register_ssr_notifier ("lpass" , &ctrl->nb); -if (IS_ERR (ctrl->notifier)) -return PTR_ERR (ctrl->notifier); - ctrl->dev = dev; ctrl->framer.rootfreq =SLIM_ROOT_FREQ >>3 ; ctrl->framer.superfreq =
@@ -1660,24 +1657,34 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)init_completion (&ctrl->qmi_up); ctrl->pdr =pdr_handle_alloc (slim_pd_status, ctrl); -if (IS_ERR (ctrl->pdr)) { - ret =dev_err_probe (dev,PTR_ERR (ctrl->pdr), -"Failed to init PDR handle\n" ); - goto err_unregister_ssr; - } +if (IS_ERR (ctrl->pdr)) +return dev_err_probe (dev,PTR_ERR (ctrl->pdr),"Failed to init PDR handle\n" ); + + ret =of_qcom_slim_ngd_register (dev, ctrl); +if (ret) + goto err_pdr_release; pds =pdr_add_lookup (ctrl->pdr,"avs/audio" ,"msm/adsp/audio_pd" );if (IS_ERR (pds) &&PTR_ERR (pds) != -EALREADY ) { ret =dev_err_probe (dev,PTR_ERR (pds),"pdr add lookup failed\n" ); - goto err_pdr_release; + goto err_unregister_ngd; + } + + ctrl->nb.notifier_call = qcom_slim_ngd_ssr_notify; + ctrl->notifier =qcom_register_ssr_notifier ("lpass" , &ctrl->nb); +if (IS_ERR (ctrl->notifier)) { + ret =PTR_ERR (ctrl->notifier); + goto err_unregister_ngd; } -return of_qcom_slim_ngd_register (dev, ctrl); +enable_irq (irq); +return 0 ; + +err_unregister_ngd: +qcom_slim_ngd_unregister (ctrl); err_pdr_release:pdr_handle_release (ctrl->pdr); -err_unregister_ssr: -qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb);return ret; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 21/1266 drm/amd: Fix set but not used warnings
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <[email protected]>
[ Upstream commit 46791d147d3ab3262298478106ef2a52fc7192e2 ]
There are many set but not used warnings under drivers/gpu/drm/amd when compiling with the latest upstream mainline GCC:
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:305:18: warning: variable ‘p’ set but not used [-Wunused-but-set-variable=] drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:103:26: warning: variable ‘internal_reg_offset’ set but not used [-Wunused-but-set-variable=]
...
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:164:26: warning: variable ‘internal_reg_offset’ set but not used [-Wunused-but-set-variable=]
...
drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:445:13: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=] drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:875:21: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=]
Remove the variables actually not used or add __maybe_unused attribute for the variables actually used to fix them, compile tested only.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 3 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 ++++------- 3 files changed, 7 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -3
@@ -299,7 +299,6 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset, int pages) {unsigned t; -unsigned p;int i, j;u64 page_base;/* Starting from VEGA10, system bit must be 0 to mean invalid. */
@@ -313,8 +312,7 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset,return ; t = offset /AMDGPU_GPU_PAGE_SIZE ; - p = t /AMDGPU_GPU_PAGES_IN_CPU_PAGE ; -for (i =0 ; i < pages; i++, p++) { +for (i =0 ; i < pages; i++) { page_base = adev->dummy_page_addr;if (!adev->gart.ptr)continue ;
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +2 -1
@@ -101,7 +101,8 @@ #define SOC15_DPG_MODE_OFFSET(ip, inst_idx, reg) \ ({ \ - uint32_t internal_reg_offset, addr; \ + /* To avoid a -Wunused-but-set-variable warning. */ \ + uint32_t internal_reg_offset __maybe_unused, addr; \ bool video_range, video1_range, aon_range, aon1_range; \ \ addr = (adev->reg_offset[ip##_HWIP][inst_idx][reg##_BASE_IDX] + reg); \
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +4 -7
@@ -322,7 +322,6 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, struint i =0 , k =0 ;int ramp_up_num_steps =1 ;// TODO: Ramp is currently disabled. Reenable it. uint8_t visual_confirm_enabled; -int pipe_idx =0 ;if (dc ==NULL )return false;
@@ -336,7 +335,7 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru cmd.fw_assisted_mclk_switch.config_data.visual_confirm_enabled = visual_confirm_enabled;if (should_manage_pstate) { -for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];if (!pipe->stream)
@@ -350,7 +349,6 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru cmd.fw_assisted_mclk_switch.config_data.vactive_stretch_margin_us = dc->debug.fpo_vactive_margin_us;break ; } - pipe_idx++; } }
@@ -714,7 +712,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, bool enable) {uint8_t cmd_pipe_index =0 ; -uint32_t i, pipe_idx; +uint32_t i;uint8_t subvp_count =0 ;union dmub_rb_cmd cmd;struct pipe_ctx *subvp_pipes[2 ];
@@ -740,7 +738,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc,if (enable) {// For each pipe that is a "main" SUBVP pipe, fill in pipe data for DMUB SUBVP cmd -for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];if (!pipe->stream)
@@ -763,7 +761,6 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc,populate_subvp_cmd_vblank_pipe_info (dc, context, &cmd, pipe, cmd_pipe_index++); } - pipe_idx++; }if (subvp_count ==2 ) {update_subvp_prefetch_end_to_mall_start (dc, context, &cmd, subvp_pipes);
@@ -1054,4 +1051,4 @@ void dc_dmub_srv_enable_dpia_trace(const struct dc *dc) }DC_LOG_DEBUG ("Enabled DPIA trace\n" ); -} +}
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 22/1266 net: ip_gre: require CAP_NET_ADMIN in the device netns for changelink
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maoyi Xie <[email protected]>
[ Upstream commit 8165f7ff57d9667d2bb477ef6af83ede7fed4ad7 ]
A tunnel changelink() operates on at most two netns, dev_net(dev) and the tunnel link netns t->net. They differ once the device is created in or moved to a netns other than the one the request runs in. The rtnl changelink path checks CAP_NET_ADMIN only against dev_net(dev), so a caller privileged there but not in t->net can rewrite a tunnel that lives in t->net.
Add rtnl_dev_link_net_capable() next to rtnl_get_net_ns_capable() in net/core/rtnetlink.c. It requires CAP_NET_ADMIN in the link netns and is skipped when the link netns is dev_net(dev), where the rtnl path already checked it. The other patches in this series use the same helper.
Gate ipgre_changelink() and erspan_changelink() with it, at the top of the op before any attribute is parsed, because the parsers update live tunnel fields first. ipgre_netlink_parms() sets t->collect_md before ip_tunnel_changelink() runs.
Commit 8b484efd5cb4 ("ip6: vti: Use ip6_tnl.net in vti6_siocdevprivate().") added the same check on the ioctl path. This adds it on RTM_NEWLINK.
--- include/net/rtnetlink.h | 2 ++ net/core/rtnetlink.c | 8 ++++++++ net/ipv4/ip_gre.c | 6 ++++++ 3 files changed, 16 insertions(+)
include/net/rtnetlink.h +2 -0
@@ -211,6 +211,8 @@ int rtnl_configure_link(struct net_devicint rtnl_nla_parse_ifinfomsg (struct nlattr **tb,const struct nlattr *nla_peer,struct netlink_ext_ack *exterr);struct net *rtnl_get_net_ns_capable (struct sock *sk,int netnsid); +bool rtnl_dev_link_net_capable (const struct net_device *dev, +const struct net *link_net);#define MODULE_ALIAS_RTNL_LINK (kind) MODULE_ALIAS("rtnl-link-" kind)
net/core/rtnetlink.c +8 -0
@@ -2157,6 +2157,14 @@ struct net *rtnl_get_net_ns_capable(stru }EXPORT_SYMBOL_GPL (rtnl_get_net_ns_capable); +bool rtnl_dev_link_net_capable (const struct net_device *dev, +const struct net *link_net) +{ +return net_eq (link_net,dev_net (dev)) || +ns_capable (link_net->user_ns,CAP_NET_ADMIN ); +} +EXPORT_SYMBOL_GPL (rtnl_dev_link_net_capable); +static int rtnl_valid_dump_ifinfo_req (const struct nlmsghdr *nlh,bool strict_check,struct nlattr **tb,struct netlink_ext_ack *extack)
net/ipv4/ip_gre.c +6 -0
@@ -1412,6 +1412,9 @@ static int ipgre_changelink(struct net_dstruct ip_tunnel_parm p;int err; +if (!rtnl_dev_link_net_capable (dev, t->net)) +return -EPERM ; + err =ipgre_newlink_encap_setup (dev, data);if (err)return err;
@@ -1441,6 +1444,9 @@ static int erspan_changelink(struct net_struct ip_tunnel_parm p;int err; +if (!rtnl_dev_link_net_capable (dev, t->net)) +return -EPERM ; + err =ipgre_newlink_encap_setup (dev, data);if (err)return err;
Greg Kroah-Hartman
maintainerPATCH 23/1266 device property: initialize the remaining fields of fwnode_handle in fwnode_init()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
[ Upstream commit 7eba000621fff223dd7bab484d48918c7c77a307 ]
If a firmware node is allocated on the stack (for instance: temporary software node whose life-time we control) or on the heap - but using a non-zeroing allocation function - and initialized using fwnode_init(), its secondary pointer will contain uninitialized memory which likely will be neither NULL nor IS_ERR() and so may end up being dereferenced (for example: in dev_to_swnode()). Set fwnode->secondary to NULL on initialization. While at it: initialize the remaining fields of struct fwnode_handle too just to be sure.
--- include/linux/fwnode.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/fwnode.h +2 -0
@@ -195,8 +195,10 @@ static inline void fwnode_init(struct fw { fwnode->secondary =NULL ; fwnode->ops = ops; + fwnode->dev =NULL ;INIT_LIST_HEAD (&fwnode->consumers);INIT_LIST_HEAD (&fwnode->suppliers); + fwnode->flags =0 ; } static inline void fwnode_set_flag(struct fwnode_handle *fwnode,
Greg Kroah-Hartman
maintainerPATCH 24/1266 f2fs: validate orphan inode entry count
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenjie Qi <[email protected]>
[ Upstream commit 846c499a65816d13f1186e3090e825e8bb8bcb8b ]
f2fs_recover_orphan_inodes() trusts the orphan block entry_count when replaying orphan inodes from the checkpoint pack. A corrupted entry_count larger than F2FS_ORPHANS_PER_BLOCK makes the recovery loop read past the ino[] array and interpret footer or following data as inode numbers.
On a crafted image, mounting an unpatched kernel can drive orphan recovery into f2fs_bug_on() and panic the kernel. Validate entry_count before consuming entries so corrupted checkpoint data fails the mount with -EFSCORRUPTED and requests fsck instead.
Set ERROR_INCONSISTENT_ORPHAN as well, so the corruption reason can be recorded in the superblock s_errors[] field. This gives fsck a persistent hint even though mount-time orphan recovery failure may leave no chance to persist SBI_NEED_FSCK through a checkpoint.
--- fs/f2fs/checkpoint.c | 14 +++++++++++++- include/linux/f2fs_fs.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-)
fs/f2fs/checkpoint.c +13 -1
@@ -742,6 +742,7 @@ int f2fs_recover_orphan_inodes(struct f2for (i =0 ; i < orphan_blocks; i++) {struct page *page;struct f2fs_orphan_block *orphan_blk; +unsigned int entry_count; page =f2fs_get_meta_page (sbi, start_blk + i);if (IS_ERR (page)) {
@@ -750,7 +751,18 @@ int f2fs_recover_orphan_inodes(struct f2 } orphan_blk = (struct f2fs_orphan_block *)page_address (page); -for (j =0 ; j <le32_to_cpu (orphan_blk->entry_count); j++) { + entry_count =le32_to_cpu (orphan_blk->entry_count); +if (entry_count >F2FS_ORPHANS_PER_BLOCK ) { +f2fs_err (sbi,"invalid orphan inode entry count %u" , + entry_count); +set_sbi_flag (sbi,SBI_NEED_FSCK ); +f2fs_handle_error (sbi,ERROR_INCONSISTENT_ORPHAN ); + err = -EFSCORRUPTED ; +f2fs_put_page (page,1 ); + goto out; + } + +for (j =0 ; j < entry_count; j++) {nid_t ino =le32_to_cpu (orphan_blk->ino[j]); err =recover_orphan_inode (sbi, ino);
include/linux/f2fs_fs.h +1 -0
@@ -102,6 +102,7 @@ enum f2fs_error {ERROR_CORRUPTED_XATTR ,ERROR_INVALID_NODE_REFERENCE ,ERROR_INCONSISTENT_NAT , +ERROR_INCONSISTENT_ORPHAN , ERROR_MAX, };
Greg Kroah-Hartman
maintainerPATCH 25/1266 f2fs: atomic: fix UAF issue on f2fs_inode_info.atomic_inode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit e0288584baa5dc41df4a829a023c4c1b33fe53d7 ]
- ioctl(F2FS_IOC_GARBAGE_COLLECT_RANGE) - shrink
- f2fs_gc
- gc_data_segment
- ra_data_block(cow_inode)
- mapping = F2FS_I(inode)->atomic_inode->i_mapping
: f2fs_is_cow_file(cow_inode) is true
- f2fs_evict_inode(atomic_inode)
- clear_inode_flag(fi->cow_inode, FI_COW_FILE)
- F2FS_I(fi->cow_inode)->atomic_inode = NULL
...
- truncate_inode_pages_final(atomic_inode)
- f2fs_grab_cache_folio(mapping)
: create folio in atomic_inode->mapping
- clear_inode(atomic_inode)
- BUG_ON(atomic_inode->i_data.nrpages)
We need to add a reference on fi->atomic_inode before using its mapping field during garbage collection, otherwise, it will cause UAF issue.
--- fs/f2fs/gc.c | 50 ++++++++++++++++++++++++++++++++++++++++++-------- fs/f2fs/inode.c | 11 ++++++++--- 2 files changed, 50 insertions(+), 11 deletions(-)
fs/f2fs/gc.c +42 -8
@@ -1173,8 +1173,8 @@ static bool is_alive(struct f2fs_sb_infostatic int ra_data_block (struct inode *inode,pgoff_t index) {struct f2fs_sb_info *sbi =F2FS_I_SB (inode); -struct address_space *mapping =f2fs_is_cow_file (inode) ? -F2FS_I (inode)->atomic_inode->i_mapping : inode->i_mapping; +struct address_space *mapping = inode->i_mapping; +struct inode *atomic_inode =NULL ;struct dnode_of_data dn;struct page *page;struct f2fs_io_info fio = {
@@ -1189,9 +1189,22 @@ static int ra_data_block(struct inode *i };int err; +f2fs_down_read (&F2FS_I (inode)->i_sem); +if (f2fs_is_cow_file (inode)) { + atomic_inode =igrab (F2FS_I (inode)->atomic_inode); +if (!atomic_inode) { +f2fs_up_read (&F2FS_I (inode)->i_sem); +return -EBUSY ; + } + mapping = atomic_inode->i_mapping; + } +f2fs_up_read (&F2FS_I (inode)->i_sem); + page =f2fs_grab_cache_page (mapping, index, true); -if (!page) -return -ENOMEM ; +if (!page) { + err = -ENOMEM ; + goto out_iput; + }if (f2fs_lookup_read_extent_cache_block (inode, index, &dn.data_blkaddr)) {
@@ -1250,11 +1263,16 @@ got_it:f2fs_update_iostat (sbi, inode,FS_DATA_READ_IO ,F2FS_BLKSIZE );f2fs_update_iostat (sbi,NULL ,FS_GDATA_READ_IO ,F2FS_BLKSIZE ); +if (atomic_inode) +iput (atomic_inode);return 0 ; put_encrypted_page:f2fs_put_page (fio.encrypted_page,1 ); put_page:f2fs_put_page (page,1 ); +out_iput: +if (atomic_inode) +iput (atomic_inode);return err; }
@@ -1265,8 +1283,8 @@ put_page:static int move_data_block (struct inode *inode,block_t bidx,int gc_type,unsigned int segno,int off) { -struct address_space *mapping =f2fs_is_cow_file (inode) ? -F2FS_I (inode)->atomic_inode->i_mapping : inode->i_mapping; +struct address_space *mapping = inode->i_mapping; +struct inode *atomic_inode =NULL ;struct f2fs_io_info fio = { .sbi =F2FS_I_SB (inode), .ino = inode->i_ino,
@@ -1288,10 +1306,23 @@ static int move_data_block(struct inode (fio.sbi->gc_mode !=GC_URGENT_HIGH ) ?CURSEG_ALL_DATA_ATGC :CURSEG_COLD_DATA ; +f2fs_down_read (&F2FS_I (inode)->i_sem); +if (f2fs_is_cow_file (inode)) { + atomic_inode =igrab (F2FS_I (inode)->atomic_inode); +if (!atomic_inode) { +f2fs_up_read (&F2FS_I (inode)->i_sem); +return -EBUSY ; + } + mapping = atomic_inode->i_mapping; + } +f2fs_up_read (&F2FS_I (inode)->i_sem); +/* do not read out */ page =f2fs_grab_cache_page (mapping, bidx, false); -if (!page) -return -ENOMEM ; +if (!page) { + err = -ENOMEM ; + goto out_iput; + }if (!check_valid_map (F2FS_I_SB (inode), segno, off)) { err = -ENOENT ;
@@ -1413,6 +1444,9 @@ put_out:f2fs_put_dnode (&dn); out:f2fs_put_page (page,1 ); +out_iput: +if (atomic_inode) +iput (atomic_inode);return err; }
fs/f2fs/inode.c +8 -3
@@ -842,10 +842,15 @@ void f2fs_evict_inode(struct inode *inodf2fs_abort_atomic_write (inode, true);if (fi->cow_inode &&f2fs_is_cow_file (fi->cow_inode)) { -clear_inode_flag (fi->cow_inode,FI_COW_FILE ); -F2FS_I (fi->cow_inode)->atomic_inode =NULL ; -iput (fi->cow_inode); +struct inode *cow_inode = fi->cow_inode; + +f2fs_down_write (&F2FS_I (cow_inode)->i_sem); +clear_inode_flag (cow_inode,FI_COW_FILE ); +F2FS_I (cow_inode)->atomic_inode =NULL ; fi->cow_inode =NULL ; +f2fs_up_write (&F2FS_I (cow_inode)->i_sem); + +iput (cow_inode); }trace_f2fs_evict_inode (inode);
Greg Kroah-Hartman
maintainerPATCH 26/1266 f2fs: bound i_inline_xattr_size for non-inline-xattr inodes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryam Vargas <[email protected]>
[ Upstream commit 378acf3cf19b6af6cba55e8dd1154c4e1504bae8 ]
When the flexible_inline_xattr feature is enabled, do_read_inode() loads the on-disk i_inline_xattr_size unconditionally:
if (f2fs_sb_has_flexible_inline_xattr(sbi)) fi->i_inline_xattr_size = le16_to_cpu(ri->i_inline_xattr_size);
but sanity_check_inode() only range-checks it when the inode also has the FI_INLINE_XATTR flag set. An inode that carries an inline dentry or inline data but not FI_INLINE_XATTR -- the normal layout for an inline directory -- therefore keeps a fully attacker-controlled i_inline_xattr_size from a crafted image.
get_inline_xattr_addrs() returns that value with no flag gating, so it feeds the inode geometry:
MAX_INLINE_DATA() = 4 * (CUR_ADDRS_PER_INODE - i_inline_xattr_size - 1) NR_INLINE_DENTRY() = MAX_INLINE_DATA() * BITS_PER_BYTE / (...)
addrs_per_page() = CUR_ADDRS_PER_INODE - i_inline_xattr_size
A large i_inline_xattr_size drives MAX_INLINE_DATA() and NR_INLINE_DENTRY() negative, so make_dentry_ptr_inline() sets d->max (int) to a negative value. The inline directory walk then compares an unsigned long bit_pos against that negative d->max, which is promoted to a huge unsigned bound, and reads far past the inline area:
while (bit_pos < d->max) /* fs/f2fs/dir.c */ ... test_bit_le(bit_pos, d->bitmap) / d->dentry[bit_pos] ...
Mounting a crafted image and reading such a directory triggers an out-of-bounds read in f2fs_fill_dentries(); the same underflow also corrupts ADDRS_PER_INODE for regular files.
Validate i_inline_xattr_size against MAX_INLINE_XATTR_SIZE whenever the flexible_inline_xattr feature is enabled -- i.e. whenever the value is loaded from disk and consumed -- and keep the lower MIN_INLINE_XATTR_SIZE bound gated on inodes that actually carry an inline xattr, so legitimate inodes with i_inline_xattr_size == 0 are still accepted.
--- fs/f2fs/inode.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
fs/f2fs/inode.c +10 -9
@@ -307,15 +307,6 @@ static bool sanity_check_inode(struct in F2FS_TOTAL_EXTRA_ATTR_SIZE);return false; } -if (f2fs_sb_has_flexible_inline_xattr (sbi) && -f2fs_has_inline_xattr (inode) && - (!fi->i_inline_xattr_size || - fi->i_inline_xattr_size >MAX_INLINE_XATTR_SIZE )) { -f2fs_warn (sbi,"%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, max: %zu" , - __func__, inode->i_ino, fi->i_inline_xattr_size, -MAX_INLINE_XATTR_SIZE ); -return false; - }if (f2fs_sb_has_compression (sbi) && fi->i_flags &F2FS_COMPR_FL && F2FS_FITS_IN_INODE(ri, fi->i_extra_isize,
@@ -329,6 +320,16 @@ static bool sanity_check_inode(struct inreturn false; } +if (f2fs_sb_has_flexible_inline_xattr (sbi) && + (fi->i_inline_xattr_size >MAX_INLINE_XATTR_SIZE || + (f2fs_has_inline_xattr (inode) && + fi->i_inline_xattr_size <MIN_INLINE_XATTR_SIZE ))) { +f2fs_warn (sbi,"%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, min: %zu, max: %zu" , + __func__, inode->i_ino, fi->i_inline_xattr_size, +MIN_INLINE_XATTR_SIZE ,MAX_INLINE_XATTR_SIZE ); +return false; + } +if (!f2fs_sb_has_extra_attr (sbi)) {if (f2fs_sb_has_project_quota (sbi)) { f2fs_warn(sbi, "%s: corrupted inode ino=%lx, wrong feature flag: %u, run fsck to fix.",
Greg Kroah-Hartman
maintainerPATCH 27/1266 f2fs: fix potential deadlock in f2fs_balance_fs()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruipeng Qi <[email protected]>
[ Upstream commit dd3114870771562036fdcf5abe813956f36d224d ]
When the f2fs filesystem space is nearly exhausted, we encounter deadlock issues as below:
INFO: task A:1890 blocked for more than 120 seconds.
Tainted: G O 6.12.41-g3fe07ddf05ab #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:A state:D stack:0 pid:1890 tgid:1626 ppid:1153 flags:0x00000204
Call trace:
__switch_to+0xf4/0x158
__schedule+0x27c/0x908
schedule+0x3c/0x118
io_schedule+0x44/0x68
folio_wait_bit_common+0x174/0x370
folio_wait_bit+0x20/0x38
folio_wait_writeback+0x54/0xc8
truncate_inode_partial_folio+0x70/0x1e0
truncate_inode_pages_range+0x1b0/0x450
truncate_pagecache+0x54/0x88
f2fs_file_write_iter+0x3e8/0xb80
do_iter_readv_writev+0xf0/0x1e0
vfs_writev+0x138/0x2c8
do_writev+0x88/0x130
__arm64_sys_writev+0x28/0x40
invoke_syscall+0x50/0x120
el0_svc_common.constprop.0+0xc8/0xf0
do_el0_svc+0x24/0x38
el0_svc+0x30/0xf8
el0t_64_sync_handler+0x120/0x130
el0t_64_sync+0x190/0x198
INFO: task kworker/u8:11:2680853 blocked for more than 120 seconds.
Tainted: G O 6.12.41-g3fe07ddf05ab #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:11 state:D stack:0 pid:2680853 tgid:2680853 ppid:2 flags:0x00000208
Workqueue: writeback wb_workfn (flush-254:0)
Call trace:
__switch_to+0xf4/0x158
__schedule+0x27c/0x908
schedule+0x3c/0x118
io_schedule+0x44/0x68
folio_wait_bit_common+0x174/0x370
__filemap_get_folio+0x214/0x348
pagecache_get_page+0x20/0x70
f2fs_get_read_data_page+0x150/0x3e8
f2fs_get_lock_data_page+0x2c/0x160
move_data_page+0x50/0x478
do_garbage_collect+0xd38/0x1528
f2fs_gc+0x240/0x7e0
f2fs_balance_fs+0x1a0/0x208
f2fs_write_single_data_page+0x6e4/0x730
f2fs_write_cache_pages+0x378/0x9b0
f2fs_write_data_pages+0x2e4/0x388
do_writepages+0x8c/0x2c8
__writeback_single_inode+0x4c/0x498
writeback_sb_inodes+0x234/0x4a8
__writeback_inodes_wb+0x58/0x118
wb_writeback+0x2f8/0x3c0
wb_workfn+0x2c4/0x508
process_one_work+0x180/0x408
worker_thread+0x258/0x368
kthread+0x118/0x128
ret_from_fork+0x10/0x200
INFO: task kworker/u8:8:2641297 blocked for more than 120 seconds.
Tainted: G O 6.12.41-g3fe07ddf05ab #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:8 state:D stack:0 pid:2641297 tgid:2641297 ppid:2 flags:0x00000208
Workqueue: writeback wb_workfn (flush-254:0)
Call trace:
__switch_to+0xf4/0x158
__schedule+0x27c/0x908
rt_mutex_schedule+0x30/0x60
__rt_mutex_slowlock_locked.constprop.0+0x460/0x8a8
rwbase_write_lock+0x24c/0x378
down_write+0x1c/0x30
f2fs_balance_fs+0x184/0x208
f2fs_write_inode+0xf4/0x328
__writeback_single_inode+0x370/0x498
writeback_sb_inodes+0x234/0x4a8
__writeback_inodes_wb+0x58/0x118
wb_writeback+0x2f8/0x3c0
wb_workfn+0x2c4/0x508
process_one_work+0x180/0x408
worker_thread+0x258/0x368
kthread+0x118/0x128
ret_from_fork+0x10/0x20
INFO: task B:1902 blocked for more than 120 seconds.
Tainted: G O 6.12.41-g3fe07ddf05ab #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:B state:D stack:0 pid:1902 tgid:1626 ppid:1153 flags:0x0000020c
Call trace:
__switch_to+0xf4/0x158
__schedule+0x27c/0x908
rt_mutex_schedule+0x30/0x60
__rt_mutex_slowlock_locked.constprop.0+0x460/0x8a8
rwbase_write_lock+0x24c/0x378
down_write+0x1c/0x30
f2fs_balance_fs+0x184/0x208
f2fs_map_blocks+0x94c/0x1110
f2fs_file_write_iter+0x228/0xb80
do_iter_readv_writev+0xf0/0x1e0
vfs_writev+0x138/0x2c8
do_writev+0x88/0x130
__arm64_sys_writev+0x28/0x40
invoke_syscall+0x50/0x120
el0_svc_common.constprop.0+0xc8/0xf0
do_el0_svc+0x24/0x38
el0_svc+0x30/0xf8
el0t_64_sync_handler+0x120/0x130
el0t_64_sync+0x190/0x198
INFO: task sync:2769849 blocked for more than 120 seconds.
Tainted: G O 6.12.41-g3fe07ddf05ab #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:sync state:D stack:0 pid:2769849 tgid:2769849 ppid:736 flags:0x0000020c
Call trace:
__switch_to+0xf4/0x158
__schedule+0x27c/0x908
schedule+0x3c/0x118
wb_wait_for_completion+0xb0/0xe8
sync_inodes_sb+0xc8/0x2b0
sync_inodes_one_sb+0x24/0x38
iterate_supers+0xa8/0x138
ksys_sync+0x54/0xc8
__arm64_sys_sync+0x18/0x30
invoke_syscall+0x50/0x120
el0_svc_common.constprop.0+0xc8/0xf0
do_el0_svc+0x24/0x38
el0_svc+0x30/0xf8
el0t_64_sync_handler+0x120/0x130
el0t_64_sync+0x190/0x198The root cause is a potential deadlock between the following tasks:
kworker/u8:11 Thread A
- f2fs_write_single_data_page
- f2fs_do_write_data_page
- folio_start_writeback(X)
- f2fs_outplace_write_data
- bio_add_folio(X)
- folio_unlock(X)
- truncate_inode_pages_range
- __filemap_get_folio(X, FGP_LOCK)
- truncate_inode_partial_folio(X)
- folio_wait_writeback(X)
- f2fs_balance_fs
- f2fs_gc
- do_garbage_collect
- move_data_page
- f2fs_get_lock_data_page
- __filemap_get_folio(X, FGP_LOCK)
Both threads try to access folio X. Thread A holds the lock but waits for writeback, while kworker waits for the lock. This causes a deadlock.
Other threads also enter D state, waiting for locks such as gc_lock and writepages.
OPU/IPU DATA folio are all affected by this issue. To avoid such potential deadlocks, always commit these cached folios before triggering f2fs_gc() in f2fs_balance_fs().
Stable-dep-of: 8b4468ec023d ("f2fs: fix potential deadlock in gc_merge path of f2fs_balance_fs()")
--- fs/f2fs/data.c | 29 +++++++++++++++++++++++++++++ fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.c | 8 ++++++++ 3 files changed, 38 insertions(+)
fs/f2fs/data.c +29 -0
@@ -887,6 +887,35 @@ void f2fs_submit_merged_ipu_write(struct } } +void f2fs_submit_all_merged_ipu_writes (struct f2fs_sb_info *sbi) +{ +struct bio_entry *be, *tmp; +struct f2fs_bio_info *io; +enum temp_type temp; + +for (temp =HOT ; temp <NR_TEMP_TYPE ; temp++) { +LIST_HEAD (list); + + io = sbi->write_io[DATA ] + temp; + +/* A lockless list_empty() check is safe here: any bios from +* other kworkers that we miss will be submitted by those +* kworkers accordingly. +*/ +if (list_empty (&io->bio_list)) +continue ; + +f2fs_down_write (&io->bio_list_lock); +list_splice_init (&io->bio_list, &list); +f2fs_up_write (&io->bio_list_lock); + +list_for_each_entry_safe (be, tmp, &list, list) { +f2fs_submit_write_bio (sbi, be->bio,DATA ); +del_bio_entry (be); + } + } +} +int f2fs_merge_page_bio (struct f2fs_io_info *fio) {struct bio *bio = *fio->bio;
fs/f2fs/f2fs.h +1 -0
@@ -3866,6 +3866,7 @@ void f2fs_submit_merged_write_cond(struc nid_t ino, enum page_type type);void f2fs_submit_merged_ipu_write (struct f2fs_sb_info *sbi,struct bio **bio,struct page *page); +void f2fs_submit_all_merged_ipu_writes (struct f2fs_sb_info *sbi);void f2fs_flush_merged_writes (struct f2fs_sb_info *sbi);int f2fs_submit_page_bio (struct f2fs_io_info *fio);int f2fs_merge_page_bio (struct f2fs_io_info *fio);
fs/f2fs/segment.c +8 -0
@@ -450,6 +450,14 @@ void f2fs_balance_fs(struct f2fs_sb_info .should_migrate_blocks = false, .err_gc_skipped = false, .nr_free_secs = 1 }; + +/* +* Submit all cached OPU/IPU DATA bios before triggering +* foreground GC to avoid potential deadlocks. +*/ +f2fs_submit_merged_write (sbi,DATA ); +f2fs_submit_all_merged_ipu_writes (sbi); +f2fs_down_write (&sbi->gc_lock);stat_inc_gc_call_count (sbi,FOREGROUND );f2fs_gc (sbi, &gc_control);
Greg Kroah-Hartman
maintainerPATCH 28/1266 f2fs: fix potential deadlock in gc_merge path of f2fs_balance_fs()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit 8b4468ec023d0d1b4669dfb867588997cc03a06b ]
When we mount device w/ gc_merge mount option, we may suffer below potential deadlock:
Kworker GC trehad Truncator
- f2fs_write_cache_pages
- f2fs_write_single_data_page
- f2fs_do_write_data_page
- folio_start_writeback --- set writeback flag on folio
- f2fs_outplace_write_data
: cached folio in internal bio cache
- f2fs_balance_fs
- wake_up(gc_thread)
: wake up gc thread to run foreground GC
- finish_wait(fggc_wq)
: wait on the waitqueue --- wait on GC thread to finish the work
- truncate_inode_pages_range
- __filemap_get_folio(, FGP_LOCK) --- lock folio
- truncate_inode_partial_folio
- folio_wait_writeback --- wait on writeback being cleared
- do_garbage_collect
- move_data_page
- f2fs_get_lock_data_folio
- lock on folio --- blocked on folio's lock
In order to avoid such deadlock, let's call below functions to commit cached bios in GC_MERGE path of f2fs_balance_fs() as the same as we did in NOGC_MERGE path.
- f2fs_submit_merged_write(sbi, DATA);
- f2fs_submit_all_merged_ipu_writes(sbi);
Reported: Sandeep Dhavale <[email protected]>
--- fs/f2fs/segment.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
fs/f2fs/segment.c +7 -7
@@ -433,6 +433,13 @@ void f2fs_balance_fs(struct f2fs_sb_infoif (has_enough_free_secs (sbi,0 ,0 ))return ; +/* +* Submit all cached OPU/IPU DATA bios before triggering +* foreground GC to avoid potential deadlocks. +*/ +f2fs_submit_merged_write (sbi,DATA ); +f2fs_submit_all_merged_ipu_writes (sbi); +if (test_opt (sbi,GC_MERGE ) && sbi->gc_thread && sbi->gc_thread->f2fs_gc_task) {DEFINE_WAIT (wait);
@@ -451,13 +458,6 @@ void f2fs_balance_fs(struct f2fs_sb_info .err_gc_skipped = false, .nr_free_secs = 1 }; -/* -* Submit all cached OPU/IPU DATA bios before triggering -* foreground GC to avoid potential deadlocks. -*/ -f2fs_submit_merged_write (sbi,DATA ); -f2fs_submit_all_merged_ipu_writes (sbi); -f2fs_down_write (&sbi->gc_lock);stat_inc_gc_call_count (sbi,FOREGROUND );f2fs_gc (sbi, &gc_control);
Greg Kroah-Hartman
maintainerPATCH 29/1266 f2fs: fix listxattr handling of corrupted xattr entries
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keshav Verma <[email protected]>
[ Upstream commit 5ef5bc304f23c3fe255d4936472378dcb74d0e94 ]
Validate the xattr entry before reading its fields in f2fs_listxattr(). Return -EFSCORRUPTED when the entry is outside the valid xattr storage area instead of returning a successful partial result.
--- fs/f2fs/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/f2fs/xattr.c +3 -3
@@ -581,8 +581,6 @@ ssize_t f2fs_listxattr(struct dentry *desize_t prefix_len;size_t size; - prefix =f2fs_xattr_prefix (entry->e_name_index, dentry); -if ((void *)(entry) +sizeof (__u32) > last_base_addr || (void *)XATTR_NEXT_ENTRY (entry) > last_base_addr) { f2fs_err(F2FS_I_SB(inode), "list inode (%lu) has corrupted xattr",
@@ -590,9 +588,11 @@ ssize_t f2fs_listxattr(struct dentry *deset_sbi_flag (F2FS_I_SB (inode),SBI_NEED_FSCK );f2fs_handle_error (F2FS_I_SB (inode),ERROR_CORRUPTED_XATTR ); -break ; + error = -EFSCORRUPTED ; + goto cleanup; } + prefix =f2fs_xattr_prefix (entry->e_name_index, dentry);if (!prefix)continue ;
Greg Kroah-Hartman
maintainerPATCH 30/1266 KVM: Replace guest-triggerable BUG_ON() in ioeventfd datamatch with get_unaligned()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
[ Upstream commit f1edbed787ba67988ed34e0132ca128b052b6ce8 ]
Drop a BUG_ON() that has been reachable since it was first added, way back in 2009, and instead use get_unaligned() to perform potentially-unaligned accesses.
For a given store, KVM x86's emulator tracks the entire value in the destination operand, x86_emulate_ctxt.dst. If the destination is memory, and the target splits multiple pages and/or is emulated MMIO, then KVM handles each fragment independently. E.g. on a page split starting at page offset 0xffc, KVM writes 4 bytes to the first page, then the remaining bytes to the second page, using ctxt->dst as the source for both (with appropriate offsets).
If the destination splits a page *and* hits emulated MMIO on the second page, then KVM will complete the write to the first page, then emulate the MMIO access to the second page. If there is a datamatch-enabled ioeventfd at offset 0 of the second page, then KVM will process the remainder of the store as a potential ioeventfd signal.
Putting it all together, if the guest emits a store that splits a page starting at page offset N, and the second page has a datamatch-enabled ioeventfd at offset 0, then KVM will check for datamatch using &dst.valptr[N] as the source. Due to dst (and thus dst.valptr) being 32-byte aligned, if N is not aligned to @len, the BUG_ON() fires.
E.g. with a 16-byte store at page offset 0xffc, to an ioeventfd of len 8, all initial checks in ioeventfd_in_range() will succeed, and the BUG_ON() fires due to @val being 4-byte aligned, but not 8-byte aligned.
------------[ cut here ]------------ kernel BUG at arch/x86/kvm/../../../virt/kvm/eventfd.c:783! Oops: invalid opcode: 0000 [#1] SMP CPU: 0 UID: 1000 PID: 615 Comm: repro Not tainted 7.1.0-rc2-ff238429d1ea #365 PREEMPT Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:ioeventfd_write+0x6c/0x70 [kvm] Call Trace: <TASK> __kvm_io_bus_write+0x85/0xb0 [kvm] kvm_io_bus_write+0x53/0x80 [kvm] vcpu_mmio_write+0x66/0xf0 [kvm] emulator_read_write_onepage+0x12a/0x540 [kvm] emulator_read_write+0x109/0x2b0 [kvm] x86_emulate_insn+0x4f8/0xfb0 [kvm] x86_emulate_instruction+0x181/0x790 [kvm] kvm_mmu_page_fault+0x313/0x630 [kvm] vmx_handle_exit+0x18a/0x590 [kvm_intel] kvm_arch_vcpu_ioctl_run+0xc81/0x1c90 [kvm] kvm_vcpu_ioctl+0x2d5/0x970 [kvm] __x64_sys_ioctl+0x8a/0xd0 do_syscall_64+0xb7/0x890 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7f19c931a9bf </TASK> Modules linked in: kvm_intel kvm irqbypass ---[ end trace 0000000000000000 ]---
In a perfect world, the fix would be to simply delete the BUG_ON(), as KVM x86 doesn't perform alignment checks on "normal" memory accesses at CPL0. Sadly, C99 ruins all the fun; while the x86 architecture plays nice, dereferencing an unaligned pointer directly is undefined behavior in C, e.g. triggers splats when running with CONFIG_UBSAN_ALIGNMENT=y.
Message-ID: <[email protected]>
--- virt/kvm/eventfd.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
virt/kvm/eventfd.c +5 -7
@@ -24,6 +24,7 @@#include <linux/slab.h> #include <linux/seqlock.h> #include <linux/irqbypass.h> +#include <asm/unaligned.h> #include <trace/events/kvm.h> #include <kvm/iodev.h>
@@ -757,21 +758,18 @@ ioeventfd_in_range(struct _ioeventfd *p,return true;/* otherwise, we have to actually compare the data */ - -BUG_ON (!IS_ALIGNED ((unsigned long )val, len)); -switch (len) {case 1 : - _val = *(u8 *)val; + _val =get_unaligned ((u8 *)val);break ;case 2 : - _val = *(u16 *)val; + _val =get_unaligned ((u16 *)val);break ;case 4 : - _val = *(u32 *)val; + _val =get_unaligned ((u32 *)val);break ;case 8 : - _val = *(u64 *)val; + _val =get_unaligned ((u64 *)val);break ;default :return false;
Greg Kroah-Hartman
maintainerPATCH 31/1266 block: Avoid mounting the bdev pseudo-filesystem in userspace
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis Arefev <[email protected]>
[ Upstream commit f73aa66dffcb8e61e78f01b56163ec16a15d06d2 ]
The bdev pseudo-filesystem is an internal kernel filesystem with which userspace should not interfere. Unregister it so that userspace cannot even attempt to mount it.
This fixes a bug [1] that occurs when attempting to access files, because the system call move_mount() uses pointers declared in the inode_operations structure, which for the bdev pseudo-filesystem are always equal to 0. inode->i_op = &empty_iops;
[1]
BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page PGD 23380067 P4D 23380067 PUD 23381067 PMD 0 Oops: 0010 [#1] PREEMPT SMP KASAN NOPTI CPU: 2 PID: 17125 Comm: syz-executor.0 Not tainted 6.1.155-syzkaller-00350-g84221fde2681 #0 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:0x0 Call Trace: <TASK> lookup_open.isra.0+0x700/0x1180 fs/namei.c:3460 open_last_lookups fs/namei.c:3550 [inline] path_openat+0x953/0x2700 fs/namei.c:3780 do_filp_open+0x1c5/0x410 fs/namei.c:3810 do_sys_openat2+0x171/0x4d0 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x13c/0x1f0 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x6e/0xd8
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- block/bdev.c | 4 ---- 1 file changed, 4 deletions(-)
block/bdev.c +0 -4
@@ -383,16 +383,12 @@ EXPORT_SYMBOL_GPL(blockdev_superblock);void __init bdev_cache_init (void ) { -int err;static struct vfsmount *bd_mnt; bdev_cachep =kmem_cache_create ("bdev_cache" ,sizeof (struct bdev_inode ),0 , (SLAB_HWCACHE_ALIGN |SLAB_RECLAIM_ACCOUNT |SLAB_MEM_SPREAD |SLAB_ACCOUNT |SLAB_PANIC ), init_once); - err =register_filesystem (&bd_type); -if (err) -panic ("Cannot register bdev pseudo-fs" ); bd_mnt =kern_mount (&bd_type);if (IS_ERR (bd_mnt))panic ("Cannot create bdev pseudo-fs" );
Greg Kroah-Hartman
maintainerPATCH 32/1266 i2c: core: fix irq domain leak on adapter registration failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 8ce19524e4cc2462685f596a6402fbd8fb984ab2 ]
Make sure to tear down the host notify irq domain on adapter registration failure to avoid leaking it.
This issue was flagged by Sashiko when reviewing another adapter registration fix.
Stable-dep-of: ba14d7cf2fe7 ("i2c: core: fix adapter registration race")
--- drivers/i2c/i2c-core-base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/i2c-core-base.c +3 -1
@@ -1551,7 +1551,7 @@ static int i2c_register_adapter(struct i res =device_register (&adap->dev);if (res) {pr_err ("adapter '%s': can't register device (%d)\n" , adap->name, res); - goto out_list; + goto err_remove_irq_domain; } adap->debugfs =debugfs_create_dir (dev_name (&adap->dev), i2c_debugfs_root);
@@ -1599,6 +1599,8 @@ out_reg:init_completion (&adap->dev_released);device_unregister (&adap->dev);wait_for_completion (&adap->dev_released); +err_remove_irq_domain: +i2c_host_notify_irq_teardown (adap); out_list:mutex_lock (&core_lock);idr_remove (&i2c_adapter_idr, adap->nr);
Greg Kroah-Hartman
maintainerPATCH 33/1266 i2c: core: fix hang on adapter registration failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 3c7e164344e5bcf6f274bbf59a3274f5caad9bc1 ]
Clients may be registered from bus notifier callbacks when the adapter is registered. On a subsequent error during registration, the adapter references taken by such clients prevent the wait for the references to be released from ever completing.
Fix this by refactoring client deregistration and deregistering also on late adapter registration failures.
Stable-dep-of: ba14d7cf2fe7 ("i2c: core: fix adapter registration race")
--- drivers/i2c/i2c-core-base.c | 49 ++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-)
drivers/i2c/i2c-core-base.c +29 -20
@@ -63,6 +63,7 @@static DEFINE_MUTEX (core_lock);static DEFINE_IDR (i2c_adapter_idr); +static void i2c_deregister_clients (struct i2c_adapter *adap);static int i2c_detect (struct i2c_adapter *adapter,struct i2c_driver *driver);static DEFINE_STATIC_KEY_FALSE (i2c_trace_msg_key);
@@ -1595,6 +1596,7 @@ static int i2c_register_adapter(struct ireturn 0 ; out_reg: +i2c_deregister_clients (adap);debugfs_remove_recursive (adap->debugfs);init_completion (&adap->dev_released);device_unregister (&adap->dev);
@@ -1738,29 +1740,10 @@ static int __process_removed_adapter(strreturn 0 ; } -/** -* i2c_del_adapter - unregister I2C adapter -* @adap: the adapter being unregistered -* Context: can sleep -* -* This unregisters an I2C adapter which was previously registered -* by @i2c_add_adapter or @i2c_add_numbered_adapter. -*/ -void i2c_del_adapter (struct i2c_adapter *adap) +static void i2c_deregister_clients (struct i2c_adapter *adap) { -struct i2c_adapter *found;struct i2c_client *client, *next; -/* First make sure that this adapter was ever added */ -mutex_lock (&core_lock); - found =idr_find (&i2c_adapter_idr, adap->nr); -mutex_unlock (&core_lock); -if (found != adap) { -pr_debug ("attempting to delete unregistered adapter [%s]\n" , adap->name); -return ; - } - -i2c_acpi_remove_space_handler (adap);/* Tell drivers about this removal */ mutex_lock (&core_lock); bus_for_each_drv(&i2c_bus_type, NULL, adap,
@@ -1786,6 +1769,32 @@ void i2c_del_adapter(struct i2c_adapter* them up properly, so we give them a chance to do that first. */ device_for_each_child (&adap->dev,NULL , __unregister_client);device_for_each_child (&adap->dev,NULL , __unregister_dummy); +} + +/** +* i2c_del_adapter - unregister I2C adapter +* @adap: the adapter being unregistered +* Context: can sleep +* +* This unregisters an I2C adapter which was previously registered +* by @i2c_add_adapter or @i2c_add_numbered_adapter. +*/ +void i2c_del_adapter (struct i2c_adapter *adap) +{ +struct i2c_adapter *found; + +/* First make sure that this adapter was ever added */ +mutex_lock (&core_lock); + found =idr_find (&i2c_adapter_idr, adap->nr); +mutex_unlock (&core_lock); +if (found != adap) { +pr_debug ("attempting to delete unregistered adapter [%s]\n" , adap->name); +return ; + } + +i2c_acpi_remove_space_handler (adap); + +i2c_deregister_clients (adap);#ifdef CONFIG_I2C_COMPAT class_compat_remove_link(i2c_adapter_compat_class, &adap->dev,
Greg Kroah-Hartman
maintainerPATCH 34/1266 i2c: core: fix NULL-deref on adapter registration failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 2295d2bb101faa663fbc45fadbb3fec45f107441 ]
If adapter registration ever fails the release callback would trigger a NULL-pointer dereference as the completion struct has not been initialised.
Note that before the offending commit this would instead have resulted in a minor memory leak of the adapter name.
Stable-dep-of: ba14d7cf2fe7 ("i2c: core: fix adapter registration race")
--- drivers/i2c/i2c-core-base.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/i2c/i2c-core-base.c +5 -3
@@ -1552,7 +1552,7 @@ static int i2c_register_adapter(struct i res =device_register (&adap->dev);if (res) {pr_err ("adapter '%s': can't register device (%d)\n" , adap->name, res); - goto err_remove_irq_domain; + goto err_put_adap; } adap->debugfs =debugfs_create_dir (dev_name (&adap->dev), i2c_debugfs_root);
@@ -1598,10 +1598,12 @@ static int i2c_register_adapter(struct i out_reg:i2c_deregister_clients (adap);debugfs_remove_recursive (adap->debugfs); +device_del (&adap->dev); +err_put_adap:init_completion (&adap->dev_released); -device_unregister (&adap->dev); +put_device (&adap->dev);wait_for_completion (&adap->dev_released); -err_remove_irq_domain: +i2c_host_notify_irq_teardown (adap); out_list:mutex_lock (&core_lock);
Greg Kroah-Hartman
maintainerPATCH 35/1266 i2c: core: fix adapter debugfs creation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 07d5fb537928aad4369aaff0cbae73ba38a719af ]
Clients can be registered from bus notifier callbacks so the debugfs directory needs to be created before registering the adapter as clients use that directory as their debugfs parent.
Move debugfs creation before adapter registration to avoid having clients create their debugfs directories in the debugfs root (which is also more likely to fail due to name collisions).
Note that failure to allocate the adapter name must now be handled explicitly as debugfs_create_dir() cannot handle a NULL name (unlike device_add() which returns an error).
Stable-dep-of: ba14d7cf2fe7 ("i2c: core: fix adapter registration race")
--- drivers/i2c/i2c-core-base.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/i2c/i2c-core-base.c +13 -8
@@ -1546,17 +1546,22 @@ static int i2c_register_adapter(struct i goto out_list; } -dev_set_name (&adap->dev,"i2c-%d" , adap->nr); + res =dev_set_name (&adap->dev,"i2c-%d" , adap->nr); +if (res) + goto err_remove_irq_domain; + adap->dev.bus = &i2c_bus_type; adap->dev.type = &i2c_adapter_type; - res =device_register (&adap->dev); +device_initialize (&adap->dev); + + adap->debugfs =debugfs_create_dir (dev_name (&adap->dev), i2c_debugfs_root); + + res =device_add (&adap->dev);if (res) {pr_err ("adapter '%s': can't register device (%d)\n" , adap->name, res); - goto err_put_adap; + goto err_remove_debugfs; } - adap->debugfs =debugfs_create_dir (dev_name (&adap->dev), i2c_debugfs_root); - res =i2c_setup_smbus_alert (adap);if (res) goto out_reg;
@@ -1597,13 +1602,13 @@ static int i2c_register_adapter(struct i out_reg:i2c_deregister_clients (adap); -debugfs_remove_recursive (adap->debugfs);device_del (&adap->dev); -err_put_adap: +err_remove_debugfs: +debugfs_remove_recursive (adap->debugfs);init_completion (&adap->dev_released);put_device (&adap->dev);wait_for_completion (&adap->dev_released); - +err_remove_irq_domain:i2c_host_notify_irq_teardown (adap); out_list:mutex_lock (&core_lock);
Greg Kroah-Hartman
maintainerPATCH 36/1266 i2c: core: fix adapter registration race
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit ba14d7cf2fe7284610a29854bdff22b2537d3ce6 ]
Adapters can be looked up based on their id using i2c_get_adapter() which takes a reference to the embedded struct device.
Make sure that the adapter (including its struct device) has been initialised before adding it to the IDR to avoid accessing uninitialised data which could, for example, lead to NULL-pointer dereferences or use-after-free.
Note that the i2c-dev chardev, which is registered from a bus notifier, currently uses i2c_get_adapter() so the adapter needs to be added to the IDR before registration.
--- drivers/i2c/i2c-core-base.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core-base.c +6 -2
@@ -1556,6 +1556,10 @@ static int i2c_register_adapter(struct i adap->debugfs =debugfs_create_dir (dev_name (&adap->dev), i2c_debugfs_root); +mutex_lock (&core_lock); +idr_replace (&i2c_adapter_idr, adap, adap->nr); +mutex_unlock (&core_lock); + res =device_add (&adap->dev);if (res) {pr_err ("adapter '%s': can't register device (%d)\n" , adap->name, res);
@@ -1629,7 +1633,7 @@ static int __i2c_add_numbered_adapter(stint id;mutex_lock (&core_lock); - id =idr_alloc (&i2c_adapter_idr, adap, adap->nr, adap->nr +1 ,GFP_KERNEL ); + id =idr_alloc (&i2c_adapter_idr,NULL , adap->nr, adap->nr +1 ,GFP_KERNEL );mutex_unlock (&core_lock);if (WARN (id <0 ,"couldn't get idr" ))return id == -ENOSPC ? -EBUSY : id;
@@ -1665,7 +1669,7 @@ int i2c_add_adapter(struct i2c_adapter * }mutex_lock (&core_lock); - id =idr_alloc (&i2c_adapter_idr, adapter, + id =idr_alloc (&i2c_adapter_idr,NULL , __i2c_first_dynamic_bus_num,0 ,GFP_KERNEL );mutex_unlock (&core_lock);if (WARN (id <0 ,"couldn't get idr" ))
Greg Kroah-Hartman
maintainerPATCH 37/1266 fbdev: fbcon: fix out-of-bounds read in err_out of fbcon_do_set_font()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingyu Wang <[email protected]>
[ Upstream commit 8fdc8c2057eea08d40ce2c8eed41ff9e451c65c2 ]
When fbcon_do_set_font() fails (e.g., due to a memory allocation failure inside vc_resize() under heavy memory pressure), it jumps to the err_out label to roll back the console state. However, the current rollback logic forgets to restore the hi_font state, leading to a severe state machine corruption.
Earlier in the function, set_vc_hi_font() might be called to change vc->vc_hi_font_mask and mutate the screen buffer. If vc_resize() subsequently fails, the err_out path restores vc_font.charcount but entirely skips rolling back the vc_hi_font_mask and the screen buffer.
This mismatch leaves the terminal in a desynchronized state. Because vc_hi_font_mask remains set, the VT subsystem will still accept character indices greater than 255 from userspace and write them to the screen buffer. Subsequent rendering calls (e.g., fbcon_putcs()) will then use these inflated indices to access the reverted, 256-character font array, leading to a deterministic out-of-bounds read and potential kernel memory disclosure.
Fix this by adding the missing rollback logic for the hi_font mask and screen buffer in the error path.
--- drivers/video/fbdev/core/fbcon.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/video/fbdev/core/fbcon.c +7 -0
@@ -2418,6 +2418,7 @@ static int fbcon_do_set_font(struct vc_dstruct fbcon_display *p = &fb_display[vc->vc_num];int resize, ret, old_userfont, old_width, old_height, old_charcount;u8 *old_data = vc->vc_font.data; +unsigned short old_hi_font_mask = vc->vc_hi_font_mask; resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); vc->vc_font.data = (void *)(p->fontdata = data);
@@ -2471,6 +2472,12 @@ err_out: vc->vc_font.height = old_height; vc->vc_font.charcount = old_charcount; +/* Restore the hi_font state and screen buffer */ +if (old_hi_font_mask && !vc->vc_hi_font_mask) +set_vc_hi_font (vc, true); +else if (!old_hi_font_mask && vc->vc_hi_font_mask) +set_vc_hi_font (vc, false); +return ret; }
Greg Kroah-Hartman
maintainerPATCH 38/1266 NFSv4/flexfiles: reject zero filehandle version count
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Bommarito <[email protected]>
[ Upstream commit 2c6bb3c40bc24f6aa8dfbe6fe98c3ad6389203f2 ]
ff_layout_alloc_lseg() decodes the filehandle-version array count from the flexfiles layout body. The value is used as the count for kzalloc_objs(), and the current code only rejects NULL.
A zero count yields ZERO_SIZE_PTR, which can be stored in dss_info->fh_versions even though later flexfiles paths assume that at least one filehandle version exists.
Reject fh_count == 0 before the allocation, matching the existing zero version_count validation in the flexfiles GETDEVICEINFO parser.
A QEMU/KASAN run with a malformed flexfiles layout hit:
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:ff_layout_encode_ff_layoutupdate.isra.0+0x15f/0x750 ff_layout_encode_layoutreturn+0x683/0x970 nfs4_xdr_enc_layoutreturn+0x278/0x3a0 Kernel panic - not syncing: Fatal exception
The patched kernel rejects the malformed layout without KASAN/oops/panic, and a valid fh_count=1 regression still opens, reads, and unmounts cleanly.
--- fs/nfs/flexfilelayout/flexfilelayout.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nfs/flexfilelayout/flexfilelayout.c +4 -0
@@ -460,6 +460,10 @@ ff_layout_alloc_lseg(struct pnfs_layout_if (!p) goto out_err_free; fh_count =be32_to_cpup (p); +if (fh_count ==0 ) { + rc = -EINVAL ; + goto out_err_free; + } fls->mirror_array[i]->fh_versions = kcalloc(fh_count, sizeof(struct nfs_fh),
Greg Kroah-Hartman
maintainerPATCH 39/1266 nfsd: Dont reset the write verifier on a commit EAGAIN
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 1b2021bdeeca12364ad0fa7aac9ddba5cae964f3 ]
If fsync() is returning EAGAIN, then we can assume that the filesystem being exported is something like NFS with the 'softerr' mount option enabled, and that it is just asking us to replay the fsync() operation at a later date.
If we see an ESTALE, then ditto: the file is gone, so there is no danger of losing the error.
For those cases, do not reset the write verifier. A write verifier change has a global effect, causing retransmission by all clients of all uncommitted unstable writes for all files, so it is worth mitigating where possible.
Stable-dep-of: 2090b05803fa ("nfsd: reset write verifier on deferred writeback errors")
--- fs/nfsd/vfs.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)
fs/nfsd/vfs.c +23 -10
@@ -338,6 +338,24 @@ out:return err; } +static void +commit_reset_write_verifier (struct nfsd_net *nn,struct svc_rqst *rqstp, +int err) +{ +switch (err) { +case -EAGAIN : +case -ESTALE : +/* +* Neither of these are the result of a problem with +* durable storage, so avoid a write verifier reset. +*/ +break ; +default : +nfsd_reset_write_verifier (nn); +trace_nfsd_writeverf_reset (nn, rqstp, err); + } +} +/* * Commit metadata changes to stable storage. */
@@ -659,8 +677,7 @@ __be32 nfsd4_clone_file_range(struct svc &nfsd4_get_cstate (rqstp)->current_fh, dst_pos, count, status); -nfsd_reset_write_verifier (nn); -trace_nfsd_writeverf_reset (nn, rqstp, status); +commit_reset_write_verifier (nn, rqstp, status); ret =nfserrno (status); } }
@@ -1177,8 +1194,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s host_err =vfs_iter_write (file, &iter, &pos, flags);file_end_write (file);if (host_err <0 ) { -nfsd_reset_write_verifier (nn); -trace_nfsd_writeverf_reset (nn, rqstp, host_err); +commit_reset_write_verifier (nn, rqstp, host_err); goto out_nfserr; } *cnt = host_err;
@@ -1193,10 +1209,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, sif (stable && use_wgather) { host_err =wait_for_concurrent_writes (file); -if (host_err <0 ) { -nfsd_reset_write_verifier (nn); -trace_nfsd_writeverf_reset (nn, rqstp, host_err); - } +if (host_err <0 ) +commit_reset_write_verifier (nn, rqstp, host_err); } out_nfserr:
@@ -1343,8 +1357,7 @@ nfsd_commit(struct svc_rqst *rqstp, stru err = nfserr_notsupp;break ;default : -nfsd_reset_write_verifier (nn); -trace_nfsd_writeverf_reset (nn, rqstp, err2); +commit_reset_write_verifier (nn, rqstp, err2); err =nfserrno (err2); } }else
Greg Kroah-Hartman
maintainerPATCH 40/1266 apparmor: advertise the tcp fast open fix is applied
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <[email protected]>
[ Upstream commit 2f6701a5ce6257ae7a64ddc6d89d0a08d2a034f8 ]
The fix for tcp-fast-open ensures that the connect permission is being mediated correctly but it didn't add an artifact to the feature set to advertise the fix is available. Add an artifact so that the test suite can identify if the fix has not been properly applied or a new unexpected regression has occurred.
--- security/apparmor/net.c | 1 + 1 file changed, 1 insertion(+)
security/apparmor/net.c +1 -0
@@ -21,6 +21,7 @@struct aa_sfs_entry aa_sfs_entry_network[] = {AA_SFS_FILE_STRING ("af_mask" ,AA_SFS_AF_MASK ), +AA_SFS_FILE_BOOLEAN ("tcp-fast-open" ,1 ), { } };
Greg Kroah-Hartman
maintainerPATCH 41/1266 nfsd: move name lookup out of nfsd4_list_rec_dir()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
[ Upstream commit 89bd77cf436bf25e448817a662ebf76515f22863 ]
nfsd4_list_rec_dir() is called with two different callbacks. One of the callbacks uses vfs_rmdir() to remove the directory. The other doesn't use the dentry at all, just the name.
As only one callback needs the dentry, this patch moves the lookup into that callback. This prepares of changes to how directory operations are locked.
Stable-dep-of: 4552f4e3f2c9 ("nfsd: change nfs4_client_to_reclaim() to allocate data")
--- fs/nfsd/nfs4recover.c | 55 ++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 27 deletions(-)
fs/nfsd/nfs4recover.c +28 -27
@@ -254,7 +254,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)nfs4_reset_creds (original_cred); } -typedef int (recdir_func )(struct dentry *,struct dentry *,struct nfsd_net *); +typedef int (recdir_func )(struct dentry *,char *,struct nfsd_net *);struct name_list {char name[HEXDIR_LEN ];
@@ -308,23 +308,14 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn) } status =iterate_dir (nn->rec_file, &ctx.ctx); -inode_lock_nested (d_inode (dir),I_MUTEX_PARENT );list_for_each_entry_safe (entry, tmp, &ctx.names, list) { -if (!status) { -struct dentry *dentry; - dentry =lookup_one_len (entry->name, dir,HEXDIR_LEN -1 ); -if (IS_ERR (dentry)) { - status =PTR_ERR (dentry); -break ; - } - status =f (dir, dentry, nn); -dput (dentry); - } +if (!status) + status =f (dir, entry->name, nn); +list_del (&entry->list);kfree (entry); } -inode_unlock (d_inode (dir));nfs4_reset_creds (original_cred);list_for_each_entry_safe (entry, tmp, &ctx.names, list) {
@@ -422,18 +413,19 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp) }static int -purge_old (struct dentry *parent,struct dentry *child,struct nfsd_net *nn) +purge_old (struct dentry *parent,char *cname,struct nfsd_net *nn) {int status; +struct dentry *child;struct xdr_netobj name; -if (child->d_name.len !=HEXDIR_LEN -1 ) { -printk ("%s: illegal name %pd in recovery directory\n" , - __func__, child); +if (strlen (cname) !=HEXDIR_LEN -1 ) { +printk ("%s: illegal name %s in recovery directory\n" , + __func__, cname);/* Keep trying; maybe the others are OK: */ return 0 ; } - name.data =kmemdup_nul (child->d_name.name, child->d_name.len,GFP_KERNEL ); + name.data =kstrdup (cname,GFP_KERNEL );if (!name.data) {dprintk ("%s: failed to allocate memory for name.data!\n" , __func__);
@@ -443,10 +435,17 @@ purge_old(struct dentry *parent, struct dentry *child, struct nfsd_net *nn)if (nfs4_has_reclaimed_state (name, nn)) goto out_free; - status =vfs_rmdir (&nop_mnt_idmap,d_inode (parent), child); -if (status) -printk ("failed to remove client recovery directory %pd\n" , - child); +inode_lock_nested (d_inode (parent),I_MUTEX_PARENT ); + child =lookup_one_len (cname, parent,HEXDIR_LEN -1 ); +if (!IS_ERR (child)) { + status =vfs_rmdir (&nop_mnt_idmap,d_inode (parent), child); +if (status) +printk ("failed to remove client recovery directory %pd\n" , + child); +dput (child); + } +inode_unlock (d_inode (parent)); + out_free:kfree (name.data); out:
@@ -477,18 +476,18 @@ nfsd4_recdir_purge_old(struct nfsd_net *nn) }static int -load_recdir (struct dentry *parent,struct dentry *child,struct nfsd_net *nn) +load_recdir (struct dentry *parent,char *cname,struct nfsd_net *nn) {struct xdr_netobj name;struct xdr_netobj princhash = { .len =0 , .data =NULL }; -if (child->d_name.len !=HEXDIR_LEN -1 ) { -printk ("%s: illegal name %pd in recovery directory\n" , - __func__, child); +if (strlen (cname) !=HEXDIR_LEN -1 ) { +printk ("%s: illegal name %s in recovery directory\n" , + __func__, cname);/* Keep trying; maybe the others are OK: */ return 0 ; } - name.data =kmemdup_nul (child->d_name.name, child->d_name.len,GFP_KERNEL ); + name.data =kstrdup (cname,GFP_KERNEL );if (!name.data) {dprintk ("%s: failed to allocate memory for name.data!\n" , __func__);
@@ -843,11 +842,13 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,return PTR_ERR (name.data); name.len = namelen; } +#ifdef CONFIG_NFSD_V4 if (name.len >5 &&memcmp (name.data,"hash:" ,5 ) ==0 ) { name.len = name.len -5 ;memmove (name.data, name.data +5 , name.len); cn->cn_has_legacy = true; } +#endif if (!nfs4_client_to_reclaim (name, princhash, nn)) {kfree (name.data);kfree (princhash.data);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 42/1266 nfsd: change nfs4_client_to_reclaim() to allocate data
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
[ Upstream commit 4552f4e3f2c96597914f07b060d5c5db84420ddd ]
The calling convention for nfs4_client_to_reclaim() is clumsy in that the caller needs to free memory if the function fails. It is much cleaner if the function frees its own memory.
This patch changes nfs4_client_to_reclaim() to re-allocate the .data fields to be stored in the newly allocated struct nfs4_client_reclaim, and to free everything on failure.
__cld_pipe_inprogress_downcall() needs to allocate the data anyway to copy it from user-space, so now that data is allocated twice. I think that is a small price to pay for a cleaner interface.
--- fs/nfsd/nfs4recover.c | 67 +++++++++++++++---------------------------- fs/nfsd/nfs4state.c | 22 ++++++++++++-- 2 files changed, 42 insertions(+), 47 deletions(-)
fs/nfsd/nfs4recover.c +23 -44
@@ -167,24 +167,13 @@ legacy_recdir_name_error(struct nfs4_client *clp, int error)static void __nfsd4_create_reclaim_record_grace (struct nfs4_client *clp, -const char *dname,int len,struct nfsd_net *nn) +char *dname,struct nfsd_net *nn) { -struct xdr_netobj name; +struct xdr_netobj name = { .len =strlen (dname), .data = dname };struct xdr_netobj princhash = { .len =0 , .data =NULL };struct nfs4_client_reclaim *crp; - name.data =kmemdup (dname, len,GFP_KERNEL ); -if (!name.data) { -dprintk ("%s: failed to allocate memory for name.data!\n" , - __func__); -return ; - } - name.len = len; crp =nfs4_client_to_reclaim (name, princhash, nn); -if (!crp) { -kfree (name.data); -return ; - } crp->cr_clp = clp; }
@@ -240,8 +229,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)inode_unlock (d_inode (dir));if (status ==0 ) {if (nn->in_grace) -__nfsd4_create_reclaim_record_grace (clp, dname, -HEXDIR_LEN , nn); +__nfsd4_create_reclaim_record_grace (clp, dname, nn);vfs_fsync (nn->rec_file,0 ); }else { printk(KERN_ERR "NFSD: failed to write recovery record"
@@ -478,7 +466,7 @@ nfsd4_recdir_purge_old(struct nfsd_net *nn)static int load_recdir (struct dentry *parent,char *cname,struct nfsd_net *nn) { -struct xdr_netobj name; +struct xdr_netobj name = { .len =HEXDIR_LEN , .data = cname };struct xdr_netobj princhash = { .len =0 , .data =NULL };if (strlen (cname) !=HEXDIR_LEN -1 ) {
@@ -487,16 +475,7 @@ load_recdir(struct dentry *parent, char *cname, struct nfsd_net *nn)/* Keep trying; maybe the others are OK: */ return 0 ; } - name.data =kstrdup (cname,GFP_KERNEL ); -if (!name.data) { -dprintk ("%s: failed to allocate memory for name.data!\n" , - __func__); - goto out; - } - name.len =HEXDIR_LEN ; -if (!nfs4_client_to_reclaim (name, princhash, nn)) -kfree (name.data); -out: +nfs4_client_to_reclaim (name, princhash, nn);return 0 ; }
@@ -792,6 +771,8 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg, {uint8_t cmd, princhashlen;struct xdr_netobj name, princhash = { .len =0 , .data =NULL }; + char *namecopy __free(kfree) = NULL; + char *princhashcopy __free(kfree) = NULL;uint16_t namelen;struct cld_net *cn = nn->cld_net;
@@ -810,20 +791,20 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,dprintk ("%s: namelen should not be zero" , __func__);return -EINVAL ; } - name.data =memdup_user (&ci->cc_name.cn_id, namelen); -if (IS_ERR (name.data)) -return PTR_ERR (name.data); + namecopy =memdup_user (&ci->cc_name.cn_id, namelen); +if (IS_ERR (namecopy)) +return PTR_ERR (namecopy); + name.data = namecopy; name.len = namelen;if (get_user (princhashlen, &ci->cc_princhash.cp_len))return -EFAULT ;if (princhashlen >0 ) { - princhash.data =memdup_user ( - &ci->cc_princhash.cp_data, - princhashlen); -if (IS_ERR (princhash.data)) { -kfree (name.data); -return PTR_ERR (princhash.data); - } + princhashcopy =memdup_user ( + &ci->cc_princhash.cp_data, + princhashlen); +if (IS_ERR (princhashcopy)) +return PTR_ERR (princhashcopy); + princhash.data = princhashcopy; princhash.len = princhashlen; }else princhash.len =0 ;
@@ -837,23 +818,21 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,dprintk ("%s: namelen should not be zero" , __func__);return -EINVAL ; } - name.data =memdup_user (&cnm->cn_id, namelen); -if (IS_ERR (name.data)) -return PTR_ERR (name.data); + namecopy =memdup_user (&cnm->cn_id, namelen); +if (IS_ERR (namecopy)) +return PTR_ERR (namecopy); + name.data = namecopy; name.len = namelen; }#ifdef CONFIG_NFSD_V4 if (name.len >5 &&memcmp (name.data,"hash:" ,5 ) ==0 ) { name.len = name.len -5 ; -memmove (name.data, name.data +5 , name.len); + name.data = name.data +5 ; cn->cn_has_legacy = true; }#endif -if (!nfs4_client_to_reclaim (name, princhash, nn)) { -kfree (name.data); -kfree (princhash.data); +if (!nfs4_client_to_reclaim (name, princhash, nn))return -EFAULT ; - }return nn->client_tracking_ops->msglen; }return -EFAULT ;
fs/nfsd/nfs4state.c +19 -3
@@ -8093,9 +8093,6 @@ nfs4_has_reclaimed_state(struct xdr_netobj name, struct nfsd_net *nn)/* * failure => all reset bets are off, nfserr_no_grace... -* -* The caller is responsible for freeing name.data if NULL is returned (it -* will be freed in nfs4_remove_reclaim_record in the normal case). */ struct nfs4_client_reclaim * nfs4_client_to_reclaim(struct xdr_netobj name, struct xdr_netobj princhash,
@@ -8104,6 +8101,22 @@ nfs4_client_to_reclaim(struct xdr_netobj name, struct xdr_netobj princhash,unsigned int strhashval;struct nfs4_client_reclaim *crp; + name.data =kmemdup (name.data, name.len,GFP_KERNEL ); +if (!name.data) { +dprintk ("%s: failed to allocate memory for name.data!\n" , + __func__); +return NULL ; + } +if (princhash.len) { + princhash.data =kmemdup (princhash.data, princhash.len,GFP_KERNEL ); +if (!princhash.data) { +dprintk ("%s: failed to allocate memory for princhash.data!\n" , + __func__); +kfree (name.data); +return NULL ; + } + }else + princhash.data =NULL ; crp =alloc_reclaim ();if (crp) { strhashval =clientstr_hashval (name);
@@ -8115,6 +8128,9 @@ nfs4_client_to_reclaim(struct xdr_netobj name, struct xdr_netobj princhash, crp->cr_princhash.len = princhash.len; crp->cr_clp =NULL ; nn->reclaim_str_hashtbl_size++; + }else { +kfree (name.data); +kfree (princhash.data); }return crp; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 43/1266 net: team: rename team to team_core for linking
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit a0393e3e3ddbb177b25f0a978c72f5efe942fe7d ]
Similar with commit 08d323234d10 ("net: fou: rename the source for linking"), We'll need to link two objects together to form the team module. This means the source can't be called team, the build system expects team.o to be the combined object.
Stable-dep-of: 425000dbf173 ("team: fix header_ops type confusion with non-Ethernet ports")
---
drivers/net/team/Makefile | 1 +
drivers/net/team/{team.c => team_core.c} | 0
2 files changed, 1 insertion(+)
rename drivers/net/team/{team.c => team_core.c} (100%)drivers/net/team/Makefile +1 -0
@@ -3,6 +3,7 @@ # Makefile for the network team driver # +team-y:= team_core.o obj-$(CONFIG_NET_TEAM) += team.o obj-$(CONFIG_NET_TEAM_MODE_BROADCAST) += team_mode_broadcast.o obj-$(CONFIG_NET_TEAM_MODE_ROUNDROBIN) += team_mode_roundrobin.o
drivers/net/team/team_core.c renamed from drivers/net/team/team.c +0 -0
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 44/1266 net, team, bonding: Add netdev_base_features helper
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit d2516c3a53705f783bb6868df0f4a2b977898a71 ]
Both bonding and team driver have logic to derive the base feature flags before iterating over their slave devices to refine the set via netdev_increment_features().
Add a small helper netdev_base_features() so this can be reused instead of having it open-coded multiple times.
Stable-dep-of: d064ea7fe2a2 ("bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features")
--- drivers/net/bonding/bond_main.c | 4 +--- drivers/net/team/team_core.c | 3 +-- include/linux/netdev_features.h | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/bonding/bond_main.c +1 -3
@@ -1456,9 +1456,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,struct slave *slave; mask = features; - - features &= ~NETIF_F_ONE_FOR_ALL ; - features |=NETIF_F_ALL_FOR_ALL ; + features =netdev_base_features (features);bond_for_each_slave (bond, slave, iter) { features = netdev_increment_features(features,
drivers/net/team/team_core.c +1 -2
@@ -2026,8 +2026,7 @@ static netdev_features_t team_fix_features(struct net_device *dev,netdev_features_t mask; mask = features; - features &= ~NETIF_F_ONE_FOR_ALL ; - features |=NETIF_F_ALL_FOR_ALL ; + features =netdev_base_features (features);rcu_read_lock ();list_for_each_entry_rcu (port, &team->port_list, list) {
include/linux/netdev_features.h +7 -0
@@ -261,4 +261,11 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) NETIF_F_GSO_UDP_TUNNEL | \ NETIF_F_GSO_UDP_TUNNEL_CSUM) +static inline netdev_features_t netdev_base_features (netdev_features_t features) +{ + features &= ~NETIF_F_ONE_FOR_ALL ; + features |=NETIF_F_ALL_FOR_ALL ; +return features; +} +#endif /* _LINUX_NETDEV_FEATURES_H */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 45/1266 bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit d064ea7fe2a24938997b5e88e6b61cbb0a4bb906 ]
If a bonding device has slave devices, then the current logic to derive the feature set for the master bond device is limited in that flags which are fully supported by the underlying slave devices cannot be propagated up to vlan devices which sit on top of bond devices. Instead, these get blindly masked out via current NETIF_F_ALL_FOR_ALL logic.
vlan_features and mpls_features should reuse netdev_base_features() in order derive the set in the same way as ndo_fix_features before iterating through the slave devices to refine the feature set.
--- drivers/net/bonding/bond_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +3 -2
@@ -1499,8 +1499,9 @@ static void bond_compute_features(struct bonding *bond)if (!bond_has_slaves (bond)) goto done; - vlan_features &=NETIF_F_ALL_FOR_ALL ; - mpls_features &=NETIF_F_ALL_FOR_ALL ; + + vlan_features =netdev_base_features (vlan_features); + mpls_features =netdev_base_features (mpls_features);bond_for_each_slave (bond, slave, iter) { vlan_features = netdev_increment_features(vlan_features,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 46/1266 bonding: add ESP offload features when slaves support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianbo Liu <[email protected]>
[ Upstream commit 4861333b42178fa3d8fd1bb4e2cfb2fedc968dba ]
Add NETIF_F_GSO_ESP bit to bond's gso_partial_features if all slaves support it, such that ESP segmentation is handled by hardware if possible.
Stable-dep-of: 950803f72547 ("bonding: fix type confusion in bond_setup_by_slave()")
--- drivers/net/bonding/bond_main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/bonding/bond_main.c +9 -0
@@ -1484,6 +1484,7 @@ static void bond_compute_features(struct bonding *bond) {unsigned int dst_release_flag =IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM ; +netdev_features_t gso_partial_features =NETIF_F_GSO_ESP ;netdev_features_t vlan_features =BOND_VLAN_FEATURES ;netdev_features_t enc_features =BOND_ENC_FEATURES ;#ifdef CONFIG_XFRM_OFFLOAD
@@ -1517,6 +1518,9 @@ static void bond_compute_features(struct bonding *bond) BOND_XFRM_FEATURES);#endif /* CONFIG_XFRM_OFFLOAD */ +if (slave->dev->hw_enc_features &NETIF_F_GSO_PARTIAL ) + gso_partial_features &= slave->dev->gso_partial_features; + mpls_features =netdev_increment_features (mpls_features, slave->dev->mpls_features,BOND_MPLS_FEATURES );
@@ -1530,6 +1534,11 @@ static void bond_compute_features(struct bonding *bond) } bond_dev->hard_header_len = max_hard_header_len; +if (gso_partial_features &NETIF_F_GSO_ESP ) + bond_dev->gso_partial_features |=NETIF_F_GSO_ESP ; +else + bond_dev->gso_partial_features &= ~NETIF_F_GSO_ESP ; + done: bond_dev->vlan_features = vlan_features; bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 47/1266 bonding: Correctly support GSO ESP offload
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <[email protected]>
[ Upstream commit 9e6c4e6b605c1fa3e24f74ee0b641e95f090188a ]
The referenced fix is incomplete. It correctly computes bond_dev->gso_partial_features across slaves, but unfortunately netdev_fix_features discards gso_partial_features from the feature set if NETIF_F_GSO_PARTIAL isn't set in bond_dev->features.
This is visible with ethtool -k bond0 | grep esp:
tx-esp-segmentation: off [requested on]
esp-hw-offload: on
esp-tx-csum-hw-offload: on
This patch reworks the bonding GSO offload support by:
- making aggregating gso_partial_features across slaves similar to the other feature sets (this part is a no-op).
- advertising the default partial gso features on empty bond devs, same as with other feature sets (also a no-op).
- adding NETIF_F_GSO_PARTIAL to hw_enc_features filtered across slaves.
- adding NETIF_F_GSO_PARTIAL to features in bond_setup()
With all of these, 'ethtool -k bond0 | grep esp' now reports:
tx-esp-segmentation: on
esp-hw-offload: on
esp-tx-csum-hw-offload: on
Stable-dep-of: 950803f72547 ("bonding: fix type confusion in bond_setup_by_slave()")
--- drivers/net/bonding/bond_main.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/net/bonding/bond_main.c +10 -9
@@ -1474,17 +1474,20 @@ static netdev_features_t bond_fix_features(struct net_device *dev, NETIF_F_HIGHDMA | NETIF_F_LRO)#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ - NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE) + NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_PARTIAL)#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_GSO_SOFTWARE) +#define BOND_GSO_PARTIAL_FEATURES (NETIF_F_GSO_ESP) +static void bond_compute_features (struct bonding *bond) { +netdev_features_t gso_partial_features =BOND_GSO_PARTIAL_FEATURES ;unsigned int dst_release_flag =IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM ; -netdev_features_t gso_partial_features =NETIF_F_GSO_ESP ;netdev_features_t vlan_features =BOND_VLAN_FEATURES ;netdev_features_t enc_features =BOND_ENC_FEATURES ;#ifdef CONFIG_XFRM_OFFLOAD
@@ -1518,8 +1521,9 @@ static void bond_compute_features(struct bonding *bond) BOND_XFRM_FEATURES);#endif /* CONFIG_XFRM_OFFLOAD */ -if (slave->dev->hw_enc_features &NETIF_F_GSO_PARTIAL ) - gso_partial_features &= slave->dev->gso_partial_features; + gso_partial_features =netdev_increment_features (gso_partial_features, + slave->dev->gso_partial_features, +BOND_GSO_PARTIAL_FEATURES ); mpls_features = netdev_increment_features(mpls_features, slave->dev->mpls_features,
@@ -1534,12 +1538,8 @@ static void bond_compute_features(struct bonding *bond) } bond_dev->hard_header_len = max_hard_header_len; -if (gso_partial_features &NETIF_F_GSO_ESP ) - bond_dev->gso_partial_features |=NETIF_F_GSO_ESP ; -else - bond_dev->gso_partial_features &= ~NETIF_F_GSO_ESP ; - done: + bond_dev->gso_partial_features = gso_partial_features; bond_dev->vlan_features = vlan_features; bond_dev->hw_enc_features = enc_features |NETIF_F_GSO_ENCAP_ALL | NETIF_F_HW_VLAN_CTAG_TX |
@@ -6090,6 +6090,7 @@ void bond_setup(struct net_device *bond_dev) bond_dev->hw_features |=NETIF_F_GSO_ENCAP_ALL ; bond_dev->features |= bond_dev->hw_features; bond_dev->features |=NETIF_F_HW_VLAN_CTAG_TX |NETIF_F_HW_VLAN_STAG_TX ; + bond_dev->features |=NETIF_F_GSO_PARTIAL ;#ifdef CONFIG_XFRM_OFFLOAD bond_dev->hw_features |=BOND_XFRM_FEATURES ;/* Only enable XFRM features if this is an active-backup config */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 48/1266 net: add a common function to compute features for upper devices
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit 28098defc79fe7d29e6bfe4eb6312991f6bdc3d3 ]
Some high level software drivers need to compute features from lower devices. But each has their own implementations and may lost some feature compute. Let's use one common function to compute features for kinds of these devices.
The new helper uses the current bond implementation as the reference one, as the latter already handles all the relevant aspects: netdev features, TSO limits and dst retention.
Stable-dep-of: 950803f72547 ("bonding: fix type confusion in bond_setup_by_slave()")
--- include/linux/netdev_features.h | 18 +++++++ include/linux/netdevice.h | 1 + net/core/dev.c | 88 +++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+)
include/linux/netdev_features.h +18 -0
@@ -261,6 +261,24 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) NETIF_F_GSO_UDP_TUNNEL | \ NETIF_F_GSO_UDP_TUNNEL_CSUM) +/* virtual device features */ +#define MASTER_UPPER_DEV_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ + NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_ENCAP_ALL | \ + NETIF_F_HIGHDMA | NETIF_F_LRO) + +#define MASTER_UPPER_DEV_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ + NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_PARTIAL) + +#define MASTER_UPPER_DEV_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ + NETIF_F_GSO_SOFTWARE) + +#define MASTER_UPPER_DEV_XFRM_FEATURES (NETIF_F_HW_ESP | NETIF_F_HW_ESP_TX_CSUM | \ + NETIF_F_GSO_ESP) + +#define MASTER_UPPER_DEV_GSO_PARTIAL_FEATURES (NETIF_F_GSO_ESP) +static inline netdev_features_t netdev_base_features (netdev_features_t features) { features &= ~NETIF_F_ONE_FOR_ALL ;
include/linux/netdevice.h +1 -0
@@ -5005,6 +5005,7 @@ static inline netdev_features_t netdev_add_tso_features(netdev_features_t featurint __netdev_update_features (struct net_device *dev);void netdev_update_features (struct net_device *dev);void netdev_change_features (struct net_device *dev); +void netdev_compute_master_upper_features (struct net_device *dev,bool update_header);void netif_stacked_transfer_operstate (const struct net_device *rootdev,struct net_device *dev);
net/core/dev.c +88 -0
94 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 49/1266 bonding: use common function to compute the features
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit d4fde269a970666a30dd3abd0413273a06dd972d ]
Use the new functon netdev_compute_master_upper_features() to compute the bonding features.
Note that bond_compute_features() currently uses bond_for_each_slave() to traverse the lower devices list, and that is just a macro wrapper of netdev_for_each_lower_private(). We use similar helper netdev_for_each_lower_dev() in netdev_compute_master_upper_features() to iterate the slave device, as there is not need to get the private data.
No functional change intended.
Stable-dep-of: 950803f72547 ("bonding: fix type confusion in bond_setup_by_slave()")
--- drivers/net/bonding/bond_main.c | 99 ++------------------------------- 1 file changed, 4 insertions(+), 95 deletions(-)
drivers/net/bonding/bond_main.c +4 -95
@@ -1468,97 +1468,6 @@ static netdev_features_t bond_fix_features(struct net_device *dev,return features; } -#define BOND_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ - NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_GSO_ENCAP_ALL | \ - NETIF_F_HIGHDMA | NETIF_F_LRO) - -#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ - NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_GSO_PARTIAL) - -#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ - NETIF_F_GSO_SOFTWARE) - -#define BOND_GSO_PARTIAL_FEATURES (NETIF_F_GSO_ESP) - - -static void bond_compute_features (struct bonding *bond) -{ -netdev_features_t gso_partial_features =BOND_GSO_PARTIAL_FEATURES ; -unsigned int dst_release_flag =IFF_XMIT_DST_RELEASE | -IFF_XMIT_DST_RELEASE_PERM ; -netdev_features_t vlan_features =BOND_VLAN_FEATURES ; -netdev_features_t enc_features =BOND_ENC_FEATURES ; -#ifdef CONFIG_XFRM_OFFLOAD -netdev_features_t xfrm_features =BOND_XFRM_FEATURES ; -#endif /* CONFIG_XFRM_OFFLOAD */ -netdev_features_t mpls_features =BOND_MPLS_FEATURES ; -struct net_device *bond_dev = bond->dev; -struct list_head *iter; -struct slave *slave; -unsigned short max_hard_header_len =ETH_HLEN ; -unsigned int tso_max_size =TSO_MAX_SIZE ; -u16 tso_max_segs =TSO_MAX_SEGS ; - -if (!bond_has_slaves (bond)) - goto done; - - vlan_features =netdev_base_features (vlan_features); - mpls_features =netdev_base_features (mpls_features); - -bond_for_each_slave (bond, slave, iter) { - vlan_features =netdev_increment_features (vlan_features, - slave->dev->vlan_features,BOND_VLAN_FEATURES ); - - enc_features =netdev_increment_features (enc_features, - slave->dev->hw_enc_features, -BOND_ENC_FEATURES ); - -#ifdef CONFIG_XFRM_OFFLOAD - xfrm_features =netdev_increment_features (xfrm_features, - slave->dev->hw_enc_features, -BOND_XFRM_FEATURES ); -#endif /* CONFIG_XFRM_OFFLOAD */ - - gso_partial_features =netdev_increment_features (gso_partial_features, - slave->dev->gso_partial_features, -BOND_GSO_PARTIAL_FEATURES ); - - mpls_features =netdev_increment_features (mpls_features, - slave->dev->mpls_features, -BOND_MPLS_FEATURES ); - - dst_release_flag &= slave->dev->priv_flags; -if (slave->dev->hard_header_len > max_hard_header_len) - max_hard_header_len = slave->dev->hard_header_len; - - tso_max_size =min (tso_max_size, slave->dev->tso_max_size); - tso_max_segs =min (tso_max_segs, slave->dev->tso_max_segs); - } - bond_dev->hard_header_len = max_hard_header_len; - -done: - bond_dev->gso_partial_features = gso_partial_features; - bond_dev->vlan_features = vlan_features; - bond_dev->hw_enc_features = enc_features |NETIF_F_GSO_ENCAP_ALL | -NETIF_F_HW_VLAN_CTAG_TX | -NETIF_F_HW_VLAN_STAG_TX ; -#ifdef CONFIG_XFRM_OFFLOAD - bond_dev->hw_enc_features |= xfrm_features; -#endif /* CONFIG_XFRM_OFFLOAD */ - bond_dev->mpls_features = mpls_features; -netif_set_tso_max_segs (bond_dev, tso_max_segs); -netif_set_tso_max_size (bond_dev, tso_max_size); - - bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE ; -if ((bond_dev->priv_flags &IFF_XMIT_DST_RELEASE_PERM ) && - dst_release_flag == (IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM )) - bond_dev->priv_flags |=IFF_XMIT_DST_RELEASE ; - -netdev_change_features (bond_dev); -} -static void bond_setup_by_slave (struct net_device *bond_dev,struct net_device *slave_dev) {
@@ -2311,7 +2220,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, } bond->slave_cnt++; -bond_compute_features (bond); +netdev_compute_master_upper_features (bond->dev, true);bond_set_carrier (bond);/* Needs to be called before bond_select_active_slave(), which will
@@ -2563,7 +2472,7 @@ static int __bond_release_one(struct net_device *bond_dev,call_netdevice_notifiers (NETDEV_RELEASE , bond->dev); } -bond_compute_features (bond); +netdev_compute_master_upper_features (bond->dev, true);if (!(bond_dev->features &NETIF_F_VLAN_CHALLENGED ) && (old_features &NETIF_F_VLAN_CHALLENGED ))slave_info (bond_dev, slave_dev,"last VLAN challenged slave left bond - VLAN blocking is removed\n" );
@@ -4065,7 +3974,7 @@ static int bond_slave_netdev_event(unsigned long event,case NETDEV_FEAT_CHANGE :if (!bond->notifier_ctx) { bond->notifier_ctx = true; -bond_compute_features (bond); +netdev_compute_master_upper_features (bond->dev, true); bond->notifier_ctx = false; }break ;
@@ -6081,7 +5990,7 @@ void bond_setup(struct net_device *bond_dev)/* Don't allow bond devices to change network namespaces. */ bond_dev->features |=NETIF_F_NETNS_LOCAL ; - bond_dev->hw_features =BOND_VLAN_FEATURES | + bond_dev->hw_features =MASTER_UPPER_DEV_VLAN_FEATURES |NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_RX |
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 50/1266 bonding: fix xfrm offload feature setup on active-backup mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit 5b66169f6be4847008c0aea50885ff0632151479 ]
The active-backup bonding mode supports XFRM ESP offload. However, when a bond is added using command like ip link add bond0 type bond mode 1 miimon 100, the ethtool -k command shows that the XFRM ESP offload is disabled. This occurs because, in bond_newlink(), we change bond link first and register bond device later. So the XFRM feature update in bond_option_mode_set() is not called as the bond device is not yet registered, leading to the offload feature not being set successfully.
To resolve this issue, we can modify the code order in bond_newlink() to ensure that the bond device is registered first before changing the bond link parameters. This change will allow the XFRM ESP offload feature to be correctly enabled.
--- drivers/net/bonding/bond_main.c | 2 +- drivers/net/bonding/bond_netlink.c | 16 +++++++++------- include/net/bonding.h | 1 + 3 files changed, 11 insertions(+), 8 deletions(-)
drivers/net/bonding/bond_main.c +1 -1
@@ -4260,7 +4260,7 @@ void bond_work_init_all(struct bonding *bond)INIT_DELAYED_WORK (&bond->slave_arr_work, bond_slave_arr_handler); } -static void bond_work_cancel_all (struct bonding *bond) +void bond_work_cancel_all (struct bonding *bond) {cancel_delayed_work_sync (&bond->mii_work);cancel_delayed_work_sync (&bond->arp_work);
drivers/net/bonding/bond_netlink.c +9 -7
@@ -596,18 +596,20 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev, struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack) { + struct bonding *bond = netdev_priv(bond_dev);int err; - err =bond_changelink (bond_dev, tb, data, extack); -if (err <0 ) + err =register_netdevice (bond_dev); +if (err)return err; - err =register_netdevice (bond_dev); -if (!err) { -struct bonding *bond =netdev_priv (bond_dev); +netif_carrier_off (bond_dev); +bond_work_init_all (bond); -netif_carrier_off (bond_dev); -bond_work_init_all (bond); + err =bond_changelink (bond_dev, tb, data, extack); +if (err) { +bond_work_cancel_all (bond); +unregister_netdevice (bond_dev); }return err;
include/net/bonding.h +1 -0
@@ -713,6 +713,7 @@ struct bond_vlan_tag *bond_verify_device_path(struct net_device *start_dev,int bond_update_slave_arr (struct bonding *bond,struct slave *skipslave);void bond_slave_arr_work_rearm (struct bonding *bond,unsigned long delay);void bond_work_init_all (struct bonding *bond); +void bond_work_cancel_all (struct bonding *bond);#ifdef CONFIG_PROC_FS void bond_create_proc_entry (struct bonding *bond);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 51/1266 bonding: fix type confusion in bond_setup_by_slave()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit 950803f7254721c1c15858fbbfae3deaaeeecb11 ]
kernel BUG at net/core/skbuff.c:2306!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:pskb_expand_head+0xa08/0xfe0 net/core/skbuff.c:2306 RSP: 0018:ffffc90004aff760 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff88807e3c8780 RCX: ffffffff89593e0e RDX: ffff88807b7c4900 RSI: ffffffff89594747 RDI: ffff88807b7c4900 RBP: 0000000000000820 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000961a63e0 R11: 0000000000000000 R12: ffff88807e3c8780 R13: 00000000961a6560 R14: dffffc0000000000 R15: 00000000961a63e0 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe1a0ed8df0 CR3: 000000002d816000 CR4: 00000000003526f0 Call Trace: <TASK> ipgre_header+0xdd/0x540 net/ipv4/ip_gre.c:900 dev_hard_header include/linux/netdevice.h:3439 [inline] packet_snd net/packet/af_packet.c:3028 [inline] packet_sendmsg+0x3ae5/0x53c0 net/packet/af_packet.c:3108 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0xa54/0xc30 net/socket.c:2592 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2646 __sys_sendmsg+0x170/0x220 net/socket.c:2678 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe1a0e6c1a9
When a non-Ethernet device (e.g. GRE tunnel) is enslaved to a bond, bond_setup_by_slave() directly copies the slave's header_ops to the bond device:
bond_dev->header_ops = slave_dev->header_ops;
This causes a type confusion when dev_hard_header() is later called on the bond device. Functions like ipgre_header(), ip6gre_header(),all use netdev_priv(dev) to access their device-specific private data. When called with the bond device, netdev_priv() returns the bond's private data (struct bonding) instead of the expected type (e.g. struct ip_tunnel), leading to garbage values being read and kernel crashes.
Fix this by introducing bond_header_ops with wrapper functions that delegate to the active slave's header_ops using the slave's own device. This ensures netdev_priv() in the slave's header functions always receives the correct device.
The fix is placed in the bonding driver rather than individual device drivers, as the root cause is bond blindly inheriting header_ops from the slave without considering that these callbacks expect a specific netdev_priv() layout.
The type confusion can be observed by adding a printk in ipgre_header() and running the following commands:
ip link add dummy0 type dummy
ip addr add 10.0.0.1/24 dev dummy0
ip link set dummy0 up
ip link add gre1 type gre local 10.0.0.1 ip link add bond1 type bond mode active-backup ip link set gre1 master bond1
ip link set gre1 up
ip link set bond1 up
ip addr add fe80::1/64 dev bond1
--- drivers/net/bonding/bond_main.c | 47 ++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +46 -1
@@ -1468,6 +1468,50 @@ static netdev_features_t bond_fix_features(struct net_device *dev,return features; } +static int bond_header_create (struct sk_buff *skb,struct net_device *bond_dev, +unsigned short type,const void *daddr, +const void *saddr,unsigned int len) +{ +struct bonding *bond =netdev_priv (bond_dev); +const struct header_ops *slave_ops; +struct slave *slave; +int ret =0 ; + +rcu_read_lock (); + slave =rcu_dereference (bond->curr_active_slave); +if (slave) { + slave_ops =READ_ONCE (slave->dev->header_ops); +if (slave_ops && slave_ops->create) + ret = slave_ops->create (skb, slave->dev, + type, daddr, saddr, len); + } +rcu_read_unlock (); +return ret; +} + +static int bond_header_parse (const struct sk_buff *skb,unsigned char *haddr) +{ +struct bonding *bond =netdev_priv (skb->dev); +const struct header_ops *slave_ops; +struct slave *slave; +int ret =0 ; + +rcu_read_lock (); + slave =rcu_dereference (bond->curr_active_slave); +if (slave) { + slave_ops =READ_ONCE (slave->dev->header_ops); +if (slave_ops && slave_ops->parse) + ret = slave_ops->parse (skb, haddr); + } +rcu_read_unlock (); +return ret; +} + +static const struct header_ops bond_header_ops = { + .create = bond_header_create, + .parse = bond_header_parse, +}; +static void bond_setup_by_slave (struct net_device *bond_dev,struct net_device *slave_dev) {
@@ -1475,7 +1519,8 @@ static void bond_setup_by_slave(struct net_device *bond_dev,dev_close (bond_dev); - bond_dev->header_ops = slave_dev->header_ops; + bond_dev->header_ops = slave_dev->header_ops ? + &bond_header_ops :NULL ; bond_dev->type = slave_dev->type; bond_dev->hard_header_len = slave_dev->hard_header_len;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 52/1266 bonding: prevent potential infinite loop in bond_header_parse()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit b7405dcf7385445e10821777143f18c3ce20fa04 ]
bond_header_parse() can loop if a stack of two bonding devices is setup, because skb->dev always points to the hierarchy top.
Add new "const struct net_device *dev" parameter to (struct header_ops)->parse() method to make sure the recursion is bounded, and that the final leaf parse method is called.
--- drivers/firewire/net.c | 5 +++-- drivers/net/bonding/bond_main.c | 8 +++++--- drivers/net/wireless/cisco/airo.c | 4 +++- drivers/net/wireless/intersil/hostap/hostap_main.c | 1 + include/linux/etherdevice.h | 3 ++- include/linux/if_ether.h | 3 ++- include/linux/netdevice.h | 6 ++++-- net/ethernet/eth.c | 9 +++------ net/ipv4/ip_gre.c | 3 ++- net/mac802154/iface.c | 4 +++- net/phonet/af_phonet.c | 5 ++++- 11 files changed, 32 insertions(+), 19 deletions(-)
drivers/firewire/net.c +3 -2
@@ -257,9 +257,10 @@ static void fwnet_header_cache_update(struct hh_cache *hh,memcpy ((u8 *)hh->hh_data +HH_DATA_OFF (FWNET_HLEN ), haddr, net->addr_len); } -static int fwnet_header_parse (const struct sk_buff *skb,unsigned char *haddr) +static int fwnet_header_parse (const struct sk_buff *skb,const struct net_device *dev, +unsigned char *haddr) { -memcpy (haddr, skb->dev->dev_addr,FWNET_ALEN ); +memcpy (haddr, dev->dev_addr,FWNET_ALEN );return FWNET_ALEN ; }
drivers/net/bonding/bond_main.c +5 -3
@@ -1489,9 +1489,11 @@ static int bond_header_create(struct sk_buff *skb, struct net_device *bond_dev,return ret; } -static int bond_header_parse (const struct sk_buff *skb,unsigned char *haddr) +static int bond_header_parse (const struct sk_buff *skb, +const struct net_device *dev, +unsigned char *haddr) { -struct bonding *bond =netdev_priv (skb->dev); +struct bonding *bond =netdev_priv (dev);const struct header_ops *slave_ops;struct slave *slave;int ret =0 ;
@@ -1501,7 +1503,7 @@ static int bond_header_parse(const struct sk_buff *skb, unsigned char *haddr)if (slave) { slave_ops =READ_ONCE (slave->dev->header_ops);if (slave_ops && slave_ops->parse) - ret = slave_ops->parse (skb, haddr); + ret = slave_ops->parse (skb, slave->dev, haddr); }rcu_read_unlock ();return ret;
drivers/net/wireless/cisco/airo.c +3 -1
@@ -2437,7 +2437,9 @@ void stop_airo_card(struct net_device *dev, int freeres)EXPORT_SYMBOL (stop_airo_card); -static int wll_header_parse (const struct sk_buff *skb,unsigned char *haddr) +static int wll_header_parse (const struct sk_buff *skb, +const struct net_device *dev, +unsigned char *haddr) {memcpy (haddr,skb_mac_header (skb) +10 ,ETH_ALEN );return ETH_ALEN ;
drivers/net/wireless/intersil/hostap/hostap_main.c +1 -0
@@ -575,6 +575,7 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)static int hostap_80211_header_parse (const struct sk_buff *skb, +const struct net_device *dev,unsigned char *haddr) {memcpy (haddr,skb_mac_header (skb) +10 ,ETH_ALEN );/* addr2 */
include/linux/etherdevice.h +2 -1
@@ -42,7 +42,8 @@ extern const struct header_ops eth_header_ops;int eth_header (struct sk_buff *skb,struct net_device *dev,unsigned short type,const void *daddr,const void *saddr,unsigned len); -int eth_header_parse (const struct sk_buff *skb,unsigned char *haddr); +int eth_header_parse (const struct sk_buff *skb,const struct net_device *dev, +unsigned char *haddr);int eth_header_cache (const struct neighbour *neigh,struct hh_cache *hh,__be16 type); void eth_header_cache_update(struct hh_cache *hh, const struct net_device *dev,
include/linux/if_ether.h +2 -1
@@ -37,7 +37,8 @@ static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb)return (struct ethhdr *)skb_inner_mac_header (skb); } -int eth_header_parse (const struct sk_buff *skb,unsigned char *haddr); +int eth_header_parse (const struct sk_buff *skb,const struct net_device *dev, +unsigned char *haddr);extern ssize_t sysfs_format_mac (char *buf,const unsigned char *addr,int len);
include/linux/netdevice.h +4 -2
@@ -312,7 +312,9 @@ struct header_ops {int (*create) (struct sk_buff *skb,struct net_device *dev,unsigned short type,const void *daddr,const void *saddr,unsigned int len); -int (*parse)(const struct sk_buff *skb,unsigned char *haddr); +int (*parse)(const struct sk_buff *skb, +const struct net_device *dev, +unsigned char *haddr);int (*cache)(const struct neighbour *neigh,struct hh_cache *hh,__be16 type); void (*cache_update)(struct hh_cache *hh, const struct net_device *dev,
@@ -3174,7 +3176,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,if (!dev->header_ops || !dev->header_ops->parse)return 0 ; -return dev->header_ops->parse (skb, haddr); +return dev->header_ops->parse (skb, dev, haddr); }static inline __be16 dev_parse_header_protocol (const struct sk_buff *skb)
net/ethernet/eth.c +3 -6
@@ -195,14 +195,11 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) }EXPORT_SYMBOL (eth_type_trans); -/** -* eth_header_parse - extract hardware address from packet -* @skb: packet to extract header from -* @haddr: destination buffer -*/ -int eth_header_parse (const struct sk_buff *skb,unsigned char *haddr) +int eth_header_parse (const struct sk_buff *skb,const struct net_device *dev, +unsigned char *haddr) {const struct ethhdr *eth =eth_hdr (skb); +memcpy (haddr, eth->h_source,ETH_ALEN );return ETH_ALEN ; }
net/ipv4/ip_gre.c +2 -1
@@ -888,7 +888,8 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,return -(t->hlen +sizeof (*iph)); } -static int ipgre_header_parse (const struct sk_buff *skb,unsigned char *haddr) +static int ipgre_header_parse (const struct sk_buff *skb,const struct net_device *dev, +unsigned char *haddr) {const struct iphdr *iph = (const struct iphdr *)skb_mac_header (skb);memcpy (haddr, &iph->saddr,4 );
net/mac802154/iface.c +3 -1
@@ -469,7 +469,9 @@ static int mac802154_header_create(struct sk_buff *skb, }static int -mac802154_header_parse (const struct sk_buff *skb,unsigned char *haddr) +mac802154_header_parse (const struct sk_buff *skb, +const struct net_device *dev, +unsigned char *haddr) {struct ieee802154_hdr hdr;
net/phonet/af_phonet.c +4 -1
@@ -129,9 +129,12 @@ static int pn_header_create(struct sk_buff *skb, struct net_device *dev,return 1 ; } -static int pn_header_parse (const struct sk_buff *skb,unsigned char *haddr) +static int pn_header_parse (const struct sk_buff *skb, +const struct net_device *dev, +unsigned char *haddr) {const u8 *media =skb_mac_header (skb); + *haddr = *media;return 1 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 53/1266 team: fix header_ops type confusion with non-Ethernet ports
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit 425000dbf17373a4ab8be9428f5dc055ef870a56 ]
Similar to commit 950803f72547 ("bonding: fix type confusion in bond_setup_by_slave()") team has the same class of header_ops type confusion.
For non-Ethernet ports, team_setup_by_port() copies port_dev->header_ops directly. When the team device later calls dev_hard_header() or dev_parse_header(), these callbacks can run with the team net_device instead of the real lower device, so netdev_priv(dev) is interpreted as the wrong private type and can crash.
The syzbot report shows a crash in bond_header_create(), but the root cause is in team: the topology is gre -> bond -> team, and team calls the inherited header_ops with its own net_device instead of the lower device, so bond_header_create() receives a team device and interprets netdev_priv() as bonding private data, causing a type confusion crash.
Fix this by introducing team header_ops wrappers for create/parse, selecting a team port under RCU, and calling the lower device callbacks with port->dev, so each callback always sees the correct net_device context.
Also pass the selected lower device to the lower parse callback, so recursion is bounded in stacked non-Ethernet topologies and parse callbacks always run with the correct device context.
--- drivers/net/team/team_core.c | 65 +++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-)
drivers/net/team/team_core.c +64 -1
@@ -2128,6 +2128,68 @@ static const struct ethtool_ops team_ethtool_ops = {* rt netlink interface ***********************/ +/* For tx path we need a linkup && enabled port and for parse any port +* suffices. +*/ +static struct team_port *team_header_port_get_rcu (struct team *team, +bool txable) +{ +struct team_port *port; + +list_for_each_entry_rcu (port, &team->port_list, list) { +if (!txable ||team_port_txable (port)) +return port; + } + +return NULL ; +} + +static int team_header_create (struct sk_buff *skb,struct net_device *team_dev, +unsigned short type,const void *daddr, +const void *saddr,unsigned int len) +{ +struct team *team =netdev_priv (team_dev); +const struct header_ops *port_ops; +struct team_port *port; +int ret =0 ; + +rcu_read_lock (); + port =team_header_port_get_rcu (team, true); +if (port) { + port_ops =READ_ONCE (port->dev->header_ops); +if (port_ops && port_ops->create) + ret = port_ops->create (skb, port->dev, + type, daddr, saddr, len); + } +rcu_read_unlock (); +return ret; +} + +static int team_header_parse (const struct sk_buff *skb, +const struct net_device *team_dev, +unsigned char *haddr) +{ +struct team *team =netdev_priv (team_dev); +const struct header_ops *port_ops; +struct team_port *port; +int ret =0 ; + +rcu_read_lock (); + port =team_header_port_get_rcu (team, false); +if (port) { + port_ops =READ_ONCE (port->dev->header_ops); +if (port_ops && port_ops->parse) + ret = port_ops->parse (skb, port->dev, haddr); + } +rcu_read_unlock (); +return ret; +} + +static const struct header_ops team_header_ops = { + .create = team_header_create, + .parse = team_header_parse, +}; +static void team_setup_by_port (struct net_device *dev,struct net_device *port_dev) {
@@ -2136,7 +2198,8 @@ static void team_setup_by_port(struct net_device *dev,if (port_dev->type ==ARPHRD_ETHER ) dev->header_ops = team->header_ops_cache;else - dev->header_ops = port_dev->header_ops; + dev->header_ops = port_dev->header_ops ? + &team_header_ops :NULL ; dev->type = port_dev->type; dev->hard_header_len = port_dev->hard_header_len; dev->needed_headroom = port_dev->needed_headroom;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 54/1266 mm/vmscan: flush deferred TLB before freeing large folios
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
In reclaim, shrink_folio_list() unmaps PTEs with a deferred, batched TLB flush. The batch is only flushed by try_to_unmap_flush() near the end of the function, just before the order-0 folios collected in @free_folios are handed back to the allocator.
Large folios don't go through @free_folios -- they're freed inline at the free_it label via destroy_large_folio(), which runs before that flush. So a large folio's pages can be returned to the buddy allocator and reused while another CPU still holds a stale TLB entry for them, and that CPU then reads or executes through the stale translation into the reused page. For file-backed large folios (e.g. executable text) this shows up as random SIGSEGV/SIGILL in user space, with fault addresses that don't match the code being run.
Flush the deferred batch before freeing a large folio inline, the same way the order-0 path already waits for the flush.
Upstream this is fixed as a side effect of commit bc2ff4cbc329 ("mm: free folios in a batch in shrink_folio_list()"), which is a larger change; this is the minimal fix for -stable.
--- mm/vmscan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
mm/vmscan.c +4 -2
@@ -2123,10 +2123,12 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,* Is there need to periodically free_folio_list? It would * appear not as the counts should be low */ -if (unlikely (folio_test_large (folio))) +if (unlikely (folio_test_large (folio))) { +try_to_unmap_flush ();destroy_large_folio (folio); -else + }else {list_add (&folio->lru, &free_folios); + }continue ; activate_locked_split:
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 55/1266 xfs: recreate work items when recovering intent items
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
commit e70fb328d5277297ea2d9169a3a046de6412d777 upstream.
Recreate work items for each xfs_defer_pending object when we are recovering intent items.
[ fp: fix conflict in calling xfs_attr_namecheck() with 2 args instead
of 3 due to backported ea0b3e814741 ("xfs: enforce one namespace per attribute") ]
--- fs/xfs/libxfs/xfs_defer.c | 3 +- fs/xfs/libxfs/xfs_defer.h | 9 +++ fs/xfs/xfs_attr_item.c | 92 +++++++++++++++++------------- fs/xfs/xfs_bmap_item.c | 55 +++++++++++------- fs/xfs/xfs_extfree_item.c | 49 +++++++++------- fs/xfs/xfs_refcount_item.c | 60 ++++++++++---------- fs/xfs/xfs_rmap_item.c | 112 ++++++++++++++++++++----------------- 7 files changed, 216 insertions(+), 164 deletions(-)
fs/xfs/libxfs/xfs_defer.c +1 -2
@@ -676,9 +676,8 @@ xfs_defer_add(list_add_tail (&dfp->dfp_list, &tp->t_dfops); } -list_add_tail (li, &dfp->dfp_work); +xfs_defer_add_item (dfp, li);trace_xfs_defer_add_item (tp->t_mountp, dfp, li); - dfp->dfp_count++; }/*
fs/xfs/libxfs/xfs_defer.h +9 -0
@@ -130,6 +130,15 @@ void xfs_defer_start_recovery(struct xfs_log_item *lip,void xfs_defer_cancel_recovery (struct xfs_mount *mp,struct xfs_defer_pending *dfp); +static inline void +xfs_defer_add_item ( +struct xfs_defer_pending *dfp, +struct list_head *work) +{ +list_add_tail (work, &dfp->dfp_work); + dfp->dfp_count++; +} +int __init xfs_defer_init_item_caches (void );void xfs_defer_destroy_item_caches (void );
fs/xfs/xfs_attr_item.c +52 -40
122 lines not on this page · raw message
fs/xfs/xfs_bmap_item.c +35 -20
99 lines not on this page · raw message
fs/xfs/xfs_extfree_item.c +30 -19
87 lines not on this page · raw message
fs/xfs/xfs_refcount_item.c +28 -32
95 lines not on this page · raw message
fs/xfs/xfs_rmap_item.c +61 -51
139 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 56/1266 xfs: dump the recovered xattri log item if corruption happens
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
commit a51489e140d302c7afae763eacf882a23513f7e4 upstream.
If xfs_attri_item_recover receives a corruption error when it tries to finish a recovered log intent item, it should dump the log item for debugging, just like all the other log intent items.
--- fs/xfs/xfs_attr_item.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/xfs/xfs_attr_item.c +4 -0
@@ -672,6 +672,10 @@ xfs_attri_item_recover(xfs_irele (ip);return 0 ; } +if (error == -EFSCORRUPTED ) +XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, + &attrip->attri_format, +sizeof (attrip->attri_format));if (error) {xfs_trans_cancel (tp); goto out_unlock;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 57/1266 xfs: use xfs_defer_finish_one to finish recovered work items
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
commit e5f1a5146ec35f3ed5d7f5ac7807a10c0062b6b8 upstream.
Get rid of the open-coded calls to xfs_defer_finish_one. This also means that the recovery transaction takes care of cleaning up the dfp, and we have solved (I hope) all the ownership issues in recovery.
--- fs/xfs/libxfs/xfs_defer.c | 2 +- fs/xfs/libxfs/xfs_defer.h | 1 + fs/xfs/libxfs/xfs_log_recover.h | 2 +- fs/xfs/xfs_attr_item.c | 20 +---------- fs/xfs/xfs_bmap_item.c | 24 ++++--------- fs/xfs/xfs_extfree_item.c | 45 +++++------------------- fs/xfs/xfs_log_recover.c | 22 +++++++----- fs/xfs/xfs_refcount_item.c | 61 +++++---------------------------- fs/xfs/xfs_rmap_item.c | 29 +++++----------- 9 files changed, 49 insertions(+), 157 deletions(-)
fs/xfs/libxfs/xfs_defer.c +1 -1
@@ -484,7 +484,7 @@ xfs_defer_relog(* Log an intent-done item for the first pending intent, and finish the work * items. */ -static int +int xfs_defer_finish_one (struct xfs_trans *tp,struct xfs_defer_pending *dfp)
fs/xfs/libxfs/xfs_defer.h +1 -0
@@ -41,6 +41,7 @@ void xfs_defer_add(struct xfs_trans *tp, enum xfs_defer_ops_type type, struct list_head *h);int xfs_defer_finish_noroll (struct xfs_trans **tp);int xfs_defer_finish (struct xfs_trans **tp); +int xfs_defer_finish_one (struct xfs_trans *tp,struct xfs_defer_pending *dfp);void xfs_defer_cancel (struct xfs_trans *);void xfs_defer_move (struct xfs_trans *dtp,struct xfs_trans *stp);
fs/xfs/libxfs/xfs_log_recover.h +1 -1
@@ -155,7 +155,7 @@ xlog_recover_resv(const struct xfs_trans_res *r)void xlog_recover_intent_item (struct xlog *log,struct xfs_log_item *lip,xfs_lsn_t lsn,unsigned int dfp_type); -void xlog_recover_transfer_intent (struct xfs_trans *tp, +int xlog_recover_finish_intent (struct xfs_trans *tp,struct xfs_defer_pending *dfp);#endif /* __XFS_LOG_RECOVER_H__ */
fs/xfs/xfs_attr_item.c +1 -19
@@ -625,7 +625,6 @@ xfs_attri_item_recover(struct xfs_attri_log_nameval *nv = attrip->attri_nameval;int error;int total; -struct xfs_attrd_log_item *done_item =NULL ;/* * First check the validity of the attr described by the ATTRI. If any
@@ -651,27 +650,10 @@ xfs_attri_item_recover(return error; args->trans = tp; - done_item =xfs_trans_get_attrd (tp, attrip); -xlog_recover_transfer_intent (tp, dfp); -xfs_ilock (ip,XFS_ILOCK_EXCL );xfs_trans_ijoin (tp, ip,0 ); - error =xfs_xattri_finish_update (attr, done_item); -if (error == -EAGAIN ) { -/* -* There's more work to do, so add the intent item to this -* transaction so that we can continue it later. -*/ -xfs_defer_add (tp,XFS_DEFER_OPS_TYPE_ATTR , &attr->xattri_list); - error =xfs_defer_ops_capture_and_commit (tp, capture_list); -if (error) - goto out_unlock; - -xfs_iunlock (ip,XFS_ILOCK_EXCL ); -xfs_irele (ip); -return 0 ; - } + error =xlog_recover_finish_intent (tp, dfp);if (error == -EFSCORRUPTED ) XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, &attrip->attri_format,
fs/xfs/xfs_bmap_item.c +7 -17
@@ -498,6 +498,7 @@ xfs_bui_recover_work( bi->bi_bmap.br_blockcount = map->me_len; bi->bi_bmap.br_state = (map->me_flags &XFS_BMAP_EXTENT_UNWRITTEN ) ?XFS_EXT_UNWRITTEN :XFS_EXT_NORM ; +xfs_bmap_update_get_group (mp, bi);xfs_defer_add_item (dfp, &bi->bi_list);return bi;
@@ -519,8 +520,7 @@ xfs_bui_item_recover(struct xfs_inode *ip =NULL ;struct xfs_mount *mp = lip->li_log->l_mp;struct xfs_map_extent *map; -struct xfs_bud_log_item *budp; -struct xfs_bmap_intent *fake; +struct xfs_bmap_intent *work;int iext_delta;int error =0 ;
@@ -531,7 +531,7 @@ xfs_bui_item_recover( } map = &buip->bui_format.bui_extents[0 ]; - fake =xfs_bui_recover_work (mp, dfp, map); + work =xfs_bui_recover_work (mp, dfp, map); error =xlog_recover_iget (mp, map->me_owner, &ip);if (error)
@@ -544,39 +544,29 @@ xfs_bui_item_recover(if (error) goto err_rele; - budp =xfs_trans_get_bud (tp, buip); -xlog_recover_transfer_intent (tp, dfp); -xfs_ilock (ip,XFS_ILOCK_EXCL );xfs_trans_ijoin (tp, ip,0 ); -if (fake->bi_type ==XFS_BMAP_MAP ) +if (work->bi_type ==XFS_BMAP_MAP ) iext_delta =XFS_IEXT_ADD_NOSPLIT_CNT ;else iext_delta =XFS_IEXT_PUNCH_HOLE_CNT ; - error =xfs_iext_count_may_overflow (ip, fake->bi_whichfork, iext_delta); + error =xfs_iext_count_may_overflow (ip, work->bi_whichfork, iext_delta);if (error == -EFBIG ) error =xfs_iext_count_upgrade (tp, ip, iext_delta);if (error) goto err_cancel; - fake->bi_owner = ip; + work->bi_owner = ip; -xfs_bmap_update_get_group (mp, fake); - error =xfs_trans_log_finish_bmap_update (tp, budp, fake); + error =xlog_recover_finish_intent (tp, dfp);if (error == -EFSCORRUPTED )XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, &buip->bui_format,sizeof (buip->bui_format)); -xfs_bmap_update_put_group (fake);if (error) goto err_cancel; -if (fake->bi_bmap.br_blockcount >0 ) { -ASSERT (fake->bi_type ==XFS_BMAP_UNMAP ); -xfs_bmap_unmap_extent (tp, ip, &fake->bi_bmap); - } -/* * Commit transaction, which frees the transaction and saves the inode * for later replay activities.
fs/xfs/xfs_extfree_item.c +8 -37
66 lines not on this page · raw message
fs/xfs/xfs_log_recover.c +14 -8
@@ -2584,7 +2584,8 @@ xlog_recover_process_intents(* replayed in the wrong order! * * The recovery function can free the log item, so we must not -* access lip after it returns. +* access lip after it returns. It must dispose of @dfp if it +* returns 0. */ error = ops->iop_recover (dfp, &capture_list);if (error) {
@@ -2592,8 +2593,6 @@ xlog_recover_process_intents( ops->iop_recover);break ; } - -xfs_defer_cancel_recovery (log->l_mp, dfp); }if (error) goto err;
@@ -2627,15 +2626,22 @@ xlog_recover_cancel_intents( }/* -* Transfer ownership of the recovered log intent item to the recovery -* transaction. +* Transfer ownership of the recovered pending work to the recovery transaction +* and try to finish the work. If there is more work to be done, the dfp will +* remain attached to the transaction. If not, the dfp is freed. */ -void -xlog_recover_transfer_intent ( +int +xlog_recover_finish_intent (struct xfs_trans *tp,struct xfs_defer_pending *dfp) { - dfp->dfp_intent =NULL ; +int error; + +list_move (&dfp->dfp_list, &tp->t_dfops); + error =xfs_defer_finish_one (tp, dfp); +if (error == -EAGAIN ) +return 0 ; +return error; }/*
fs/xfs/xfs_refcount_item.c +8 -53
85 lines not on this page · raw message
fs/xfs/xfs_rmap_item.c +8 -21
@@ -546,6 +546,7 @@ xfs_rui_recover_work( ri->ri_bmap.br_blockcount = map->me_len; ri->ri_bmap.br_state = (map->me_flags &XFS_RMAP_EXTENT_UNWRITTEN ) ?XFS_EXT_UNWRITTEN :XFS_EXT_NORM ; +xfs_rmap_update_get_group (mp, ri);xfs_defer_add_item (dfp, &ri->ri_list); }
@@ -562,11 +563,8 @@ xfs_rui_item_recover(struct xfs_trans_res resv;struct xfs_log_item *lip = dfp->dfp_intent;struct xfs_rui_log_item *ruip =RUI_ITEM (lip); -struct xfs_rud_log_item *rudp;struct xfs_trans *tp; -struct xfs_btree_cur *rcur =NULL ;struct xfs_mount *mp = lip->li_log->l_mp; -struct xfs_rmap_intent *fake;int i;int error =0 ;
@@ -593,28 +591,17 @@ xfs_rui_item_recover(if (error)return error; - rudp =xfs_trans_get_rud (tp, ruip); -xlog_recover_transfer_intent (tp, dfp); - -list_for_each_entry (fake, &dfp->dfp_work, ri_list) { -xfs_rmap_update_get_group (mp, fake); - error =xfs_trans_log_finish_rmap_update (tp, rudp, fake, - &rcur); -if (error == -EFSCORRUPTED ) -XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, - &ruip->rui_format, -sizeof (ruip->rui_format)); -xfs_rmap_update_put_group (fake); -if (error) - goto abort_error; - - } + error =xlog_recover_finish_intent (tp, dfp); +if (error == -EFSCORRUPTED ) +XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, + &ruip->rui_format, +sizeof (ruip->rui_format)); +if (error) + goto abort_error; -xfs_rmap_finish_one_cleanup (tp, rcur, error);return xfs_defer_ops_capture_and_commit (tp, capture_list); abort_error: -xfs_rmap_finish_one_cleanup (tp, rcur, error);xfs_trans_cancel (tp);return error; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 58/1266 xfs: move ->iop_recover to xfs_defer_op_type
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darrick J. Wong <[email protected]>
commit db7ccc0bac2add5a41b66578e376b49328fc99d0 upstream.
Finish off the series by moving the intent item recovery function pointer to the xfs_defer_op_type struct, since this is really a deferred work function now.
--- fs/xfs/libxfs/xfs_defer.c | 17 +++++++++++++ fs/xfs/libxfs/xfs_defer.h | 4 +++ fs/xfs/libxfs/xfs_log_recover.h | 2 ++ fs/xfs/xfs_attr_item.c | 21 +++++++++------- fs/xfs/xfs_bmap_item.c | 39 ++++++++++++++++-------------- fs/xfs/xfs_extfree_item.c | 43 +++++++++++++++++---------------- fs/xfs/xfs_log_recover.c | 19 ++++++--------- fs/xfs/xfs_refcount_item.c | 24 +++++++++--------- fs/xfs/xfs_rmap_item.c | 24 +++++++++--------- fs/xfs/xfs_trans.h | 4 --- 10 files changed, 109 insertions(+), 88 deletions(-)
fs/xfs/libxfs/xfs_defer.c +17 -0
@@ -713,6 +713,23 @@ xfs_defer_cancel_recovery(xfs_defer_pending_cancel_work (mp, dfp); } +/* Replay the deferred work item created from a recovered log intent item. */ +int +xfs_defer_finish_recovery ( +struct xfs_mount *mp, +struct xfs_defer_pending *dfp, +struct list_head *capture_list) +{ +const struct xfs_defer_op_type *ops = defer_op_types[dfp->dfp_type]; +int error; + + error = ops->recover_work (dfp, capture_list); +if (error) +trace_xlog_intent_recovery_failed (mp, error, + ops->recover_work); +return error; +} +/* * Move deferred ops from one transaction to another and reset the source to * initial state. This is primarily used to carry state forward across
fs/xfs/libxfs/xfs_defer.h +4 -0
@@ -57,6 +57,8 @@ struct xfs_defer_op_type {void (*finish_cleanup)(struct xfs_trans *tp,struct xfs_btree_cur *state,int error);void (*cancel_item)(struct list_head *item); +int (*recover_work)(struct xfs_defer_pending *dfp, +struct list_head *capture_list);unsigned int max_items; };
@@ -130,6 +132,8 @@ void xfs_defer_start_recovery(struct xfs_log_item *lip, enum xfs_defer_ops_type dfp_type, struct list_head *r_dfops);void xfs_defer_cancel_recovery (struct xfs_mount *mp,struct xfs_defer_pending *dfp); +int xfs_defer_finish_recovery (struct xfs_mount *mp, +struct xfs_defer_pending *dfp,struct list_head *capture_list);static inline void xfs_defer_add_item(
fs/xfs/libxfs/xfs_log_recover.h +2 -0
@@ -153,6 +153,8 @@ xlog_recover_resv(const struct xfs_trans_res *r)return ret; } +struct xfs_defer_pending ; +void xlog_recover_intent_item (struct xlog *log,struct xfs_log_item *lip,xfs_lsn_t lsn,unsigned int dfp_type); int xlog_recover_finish_intent(struct xfs_trans *tp,
fs/xfs/xfs_attr_item.c +12 -9
@@ -551,12 +551,17 @@ xfs_attri_recover_work(struct xfs_mount *mp, struct xfs_defer_pending *dfp, struct xfs_attri_log_format *attrp, - struct xfs_inode *ip, + struct xfs_inode **ipp, struct xfs_attri_log_nameval *nv) { struct xfs_attr_intent *attr;struct xfs_da_args *args;int local; +int error; + + error =xlog_recover_iget (mp, attrp->alfi_ino, ipp); +if (error) +return ERR_PTR (error); attr =kmem_zalloc (sizeof (struct xfs_attr_intent ) +sizeof (struct xfs_da_args ),KM_NOFS );
@@ -574,7 +579,7 @@ xfs_attri_recover_work( attr->xattri_nameval =xfs_attri_log_nameval_get (nv);ASSERT (attr->xattri_nameval); - args->dp = ip; + args->dp = *ipp; args->geo = mp->m_attr_geo; args->whichfork =XFS_ATTR_FORK ; args->name = nv->name.i_addr;
@@ -609,7 +614,7 @@ xfs_attri_recover_work(* delete the attr that it describes. */ STATIC int -xfs_attri_item_recover ( +xfs_attr_recover_work (struct xfs_defer_pending *dfp,struct list_head *capture_list) {
@@ -636,11 +641,9 @@ xfs_attri_item_recover( nv->name.i_len))return -EFSCORRUPTED ; - error =xlog_recover_iget (mp, attrp->alfi_ino, &ip); -if (error) -return error; - - attr =xfs_attri_recover_work (mp, dfp, attrp, ip, nv); + attr =xfs_attri_recover_work (mp, dfp, attrp, &ip, nv); +if (IS_ERR (attr)) +return PTR_ERR (attr); args = attr->xattri_da_args;xfs_init_attr_trans (args, &resv, &total);
@@ -890,6 +893,7 @@ const struct xfs_defer_op_type xfs_attr_defer_type = { .create_done = xfs_attr_create_done, .finish_item = xfs_attr_finish_item, .cancel_item = xfs_attr_cancel_item, + .recover_work = xfs_attr_recover_work, };/*
@@ -926,7 +930,6 @@ static const struct xfs_item_ops xfs_attri_item_ops = { .iop_format = xfs_attri_item_format, .iop_unpin = xfs_attri_item_unpin, .iop_release = xfs_attri_item_release, - .iop_recover = xfs_attri_item_recover, .iop_match = xfs_attri_item_match, .iop_relog = xfs_attri_item_relog, };
fs/xfs/xfs_bmap_item.c +21 -18
@@ -438,15 +438,6 @@ xfs_bmap_update_cancel_item(kmem_cache_free (xfs_bmap_intent_cache, bi); } -const struct xfs_defer_op_type xfs_bmap_update_defer_type = { - .max_items =XFS_BUI_MAX_FAST_EXTENTS , - .create_intent = xfs_bmap_update_create_intent, - .abort_intent = xfs_bmap_update_abort_intent, - .create_done = xfs_bmap_update_create_done, - .finish_item = xfs_bmap_update_finish_item, - .cancel_item = xfs_bmap_update_cancel_item, -}; -/* Is this recovered BUI ok? */ static inline bool xfs_bui_validate(
@@ -485,9 +476,15 @@ static inline struct xfs_bmap_intent *xfs_bui_recover_work ( struct xfs_mount *mp, struct xfs_defer_pending *dfp, + struct xfs_inode **ipp, struct xfs_map_extent *map) { struct xfs_bmap_intent *bi; +int error; + + error =xlog_recover_iget (mp, map->me_owner, ipp); +if (error) +return ERR_PTR (error); bi =kmem_cache_zalloc (xfs_bmap_intent_cache,GFP_NOFS | __GFP_NOFAIL); bi->bi_whichfork = (map->me_flags & XFS_BMAP_EXTENT_ATTR_FORK) ?
@@ -498,6 +495,7 @@ xfs_bui_recover_work( bi->bi_bmap.br_blockcount = map->me_len; bi->bi_bmap.br_state = (map->me_flags &XFS_BMAP_EXTENT_UNWRITTEN ) ?XFS_EXT_UNWRITTEN :XFS_EXT_NORM ; + bi->bi_owner = *ipp;xfs_bmap_update_get_group (mp, bi);xfs_defer_add_item (dfp, &bi->bi_list);
@@ -509,7 +507,7 @@ xfs_bui_recover_work(* We need to update some inode's bmbt. */ STATIC int -xfs_bui_item_recover ( +xfs_bmap_recover_work (struct xfs_defer_pending *dfp,struct list_head *capture_list) {
@@ -531,11 +529,9 @@ xfs_bui_item_recover( } map = &buip->bui_format.bui_extents[0 ]; - work =xfs_bui_recover_work (mp, dfp, map); - - error =xlog_recover_iget (mp, map->me_owner, &ip); -if (error) -return error; + work =xfs_bui_recover_work (mp, dfp, &ip, map); +if (IS_ERR (work)) +return PTR_ERR (work);/* Allocate transaction and do the work. */ resv =xlog_recover_resv (&M_RES (mp)->tr_itruncate);
@@ -558,8 +554,6 @@ xfs_bui_item_recover(if (error) goto err_cancel; - work->bi_owner = ip; - error =xlog_recover_finish_intent (tp, dfp);if (error == -EFSCORRUPTED ) XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp,
@@ -588,6 +582,16 @@ xfs_bui_item_recover(return error; } +const struct xfs_defer_op_type xfs_bmap_update_defer_type = { + .max_items =XFS_BUI_MAX_FAST_EXTENTS , + .create_intent = xfs_bmap_update_create_intent, + .abort_intent = xfs_bmap_update_abort_intent, + .create_done = xfs_bmap_update_create_done, + .finish_item = xfs_bmap_update_finish_item, + .cancel_item = xfs_bmap_update_cancel_item, + .recover_work = xfs_bmap_recover_work, +}; + STATIC bool xfs_bui_item_match( struct xfs_log_item *lip,
@@ -628,7 +632,6 @@ static const struct xfs_item_ops xfs_bui_item_ops = { .iop_format = xfs_bui_item_format, .iop_unpin = xfs_bui_item_unpin, .iop_release = xfs_bui_item_release, - .iop_recover = xfs_bui_item_recover, .iop_match = xfs_bui_item_match, .iop_relog = xfs_bui_item_relog, };
fs/xfs/xfs_extfree_item.c +22 -21
73 lines not on this page · raw message
fs/xfs/xfs_log_recover.c +7 -12
@@ -2565,17 +2565,14 @@ xlog_recover_process_intents(#endif list_for_each_entry_safe (dfp, n, &log->r_dfops, dfp_list) { -struct xfs_log_item *lip = dfp->dfp_intent; -const struct xfs_item_ops *ops = lip->li_ops; - -ASSERT (xlog_item_is_intent (lip)); +ASSERT (xlog_item_is_intent (dfp->dfp_intent));/* * We should never see a redo item with a LSN higher than * the last transaction we found in the log at the start * of recovery. */ -ASSERT (XFS_LSN_CMP (last_lsn, lip->li_lsn) >=0 ); +ASSERT (XFS_LSN_CMP (last_lsn, dfp->dfp_intent->li_lsn) >=0 );/* * NOTE: If your intent processing routine can create more
@@ -2584,15 +2581,13 @@ xlog_recover_process_intents(* replayed in the wrong order! * * The recovery function can free the log item, so we must not -* access lip after it returns. It must dispose of @dfp if it -* returns 0. +* access dfp->dfp_intent after it returns. It must dispose of +* @dfp if it returns 0. */ - error = ops->iop_recover (dfp, &capture_list); -if (error) { -trace_xlog_intent_recovery_failed (log->l_mp, error, - ops->iop_recover); + error =xfs_defer_finish_recovery (log->l_mp, dfp, + &capture_list); +if (error)break ; - } }if (error) goto err;
fs/xfs/xfs_refcount_item.c +12 -12
@@ -433,16 +433,6 @@ xfs_refcount_update_cancel_item(kmem_cache_free (xfs_refcount_intent_cache, ri); } -const struct xfs_defer_op_type xfs_refcount_update_defer_type = { - .max_items =XFS_CUI_MAX_FAST_EXTENTS , - .create_intent = xfs_refcount_update_create_intent, - .abort_intent = xfs_refcount_update_abort_intent, - .create_done = xfs_refcount_update_create_done, - .finish_item = xfs_refcount_update_finish_item, - .finish_cleanup = xfs_refcount_finish_one_cleanup, - .cancel_item = xfs_refcount_update_cancel_item, -}; -/* Is this recovered CUI ok? */ static inline bool xfs_cui_validate_phys(
@@ -491,7 +481,7 @@ xfs_cui_recover_work(* We need to update the refcountbt. */ STATIC int -xfs_cui_item_recover ( +xfs_refcount_recover_work (struct xfs_defer_pending *dfp,struct list_head *capture_list) {
@@ -553,6 +543,17 @@ xfs_cui_item_recover(return error; } +const struct xfs_defer_op_type xfs_refcount_update_defer_type = { + .max_items =XFS_CUI_MAX_FAST_EXTENTS , + .create_intent = xfs_refcount_update_create_intent, + .abort_intent = xfs_refcount_update_abort_intent, + .create_done = xfs_refcount_update_create_done, + .finish_item = xfs_refcount_update_finish_item, + .finish_cleanup = xfs_refcount_finish_one_cleanup, + .cancel_item = xfs_refcount_update_cancel_item, + .recover_work = xfs_refcount_recover_work, +}; + STATIC bool xfs_cui_item_match( struct xfs_log_item *lip,
@@ -593,7 +594,6 @@ static const struct xfs_item_ops xfs_cui_item_ops = { .iop_format = xfs_cui_item_format, .iop_unpin = xfs_cui_item_unpin, .iop_release = xfs_cui_item_release, - .iop_recover = xfs_cui_item_recover, .iop_match = xfs_cui_item_match, .iop_relog = xfs_cui_item_relog, };
fs/xfs/xfs_rmap_item.c +12 -12
@@ -452,16 +452,6 @@ xfs_rmap_update_cancel_item(kmem_cache_free (xfs_rmap_intent_cache, ri); } -const struct xfs_defer_op_type xfs_rmap_update_defer_type = { - .max_items =XFS_RUI_MAX_FAST_EXTENTS , - .create_intent = xfs_rmap_update_create_intent, - .abort_intent = xfs_rmap_update_abort_intent, - .create_done = xfs_rmap_update_create_done, - .finish_item = xfs_rmap_update_finish_item, - .finish_cleanup = xfs_rmap_finish_one_cleanup, - .cancel_item = xfs_rmap_update_cancel_item, -}; -/* Is this recovered RUI ok? */ static inline bool xfs_rui_validate_map(
@@ -556,7 +546,7 @@ xfs_rui_recover_work(* We need to update the rmapbt. */ STATIC int -xfs_rui_item_recover ( +xfs_rmap_recover_work (struct xfs_defer_pending *dfp,struct list_head *capture_list) {
@@ -606,6 +596,17 @@ xfs_rui_item_recover(return error; } +const struct xfs_defer_op_type xfs_rmap_update_defer_type = { + .max_items =XFS_RUI_MAX_FAST_EXTENTS , + .create_intent = xfs_rmap_update_create_intent, + .abort_intent = xfs_rmap_update_abort_intent, + .create_done = xfs_rmap_update_create_done, + .finish_item = xfs_rmap_update_finish_item, + .finish_cleanup = xfs_rmap_finish_one_cleanup, + .cancel_item = xfs_rmap_update_cancel_item, + .recover_work = xfs_rmap_recover_work, +}; + STATIC bool xfs_rui_item_match( struct xfs_log_item *lip,
@@ -646,7 +647,6 @@ static const struct xfs_item_ops xfs_rui_item_ops = { .iop_format = xfs_rui_item_format, .iop_unpin = xfs_rui_item_unpin, .iop_release = xfs_rui_item_release, - .iop_recover = xfs_rui_item_recover, .iop_match = xfs_rui_item_match, .iop_relog = xfs_rui_item_relog, };
fs/xfs/xfs_trans.h +0 -4
@@ -66,8 +66,6 @@ struct xfs_log_item { { (1u << XFS_LI_DIRTY), "DIRTY" }, \ { (1u << XFS_LI_WHITEOUT), "WHITEOUT" } -struct xfs_defer_pending ; -struct xfs_item_ops {unsigned flags;void (*iop_size)(struct xfs_log_item *,int *,int *);
@@ -80,8 +78,6 @@ struct xfs_item_ops {xfs_lsn_t (*iop_committed)(struct xfs_log_item *,xfs_lsn_t );uint (*iop_push)(struct xfs_log_item *,struct list_head *);void (*iop_release)(struct xfs_log_item *); -int (*iop_recover)(struct xfs_defer_pending *dfp, -struct list_head *capture_list);bool (*iop_match)(struct xfs_log_item *item,uint64_t id);struct xfs_log_item *(*iop_relog)(struct xfs_log_item *intent,struct xfs_trans *tp);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 59/1266 Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudia Draghicescu <[email protected]>
[ Upstream commit f4da3ee15de9944482382181329bb6d7335ca003 ]
Copy the content of a Periodic Advertisement Report to BASE only if the service UUID is Basic Audio Announcement Service UUID.
--- net/bluetooth/iso.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
net/bluetooth/iso.c +12 -4
@@ -14,6 +14,7 @@#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/hci_core.h> #include <net/bluetooth/iso.h> +#include "eir.h" static const struct proto_ops iso_sock_ops;
@@ -47,6 +48,7 @@ static void iso_sock_kill(struct sock *sk);#define EIR_SERVICE_DATA_LENGTH 4#define BASE_MAX_LENGTH (HCI_MAX_PER_AD_LENGTH - EIR_SERVICE_DATA_LENGTH) +#define EIR_BAA_SERVICE_UUID 0x1851/* iso_pinfo flags values */ enum {
@@ -1587,6 +1589,8 @@ static int iso_sock_getsockopt(struct socket *sock, int level, int optname, len = min_t(unsigned int, len, base_len);if (copy_to_user (optval, base, len)) err = -EFAULT ; +if (put_user (len, optlen)) + err = -EFAULT ;break ;
@@ -1928,12 +1932,16 @@ int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags) ev3 =hci_recv_event_data (hdev,HCI_EV_LE_PER_ADV_REPORT );if (ev3) { +size_t base_len = ev3->length; +u8 *base; + sk =iso_get_sock_listen (&hdev->bdaddr, bdaddr, iso_match_sync_handle_pa_report, ev3); - -if (sk) { -memcpy (iso_pi (sk)->base, ev3->data, ev3->length); -iso_pi (sk)->base_len = ev3->length; + base =eir_get_service_data (ev3->data, ev3->length, +EIR_BAA_SERVICE_UUID , &base_len); +if (base && sk && base_len <=sizeof (iso_pi (sk)->base)) { +memcpy (iso_pi (sk)->base, base, base_len); +iso_pi (sk)->base_len = base_len; } }else { sk =iso_get_sock_listen (&hdev->bdaddr,BDADDR_ANY ,NULL ,NULL );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 60/1266 perf trace beauty fcntl: Fix build with older kernel headers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit 7ee7f48413c42b90230de4a8e40898b757bc8e82 upstream.
Toolchains with older kernel headers that do not include upstream commit c75b1d9421f80f41 ("fs: add fcntl() interface for setting/getting write life time hints") will now fail to build perf due to missing definitions for F_GET_RW_HINT/F_SET_RW_HINT/F_GET_FILE_RW_HINT/F_SET_FILE_RW_HINT.
Provide a fallback definition for these when they are not already defined.
--- tools/perf/trace/beauty/fcntl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
tools/perf/trace/beauty/fcntl.c +16 -0
@@ -9,6 +9,22 @@#include <linux/kernel.h> #include <uapi/linux/fcntl.h> +#ifndef F_GET_RW_HINT +#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11) +#endif + +#ifndef F_SET_RW_HINT +#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12) +#endif + +#ifndef F_GET_FILE_RW_HINT +#define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13) +#endif + +#ifndef F_SET_FILE_RW_HINT +#define F_SET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 14) +#endif +static size_t fcntl__scnprintf_getfd (unsigned long val,char *bf,size_t size,bool show_prefix) { return val ? scnprintf(bf, size, "%s", "0") :
Greg Kroah-Hartman
maintainerPATCH 61/1266 ACPI: CPPC: Suppress UBSAN warning caused by field misuse
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Linton <[email protected]>
commit 1b1acf2dada0cc3931bb2cb9ff8832edfbee46a1 upstream.
The definition of reg->access_width changes depending on the reg->space_id type. Type ACPI_ADR_SPACE_PLATFORM_COMM uses access_width to indicate the PCC region, which can result in a UBSAN if the value is greater than 4.
For example:
UBSAN: shift-out-of-bounds in drivers/acpi/cppc_acpi.c:1090:9 shift exponent 32 is too large for 32-bit type 'int' CPU: 61 UID: 0 PID: 1220 Comm: (udev-worker) Not tainted 7.0.10-201.fc44.aarch64 #1 PREEMPT(lazy) Hardware name: To be filled by O.E.M. Call trace: ...(trimming) ubsan_epilogue+0x10/0x48 __ubsan_handle_shift_out_of_bounds+0xdc/0x1e0 cpc_write+0x4d0/0x670 cppc_set_perf+0x18c/0x490 cppc_cpufreq_cpu_init+0x1c8/0x380 [cppc_cpufreq] ... (trimming)
Lets fix this by validating the region type, as well as whether access_width has a value. Then since we are returning bit_width directly for ACPI_ADR_SPACE_PLATFORM_COMM, drop the code correcting the size.
--- drivers/acpi/cppc_acpi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/acpi/cppc_acpi.c +7 -4
@@ -171,8 +171,13 @@ show_cppc_data(cppc_get_perf_caps, cppc_show_cppc_data (cppc_get_perf_ctrs, cppc_perf_fb_ctrs, reference_perf);show_cppc_data (cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time); -/* Check for valid access_width, otherwise, fallback to using bit_width */ -#define GET_BIT_WIDTH (reg) ((reg)->access_width ? (8 << ((reg)->access_width - 1)) : (reg)->bit_width) +/* +* PCC reuses the access_width field as the subspace id, so only decode access +* size for non-PCC registers. Otherwise, use the bit_width. +*/ +#define GET_BIT_WIDTH (reg) (((reg)->access_width && \ + (reg)->space_id != ACPI_ADR_SPACE_PLATFORM_COMM) ? \ + (8 << ((reg)->access_width - 1)) : (reg)->bit_width)/* Shift and apply the mask for CPC reads/writes */ #define MASK_VAL_READ (reg, val) (((val) >> (reg)->bit_offset) & \
@@ -1033,7 +1038,6 @@ static int cpc_read(int cpu, struct cpc_* by the bit width field; the access size is used to indicate * the PCC subspace id. */ - size = reg->bit_width; vaddr =GET_PCC_VADDR (reg->address, pcc_ss_id); }else if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY )
@@ -1105,7 +1109,6 @@ static int cpc_write(int cpu, struct cpc* by the bit width field; the access size is used to indicate * the PCC subspace id. */ - size = reg->bit_width; vaddr =GET_PCC_VADDR (reg->address, pcc_ss_id); }else if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY )
Greg Kroah-Hartman
maintainerPATCH 62/1266 ACPI: NFIT: core: Fix possible NULL pointer dereference
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 027e128abb82788189d6d45b68e3e8e7329b67be upstream.
After commit 9b311b7313d6 ("ACPI: NFIT: Install Notify() handler before getting NFIT table"), acpi_nfit_probe() installs an ACPI notify handler for the NFIT device before checking the presence of the NFIT table. If that table is not there, 0 is returned without allocating the acpi_desc object and setting the driver data pointer of the NFIT device. If the platform firmware triggers an NFIT_NOTIFY_UC_MEMORY_ERROR notification on the NFIT device at that point, acpi_nfit_uc_error_notify() will dereference a NULL pointer.
Prevent that from occurring by adding an acpi_desc check against NULL to acpi_nfit_uc_error_notify().
--- drivers/acpi/nfit/core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/nfit/core.c +3 -0
@@ -3453,6 +3453,9 @@ static void acpi_nfit_uc_error_notify(st {struct acpi_nfit_desc *acpi_desc =dev_get_drvdata (dev); +if (!acpi_desc) +return ; +if (acpi_desc->scrub_mode ==HW_ERROR_SCRUB_ON )acpi_nfit_ars_rescan (acpi_desc,ARS_REQ_LONG );else
Greg Kroah-Hartman
maintainerPATCH 63/1266 rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Ryhl <[email protected]>
commit 191f49f1e38b1c10eb44b0f967c6175c884ef7db upstream.
Due to a rustc bug, the -Cforce-frame-pointers=y flag only emits the frame-pointer annotation for functions, but not for the module. This means that functions generated by the LLVM backend such as 'asan.module_ctor' do not receive the frame-pointer annotation.
This is likely to lead to broken backtraces and may also cause issues with ftrace if these features are used with functions generated by the LLVM backend.
Thus, use -Zllvm_module_flag to work around this rustc bug if using a rustc without the fix.
[ The fix [1] has landed for Rust 1.98.0 (expected release on
2026-08-20). - Miguel ]
[ - Adjusted Cc: stable@ as discussed.
- Added comment with link to the PR, similar to what we did in commit ac35b5580ace ("rust: arm64: set uwtable llvm module flag for CONFIG_UNWIND_TABLES").
- Miguel ]
--- Makefile | 3 +++ 1 file changed, 3 insertions(+)
Makefile +3 -0
@@ -857,6 +857,9 @@ KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y +# Work around rustc bug on compilers without +# https://github.com/rust-lang/rust/pull/156980. +KBUILD_RUSTFLAGS += $(if $(call rustc-min-version,109800),,-Zllvm_module_flag=frame-pointer:u32:2:max) else # Some targets (ARM with Thumb2, for example), can't be built with frame # pointers. For those, we don't have FUNCTION_TRACER automatically
Re: [PATCH 6.6 0063/1266] rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER
Quoted 43 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Ryhl <[email protected]>
commit
191f49f1e38b1c10eb44b0f967c6175c884ef7dbupstream.Due to a rustc bug, the -Cforce-frame-pointers=y flag only emits the frame-pointer annotation for functions, but not for the module. This means that functions generated by the LLVM backend such as 'asan.module_ctor' do not receive the frame-pointer annotation.
This is likely to lead to broken backtraces and may also cause issues with ftrace if these features are used with functions generated by the LLVM backend.
Thus, use -Zllvm_module_flag to work around this rustc bug if using a rustc without the fix.
[ The fix [1] has landed for Rust 1.98.0 (expected release on
2026-08-20). - Miguel ]Cc [email protected] # 6.12.y and later (flag not available in pinned Rust in older LTSs).Fixes 2f7ab1267dc9 ("Kbuild: add Rust support")Signed-off-by Alice Ryhl <[email protected]>[ - Adjusted Cc: stable@ as discussed.
- Added comment with link to the PR, similar to what we did in commitac35b5580ace("rust: arm64: set uwtable llvm module flag forCONFIG_UNWIND_TABLES").
- Miguel ]Signed-off-by Miguel Ojeda <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- Makefile | 3 +++ 1 file changed, 3 insertions(+)
Makefile KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y · line 862
Quoted 6 lines
Makefile +3
-0@@ -857,6 +857,9 @@ KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y +# Work around rustc bug on compilers without +# https://github.com/rust-lang/rust/pull/156980. +KBUILD_RUSTFLAGS += $(if $(call rustc-min-version,109800),,-Zllvm_module_flag=frame-pointer:u32:2:max)
We shouldn't backport this to 6.6 because -Zllvm_module_flag does not exist on the rustc version used by the 6.6. kernel.
Alice
Re: [PATCH 6.6 0063/1266] rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER
Quoted 3 lines · Alice Ryhl
We shouldn't backport this to 6.6 because -Zllvm_module_flag does not exist on the rustc version used by the 6.6. kernel.
Yeah -- please see the instruction above:
# 6.12.y and later (flag not available in pinned Rust in older LTSs).
More details I wrote back then at:
https://lore.kernel.org/all/CANiq72kek9NoFe2PCFnND1p6BRbuzgv6kT2o5jw09sWg+wau_Q@mail.gmail.com/
Cheers,
Miguel
Greg Kroah-Hartman
maintainerPATCH 64/1266 perf/core: Detach event groups during remove_on_exec
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taeyang Lee <[email protected]>
[ Upstream commit 037a3c43edfb597665dd34457cd22b14692f2ba3 ]
perf_event_remove_on_exec() removes events by calling perf_event_exit_event(). For top-level events, this removes the event from the context with DETACH_EXIT only.
This can leave inconsistent group state when a removed event is a group leader and the group contains siblings without remove_on_exec. If the group was active, the surviving siblings can remain active and attached to the removed leader's sibling list, but are no longer represented by a valid group leader on the PMU context active lists.
A later close of the removed leader uses DETACH_GROUP and can promote the still-active siblings from this stale group state. The next schedule-in can then add an already-linked active_list entry again, corrupting the PMU context active list.
With DEBUG_LIST enabled, this is caught as a list_add double-add in merge_sched_in().
Fix this by detaching group relationships when remove_on_exec removes an event. This preserves the existing task-exit and revoke behavior, while ensuring surviving siblings are ungrouped before the removed event leaves the context.
--- kernel/events/core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
kernel/events/core.c +8 -6
@@ -4449,7 +4449,8 @@ static void perf_event_enable_on_exec(struct perf_event_context *ctx)static void perf_remove_from_owner (struct perf_event *event);static void perf_event_exit_event (struct perf_event *event, -struct perf_event_context *ctx); +struct perf_event_context *ctx, +unsigned long detach_flags);/* * Removes all events from the current task that have been marked
@@ -4476,7 +4477,7 @@ static void perf_event_remove_on_exec(struct perf_event_context *ctx) modified = true; -perf_event_exit_event (event, ctx); +perf_event_exit_event (event, ctx,DETACH_GROUP ); }raw_spin_lock_irqsave (&ctx->lock, flags);
@@ -13230,10 +13231,11 @@ static void sync_child_event(struct perf_event *child_event) }static void -perf_event_exit_event (struct perf_event *event,struct perf_event_context *ctx) +perf_event_exit_event (struct perf_event *event, +struct perf_event_context *ctx, +unsigned long detach_flags) {struct perf_event *parent_event = event->parent; -unsigned long detach_flags =0 ;if (parent_event) {/*
@@ -13248,7 +13250,7 @@ perf_event_exit_event(struct perf_event *event, struct perf_event_context *ctx)* Do destroy all inherited groups, we don't care about those * and being thorough is better. */ - detach_flags =DETACH_GROUP |DETACH_CHILD ; + detach_flags |=DETACH_GROUP |DETACH_CHILD ;mutex_lock (&parent_event->child_mutex); }
@@ -13328,7 +13330,7 @@ static void perf_event_exit_task_context(struct task_struct *child)perf_event_task (child, child_ctx,0 );list_for_each_entry_safe (child_event, next, &child_ctx->event_list, event_entry) -perf_event_exit_event (child_event, child_ctx); +perf_event_exit_event (child_event, child_ctx,0 );mutex_unlock (&child_ctx->mutex);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 65/1266 Revert "crypto: talitos - rename first/last to first_desc/last_desc"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Goetz Goerisch <[email protected]>
This reverts commit a866e2b1c65edaee2e1bb1024ee2c761ced335f8.
Which was backported without applying upstream commit 9826d1d6ed5f86cb3d61610b3b1fe31e96a40418 first.
Commit a1b80018b8cec27fc06a8b04a7f8b5f6cfe86eae
was backported to 6.6.y with a866e2b1c65edaee2e1bb1024ee2c761ced335f8
It renames last to last_desc but misses one occurrence which leads to compile errors on mpc85xx
drivers/crypto/talitos.c: In function 'ahash_digest':drivers/crypto/talitos.c:2204:16: error: 'struct talitos_ahash_req_ctx' has no member named 'last'
2204 | req_ctx->last = 1;
| ^~~~Instead of renaming req_ctx->last, commit 9826d1d6ed5f8 ("crypto: talitos - stop using crypto_ahash::init") should be applied.
Ideally before commit 00463d5f864a ("crypto: talitos - fix SEC1 32k ahash request limitation") to avoid any compilation breakage and ensure correctness of the code.
Reverting and applying in correct order.
--- drivers/crypto/talitos.c | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-)
drivers/crypto/talitos.c +23 -23
@@ -869,8 +869,8 @@ struct talitos_ahash_req_ctx {u8 buf[2 ][HASH_MAX_BLOCK_SIZE ];int buf_idx;unsigned int swinit; -unsigned int first_desc; -unsigned int last_desc; +unsigned int first; +unsigned int last;unsigned int last_request;unsigned int to_hash_later;unsigned int nbuf;
@@ -889,8 +889,8 @@ struct talitos_export_state {u32 hw_context[TALITOS_MDEU_MAX_CONTEXT_SIZE /sizeof (u32)];u8 buf[HASH_MAX_BLOCK_SIZE ];unsigned int swinit; -unsigned int first_desc; -unsigned int last_desc; +unsigned int first; +unsigned int last;unsigned int to_hash_later;unsigned int nbuf; };
@@ -1722,7 +1722,7 @@ static void common_nonsnoop_hash_unmap(struct device *dev,if (desc->next_desc && desc->ptr[5 ].ptr != desc2->ptr[5 ].ptr)unmap_single_talitos_ptr (dev, &desc2->ptr[5 ],DMA_FROM_DEVICE ); -if (req_ctx->last_desc) +if (req_ctx->last)memcpy (areq->result, req_ctx->hw_context,crypto_ahash_digestsize (tfm));
@@ -1759,7 +1759,7 @@ static void ahash_done(struct device *dev, container_of(desc, struct talitos_edesc, desc);struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -if (!req_ctx->last_desc && req_ctx->to_hash_later) { +if (!req_ctx->last && req_ctx->to_hash_later) {/* Position any partial block for next update/final/finup */ req_ctx->buf_idx = (req_ctx->buf_idx +1 ) &1 ; req_ctx->nbuf = req_ctx->to_hash_later;
@@ -1825,7 +1825,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,/* first DWORD empty */ /* hash context in */ -if (!req_ctx->first_desc || req_ctx->swinit) { +if (!req_ctx->first || req_ctx->swinit) { map_single_talitos_ptr_nosync(dev, &desc->ptr[1], req_ctx->hw_context_size, req_ctx->hw_context,
@@ -1833,7 +1833,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, req_ctx->swinit =0 ; }/* Indicate next op is not the first. */ - req_ctx->first_desc =0 ; + req_ctx->first =0 ;/* HMAC key */ if (ctx->keylen)
@@ -1866,7 +1866,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,/* fifth DWORD empty */ /* hash/HMAC out -or- hash context out */ -if (req_ctx->last_desc) +if (req_ctx->last)map_single_talitos_ptr (dev, &desc->ptr[5 ],crypto_ahash_digestsize (tfm), req_ctx->hw_context,DMA_FROM_DEVICE );
@@ -1908,7 +1908,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,if (sg_count >1 ) sync_needed = true;copy_talitos_ptr (&desc2->ptr[5 ], &desc->ptr[5 ], is_sec1); -if (req_ctx->last_desc) +if (req_ctx->last) map_single_talitos_ptr_nosync(dev, &desc->ptr[5], req_ctx->hw_context_size, req_ctx->hw_context,
@@ -1964,7 +1964,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytesbool is_sec1 =has_ftr_sec1 (priv);u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; -if (!req_ctx->last_desc && (nbytes + req_ctx->nbuf <= blocksize)) { +if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) {/* Buffer up to one whole block */ nents =sg_nents_for_len (req_ctx->request_sl, nbytes);if (nents <0 ) {
@@ -1981,7 +1981,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes nbytes_to_hash = nbytes + req_ctx->nbuf; to_hash_later = nbytes_to_hash & (blocksize -1 ); -if (req_ctx->last_desc) +if (req_ctx->last) to_hash_later =0 ;else if (to_hash_later)/* There is a partial block. Hash the full block(s) now */
@@ -2041,19 +2041,19 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes edesc->desc.hdr = ctx->desc_hdr_template;/* On last one, request SEC to pad; otherwise continue */ -if (req_ctx->last_desc) +if (req_ctx->last) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_PAD ;else edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_CONT ;/* request SEC to INIT hash. */ -if (req_ctx->first_desc && !req_ctx->swinit) +if (req_ctx->first && !req_ctx->swinit) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_INIT ;/* When the tfm context has a keylen, it's an HMAC. * A first or last (ie. not middle) descriptor must request HMAC. */ -if (ctx->keylen && (req_ctx->first_desc || req_ctx->last_desc)) +if (ctx->keylen && (req_ctx->first || req_ctx->last)) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_HMAC ;return common_nonsnoop_hash (edesc, req_ctx->areq, nbytes_to_hash, ahash_done);
@@ -2076,7 +2076,7 @@ static void sec1_ahash_process_remaining(struct work_struct *work) req_ctx->remaining_ahash_request_bytes;if (req_ctx->last_request) - req_ctx->last_desc =1 ; + req_ctx->last =1 ; } err = ahash_process_req_one(req_ctx->areq,
@@ -2103,7 +2103,7 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)if (nbytes >TALITOS1_MAX_DATA_LEN ) nbytes =TALITOS1_MAX_DATA_LEN ;else if (req_ctx->last_request) - req_ctx->last_desc =1 ; + req_ctx->last =1 ; } req_ctx->current_ahash_request_bytes = nbytes;
@@ -2124,14 +2124,14 @@ static int ahash_init(struct ahash_request *areq)/* Initialize the context */ req_ctx->buf_idx =0 ; req_ctx->nbuf =0 ; - req_ctx->first_desc =1 ;/* first_desc indicates h/w must init its context */ + req_ctx->first =1 ;/* first indicates h/w must init its context */ req_ctx->swinit =0 ;/* assume h/w init of context */ size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; req_ctx->hw_context_size = size; req_ctx->last_request =0 ; - req_ctx->last_desc =0 ; + req_ctx->last =0 ;INIT_WORK (&req_ctx->sec1_ahash_process_remaining, sec1_ahash_process_remaining); dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size,
@@ -2223,8 +2223,8 @@ static int ahash_export(struct ahash_request *areq, void *out) req_ctx->hw_context_size);memcpy (export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); export->swinit = req_ctx->swinit; - export->first_desc = req_ctx->first_desc; - export->last_desc = req_ctx->last_desc; + export->first = req_ctx->first; + export->last = req_ctx->last; export->to_hash_later = req_ctx->to_hash_later; export->nbuf = req_ctx->nbuf;
@@ -2249,8 +2249,8 @@ static int ahash_import(struct ahash_request *areq, const void *in)memcpy (req_ctx->hw_context, export->hw_context, size);memcpy (req_ctx->buf[0 ], export->buf, export->nbuf); req_ctx->swinit = export->swinit; - req_ctx->first_desc = export->first_desc; - req_ctx->last_desc = export->last_desc; + req_ctx->first = export->first; + req_ctx->last = export->last; req_ctx->to_hash_later = export->to_hash_later; req_ctx->nbuf = export->nbuf;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 66/1266 Revert "crypto: talitos - fix SEC1 32k ahash request limitation"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Goetz Goerisch <[email protected]>
This reverts commit 00463d5f864ae28b7938d5acd0ddd800d5457e8b. Which was backported without applying upstream commit 9826d1d6ed5f86cb3d61610b3b1fe31e96a40418 first.
Commit a1b80018b8cec27fc06a8b04a7f8b5f6cfe86eae
was backported to 6.6.y with a866e2b1c65edaee2e1bb1024ee2c761ced335f8
It renames last to last_desc but misses one occurrence which leads to compile errors on mpc85xx
drivers/crypto/talitos.c: In function 'ahash_digest':drivers/crypto/talitos.c:2204:16: error: 'struct talitos_ahash_req_ctx' has no member named 'last'
2204 | req_ctx->last = 1;
| ^~~~Instead of renaming req_ctx->last, commit 9826d1d6ed5f8 ("crypto: talitos - stop using crypto_ahash::init") should be applied.
Ideally before commit 00463d5f864a ("crypto: talitos - fix SEC1 32k ahash request limitation") to avoid any compilation breakage and ensure correctness of the code.
Reverting and applying in correct order.
--- drivers/crypto/talitos.c | 216 +++++++++++++-------------------------- 1 file changed, 69 insertions(+), 147 deletions(-)
drivers/crypto/talitos.c +69 -147
@@ -12,7 +12,6 @@* All rights reserved. */ -#include <linux/workqueue.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h>
@@ -871,18 +870,10 @@ struct talitos_ahash_req_ctx {unsigned int swinit;unsigned int first;unsigned int last; -unsigned int last_request;unsigned int to_hash_later;unsigned int nbuf;struct scatterlist bufsl[2 ];struct scatterlist *psrc; - -struct scatterlist request_bufsl[2 ]; -struct ahash_request *areq; -struct scatterlist *request_sl; -unsigned int remaining_ahash_request_bytes; -unsigned int current_ahash_request_bytes; -struct work_struct sec1_ahash_process_remaining; };struct talitos_export_state {
@@ -1768,20 +1759,7 @@ static void ahash_done(struct device *dev,kfree (edesc); -if (err) { -ahash_request_complete (areq, err); -return ; - } - - req_ctx->remaining_ahash_request_bytes -= - req_ctx->current_ahash_request_bytes; - -if (!req_ctx->remaining_ahash_request_bytes) { -ahash_request_complete (areq,0 ); -return ; - } - -schedule_work (&req_ctx->sec1_ahash_process_remaining); +ahash_request_complete (areq, err); }/*
@@ -1947,7 +1925,60 @@ static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq, nbytes, 0, 0, 0, areq->base.flags, false); } -static int ahash_process_req_one (struct ahash_request *areq,unsigned int nbytes) +static int ahash_init (struct ahash_request *areq) +{ +struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); +struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); +struct device *dev = ctx->dev; +struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); +unsigned int size; +dma_addr_t dma; + +/* Initialize the context */ + req_ctx->buf_idx =0 ; + req_ctx->nbuf =0 ; + req_ctx->first =1 ;/* first indicates h/w must init its context */ + req_ctx->swinit =0 ;/* assume h/w init of context */ + size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) + ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 + :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; + req_ctx->hw_context_size = size; + + dma =dma_map_single (dev, req_ctx->hw_context, req_ctx->hw_context_size, +DMA_TO_DEVICE ); +dma_unmap_single (dev, dma, req_ctx->hw_context_size,DMA_TO_DEVICE ); + +return 0 ; +} + +/* +* on h/w without explicit sha224 support, we initialize h/w context +* manually with sha224 constants, and tell it to run sha256. +*/ +static int ahash_init_sha224_swinit (struct ahash_request *areq) +{ +struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); + + req_ctx->hw_context[0 ] =SHA224_H0 ; + req_ctx->hw_context[1 ] =SHA224_H1 ; + req_ctx->hw_context[2 ] =SHA224_H2 ; + req_ctx->hw_context[3 ] =SHA224_H3 ; + req_ctx->hw_context[4 ] =SHA224_H4 ; + req_ctx->hw_context[5 ] =SHA224_H5 ; + req_ctx->hw_context[6 ] =SHA224_H6 ; + req_ctx->hw_context[7 ] =SHA224_H7 ; + +/* init 64-bit count */ + req_ctx->hw_context[8 ] =0 ; + req_ctx->hw_context[9 ] =0 ; + +ahash_init (areq); + req_ctx->swinit =1 ;/* prevent h/w initting context with sha256 values*/ + +return 0 ; +} + +static int ahash_process_req (struct ahash_request *areq,unsigned int nbytes) {struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq);struct talitos_ctx *ctx =crypto_ahash_ctx (tfm);
@@ -1966,12 +1997,12 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytesif (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) {/* Buffer up to one whole block */ - nents =sg_nents_for_len (req_ctx->request_sl, nbytes); + nents =sg_nents_for_len (areq->src, nbytes);if (nents <0 ) {dev_err (dev,"Invalid number of src SG.\n" );return nents; } -sg_copy_to_buffer (req_ctx->request_sl, nents, +sg_copy_to_buffer (areq->src, nents, ctx_buf + req_ctx->nbuf, nbytes); req_ctx->nbuf += nbytes;return 0 ;
@@ -1998,7 +2029,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytessg_init_table (req_ctx->bufsl, nsg);sg_set_buf (req_ctx->bufsl, ctx_buf, req_ctx->nbuf);if (nsg >1 ) -sg_chain (req_ctx->bufsl,2 , req_ctx->request_sl); +sg_chain (req_ctx->bufsl,2 , areq->src); req_ctx->psrc = req_ctx->bufsl; }else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) {int offset;
@@ -2007,26 +2038,26 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes offset = blocksize - req_ctx->nbuf; else offset = nbytes_to_hash - req_ctx->nbuf; - nents =sg_nents_for_len (req_ctx->request_sl, offset); + nents =sg_nents_for_len (areq->src, offset);if (nents <0 ) {dev_err (dev,"Invalid number of src SG.\n" );return nents; } -sg_copy_to_buffer (req_ctx->request_sl, nents, +sg_copy_to_buffer (areq->src, nents, ctx_buf + req_ctx->nbuf, offset); req_ctx->nbuf += offset; - req_ctx->psrc =scatterwalk_ffwd (req_ctx->bufsl, req_ctx->request_sl, + req_ctx->psrc =scatterwalk_ffwd (req_ctx->bufsl, areq->src, offset); }else - req_ctx->psrc = req_ctx->request_sl; + req_ctx->psrc = areq->src;if (to_hash_later) { - nents =sg_nents_for_len (req_ctx->request_sl, nbytes); + nents =sg_nents_for_len (areq->src, nbytes);if (nents <0 ) {dev_err (dev,"Invalid number of src SG.\n" );return nents; } -sg_pcopy_to_buffer (req_ctx->request_sl, nents, +sg_pcopy_to_buffer (areq->src, nents, req_ctx->buf[(req_ctx->buf_idx +1 ) &1 ], to_hash_later, nbytes - to_hash_later);
@@ -2034,7 +2065,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes req_ctx->to_hash_later = to_hash_later;/* Allocate extended descriptor */ - edesc =ahash_edesc_alloc (req_ctx->areq, nbytes_to_hash); + edesc =ahash_edesc_alloc (areq, nbytes_to_hash);if (IS_ERR (edesc))return PTR_ERR (edesc);
@@ -2056,123 +2087,14 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytesif (ctx->keylen && (req_ctx->first || req_ctx->last)) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_HMAC ; -return common_nonsnoop_hash (edesc, req_ctx->areq, nbytes_to_hash, ahash_done); -} - -static void sec1_ahash_process_remaining (struct work_struct *work) -{ -struct talitos_ahash_req_ctx *req_ctx = - container_of(work, struct talitos_ahash_req_ctx, - sec1_ahash_process_remaining); -int err =0 ; - - req_ctx->request_sl =scatterwalk_ffwd (req_ctx->request_bufsl, - req_ctx->request_sl,TALITOS1_MAX_DATA_LEN ); - -if (req_ctx->remaining_ahash_request_bytes >TALITOS1_MAX_DATA_LEN ) - req_ctx->current_ahash_request_bytes =TALITOS1_MAX_DATA_LEN ; -else { - req_ctx->current_ahash_request_bytes = - req_ctx->remaining_ahash_request_bytes; - -if (req_ctx->last_request) - req_ctx->last =1 ; - } - - err =ahash_process_req_one (req_ctx->areq, - req_ctx->current_ahash_request_bytes); - -if (err != -EINPROGRESS ) -ahash_request_complete (req_ctx->areq, err); -} - -static int ahash_process_req (struct ahash_request *areq,unsigned int nbytes) -{ -struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); -struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); -struct device *dev = ctx->dev; -struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -struct talitos_private *priv =dev_get_drvdata (dev); -bool is_sec1 =has_ftr_sec1 (priv); - - req_ctx->areq = areq; - req_ctx->request_sl = areq->src; - req_ctx->remaining_ahash_request_bytes = nbytes; - -if (is_sec1) { -if (nbytes >TALITOS1_MAX_DATA_LEN ) - nbytes =TALITOS1_MAX_DATA_LEN ; -else if (req_ctx->last_request) - req_ctx->last =1 ; - } - - req_ctx->current_ahash_request_bytes = nbytes; - -return ahash_process_req_one (req_ctx->areq, - req_ctx->current_ahash_request_bytes); -} - -static int ahash_init (struct ahash_request *areq) -{ -struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); -struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); -struct device *dev = ctx->dev; -struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -unsigned int size; -dma_addr_t dma; - -/* Initialize the context */ - req_ctx->buf_idx =0 ; - req_ctx->nbuf =0 ; - req_ctx->first =1 ;/* first indicates h/w must init its context */ - req_ctx->swinit =0 ;/* assume h/w init of context */ - size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) - ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 - :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; - req_ctx->hw_context_size = size; - req_ctx->last_request =0 ; - req_ctx->last =0 ; -INIT_WORK (&req_ctx->sec1_ahash_process_remaining, sec1_ahash_process_remaining); - - dma =dma_map_single (dev, req_ctx->hw_context, req_ctx->hw_context_size, -DMA_TO_DEVICE ); -dma_unmap_single (dev, dma, req_ctx->hw_context_size,DMA_TO_DEVICE ); - -return 0 ; -} - -/* -* on h/w without explicit sha224 support, we initialize h/w context -* manually with sha224 constants, and tell it to run sha256. -*/ -static int ahash_init_sha224_swinit (struct ahash_request *areq) -{ -struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - - req_ctx->hw_context[0 ] =SHA224_H0 ; - req_ctx->hw_context[1 ] =SHA224_H1 ; - req_ctx->hw_context[2 ] =SHA224_H2 ; - req_ctx->hw_context[3 ] =SHA224_H3 ; - req_ctx->hw_context[4 ] =SHA224_H4 ; - req_ctx->hw_context[5 ] =SHA224_H5 ; - req_ctx->hw_context[6 ] =SHA224_H6 ; - req_ctx->hw_context[7 ] =SHA224_H7 ; - -/* init 64-bit count */ - req_ctx->hw_context[8 ] =0 ; - req_ctx->hw_context[9 ] =0 ; - -ahash_init (areq); - req_ctx->swinit =1 ;/* prevent h/w initting context with sha256 values*/ - -return 0 ; +return common_nonsnoop_hash (edesc, areq, nbytes_to_hash, ahash_done); }static int ahash_update (struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - req_ctx->last_request =0 ; + req_ctx->last =0 ;return ahash_process_req (areq, areq->nbytes); }
@@ -2181,7 +2103,7 @@ static int ahash_final(struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - req_ctx->last_request =1 ; + req_ctx->last =1 ;return ahash_process_req (areq,0 ); }
@@ -2190,7 +2112,7 @@ static int ahash_finup(struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - req_ctx->last_request =1 ; + req_ctx->last =1 ;return ahash_process_req (areq, areq->nbytes); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 67/1266 crypto: talitos - stop using crypto_ahash::init
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <[email protected]>
commit 9826d1d6ed5f86cb3d61610b3b1fe31e96a40418 upstream.
The function pointer crypto_ahash::init is an internal implementation detail of the ahash API that exists to help it support both ahash and shash algorithms. With an upcoming refactoring of how the ahash API supports shash algorithms, this field will be removed.
Some drivers are invoking crypto_ahash::init to call into their own code, which is unnecessary and inefficient. The talitos driver is one of those drivers. Make it just call its own code directly.
--- drivers/crypto/talitos.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/crypto/talitos.c +9 -6
@@ -2119,13 +2119,14 @@ static int ahash_finup(struct ahash_request *areq)static int ahash_digest (struct ahash_request *areq) { -struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -struct crypto_ahash *ahash =crypto_ahash_reqtfm (areq); - - ahash->init (areq); - req_ctx->last =1 ; +ahash_init (areq); +return ahash_finup (areq); +} -return ahash_process_req (areq, areq->nbytes); +static int ahash_digest_sha224_swinit (struct ahash_request *areq) +{ +ahash_init_sha224_swinit (areq); +return ahash_finup (areq); }static int ahash_export (struct ahash_request *areq,void *out)
@@ -3242,6 +3243,8 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, (!strcmp(alg->cra_name, "sha224") || !strcmp(alg->cra_name, "hmac(sha224)"))) { t_alg->algt.alg.hash.init = ahash_init_sha224_swinit; + t_alg->algt.alg.hash.digest = + ahash_digest_sha224_swinit; t_alg->algt.desc_hdr_template =DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU | DESC_HDR_SEL0_MDEUA |
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 68/1266 crypto: talitos - fix SEC1 32k ahash request limitation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Louvel <[email protected]>
commit 655ef638a2bc3cd0a9eff99a02f83cab94a3a917 upstream.
Since commit c662b043cdca ("crypto: af_alg/hash: Support MSG_SPLICE_PAGES"), the crypto core may pass large scatterlists spanning multiple pages to drivers supporting ahash operations. As a result, a driver can now receive large ahash requests.
The SEC1 engine has a limitation where a single descriptor cannot process more than 32k of data. The current implementation attempts to handle the entire request within a single descriptor, which leads to failures raised by the driver:
"length exceeds h/w max limit"
Address this limitation by splitting large ahash requests into multiple descriptors, each respecting the 32k hardware limit. This allows processing arbitrarily large requests.
--- drivers/crypto/talitos.c | 216 ++++++++++++++++++++++++++------------- 1 file changed, 147 insertions(+), 69 deletions(-)
drivers/crypto/talitos.c +147 -69
@@ -12,6 +12,7 @@* All rights reserved. */ +#include <linux/workqueue.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h>
@@ -870,10 +871,18 @@ struct talitos_ahash_req_ctx {unsigned int swinit;unsigned int first;unsigned int last; +unsigned int last_request;unsigned int to_hash_later;unsigned int nbuf;struct scatterlist bufsl[2 ];struct scatterlist *psrc; + +struct scatterlist request_bufsl[2 ]; +struct ahash_request *areq; +struct scatterlist *request_sl; +unsigned int remaining_ahash_request_bytes; +unsigned int current_ahash_request_bytes; +struct work_struct sec1_ahash_process_remaining; };struct talitos_export_state {
@@ -1759,7 +1768,20 @@ static void ahash_done(struct device *dev,kfree (edesc); -ahash_request_complete (areq, err); +if (err) { +ahash_request_complete (areq, err); +return ; + } + + req_ctx->remaining_ahash_request_bytes -= + req_ctx->current_ahash_request_bytes; + +if (!req_ctx->remaining_ahash_request_bytes) { +ahash_request_complete (areq,0 ); +return ; + } + +schedule_work (&req_ctx->sec1_ahash_process_remaining); }/*
@@ -1925,60 +1947,7 @@ static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq, nbytes, 0, 0, 0, areq->base.flags, false); } -static int ahash_init (struct ahash_request *areq) -{ -struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); -struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); -struct device *dev = ctx->dev; -struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -unsigned int size; -dma_addr_t dma; - -/* Initialize the context */ - req_ctx->buf_idx =0 ; - req_ctx->nbuf =0 ; - req_ctx->first =1 ;/* first indicates h/w must init its context */ - req_ctx->swinit =0 ;/* assume h/w init of context */ - size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) - ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 - :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; - req_ctx->hw_context_size = size; - - dma =dma_map_single (dev, req_ctx->hw_context, req_ctx->hw_context_size, -DMA_TO_DEVICE ); -dma_unmap_single (dev, dma, req_ctx->hw_context_size,DMA_TO_DEVICE ); - -return 0 ; -} - -/* -* on h/w without explicit sha224 support, we initialize h/w context -* manually with sha224 constants, and tell it to run sha256. -*/ -static int ahash_init_sha224_swinit (struct ahash_request *areq) -{ -struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - - req_ctx->hw_context[0 ] =SHA224_H0 ; - req_ctx->hw_context[1 ] =SHA224_H1 ; - req_ctx->hw_context[2 ] =SHA224_H2 ; - req_ctx->hw_context[3 ] =SHA224_H3 ; - req_ctx->hw_context[4 ] =SHA224_H4 ; - req_ctx->hw_context[5 ] =SHA224_H5 ; - req_ctx->hw_context[6 ] =SHA224_H6 ; - req_ctx->hw_context[7 ] =SHA224_H7 ; - -/* init 64-bit count */ - req_ctx->hw_context[8 ] =0 ; - req_ctx->hw_context[9 ] =0 ; - -ahash_init (areq); - req_ctx->swinit =1 ;/* prevent h/w initting context with sha256 values*/ - -return 0 ; -} - -static int ahash_process_req (struct ahash_request *areq,unsigned int nbytes) +static int ahash_process_req_one (struct ahash_request *areq,unsigned int nbytes) {struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq);struct talitos_ctx *ctx =crypto_ahash_ctx (tfm);
@@ -1997,12 +1966,12 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) {/* Buffer up to one whole block */ - nents =sg_nents_for_len (areq->src, nbytes); + nents =sg_nents_for_len (req_ctx->request_sl, nbytes);if (nents <0 ) {dev_err (dev,"Invalid number of src SG.\n" );return nents; } -sg_copy_to_buffer (areq->src, nents, +sg_copy_to_buffer (req_ctx->request_sl, nents, ctx_buf + req_ctx->nbuf, nbytes); req_ctx->nbuf += nbytes;return 0 ;
@@ -2029,7 +1998,7 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)sg_init_table (req_ctx->bufsl, nsg);sg_set_buf (req_ctx->bufsl, ctx_buf, req_ctx->nbuf);if (nsg >1 ) -sg_chain (req_ctx->bufsl,2 , areq->src); +sg_chain (req_ctx->bufsl,2 , req_ctx->request_sl); req_ctx->psrc = req_ctx->bufsl; }else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) {int offset;
@@ -2038,26 +2007,26 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes) offset = blocksize - req_ctx->nbuf; else offset = nbytes_to_hash - req_ctx->nbuf; - nents =sg_nents_for_len (areq->src, offset); + nents =sg_nents_for_len (req_ctx->request_sl, offset);if (nents <0 ) {dev_err (dev,"Invalid number of src SG.\n" );return nents; } -sg_copy_to_buffer (areq->src, nents, +sg_copy_to_buffer (req_ctx->request_sl, nents, ctx_buf + req_ctx->nbuf, offset); req_ctx->nbuf += offset; - req_ctx->psrc =scatterwalk_ffwd (req_ctx->bufsl, areq->src, + req_ctx->psrc =scatterwalk_ffwd (req_ctx->bufsl, req_ctx->request_sl, offset); }else - req_ctx->psrc = areq->src; + req_ctx->psrc = req_ctx->request_sl;if (to_hash_later) { - nents =sg_nents_for_len (areq->src, nbytes); + nents =sg_nents_for_len (req_ctx->request_sl, nbytes);if (nents <0 ) {dev_err (dev,"Invalid number of src SG.\n" );return nents; } -sg_pcopy_to_buffer (areq->src, nents, +sg_pcopy_to_buffer (req_ctx->request_sl, nents, req_ctx->buf[(req_ctx->buf_idx +1 ) &1 ], to_hash_later, nbytes - to_hash_later);
@@ -2065,7 +2034,7 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes) req_ctx->to_hash_later = to_hash_later;/* Allocate extended descriptor */ - edesc =ahash_edesc_alloc (areq, nbytes_to_hash); + edesc =ahash_edesc_alloc (req_ctx->areq, nbytes_to_hash);if (IS_ERR (edesc))return PTR_ERR (edesc);
@@ -2087,14 +2056,123 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)if (ctx->keylen && (req_ctx->first || req_ctx->last)) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_HMAC ; -return common_nonsnoop_hash (edesc, areq, nbytes_to_hash, ahash_done); +return common_nonsnoop_hash (edesc, req_ctx->areq, nbytes_to_hash, ahash_done); } -static int ahash_update (struct ahash_request *areq) +static void sec1_ahash_process_remaining (struct work_struct *work) +{ +struct talitos_ahash_req_ctx *req_ctx = + container_of(work, struct talitos_ahash_req_ctx, + sec1_ahash_process_remaining); +int err =0 ; + + req_ctx->request_sl =scatterwalk_ffwd (req_ctx->request_bufsl, + req_ctx->request_sl,TALITOS1_MAX_DATA_LEN ); + +if (req_ctx->remaining_ahash_request_bytes >TALITOS1_MAX_DATA_LEN ) + req_ctx->current_ahash_request_bytes =TALITOS1_MAX_DATA_LEN ; +else { + req_ctx->current_ahash_request_bytes = + req_ctx->remaining_ahash_request_bytes; + +if (req_ctx->last_request) + req_ctx->last =1 ; + } + + err =ahash_process_req_one (req_ctx->areq, + req_ctx->current_ahash_request_bytes); + +if (err != -EINPROGRESS ) +ahash_request_complete (req_ctx->areq, err); +} + +static int ahash_process_req (struct ahash_request *areq,unsigned int nbytes) +{ +struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); +struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); +struct device *dev = ctx->dev; +struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); +struct talitos_private *priv =dev_get_drvdata (dev); +bool is_sec1 =has_ftr_sec1 (priv); + + req_ctx->areq = areq; + req_ctx->request_sl = areq->src; + req_ctx->remaining_ahash_request_bytes = nbytes; + +if (is_sec1) { +if (nbytes >TALITOS1_MAX_DATA_LEN ) + nbytes =TALITOS1_MAX_DATA_LEN ; +else if (req_ctx->last_request) + req_ctx->last =1 ; + } + + req_ctx->current_ahash_request_bytes = nbytes; + +return ahash_process_req_one (req_ctx->areq, + req_ctx->current_ahash_request_bytes); +} + +static int ahash_init (struct ahash_request *areq) { +struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); +struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); +struct device *dev = ctx->dev;struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); +unsigned int size; +dma_addr_t dma; +/* Initialize the context */ + req_ctx->buf_idx =0 ; + req_ctx->nbuf =0 ; + req_ctx->first =1 ;/* first indicates h/w must init its context */ + req_ctx->swinit =0 ;/* assume h/w init of context */ + size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) + ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 + :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; + req_ctx->hw_context_size = size; + req_ctx->last_request =0 ; req_ctx->last =0 ; +INIT_WORK (&req_ctx->sec1_ahash_process_remaining, sec1_ahash_process_remaining); + + dma =dma_map_single (dev, req_ctx->hw_context, req_ctx->hw_context_size, +DMA_TO_DEVICE ); +dma_unmap_single (dev, dma, req_ctx->hw_context_size,DMA_TO_DEVICE ); + +return 0 ; +} + +/* +* on h/w without explicit sha224 support, we initialize h/w context +* manually with sha224 constants, and tell it to run sha256. +*/ +static int ahash_init_sha224_swinit (struct ahash_request *areq) +{ +struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); + + req_ctx->hw_context[0 ] =SHA224_H0 ; + req_ctx->hw_context[1 ] =SHA224_H1 ; + req_ctx->hw_context[2 ] =SHA224_H2 ; + req_ctx->hw_context[3 ] =SHA224_H3 ; + req_ctx->hw_context[4 ] =SHA224_H4 ; + req_ctx->hw_context[5 ] =SHA224_H5 ; + req_ctx->hw_context[6 ] =SHA224_H6 ; + req_ctx->hw_context[7 ] =SHA224_H7 ; + +/* init 64-bit count */ + req_ctx->hw_context[8 ] =0 ; + req_ctx->hw_context[9 ] =0 ; + +ahash_init (areq); + req_ctx->swinit =1 ;/* prevent h/w initting context with sha256 values*/ + +return 0 ; +} + +static int ahash_update (struct ahash_request *areq) +{ +struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); + + req_ctx->last_request =0 ;return ahash_process_req (areq, areq->nbytes); }
@@ -2103,7 +2181,7 @@ static int ahash_final(struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - req_ctx->last =1 ; + req_ctx->last_request =1 ;return ahash_process_req (areq,0 ); }
@@ -2112,7 +2190,7 @@ static int ahash_finup(struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); - req_ctx->last =1 ; + req_ctx->last_request =1 ;return ahash_process_req (areq, areq->nbytes); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 69/1266 crypto: talitos - rename first/last to first_desc/last_desc
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Louvel <[email protected]>
commit a1b80018b8cec27fc06a8b04a7f8b5f6cfe86eae upstream.
Previous commit introduces a new last_request variable in the context structure.
Renaming the first/last existing member variable in the context structure to improve readability.
--- drivers/crypto/talitos.c | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-)
drivers/crypto/talitos.c +23 -23
@@ -869,8 +869,8 @@ struct talitos_ahash_req_ctx {u8 buf[2 ][HASH_MAX_BLOCK_SIZE ];int buf_idx;unsigned int swinit; -unsigned int first; -unsigned int last; +unsigned int first_desc; +unsigned int last_desc;unsigned int last_request;unsigned int to_hash_later;unsigned int nbuf;
@@ -889,8 +889,8 @@ struct talitos_export_state {u32 hw_context[TALITOS_MDEU_MAX_CONTEXT_SIZE /sizeof (u32)];u8 buf[HASH_MAX_BLOCK_SIZE ];unsigned int swinit; -unsigned int first; -unsigned int last; +unsigned int first_desc; +unsigned int last_desc;unsigned int to_hash_later;unsigned int nbuf; };
@@ -1722,7 +1722,7 @@ static void common_nonsnoop_hash_unmap(struct device *dev,if (desc->next_desc && desc->ptr[5 ].ptr != desc2->ptr[5 ].ptr)unmap_single_talitos_ptr (dev, &desc2->ptr[5 ],DMA_FROM_DEVICE ); -if (req_ctx->last) +if (req_ctx->last_desc)memcpy (areq->result, req_ctx->hw_context,crypto_ahash_digestsize (tfm));
@@ -1759,7 +1759,7 @@ static void ahash_done(struct device *dev, container_of(desc, struct talitos_edesc, desc);struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -if (!req_ctx->last && req_ctx->to_hash_later) { +if (!req_ctx->last_desc && req_ctx->to_hash_later) {/* Position any partial block for next update/final/finup */ req_ctx->buf_idx = (req_ctx->buf_idx +1 ) &1 ; req_ctx->nbuf = req_ctx->to_hash_later;
@@ -1825,7 +1825,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,/* first DWORD empty */ /* hash context in */ -if (!req_ctx->first || req_ctx->swinit) { +if (!req_ctx->first_desc || req_ctx->swinit) { map_single_talitos_ptr_nosync(dev, &desc->ptr[1], req_ctx->hw_context_size, req_ctx->hw_context,
@@ -1833,7 +1833,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, req_ctx->swinit =0 ; }/* Indicate next op is not the first. */ - req_ctx->first =0 ; + req_ctx->first_desc =0 ;/* HMAC key */ if (ctx->keylen)
@@ -1866,7 +1866,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,/* fifth DWORD empty */ /* hash/HMAC out -or- hash context out */ -if (req_ctx->last) +if (req_ctx->last_desc)map_single_talitos_ptr (dev, &desc->ptr[5 ],crypto_ahash_digestsize (tfm), req_ctx->hw_context,DMA_FROM_DEVICE );
@@ -1908,7 +1908,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,if (sg_count >1 ) sync_needed = true;copy_talitos_ptr (&desc2->ptr[5 ], &desc->ptr[5 ], is_sec1); -if (req_ctx->last) +if (req_ctx->last_desc) map_single_talitos_ptr_nosync(dev, &desc->ptr[5], req_ctx->hw_context_size, req_ctx->hw_context,
@@ -1964,7 +1964,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytesbool is_sec1 =has_ftr_sec1 (priv);u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; -if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { +if (!req_ctx->last_desc && (nbytes + req_ctx->nbuf <= blocksize)) {/* Buffer up to one whole block */ nents =sg_nents_for_len (req_ctx->request_sl, nbytes);if (nents <0 ) {
@@ -1981,7 +1981,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes nbytes_to_hash = nbytes + req_ctx->nbuf; to_hash_later = nbytes_to_hash & (blocksize -1 ); -if (req_ctx->last) +if (req_ctx->last_desc) to_hash_later =0 ;else if (to_hash_later)/* There is a partial block. Hash the full block(s) now */
@@ -2041,19 +2041,19 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes edesc->desc.hdr = ctx->desc_hdr_template;/* On last one, request SEC to pad; otherwise continue */ -if (req_ctx->last) +if (req_ctx->last_desc) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_PAD ;else edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_CONT ;/* request SEC to INIT hash. */ -if (req_ctx->first && !req_ctx->swinit) +if (req_ctx->first_desc && !req_ctx->swinit) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_INIT ;/* When the tfm context has a keylen, it's an HMAC. * A first or last (ie. not middle) descriptor must request HMAC. */ -if (ctx->keylen && (req_ctx->first || req_ctx->last)) +if (ctx->keylen && (req_ctx->first_desc || req_ctx->last_desc)) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_HMAC ;return common_nonsnoop_hash (edesc, req_ctx->areq, nbytes_to_hash, ahash_done);
@@ -2076,7 +2076,7 @@ static void sec1_ahash_process_remaining(struct work_struct *work) req_ctx->remaining_ahash_request_bytes;if (req_ctx->last_request) - req_ctx->last =1 ; + req_ctx->last_desc =1 ; } err = ahash_process_req_one(req_ctx->areq,
@@ -2103,7 +2103,7 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)if (nbytes >TALITOS1_MAX_DATA_LEN ) nbytes =TALITOS1_MAX_DATA_LEN ;else if (req_ctx->last_request) - req_ctx->last =1 ; + req_ctx->last_desc =1 ; } req_ctx->current_ahash_request_bytes = nbytes;
@@ -2124,14 +2124,14 @@ static int ahash_init(struct ahash_request *areq)/* Initialize the context */ req_ctx->buf_idx =0 ; req_ctx->nbuf =0 ; - req_ctx->first =1 ;/* first indicates h/w must init its context */ + req_ctx->first_desc =1 ;/* first_desc indicates h/w must init its context */ req_ctx->swinit =0 ;/* assume h/w init of context */ size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; req_ctx->hw_context_size = size; req_ctx->last_request =0 ; - req_ctx->last =0 ; + req_ctx->last_desc =0 ;INIT_WORK (&req_ctx->sec1_ahash_process_remaining, sec1_ahash_process_remaining); dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size,
@@ -2224,8 +2224,8 @@ static int ahash_export(struct ahash_request *areq, void *out) req_ctx->hw_context_size);memcpy (export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); export->swinit = req_ctx->swinit; - export->first = req_ctx->first; - export->last = req_ctx->last; + export->first_desc = req_ctx->first_desc; + export->last_desc = req_ctx->last_desc; export->to_hash_later = req_ctx->to_hash_later; export->nbuf = req_ctx->nbuf;
@@ -2250,8 +2250,8 @@ static int ahash_import(struct ahash_request *areq, const void *in)memcpy (req_ctx->hw_context, export->hw_context, size);memcpy (req_ctx->buf[0 ], export->buf, export->nbuf); req_ctx->swinit = export->swinit; - req_ctx->first = export->first; - req_ctx->last = export->last; + req_ctx->first_desc = export->first_desc; + req_ctx->last_desc = export->last_desc; req_ctx->to_hash_later = export->to_hash_later; req_ctx->nbuf = export->nbuf;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 70/1266 arm64: sysreg: Add layout for ID_AA64MMFR4_EL1
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
[ Upstream commit cfc680bb04c54e61faa51a34d8383a0aa25b583f ]
ARMv9.5 has infroduced ID_AA64MMFR4_EL1 with a bunch of new features. Add the corresponding layout.
This is extracted from the public ARM SysReg_xml_A_profile-2023-09 delivery, timestamped d55f5af8e09052abe92a02adf820deea2eaed717.
--- arch/arm64/tools/sysreg | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
arch/arm64/tools/sysreg +37 -0
@@ -1669,6 +1669,43 @@ UnsignedEnum 3:0 TCRX EndEnum EndSysreg +Sysreg ID_AA64MMFR4_EL1 3 0 0 7 4 +Res0 63:40 +UnsignedEnum 39:36 E3DSE + 0b0000 NI + 0b0001 IMP +EndEnum +Res0 35:28 +SignedEnum 27:24 E2H0 + 0b0000 IMP + 0b1110 NI_NV1 + 0b1111 NI +EndEnum +UnsignedEnum 23:20 NV_frac + 0b0000 NV_NV2 + 0b0001 NV2_ONLY +EndEnum +UnsignedEnum 19:16 FGWTE3 + 0b0000 NI + 0b0001 IMP +EndEnum +UnsignedEnum 15:12 HACDBS + 0b0000 NI + 0b0001 IMP +EndEnum +UnsignedEnum 11:8 ASID2 + 0b0000 NI + 0b0001 IMP +EndEnum +SignedEnum 7:4 EIESB + 0b0000 NI + 0b0001 ToEL3 + 0b0010 ToELx + 0b1111 ANY +EndEnum +Res0 3:0 +EndSysreg + Sysreg SCTLR_EL1 3 0 1 0 0 Field 63 TIDCP Field 62 SPINTMASK
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 71/1266 arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is negative
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
[ Upstream commit 3944382fa6f22b54fd399632b1af92c28123979b ]
For CPUs that have ID_AA64MMFR4_EL1.E2H0 as negative, it is important to avoid the boot path that sets HCR_EL2.E2H=0. Fortunately, we already have this path to cope with fruity CPUs.
Tweak init_el2 to look at ID_AA64MMFR4_EL1.E2H0 first.
--- arch/arm64/kernel/head.S | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
arch/arm64/kernel/head.S +15 -8
@@ -589,25 +589,32 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) mov_q x1, INIT_SCTLR_EL1_MMU_OFF /* - * Fruity CPUs seem to have HCR_EL2.E2H set to RES1, - * making it impossible to start in nVHE mode. Is that - * compliant with the architecture? Absolutely not! + * Compliant CPUs advertise their VHE-onlyness with + * ID_AA64MMFR4_EL1.E2H0 < 0. HCR_EL2.E2H can be + * RES1 in that case. + * + * Fruity CPUs seem to have HCR_EL2.E2H set to RES1, but + * don't advertise it (they predate this relaxation). */ + mrs_s x0, SYS_ID_AA64MMFR4_EL1 + ubfx x0, x0, #ID_AA64MMFR4_EL1_E2H0_SHIFT, #ID_AA64MMFR4_EL1_E2H0_WIDTH + tbnz x0, #(ID_AA64MMFR4_EL1_E2H0_SHIFT + ID_AA64MMFR4_EL1_E2H0_WIDTH - 1), 1f + mrs x0, hcr_el2 and x0, x0, #HCR_E2H - cbz x0, 1f - + cbz x0, 2f +1: /* Set a sane SCTLR_EL1, the VHE way */ pre_disable_mmu_workaround msr_s SYS_SCTLR_EL12, x1 mov x2, #BOOT_CPU_FLAG_E2H - b 2f + b 3f -1: +2: pre_disable_mmu_workaround msr sctlr_el1, x1 mov x2, xzr -2: +3: __init_el2_nvhe_prepare_eret mov w0, #BOOT_CPU_MODE_EL2
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 72/1266 arm64: Fix early handling of FEAT_E2H0 not being implemented
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
[ Upstream commit b3320142f3db9b3f2a23460abd3e22292e1530a5 ]
Commit 3944382fa6f2 introduced checks for the FEAT_E2H0 not being implemented. However, the check is absolutely wrong and makes a point it testing a bit that is guaranteed to be zero.
On top of that, the detection happens way too late, after the init_el2_state has done its job.
This went undetected because the HW this was tested on has E2H being RAO/WI, and not RES1. However, the bug shows up when run as a nested guest, where HCR_EL2.E2H is not necessarily set to 1. As a result, booting the kernel in hVHE mode fails with timer accesses being cought in a trap loop (which was fun to debug).
Fix the check for ID_AA64MMFR4_EL1.E2H0, and set the HCR_EL2.E2H bit early so that it can be checked by the rest of the init sequence.
With this, hVHE works again in a NV environment that doesn't have FEAT_E2H0.
--- arch/arm64/kernel/head.S | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
arch/arm64/kernel/head.S +16 -13
@@ -576,6 +576,21 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) isb 0: mov_q x0, HCR_HOST_NVHE_FLAGS + + /* + * Compliant CPUs advertise their VHE-onlyness with + * ID_AA64MMFR4_EL1.E2H0 < 0. HCR_EL2.E2H can be + * RES1 in that case. Publish the E2H bit early so that + * it can be picked up by the init_el2_state macro. + * + * Fruity CPUs seem to have HCR_EL2.E2H set to RAO/WI, but + * don't advertise it (they predate this relaxation). + */ + mrs_s x1, SYS_ID_AA64MMFR4_EL1 + tbz x1, #(ID_AA64MMFR4_EL1_E2H0_SHIFT + ID_AA64MMFR4_EL1_E2H0_WIDTH - 1), 1f + + orr x0, x0, #HCR_E2H +1: msr hcr_el2, x0 isb
@@ -588,22 +603,10 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) mov_q x1, INIT_SCTLR_EL1_MMU_OFF - /* - * Compliant CPUs advertise their VHE-onlyness with - * ID_AA64MMFR4_EL1.E2H0 < 0. HCR_EL2.E2H can be - * RES1 in that case. - * - * Fruity CPUs seem to have HCR_EL2.E2H set to RES1, but - * don't advertise it (they predate this relaxation). - */ - mrs_s x0, SYS_ID_AA64MMFR4_EL1 - ubfx x0, x0, #ID_AA64MMFR4_EL1_E2H0_SHIFT, #ID_AA64MMFR4_EL1_E2H0_WIDTH - tbnz x0, #(ID_AA64MMFR4_EL1_E2H0_SHIFT + ID_AA64MMFR4_EL1_E2H0_WIDTH - 1), 1f - mrs x0, hcr_el2 and x0, x0, #HCR_E2H cbz x0, 2f -1: + /* Set a sane SCTLR_EL1, the VHE way */ pre_disable_mmu_workaround msr_s SYS_SCTLR_EL12, x1
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 73/1266 KVM: arm64: Initialize HCR_EL2.E2H early
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 7a68b55ff39b0a1638acb1694c185d49f6077a0d ]
On CPUs without FEAT_E2H0, HCR_EL2.E2H is RES1, but may reset to an UNKNOWN value out of reset and consequently may not read as 1 unless it has been explicitly initialized.
We handled this for the head.S boot code in commits:
3944382fa6f22b54 ("arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is negative") b3320142f3db9b3f ("arm64: Fix early handling of FEAT_E2H0 not being implemented")
Unfortunately, we forgot to apply a similar fix to the KVM PSCI entry points used when relaying CPU_ON, CPU_SUSPEND, and SYSTEM SUSPEND. When KVM is entered via these entry points, the value of HCR_EL2.E2H may be consumed before it has been initialized (e.g. by the 'init_el2_state' macro).
Initialize HCR_EL2.E2H early in these paths such that it can be consumed reliably. The existing code in head.S is factored out into a new 'init_el2_hcr' macro, and this is used in the __kvm_hyp_init_cpu() function common to all the relevant PSCI entry points.
For clarity, I've tweaked the assembly used to check whether ID_AA64MMFR4_EL1.E2H0 is negative. The bitfield is extracted as a signed value, and this is checked with a signed-greater-or-equal (GE) comparison.
As the hyp code will reconfigure HCR_EL2 later in ___kvm_hyp_init(), all bits other than E2H are initialized to zero in __kvm_hyp_init_cpu().
[ Backport: Resolved trivial conflict in arch/arm64/kvm/hyp/nvhe/hyp-init.S
caused by __kvm_init_el2_state not existing in 6.6.y (EL2 state is initialized inline via init_el2_state / finalise_el2_state); placed init_el2_hcr 0 directly before the inline sequence. ]
--- arch/arm64/include/asm/el2_setup.h | 26 ++++++++++++++++++++++++++ arch/arm64/kernel/head.S | 19 +------------------ arch/arm64/kvm/hyp/nvhe/hyp-init.S | 2 ++ 3 files changed, 29 insertions(+), 18 deletions(-)
arch/arm64/include/asm/el2_setup.h +26 -0
@@ -16,6 +16,32 @@#include <asm/sysreg.h> #include <linux/irqchip/arm-gic-v3.h> +.macro init_el2_hcr val + mov_q x0, \val + +/* +* Compliant CPUs advertise their VHE-onlyness with +* ID_AA64MMFR4_EL1.E2H0 < 0. On such CPUs HCR_EL2.E2H is RES1, but it +* can reset into an UNKNOWN state and might not read as 1 until it has +* been initialized explicitly. +* +* Fruity CPUs seem to have HCR_EL2.E2H set to RAO/WI, but +* don't advertise it (they predate this relaxation). +* +* Initalize HCR_EL2.E2H so that later code can rely upon HCR_EL2.E2H +* indicating whether the CPU is running in E2H mode. +*/ + mrs_s x1, SYS_ID_AA64MMFR4_EL1 + sbfx x1, x1, #ID_AA64MMFR4_EL1_E2H0_SHIFT, #ID_AA64MMFR4_EL1_E2H0_WIDTH + cmp x1, #0 + b.ge .LnVHE_\@ + + orr x0, x0, #HCR_E2H +.LnVHE_\@: + msr hcr_el2, x0 + isb +.endm + .macro __init_el2_sctlr mov_q x0, INIT_SCTLR_EL2_MMU_OFF msr sctlr_el2, x0
arch/arm64/kernel/head.S +1 -18
@@ -575,25 +575,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) msr sctlr_el2, x0 isb 0: - mov_q x0, HCR_HOST_NVHE_FLAGS - - /* - * Compliant CPUs advertise their VHE-onlyness with - * ID_AA64MMFR4_EL1.E2H0 < 0. HCR_EL2.E2H can be - * RES1 in that case. Publish the E2H bit early so that - * it can be picked up by the init_el2_state macro. - * - * Fruity CPUs seem to have HCR_EL2.E2H set to RAO/WI, but - * don't advertise it (they predate this relaxation). - */ - mrs_s x1, SYS_ID_AA64MMFR4_EL1 - tbz x1, #(ID_AA64MMFR4_EL1_E2H0_SHIFT + ID_AA64MMFR4_EL1_E2H0_WIDTH - 1), 1f - - orr x0, x0, #HCR_E2H -1: - msr hcr_el2, x0 - isb + init_el2_hcr HCR_HOST_NVHE_FLAGS init_el2_state /* Hypervisor stub */
arch/arm64/kvm/hyp/nvhe/hyp-init.S +2 -0
@@ -202,6 +202,8 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu) 2: msr SPsel, #1 // We want to use SP_EL{1,2} + init_el2_hcr 0 + /* Initialize EL2 CPU state to sane values. */ init_el2_state // Clobbers x0..x2 finalise_el2_state
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 74/1266 KVM: arm64: Initialize SCTLR_EL1 in __kvm_hyp_init_cpu()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmed Genidi <[email protected]>
[ Upstream commit 3855a7b91d42ebf3513b7ccffc44807274978b3d ]
When KVM is in protected mode, host calls to PSCI are proxied via EL2, and cold entries from CPU_ON, CPU_SUSPEND, and SYSTEM_SUSPEND bounce through __kvm_hyp_init_cpu() at EL2 before entering the host kernel's entry point at EL1. While __kvm_hyp_init_cpu() initializes SPSR_EL2 for the exception return to EL1, it does not initialize SCTLR_EL1.
Due to this, it's possible to enter EL1 with SCTLR_EL1 in an UNKNOWN state. In practice this has been seen to result in kernel crashes after CPU_ON as a result of SCTLR_EL1.M being 1 in violation of the initial core configuration specified by PSCI.
Fix this by initializing SCTLR_EL1 for cold entry to the host kernel. As it's necessary to write to SCTLR_EL12 in VHE mode, this initialization is moved into __kvm_host_psci_cpu_entry() where we can use write_sysreg_el1().
The remnants of the '__init_el2_nvhe_prepare_eret' macro are folded into its only caller, as this is clearer than having the macro.
[ Backport: Resolved context conflicts when removing the
__init_el2_nvhe_prepare_eret macro and invocation:
- arch/arm64/include/asm/el2_setup.h: conflicted because 6.6.y lacks later GCS/MPAM macros (__init_el2_gcs / __init_el2_mpam) surrounding the definition.
- arch/arm64/kvm/hyp/nvhe/hyp-init.S: conflicted because __kvm_init_el2_state does not exist in 6.6.y (EL2 state is initialized inline). ]
--- arch/arm64/include/asm/el2_setup.h | 4 ---- arch/arm64/kernel/head.S | 3 ++- arch/arm64/kvm/hyp/nvhe/hyp-init.S | 1 - arch/arm64/kvm/hyp/nvhe/psci-relay.c | 3 +++ 4 files changed, 5 insertions(+), 6 deletions(-)
arch/arm64/include/asm/el2_setup.h +0 -4
@@ -229,10 +229,6 @@ .Lskip_fgt_\@: .endm -.macro __init_el2_nvhe_prepare_eret - mov x0, #INIT_PSTATE_EL1 - msr spsr_el2, x0 -.endm/** * Initialize EL2 registers to sane values. This should be called early on all
arch/arm64/kernel/head.S +2 -1
@@ -601,7 +601,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) msr sctlr_el1, x1 mov x2, xzr 3: - __init_el2_nvhe_prepare_eret + mov x0, #INIT_PSTATE_EL1 + msr spsr_el2, x0 mov w0, #BOOT_CPU_MODE_EL2 orr x0, x0, x2
arch/arm64/kvm/hyp/nvhe/hyp-init.S +0 -1
@@ -207,7 +207,6 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu) /* Initialize EL2 CPU state to sane values. */ init_el2_state // Clobbers x0..x2 finalise_el2_state - __init_el2_nvhe_prepare_eret /* Enable MMU, set vectors and stack. */ mov x0, x28
arch/arm64/kvm/hyp/nvhe/psci-relay.c +3 -0
@@ -218,6 +218,9 @@ asmlinkage void __noreturn __kvm_host_psci_cpu_entry(bool is_cpu_on)if (is_cpu_on)release_boot_args (boot_args); +write_sysreg_el1 (INIT_SCTLR_EL1_MMU_OFF ,SYS_SCTLR ); +write_sysreg (INIT_PSTATE_EL1 ,SPSR_EL2 ); +__host_enter (host_ctxt); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 75/1266 arm64: Revamp HCR_EL2.E2H RES1 detection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
[ Upstream commit ca88ecdce5f51874a7c151809bd2c936ee0d3805 ]
We currently have two ways to identify CPUs that only implement FEAT_VHE and not FEAT_E2H0:
- either they advertise it via ID_AA64MMFR4_EL1.E2H0,
- or the HCR_EL2.E2H bit is RAO/WI
However, there is a third category of "cpus" that fall between these two cases: on CPUs that do not implement FEAT_FGT, it is IMPDEF whether an access to ID_AA64MMFR4_EL1 can trap to EL2 when the register value is zero.
A consequence of this is that on systems such as Neoverse V2, a NV guest cannot reliably detect that it is in a VHE-only configuration (E2H is writable, and ID_AA64MMFR0_EL1 is 0), despite the hypervisor's best effort to repaint the id register.
Replace the RAO/WI test by a sequence that makes use of the VHE register remnapping between EL1 and EL2 to detect this situation, and work out whether we get the VHE behaviour even after having set HCR_EL2.E2H to 0.
This solves the NV problem, and provides a more reliable acid test for CPUs that do not completely follow the letter of the architecture while providing a RES1 behaviour for HCR_EL2.E2H.
[ Backport: Resolved conflict in arch/arm64/include/asm/el2_setup.h
by replacing msr_hcr_el2 macro usages with raw msr hcr_el2 (since the macro is missing in 6.6.y). ]
--- arch/arm64/include/asm/el2_setup.h | 38 +++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-)
arch/arm64/include/asm/el2_setup.h +32 -6
@@ -24,22 +24,48 @@* ID_AA64MMFR4_EL1.E2H0 < 0. On such CPUs HCR_EL2.E2H is RES1, but it * can reset into an UNKNOWN state and might not read as 1 until it has * been initialized explicitly. -* -* Fruity CPUs seem to have HCR_EL2.E2H set to RAO/WI, but -* don't advertise it (they predate this relaxation). -* * Initalize HCR_EL2.E2H so that later code can rely upon HCR_EL2.E2H * indicating whether the CPU is running in E2H mode. */ mrs_s x1,SYS_ID_AA64MMFR4_EL1 sbfx x1, x1, #ID_AA64MMFR4_EL1_E2H0_SHIFT, #ID_AA64MMFR4_EL1_E2H0_WIDTH cmp x1, #0 - b.ge .LnVHE_\@ + b.lt .LnE2H0_\@ +/* +* Unfortunately, HCR_EL2.E2H can be RES1 even if not advertised +* as such via ID_AA64MMFR4_EL1.E2H0: +* +* - Fruity CPUs predate the !FEAT_E2H0 relaxation, and seem to +* have HCR_EL2.E2H implemented as RAO/WI. +* +* - On CPUs that lack FEAT_FGT, a hypervisor can't trap guest +* reads of ID_AA64MMFR4_EL1 to advertise !FEAT_E2H0. NV +* guests on these hosts can write to HCR_EL2.E2H without +* trapping to the hypervisor, but these writes have no +* functional effect. +* +* Handle both cases by checking for an essential VHE property +* (system register remapping) to decide whether we're +* effectively VHE-only or not. +*/ + msr hcr_el2, x0 // Setup HCR_EL2 as nVHE + isb + mov x1, #1 // Write something to FAR_EL1 + msr far_el1, x1 + isb + mov x1, #2 // Try to overwrite it via FAR_EL2 + msr far_el2, x1 + isb + mrs x1, far_el1 // If we see the latest write in FAR_EL1, + cmp x1, #2 // we can safely assume we are VHE only. + b.ne .LnVHE_\@ // Otherwise, we know that nVHE works. + +.LnE2H0_\@: orr x0, x0, #HCR_E2H -.LnVHE_\@: msr hcr_el2, x0 isb +.LnVHE_\@: .endm .macro __init_el2_sctlr
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 76/1266 arm64: sysreg: Correct sign definitions for EIESB and DoubleLock
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fuad Tabba <[email protected]>
[ Upstream commit f4d4ebc84995178273740f3e601e97fdefc561d2 ]
The ID_AA64MMFR4_EL1.EIESB field, is an unsigned enumeration, but was incorrectly defined as a SignedEnum when introduced in commit cfc680bb04c5 ("arm64: sysreg: Add layout for ID_AA64MMFR4_EL1"). This is corrected to UnsignedEnum.
Conversely, the ID_AA64DFR0_EL1.DoubleLock field, is a signed enumeration, but was incorrectly defined as an UnsignedEnum. This is corrected to SignedEnum, which wasn't correctly set when annotated as such in commit ad16d4cf0b4f ("arm64/sysreg: Initial unsigned annotations for ID registers").
--- arch/arm64/tools/sysreg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/tools/sysreg +2 -2
@@ -1130,7 +1130,7 @@ UnsignedEnum 43:40 TraceFilt 0b0000 NI 0b0001 IMP EndEnum -UnsignedEnum 39:36 DoubleLock +SignedEnum 39:36 DoubleLock 0b0000 IMP 0b1111 NI EndEnum
@@ -1697,7 +1697,7 @@ UnsignedEnum 11:8 ASID2 0b0000 NI 0b0001 IMP EndEnum -SignedEnum 7:4 EIESB +UnsignedEnum 7:4 EIESB 0b0000 NI 0b0001 ToEL3 0b0010 ToELx
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 77/1266 virtio_net: Support dynamic rss indirection table size
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philo Lu <[email protected]>
commit 86a48a00efdf61197b6658e52c6140463eb313dc upstream.
When reading/writing virtio_net_ctrl_rss, the indirection table size is obtained from vi->rss_indir_table_size, initialized during virtnet_probe(). However, the indirection_table was statically sized as VIRTIO_NET_RSS_MAX_TABLE_LEN=128, potentially causing issues when vi->rss_indir_table_size exceeds this limit.
This patch implements dynamic allocation for the indirection table, allocated alongside vi->rss after vi->rss_indir_table_size is initialized, and freed in virtnet_remove().
In virtnet_commit_rss_command(), scatter-gather lists for RSS are initialized differently based on hash_report presence, so indirection_table is unused when !vi->has_rss. Therefore, allocation is unnecessary for hash_report-only scenarios.
[ Hyokyung Kim: 6.6.y predates the refactor that moved the RSS config into
struct virtnet_info, so struct virtio_net_ctrl_rss is still embedded in struct control_buf and reached through the heap-allocated vi->ctrl. Every adaptation below follows from that single difference:
- the new allocation and all indirection_table accesses use vi->ctrl->rss
in place of upstream's vi->rss;
- because vi->ctrl is allocated in virtnet_alloc_queues() (via init_vqs()) and freed in virtnet_free_queues(), the table is allocated and freed there too, not in virtnet_probe()/virtnet_remove(), so its lifetime tracks vi->ctrl across the probe error-unwind and freeze/restore paths;
- since freeing the table now dereferences vi->ctrl, vi->ctrl is set to NULL after each kfree so a re-entered virtnet_free_queues() cannot dereference or free a stale pointer;
- the table is allocated with kcalloc() so it is zero-filled when reallocated on the restore path (upstream never reallocates it). ]
--- drivers/net/virtio_net.c | 43 +++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-)
drivers/net/virtio_net.c +38 -5
@@ -208,15 +208,16 @@ struct receive_queue {* because table sizes may be differ according to the device configuration. */ #define VIRTIO_NET_RSS_MAX_KEY_SIZE 40 -#define VIRTIO_NET_RSS_MAX_TABLE_LEN 128struct virtio_net_ctrl_rss {u32 hash_types;u16 indirection_table_mask;u16 unclassified_queue; -u16 indirection_table[VIRTIO_NET_RSS_MAX_TABLE_LEN ]; +u16 hash_cfg_reserved;/* for HASH_CONFIG (see virtio_net_hash_config for details) */ u16 max_tx_vq;u8 hash_key_length;u8 key[VIRTIO_NET_RSS_MAX_KEY_SIZE ]; + +u16 *indirection_table; };/* Control VQ buffers: protected by the rtnl lock */
@@ -3011,6 +3012,25 @@ static int virtnet_set_ringparam(struct net_device *dev,return 0 ; } +static int rss_indirection_table_alloc (struct virtio_net_ctrl_rss *rss,u16 indir_table_size) +{ +if (!indir_table_size) { + rss->indirection_table =NULL ; +return 0 ; + } + + rss->indirection_table =kcalloc (indir_table_size,sizeof (u16),GFP_KERNEL ); +if (!rss->indirection_table) +return -ENOMEM ; + +return 0 ; +} + +static void rss_indirection_table_free (struct virtio_net_ctrl_rss *rss) +{ +kfree (rss->indirection_table); +} +static bool virtnet_commit_rss_command (struct virtnet_info *vi) {struct net_device *dev = vi->dev;
@@ -3020,11 +3040,15 @@ static bool virtnet_commit_rss_command(struct virtnet_info *vi)/* prepare sgs */ sg_init_table (sgs,4 ); - sg_buf_size = offsetof(struct virtio_net_ctrl_rss , indirection_table); + sg_buf_size = offsetof(struct virtio_net_ctrl_rss , hash_cfg_reserved);sg_set_buf (&sgs[0 ], &vi->ctrl->rss, sg_buf_size); - sg_buf_size =sizeof (uint16_t ) * (vi->ctrl->rss.indirection_table_mask +1 ); -sg_set_buf (&sgs[1 ], vi->ctrl->rss.indirection_table, sg_buf_size); +if (vi->has_rss) { + sg_buf_size =sizeof (uint16_t ) * vi->rss_indir_table_size; +sg_set_buf (&sgs[1 ], vi->ctrl->rss.indirection_table, sg_buf_size); + }else { +sg_set_buf (&sgs[1 ], &vi->ctrl->rss.hash_cfg_reserved,sizeof (uint16_t )); + } sg_buf_size = offsetof(struct virtio_net_ctrl_rss , key) - offsetof(struct virtio_net_ctrl_rss , max_tx_vq);
@@ -4080,7 +4104,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)kfree (vi->rq);kfree (vi->sq); +if (vi->ctrl) +rss_indirection_table_free (&vi->ctrl->rss);kfree (vi->ctrl); + vi->ctrl =NULL ; }static void _free_receive_bufs (struct virtnet_info *vi)
@@ -4266,6 +4293,9 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) vi->ctrl =kzalloc (sizeof (*vi->ctrl),GFP_KERNEL );if (!vi->ctrl) goto err_ctrl; +if ((vi->has_rss || vi->has_rss_hash_report) && +rss_indirection_table_alloc (&vi->ctrl->rss, vi->rss_indir_table_size)) + goto err_sq; }else { vi->ctrl =NULL ; }
@@ -4298,7 +4328,10 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) err_rq:kfree (vi->sq); err_sq: +if (vi->ctrl) +rss_indirection_table_free (&vi->ctrl->rss);kfree (vi->ctrl); + vi->ctrl =NULL ; err_ctrl:return -ENOMEM ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 78/1266 LoongArch: Add PIO for early access before ACPI PCI root register
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit 6061e65f95713b01f4313cda6637dfe3aa5412b4 upstream.
For ACPI system we suppose the ISA/LPC PIO range is registered together with PCI root bridge. But the fact is there may be some early access to the ISA/LPC PIO range before ACPI PCI root register (most of them are due to abnormal BIOS). Unconditionally register the ISA/LPC PIO range usually causes ACPI PCI root register fail because of the address range confliction. So we add a pair of helpers: acpi_add_early_pio() to add PIO for early access, and acpi_remove_early_pio() to remove PIO before PCI root register. Since acpi_remove_early_pio() may be called multiple times, we add an acpi_pio flag to ensure PIO be removed only once.
--- arch/loongarch/include/asm/acpi.h | 2 ++ arch/loongarch/kernel/acpi.c | 28 ++++++++++++++++++++++++++++ arch/loongarch/kernel/setup.c | 2 ++ arch/loongarch/pci/acpi.c | 2 ++ 4 files changed, 34 insertions(+)
arch/loongarch/include/asm/acpi.h +2 -0
@@ -37,6 +37,8 @@ static inline bool acpi_has_cpu_in_madt(void)extern struct list_head acpi_wakeup_device_list;extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC ]; +extern void acpi_add_early_pio (void ); +extern void acpi_remove_early_pio (void );extern int __init parse_acpi_topology (void );static inline u32 get_acpi_id_for_cpu (unsigned int cpu)
arch/loongarch/kernel/acpi.c +28 -0
@@ -14,6 +14,7 @@#include <linux/memblock.h> #include <linux/of_fdt.h> #include <linux/serial_core.h> +#include <linux/vmalloc.h> #include <asm/io.h> #include <asm/numa.h> #include <asm/loongson.h>
@@ -57,6 +58,33 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)return ioremap_cache (phys, size); } +#define PIO_BASE (unsigned long)PCI_IOBASE +#define PIO_SIZE ALIGN(ISA_IOSIZE, PAGE_SIZE) + +static bool acpi_pio; + +/* Add PIO for early access */ +void acpi_add_early_pio (void ) +{ +if (!acpi_disabled) { + acpi_pio = true; +ioremap_page_range (PIO_BASE ,PIO_BASE +PIO_SIZE , +LOONGSON_LIO_BASE ,pgprot_device (PAGE_KERNEL )); + } +} + +/* Remove PIO for PCI register */ +void acpi_remove_early_pio (void ) +{ +if (!acpi_pio) +return ; + +if (!acpi_disabled) { + acpi_pio = false; +vunmap_range (PIO_BASE ,PIO_BASE +PIO_SIZE ); + } +} +#ifdef CONFIG_SMP static int set_processor_mask (u32 id,u32 flags) {
arch/loongarch/kernel/setup.c +2 -0
@@ -530,6 +530,8 @@ static __init int arch_reserve_pio_range(void) {struct device_node *np; +acpi_add_early_pio (); +for_each_node_by_name (np,"isa" ) {struct of_range range;struct of_range_parser parser;
arch/loongarch/pci/acpi.c +2 -0
@@ -65,6 +65,8 @@ static int acpi_prepare_root_resources(struct acpi_pci_root_info *ci)struct resource_entry *entry, *tmp;struct acpi_device *device = ci->bridge; +acpi_remove_early_pio (); + status =acpi_pci_probe_root_resources (ci);if (status >0 ) {acpi_evaluate_integer (device->handle,"PCIH" ,NULL , &pci_h);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 79/1266 net: Drop the lock in skb_may_tx_timestamp()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 983512f3a87fd8dc4c94dfa6b596b6e57df5aad7 upstream.
skb_may_tx_timestamp() may acquire sock::sk_callback_lock. The lock must not be taken in IRQ context, only softirq is okay. A few drivers receive the timestamp via a dedicated interrupt and complete the TX timestamp from that handler. This will lead to a deadlock if the lock is already write-locked on the same CPU.
Taking the lock can be avoided. The socket (pointed by the skb) will remain valid until the skb is released. The ->sk_socket and ->file member will be set to NULL once the user closes the socket which may happen before the timestamp arrives.
If we happen to observe the pointer while the socket is closing but before the pointer is set to NULL then we may use it because both pointer (and the file's cred member) are RCU freed.
Drop the lock. Use READ_ONCE() to obtain the individual pointer. Add a matching WRITE_ONCE() where the pointer are cleared.
[ adapted sk_set_socket() in include/net/sock.h to fix the conflict from
not having commit 5d6b58c932ec ("net: lockless sock_i_ino()") and the additional previous changes required by it.
It comes down to just now having the lines of
if (sock) {
WRITE_ONCE(sk->sk_uid, SOCK_INODE(sock)->i_uid);
WRITE_ONCE(sk->sk_ino, SOCK_INODE(sock)->i_ino);
}below the changed line. ]
--- include/net/sock.h | 2 +- net/core/skbuff.c | 23 ++++++++++++++++++----- net/socket.c | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-)
include/net/sock.h +1 -1
@@ -2155,7 +2155,7 @@ static inline int sk_rx_queue_get(const struct sock *sk)static inline void sk_set_socket (struct sock *sk,struct socket *sock) { - sk->sk_socket = sock; +WRITE_ONCE (sk->sk_socket, sock); }static inline wait_queue_head_t *sk_sleep (struct sock *sk)
net/core/skbuff.c +18 -5
@@ -5258,15 +5258,28 @@ static void __skb_complete_tx_timestamp(struct sk_buff *skb,static bool skb_may_tx_timestamp (struct sock *sk,bool tsonly) { -bool ret; +struct socket *sock; +struct file *file; +bool ret = false;if (likely (READ_ONCE (sysctl_tstamp_allow_data) || tsonly))return true; -read_lock_bh (&sk->sk_callback_lock); - ret = sk->sk_socket && sk->sk_socket->file && -file_ns_capable (sk->sk_socket->file, &init_user_ns,CAP_NET_RAW ); -read_unlock_bh (&sk->sk_callback_lock); +/* The sk pointer remains valid as long as the skb is. The sk_socket and +* file pointer may become NULL if the socket is closed. Both structures +* (including file->cred) are RCU freed which means they can be accessed +* within a RCU read section. +*/ +rcu_read_lock (); + sock =READ_ONCE (sk->sk_socket); +if (!sock) + goto out; + file =READ_ONCE (sock->file); +if (!file) + goto out; + ret =file_ns_capable (file, &init_user_ns,CAP_NET_RAW ); +out: +rcu_read_unlock ();return ret; }
net/socket.c +1 -1
@@ -671,7 +671,7 @@ static void __sock_release(struct socket *sock, struct inode *inode)iput (SOCK_INODE (sock));return ; } - sock->file =NULL ; +WRITE_ONCE (sock->file,NULL ); }/**
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 80/1266 MIPS: smp: report dying CPU to RCU in stop_this_cpu()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Jelonek <[email protected]>
commit 9f3f3bdc6d9dac1a5a8262ee7ad0f2ff1527a7e7 upstream.
smp_send_stop() parks all secondary CPUs in stop_this_cpu(). The function marks the CPU offline for the scheduler via set_cpu_online(false) but never informs RCU, so RCU keeps expecting a quiescent state from CPUs that are now spinning forever with interrupts disabled.
As long as nothing waits for an RCU grace period after smp_send_stop() this is harmless, which is why it went unnoticed. Since commit 91840be8f710 ("irq_work: Fix use-after-free in irq_work_single() on PREEMPT_RT") however, irq_work_sync() calls synchronize_rcu() on architectures without an irq_work self-IPI, i.e. where arch_irq_work_has_interrupt() returns false. That is the asm-generic default used by MIPS. Any irq_work_sync() issued in the reboot/shutdown path after smp_send_stop() then blocks on a grace period that can never complete, hanging the reboot:
WARNING: CPU: 0 PID: 15 at kernel/irq_work.c:144 irq_work_queue_on ... rcu: INFO: rcu_sched detected stalls on CPUs/tasks: rcu: Offline CPU 1 blocking current GP. rcu: Offline CPU 2 blocking current GP. rcu: Offline CPU 3 blocking current GP.
This issue was noticed on several Realtek MIPS switch SoCs (MIPS interAptiv) and came up during kernel bump downstream in OpenWrt from 6.18.33 to 6.18.34, after the backport of the patch to the 6.18 stable branch. The patch also has been backported all the way back to 6.1.
Call rcu_report_dead() once interrupts are disabled, mirroring the generic CPU-hotplug offline path, so RCU stops waiting on the parked CPUs and grace periods can still complete. MIPS shuts down all CPUs here without going through the CPU-hotplug mechanism, so this report is not otherwise issued. Reporting a dying CPU to RCU outside the regular hotplug offline path is not unprecedented: arm64 does the same in cpu_die_early(). There it is an exception for a CPU that was coming online and is aborting bringup, rather than the default shutdown action as on MIPS.
Note: this differs from the upstream commit in that it calls rcu_report_dead(smp_processor_id()) instead of rcutree_report_cpu_dead(). The latter, along with the rcutree_report_cpu_dead() name, was introduced by commit 448e9f34d91d ("rcu: Standardize explicit CPU-hotplug calls") in v6.7; on this kernel the equivalent function is still named rcu_report_dead() and takes an explicit CPU argument.
--- arch/mips/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/kernel/smp.c +2 -0
@@ -19,6 +19,7 @@#include <linux/sched/mm.h> #include <linux/cpumask.h> #include <linux/cpu.h> +#include <linux/rcupdate.h> #include <linux/err.h> #include <linux/ftrace.h> #include <linux/irqdomain.h>
@@ -410,6 +411,7 @@ static void stop_this_cpu(void *dummy)set_cpu_online (smp_processor_id (), false);calculate_cpu_foreign_map ();local_irq_disable (); +rcu_report_dead (smp_processor_id ());while (1 ); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 81/1266 usb: gadget: function: rndis: add length check to response query
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Griffin Kroah-Hartman <[email protected]>
commit 95f90eea070837f7c72207d5520f805bdefc3bc5 upstream.
Add variable representations for BufLength and BufOffset in rndis_query_response(), and perform a length check on them.
This is identical to how rndis_set_response() handles these parameters.
--- drivers/usb/gadget/function/rndis.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/usb/gadget/function/rndis.c +10 -4
@@ -591,6 +591,7 @@ static int rndis_init_response(struct rnstatic int rndis_query_response (struct rndis_params *params,rndis_query_msg_type *buf) { +u32 BufLength, BufOffset;rndis_query_cmplt_type *resp;rndis_resp_t *r;
@@ -598,6 +599,13 @@ static int rndis_query_response(struct rif (!params->dev)return -ENOTSUPP ; + BufLength =le32_to_cpu (buf->InformationBufferLength); + BufOffset =le32_to_cpu (buf->InformationBufferOffset); +if ((BufLength >RNDIS_MAX_TOTAL_SIZE ) || + (BufOffset >RNDIS_MAX_TOTAL_SIZE ) || + (BufOffset +8 >=RNDIS_MAX_TOTAL_SIZE )) +return -EINVAL ; +/* * we need more memory: * gen_ndis_query_resp expects enough space for
@@ -614,10 +622,8 @@ static int rndis_query_response(struct r resp->RequestID = buf->RequestID;/* Still LE in msg buffer */ if (gen_ndis_query_resp (params,le32_to_cpu (buf->OID), -le32_to_cpu (buf->InformationBufferOffset) - +8 + (u8 *)buf, -le32_to_cpu (buf->InformationBufferLength), - r)) { + BufOffset +8 + (u8 *)buf, + BufLength, r)) {/* OID not supported */ resp->Status =cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED ); resp->MessageLength =cpu_to_le32 (sizeof *resp);
Greg Kroah-Hartman
maintainerPATCH 82/1266 usb: gadget: function: rndis: add length check for header
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Griffin Kroah-Hartman <[email protected]>
commit 21b5bf155435008e0fb0736795289788e63d426f upstream.
Add a length check for the rndis header in rndis_rm_hdr, to ensure that MessageType, MessageLength, DataOffset, and DataLength fields are present before they are accessed.
--- drivers/usb/gadget/function/rndis.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/gadget/function/rndis.c +6 -0
@@ -1080,6 +1080,12 @@ int rndis_rm_hdr(struct gether *port,/* tmp points to a struct rndis_packet_msg_type */ __le32 *tmp = (void *)skb->data; +/* Need at least MessageType, MessageLength, DataOffset, DataLength */ +if (skb->len <16 ) { +dev_kfree_skb_any (skb); +return -EINVAL ; + } +/* MessageType, MessageLength */ if (cpu_to_le32 (RNDIS_MSG_PACKET ) !=get_unaligned (tmp++)) {
Greg Kroah-Hartman
maintainerPATCH 83/1266 iio: accel: bmc150: clamp the device-reported FIFO frame count
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryam Vargas <[email protected]>
commit ce0e1cae26096fe959a0da5563a6d6d5a801d5fb upstream.
__bmc150_accel_fifo_flush() copies the number of samples the device reports in its hardware FIFO into an on-stack buffer
u16 buffer[BMC150_ACCEL_FIFO_LENGTH * 3];
which is sized for at most BMC150_ACCEL_FIFO_LENGTH (32) samples. The frame count is read from the FIFO_STATUS register and only masked to its 7 valid bits:
count = val & 0x7F;
so it can be 0..127. The only other limit applied to it is the optional caller-supplied sample budget:
if (samples && count > samples) count = samples;
which does not constrain count on the flush-all path (samples == 0), and leaves it well above 32 whenever samples is larger. count samples are then transferred into buffer[]:
bmc150_accel_fifo_transfer(data, (u8 *)buffer, count);
bmc150_accel_fifo_transfer() reads count * 6 bytes through regmap, so a malfunctioning, malicious or counterfeit accelerometer (or an attacker tampering with the I2C/SPI bus) that reports up to 127 frames writes up to 762 bytes into the 192-byte buffer: a stack out-of-bounds write of up to 570 bytes that clobbers the stack canary, saved registers and the return address.
Clamp count to BMC150_ACCEL_FIFO_LENGTH, the number of samples buffer[] is sized for, before the transfer, mirroring the watermark clamp already done in bmc150_accel_set_watermark(). A well-formed flush reports at most BMC150_ACCEL_FIFO_LENGTH frames, so legitimate devices are unaffected.
--- drivers/iio/accel/bmc150-accel-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/iio/accel/bmc150-accel-core.c +2 -0
@@ -1037,6 +1037,8 @@ static int __bmc150_accel_fifo_flush(strif (samples && count > samples) count = samples; + count =min_t (u8, count,BMC150_ACCEL_FIFO_LENGTH ); + ret =bmc150_accel_fifo_transfer (data, (u8 *)buffer, count);if (ret)return ret;