5.10.235-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainercover 5.10.235-rc1 review
This is the start of the stable review cycle for the 5.10.235 release. There are 462 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, 13 Mar 2025 14:56:39 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.235-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.10.235-rc1
Jakub Kicinski <[email protected]>
net: ipv6: fix dst refleaks in rpl, seg6 and ioam6 lwtunnels
Ben Hutchings <[email protected]>
udf: Fix use of check_add_overflow() with mixed type arguments
Ben Hutchings <[email protected]>
perf cs-etm: Add missing variable in cs_etm__process_queues()
Michal Pecio <[email protected]>
usb: xhci: Enable the TRB overfetch quirk on VIA VL805
Filipe Manana <[email protected]>
btrfs: bring back the incorrectly removed extent buffer lock recursion support
Weili Qian <[email protected]>
crypto: hisilicon/qm - inject error before stopping queue
Thomas Weißschuh <[email protected]>
kbuild: userprogs: use correct lld when linking through clang
Toke Høiland-Jørgensen <[email protected]>
sched: sch_cake: add bounds checks to host bulk flow fairness counts
Michal Luczaj <[email protected]>
vsock: Orphan socket after transport release
Michal Luczaj <[email protected]>
vsock: Keep the binding until socket destruction
Michal Luczaj <[email protected]>
bpf, vsock: Invoke proto::close on close()
Thadeu Lima de Souza Cascardo <[email protected]>
Revert "media: uvcvideo: Require entities to have a non-zero unique ID"
Ricardo Ribalda <[email protected]>
media: uvcvideo: Remove dangling pointers
Ricardo Ribalda <[email protected]>
media: uvcvideo: Only save async fh if success
Ryusuke Konishi <[email protected]>
nilfs2: handle errors that nilfs_prepare_chunk() may return
Ryusuke Konishi <[email protected]>
nilfs2: eliminate staggered calls to kunmap in nilfs_rename
Ryusuke Konishi <[email protected]>
nilfs2: move page release outside of nilfs_delete_entry and nilfs_set_link
Ralf Schlatterbeck <[email protected]>
spi-mxs: Fix chipselect glitch
Niravkumar L Rabara <[email protected]>
mtd: rawnand: cadence: fix unchecked dereference
Andy Shevchenko <[email protected]>
eeprom: digsy_mtc: Make GPIO lookup table match the device
Visweswara Tanuku <[email protected]>
slimbus: messaging: Free transaction ID in delayed interrupt scenario
Alexander Shishkin <[email protected]>
intel_th: pci: Add Panther Lake-P/U support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Panther Lake-H support
Pawel Chmielewski <[email protected]>
intel_th: pci: Add Arrow Lake support
Alexander Usyskin <[email protected]>
mei: me: add panther lake P DID
Phillip Lougher <[email protected]>
Squashfs: check the inode number is not the invalid value of zero
Andy Shevchenko <[email protected]>
xhci: pci: Fix indentation in the PCI device ID definitions
Prashanth K <[email protected]>
usb: gadget: Check bmAttributes only if configuration is valid
Marek Szyprowski <[email protected]>
usb: gadget: Fix setting self-powered state on suspend
Prashanth K <[email protected]>
usb: gadget: Set self-powered based on MaxPower and bmAttributes
AngeloGioacchino Del Regno <[email protected]>
usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality
Fedor Pchelkin <[email protected]>
usb: typec: ucsi: increase timeout for PPM reset operations
Nikita Zhandarovich <[email protected]>
usb: atm: cxacru: fix a flaw in existing endpoint checks
Claudiu Beznea <[email protected]>
usb: renesas_usbhs: Flush the notify_hotplug_work
Miao Li <[email protected]>
usb: quirks: Add DELAY_INIT and NO_LPM for Prolific Mass Storage Card Reader
Claudiu Beznea <[email protected]>
usb: renesas_usbhs: Use devm_usb_get_phy()
Claudiu Beznea <[email protected]>
usb: renesas_usbhs: Call clk_put()
Christian Heusel <[email protected]>
Revert "drivers/card_reader/rtsx_usb: Restore interrupt based detection"
Fabrizio Castro <[email protected]>
gpio: rcar: Fix missing of_node_put() call
Justin Iurman <[email protected]>
net: ipv6: fix missing dst ref drop in ila lwtunnel
Justin Iurman <[email protected]>
net: ipv6: fix dst ref loop in ila lwtunnel
Jason Xing <[email protected]>
net-timestamp: support TCP GSO case for a few missing flags
Oscar Maes <[email protected]>
vlan: enforce underlying device type
Jiayuan Chen <[email protected]>
ppp: Fix KMSAN uninit-value warning with bpf
Nikolay Aleksandrov <[email protected]>
be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink
Philipp Stanner <[email protected]>
drm/sched: Fix preprocessor guard
Xinghuo Chen <[email protected]>
hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe()
Eric Dumazet <[email protected]>
llc: do not use skb_get() before dev_queue_xmit()
Murad Masimov <[email protected]>
ALSA: usx2y: validate nrpacks module parameter on probe
Erik Schumacher <[email protected]>
hwmon: (ad7314) Validate leading zero bits and return error
Maud Spierings <[email protected]>
hwmon: (ntc_thermistor) Fix the ncpXXxh103 sensor table
Titus Rwantare <[email protected]>
hwmon: (pmbus) Initialise page count in pmbus_identify()
Vitaliy Shevtsov <[email protected]>
caif_virtio: fix wrong pointer check in cfv_probe()
Antoine Tenart <[email protected]>
net: gso: fix ownership in __udp_gso_segment
Meir Elisha <[email protected]>
nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch
Zhang Lixu <[email protected]>
HID: intel-ish-hid: Fix use-after-free issue in ishtp_hid_remove()
Yu-Chun Lin <[email protected]>
HID: google: fix unused variable warning under !CONFIG_ACPI
Johannes Berg <[email protected]>
wifi: iwlwifi: limit printed string from FW file
Hao Zhang <[email protected]>
mm/page_alloc: fix uninitialized variable
Olivier Gayot <[email protected]>
block: fix conversion of GPT partition name to 7-bit
Heiko Carstens <[email protected]>
s390/traps: Fix test_monitor_call() inline assembly
Haoxiang Li <[email protected]>
rapidio: fix an API misues when rio_add_net() fails
Haoxiang Li <[email protected]>
rapidio: add check for rio_add_net() in rio_scan_alloc_net()
Vitaliy Shevtsov <[email protected]>
wifi: nl80211: reject cooked mode if it is set along with other flags
Nikita Zhandarovich <[email protected]>
wifi: cfg80211: regulatory: improve invalid hints checking
Ahmed S. Darwish <[email protected]>
x86/cpu: Properly parse CPUID leaf 0x2 TLB descriptor 0x63
Ahmed S. Darwish <[email protected]>
x86/cpu: Validate CPUID leaf 0x2 EDX output
Ahmed S. Darwish <[email protected]>
x86/cacheinfo: Validate CPUID leaf 0x2 EDX output
Mingcong Bai <[email protected]>
platform/x86: thinkpad_acpi: Add battery quirk for ThinkPad X131e
Richard Thier <[email protected]>
drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M
Kailang Yang <[email protected]>
ALSA: hda/realtek: update ALC222 depop optimize
Hoku Ishibe <[email protected]>
ALSA: hda: intel: Add Dell ALC3271 to power_save denylist
Koichiro Den <[email protected]>
gpio: aggregator: protect driver attr handlers against module unload
Daniil Dulov <[email protected]>
HID: appleir: Fix potential NULL dereference at raw event handle
Rob Herring (Arm) <[email protected]>
Revert "of: reserved-memory: Fix using wrong number of cells to get property 'alignment'"
Peter Jones <[email protected]>
efi: Don't map the entire mokvar table to determine its size
Alex Deucher <[email protected]>
drm/amdgpu: disable BAR resize on Dell G5 SE
Ma Jun <[email protected]>
drm/amdgpu: Check extended configuration space register when system uses large bar
Haoxiang Li <[email protected]>
smb: client: Add check for next_buffer in receive_encrypted_standard()
Christian Brauner <[email protected]>
acct: perform last write from workqueue
Yang Yang <[email protected]>
kernel/acct.c: use dedicated helper to access rlimit values
Hui Su <[email protected]>
kernel/acct.c: use #elif instead of #end and #elif
Gavrilov Ilia <[email protected]>
drop_monitor: fix incorrect initialization order
Quang Le <[email protected]>
pfifo_tail_enqueue: Drop new packet when sch->limit == 0
Thomas Gleixner <[email protected]>
intel_idle: Handle older CPUs, which stop the TSC in deeper C states, correctly
Thomas Gleixner <[email protected]>
sched/core: Prevent rescheduling when interrupts are disabled
Ard Biesheuvel <[email protected]>
vmlinux.lds: Ensure that const vars with relocations are mapped R/O
Paolo Abeni <[email protected]>
mptcp: always handle address removal under msk socket lock
Kaustabh Chakraborty <[email protected]>
phy: exynos5-usbdrd: fix MPLL_MULTIPLIER and SSC_REFCLKSEL masks in refclk
BH Hsieh <[email protected]>
phy: tegra: xusb: reset VBUS & ID OVERRIDE
Nikita Zhandarovich <[email protected]>
usbnet: gl620a: fix endpoint checking in genelink_bind()
Tyrone Ting <[email protected]>
i2c: npcm: disable interrupt enable bit before devm_request_irq
Kan Liang <[email protected]>
perf/core: Fix low freq setting via IOC_PERIOD
Nikolay Kuratov <[email protected]>
ftrace: Avoid potential division by zero in function_stat_show()
Russell Senior <[email protected]>
x86/CPU: Fix warm boot hang regression on AMD SC1100 SoC systems
Justin Iurman <[email protected]>
net: ipv6: fix dst ref loop on input in rpl lwt
Justin Iurman <[email protected]>
net: ipv6: rpl_iptunnel: mitigate 2-realloc issue
Justin Iurman <[email protected]>
include: net: add static inline dst_dev_overhead() to dst.h
Brian Vazquez <[email protected]>
net: use indirect call helpers for dst_output
Brian Vazquez <[email protected]>
net: use indirect call helpers for dst_input
Zheng Yongjun <[email protected]>
net: ipv6: rpl_iptunnel: simplify the return expression of rpl_do_srh()
Harshal Chaudhari <[email protected]>
net: mvpp2: cls: Fixed Non IP flow, with vlan tag flow defination.
Wang Hai <[email protected]>
tcp: Defer ts_recent changes until req is owned
Philo Lu <[email protected]>
ipvs: Always clear ipvs_property flag in skb_scrub_packet()
Nicolas Frattaroli <[email protected]>
ASoC: es8328: fix route from DAC to output
Sean Anderson <[email protected]>
net: cadence: macb: Synchronize stats calculations
Ido Schimmel <[email protected]>
net: loopback: Avoid sending IP packets without an Ethernet header
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix L2CAP_ECRED_CONN_RSP response
Takashi Iwai <[email protected]>
ALSA: usb-audio: Avoid dropping MIDI events at closing multiple ports
Arnd Bergmann <[email protected]>
sunrpc: suppress warnings for unused procfs functions
Patrisious Haddad <[email protected]>
RDMA/mlx5: Fix bind QP error cleanup flow
Mark Zhang <[email protected]>
IB/mlx5: Set and get correct qp_num for a DCT QP
Patrick Bellasi <[email protected]>
x86/cpu/kvm: SRSO: Fix possible missing IBPB on VM-Exit
Niravkumar L Rabara <[email protected]>
mtd: rawnand: cadence: fix incorrect device in dma_unmap_single
Niravkumar L Rabara <[email protected]>
mtd: rawnand: cadence: use dma_map_resource for sdma address
Niravkumar L Rabara <[email protected]>
mtd: rawnand: cadence: fix error code in cadence_nand_init()
Christian Brauner <[email protected]>
acct: block access to kernel internal filesystems
John Veness <[email protected]>
ALSA: hda/conexant: Add quirk for HP ProBook 450 G4 mute LED
Haoxiang Li <[email protected]>
nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()
Sumit Garg <[email protected]>
tee: optee: Fix supplicant wait loop
Yan Zhai <[email protected]>
bpf: skip non exist keys in generic_map_lookup_batch
Andrey Vatoropin <[email protected]>
power: supply: da9150-fg: fix potential overflow
Cong Wang <[email protected]>
flow_dissector: Fix port range key handling in BPF conversion
Cong Wang <[email protected]>
flow_dissector: Fix handling of mixed port and port-range keys
Maksym Glubokiy <[email protected]>
net: extract port range fields from fl_flow_key
Kuniyuki Iwashima <[email protected]>
geneve: Suppress list corruption splat in geneve_destroy_tunnels().
Kuniyuki Iwashima <[email protected]>
gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl().
Kuniyuki Iwashima <[email protected]>
geneve: Fix use-after-free in geneve_find_dev().
Christophe Leroy <[email protected]>
powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC
Kailang Yang <[email protected]>
ALSA: hda/realtek: Fixup ALC225 depop procedure
Christophe Leroy <[email protected]>
powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline
Michael Ellerman <[email protected]>
powerpc/64s/mm: Move __real_pte stubs into hash-4k.h
Jill Donahue <[email protected]>
USB: gadget: f_midi: f_midi_complete to call queue_work
Davidlohr Bueso <[email protected]>
usb/gadget: f_midi: Replace tasklet with work
Selvarasu Ganesan <[email protected]>
usb: dwc3: Fix timeout issue during controller enter/exit from halt state
Wesley Cheng <[email protected]>
usb: dwc3: Increase DWC3 controller halt timeout
Sven Eckelmann <[email protected]>
batman-adv: Drop unmanaged ELP metric worker
Sven Eckelmann <[email protected]>
batman-adv: Drop initialization of flexible ethtool_link_ksettings
Sven Eckelmann <[email protected]>
batman-adv: Add new include for min/max helpers
Jarkko Sakkinen <[email protected]>
tpm: Change to kvalloc() in eventlog/acpi.c
Eddie James <[email protected]>
tpm: Use managed allocation for bios event log
Thomas Zimmermann <[email protected]>
drm/rockchip: cdn-dp: Use drm_connector_helper_hpd_irq_event()
Maxime Ripard <[email protected]>
drm/probe-helper: Create a HPD IRQ event helper for a single connector
Chen Ridong <[email protected]>
memcg: fix soft lockup in the OOM process
Carlos Galo <[email protected]>
mm: update mark_victim tracepoints fields
Ignat Korchagin <[email protected]>
crypto: testmgr - some more fixes to RSA test vectors
Ignat Korchagin <[email protected]>
crypto: testmgr - populate RSA CRT parameters in RSA test vectors
lei he <[email protected]>
crypto: testmgr - fix version number of RSA tests
Lei He <[email protected]>
crypto: testmgr - Fix wrong test case of RSA
Lei He <[email protected]>
crypto: testmgr - fix wrong key length for pkcs1pad
Catalin Marinas <[email protected]>
arm64: mte: Do not allow PROT_MTE on MAP_HUGETLB user mappings
Casey Chen <[email protected]>
nvme-pci: fix multiple races in nvme_setup_io_queues
Xin Long <[email protected]>
vlan: move dev_put into vlan_dev_uninit
Xin Long <[email protected]>
vlan: introduce vlan_dev_free_egress_priority
Stefan Berger <[email protected]>
ima: Fix use-after-free on a dentry's dname.name
Calvin Owens <[email protected]>
pps: Fix a use-after-free
Filipe Manana <[email protected]>
btrfs: avoid monopolizing a core when activating a swap file
Koichiro Den <[email protected]>
Revert "btrfs: avoid monopolizing a core when activating a swap file"
David Woodhouse <[email protected]>
x86/i8253: Disable PIT timer 0 when not in use
Chao Yu <[email protected]>
f2fs: fix to wait dio completion
Hangbin Liu <[email protected]>
selftests: rtnetlink: update netdevsim ipsec output format
Hangbin Liu <[email protected]>
netdevsim: print human readable IP address
Jiaqing Zhao <[email protected]>
parport_pc: add support for ASIX AX99100
Jiaqing Zhao <[email protected]>
serial: 8250_pci: add support for ASIX AX99100
Jiaqing Zhao <[email protected]>
can: ems_pci: move ASIX AX99100 ids to pci_ids.h
Ryusuke Konishi <[email protected]>
nilfs2: protect access to buffers with no active references
Ryusuke Konishi <[email protected]>
nilfs2: do not force clear folio if buffer is referenced
Ryusuke Konishi <[email protected]>
nilfs2: do not output warnings when clearing dirty buffers
Ivan Kokshaysky <[email protected]>
alpha: replace hardcoded stack offsets with autogenerated ones
Andrew Cooper <[email protected]>
x86/static-call: Remove early_boot_irqs_disabled check to fix Xen PVH dom0
John Ogness <[email protected]>
kdb: Do not assume write() callback available
Devarsh Thakkar <[email protected]>
drm/tidss: Clear the interrupt status for interrupts being disabled
Tomi Valkeinen <[email protected]>
drm/tidss: Fix issue in irq handling causing irq-flood issue
Eric Dumazet <[email protected]>
ndisc: extend RCU protection in ndisc_send_skb()
Eric Dumazet <[email protected]>
openvswitch: use RCU protection in ovs_vport_cmd_fill_info()
Eric Dumazet <[email protected]>
arp: use RCU protection in arp_xmit()
Eric Dumazet <[email protected]>
neighbour: use RCU protection in __neigh_notify()
Li Zetao <[email protected]>
neighbour: delete redundant judgment statements
Eric Dumazet <[email protected]>
ndisc: use RCU protection in ndisc_alloc_skb()
Eric Dumazet <[email protected]>
ipv6: use RCU protection in ip6_default_advmss()
Eric Dumazet <[email protected]>
ipv4: use RCU protection in inet_select_addr()
Eric Dumazet <[email protected]>
ipv4: use RCU protection in rt_is_expired()
Eric Dumazet <[email protected]>
net: add dev_net_rcu() helper
Jiri Pirko <[email protected]>
net: treat possible_net_t net pointer as an RCU one and add read_pnet_rcu()
Waiman Long <[email protected]>
clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context
Waiman Long <[email protected]>
clocksource: Use pr_info() for "Checking clocksource synchronization" message
Yury Norov <[email protected]>
clocksource: Replace cpumask_weight() with cpumask_empty()
Sebastian Andrzej Siewior <[email protected]>
clocksource: Replace deprecated CPU-hotplug functions.
Paul E. McKenney <[email protected]>
clocksource: Limit number of CPUs checked for clock synchronization
Wentao Liang <[email protected]>
mlxsw: Add return value check for mlxsw_sp_port_get_stats_raw()
Nathan Chancellor <[email protected]>
arm64: Handle .ARM.attributes section in linker scripts
Jiasheng Jiang <[email protected]>
regmap-irq: Add missing kfree()
Jann Horn <[email protected]>
partitions: mac: fix handling of bogus partition table
Wentao Liang <[email protected]>
gpio: stmpe: Check return value of stmpe_reg_read in stmpe_gpio_irq_sync_unlock
Ivan Kokshaysky <[email protected]>
alpha: align stack for page fault and user unaligned trap handlers
John Keeping <[email protected]>
serial: 8250: Fix fifo underflow on flush
Ard Biesheuvel <[email protected]>
efi: Avoid cold plugged memory for placing the kernel
Ivan Kokshaysky <[email protected]>
alpha: make stack 16-byte aligned (most cases)
Alexander Hölzl <[email protected]>
can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero
Krzysztof Kozlowski <[email protected]>
can: c_can: fix unbalanced runtime PM disable in error path
Johan Hovold <[email protected]>
USB: serial: option: drop MeiG Smart defines
Fabio Porcedda <[email protected]>
USB: serial: option: fix Telit Cinterion FN990A name
Fabio Porcedda <[email protected]>
USB: serial: option: add Telit Cinterion FN990B compositions
Chester A. Unal <[email protected]>
USB: serial: option: add MeiG Smart SLM828
Jann Horn <[email protected]>
usb: cdc-acm: Fix handling of oversized fragments
Jann Horn <[email protected]>
usb: cdc-acm: Check control transfer buffer size before access
Marek Vasut <[email protected]>
USB: cdc-acm: Fill in Renesas R-Car D3 USB Download mode quirk
Alan Stern <[email protected]>
USB: hub: Ignore non-compliant devices with too many configs or interfaces
John Keeping <[email protected]>
usb: gadget: f_midi: fix MIDI Streaming descriptor lengths
Mathias Nyman <[email protected]>
USB: Add USB_QUIRK_NO_LPM quirk for sony xperia xz1 smartphone
Lei Huang <[email protected]>
USB: quirks: add USB_QUIRK_NO_LPM quirk for Teclast dist
Stefan Eichenberger <[email protected]>
usb: core: fix pipe creation for get_bMaxPacketSize0
Huacai Chen <[email protected]>
USB: pci-quirks: Fix HCCPARAMS register error for LS7A EHCI
Fabrice Gasnier <[email protected]>
usb: dwc2: gadget: remove of_node reference upon udc_stop
Guo Ren <[email protected]>
usb: gadget: udc: renesas_usb3: Fix compiler warning
Elson Roy Serrao <[email protected]>
usb: roles: set switch registered flag early on
Sean Christopherson <[email protected]>
perf/x86/intel: Ensure LBRs are disabled when a CPU is starting
Sven Eckelmann <[email protected]>
batman-adv: Ignore neighbor throughput metrics in error case
Andy Strohman <[email protected]>
batman-adv: fix panic during interface removal
Hans de Goede <[email protected]>
ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet 5V
Mike Marshall <[email protected]>
orangefs: fix a oob in orangefs_debug_write
Maksym Planeta <[email protected]>
Grab mm lock before grabbing pt lock
Ramesh Thomas <[email protected]>
vfio/pci: Enable iowrite64 and ioread64 for vfio pci
Takashi Iwai <[email protected]>
PCI/DPC: Quirk PIO log size for Intel Raptor Lake-P
Edward Adam Davis <[email protected]>
media: vidtv: Fix a null-ptr-deref in vidtv_mux_stop_thread
Arnd Bergmann <[email protected]>
media: cxd2841er: fix 64-bit division on gcc-9
Juergen Gross <[email protected]>
x86/xen: allow larger contiguous memory regions in PV guests
Petr Tesarik <[email protected]>
xen: remove a confusing comment on auto-translated guest I/O
Artur Weber <[email protected]>
gpio: bcm-kona: Add missing newline to dev_err format string
Artur Weber <[email protected]>
gpio: bcm-kona: Make sure GPIO bits are unlocked when requesting IRQ
Artur Weber <[email protected]>
gpio: bcm-kona: Fix GPIO lock/unlock for banks above bank 0
Radu Rendec <[email protected]>
arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array
Eric Dumazet <[email protected]>
team: better TEAM_OPTION_TYPE_STRING validation
Eric Dumazet <[email protected]>
vrf: use RCU protection in l3mdev_l3_out()
Eric Dumazet <[email protected]>
ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu()
Charles Han <[email protected]>
HID: multitouch: Add NULL check in mt_input_configured
Dai Ngo <[email protected]>
NFSD: fix hang in nfsd4_shutdown_callback
Li Lingfeng <[email protected]>
nfsd: clear acl_access/acl_default after releasing them
Paolo Abeni <[email protected]>
mptcp: prevent excessive coalescing on receive
Su Yue <[email protected]>
ocfs2: check dir i_size in ocfs2_find_entry
WangYuli <[email protected]>
MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
Thomas Weißschuh <[email protected]>
ptp: Ensure info->enable callback is always set
Paul Fertser <[email protected]>
net/ncsi: wait for the last response to Deselect Package before configuring channel
Ekansh Gupta <[email protected]>
misc: fastrpc: Fix registered buffer page address
Ivan Stepchenko <[email protected]>
mtd: onenand: Fix uninitialized retlen in do_otp_read()
Dan Carpenter <[email protected]>
NFC: nci: Add bounds checking in nci_hci_create_pipe()
Nikita Zhandarovich <[email protected]>
nilfs2: fix possible int overflows in nilfs_fiemap()
Matthew Wilcox (Oracle) <[email protected]>
ocfs2: handle a symlink read error correctly
Heming Zhao <[email protected]>
ocfs2: fix incorrect CPU endianness conversion causing mount failure
Mike Snitzer <[email protected]>
pnfs/flexfiles: retry getting layout segment for reads
Alex Williamson <[email protected]>
vfio/platform: check the bounds of read/write syscalls
Jennifer Berringer <[email protected]>
nvmem: core: improve range check for nvmem_cell_write()
Luca Weiss <[email protected]>
nvmem: qcom-spmi-sdam: Set size in struct nvmem_config
Bartosz Golaszewski <[email protected]>
crypto: qce - unregister previously registered algos in error path
Bartosz Golaszewski <[email protected]>
crypto: qce - fix goto jump in error path
Ricardo Ribalda <[email protected]>
media: uvcvideo: Remove redundant NULL assignment
Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix event flags in uvc_ctrl_send_events
Sam Bobrowicz <[email protected]>
media: ov5640: fix get_light_freq on auto
Cosmin Tanislav <[email protected]>
media: mc: fix endpoint iteration
Krzysztof Kozlowski <[email protected]>
soc: qcom: smem_state: fix missing of_node_put in error path
Javier Carrasco <[email protected]>
iio: light: as73211: fix channel handling in only-color triggered buffer
Nathan Chancellor <[email protected]>
x86/boot: Use '-std=gnu11' to fix build with GCC 15
Nathan Chancellor <[email protected]>
kbuild: Move -Wenum-enum-conversion to W=2
Long Li <[email protected]>
scsi: storvsc: Set correct data length for sending SCSI command without payload
Quinn Tran <[email protected]>
scsi: qla2xxx: Move FCE Trace buffer allocation to user control
Edson Juliano Drosdeck <[email protected]>
ALSA: hda/realtek: Enable headset mic on Positivo C6400
Hou Tao <[email protected]>
dm-crypt: track tag_offset in convert_context
Hou Tao <[email protected]>
dm-crypt: don't update io->sector after kcryptd_crypt_write_io_submit()
Narayana Murty N <[email protected]>
powerpc/pseries/eeh: Fix get PE state translation
Claudiu Beznea <[email protected]>
serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use
Claudiu Beznea <[email protected]>
serial: sh-sci: Drop __initdata macro for port_cfg
Stephan Gerhold <[email protected]>
soc: qcom: socinfo: Avoid out of bounds read of serial number
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Don't prepare BOT write request twice
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Decrement command ref count on cleanup
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Translate error to sense
Marcel Hamer <[email protected]>
wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize()
Bitterblue Smith <[email protected]>
wifi: rtlwifi: rtl8821ae: Fix media status report
Heiko Stuebner <[email protected]>
HID: hid-sensor-hub: don't use stale platform-data on remove
Zijun Hu <[email protected]>
of: reserved-memory: Fix using wrong number of cells to get property 'alignment'
Zijun Hu <[email protected]>
of: Fix of_find_node_opts_by_path() handling of alias+path+options
Zijun Hu <[email protected]>
of: Correct child specifier used as input of the 2nd nexus node
Kuan-Wei Chiu <[email protected]>
perf bench: Fix undefined behavior in cmpworker()
Nathan Chancellor <[email protected]>
efi: libstub: Use '-std=gnu11' to fix build with GCC 15
Zijun Hu <[email protected]>
blk-cgroup: Fix class @block_class's subsystem refcount leakage
Anastasia Belova <[email protected]>
clk: qcom: clk-rpmh: prevent integer overflow in recalc_rate
Gabor Juhos <[email protected]>
clk: qcom: clk-alpha-pll: fix alpha mode configuration
Cody Eksal <[email protected]>
clk: sunxi-ng: a100: enable MMC clock reparenting
Fedor Pchelkin <[email protected]>
Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection
Fedor Pchelkin <[email protected]>
Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc
Haoxiang Li <[email protected]>
drm/komeda: Add check for komeda_get_layer_fourcc_list()
David Hildenbrand <[email protected]>
KVM: s390: vsie: fix some corner-cases when grabbing vsie pages
Sean Christopherson <[email protected]>
KVM: Explicitly verify target vCPU is online in kvm_get_vcpu()
Jakob Unterwurzacher <[email protected]>
arm64: dts: rockchip: increase gmac rx_delay on rk3399-puma
Dan Carpenter <[email protected]>
binfmt_flat: Fix integer overflow bug on 32 bit systems
Thomas Zimmermann <[email protected]>
m68k: vga: Fix I/O defines
Heiko Carstens <[email protected]>
s390/futex: Fix FUTEX_OP_ANDN implementation
Maarten Lankhorst <[email protected]>
drm/modeset: Handle tiled displays in pan_display_atomic.
Alexander Sverdlin <[email protected]>
leds: lp8860: Write full EEPROM, not only half of it
Viresh Kumar <[email protected]>
cpufreq: s3c64xx: Fix compilation warning
Willem de Bruijn <[email protected]>
tun: revert fix group permission check
Cong Wang <[email protected]>
netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()
Juergen Gross <[email protected]>
x86/xen: add FRAME_END to xen_hypercall_hvm()
Juergen Gross <[email protected]>
x86/xen: fix xen_hypercall_hvm() to not clobber %rbx
Eric Dumazet <[email protected]>
net: rose: lock the socket in rose_bind()
Jacob Moroni <[email protected]>
net: atlantic: fix warning during hot unplug
Mark Tomlinson <[email protected]>
gpio: pca953x: Improve interrupt support
Yan Zhai <[email protected]>
udp: gso: do not drop small packets when PMTU reduces
Lenny Szubowicz <[email protected]>
tg3: Disable tg3 PCIe AER on system reboot
Hans Verkuil <[email protected]>
gpu: drm_dp_cec: fix broken CEC adapter properties check
Prasad Pandit <[email protected]>
firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry
Daniel Wagner <[email protected]>
nvme: handle connectivity loss in nvme_set_queue_count
Michal Pecio <[email protected]>
usb: xhci: Fix NULL pointer dereference on certain command aborts
Hardik Gajjar <[email protected]>
usb: xhci: Add timeout argument in address_device USB HCD callback
Nikita Zhandarovich <[email protected]>
net: usb: rtl8150: enable basic endpoint checking
Emil Renner Berthing <[email protected]>
net: usb: rtl8150: use new tasklet API
Xi Ruoyao <[email protected]>
x86/mm: Don't disable PCID when INVLPG has been fixed by microcode
Illia Ostapyshyn <[email protected]>
Input: allocate keycode for phone linking
Liu Ye <[email protected]>
selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()
Dan Carpenter <[email protected]>
tipc: re-order conditions in tipc_crypto_key_rcv()
Yuanjie Yang <[email protected]>
mmc: sdhci-msm: Correctly set the load for the regulator
Borislav Petkov <[email protected]>
APEI: GHES: Have GHES honor the panic= setting
Randolph Ha <[email protected]>
i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz
Vadim Fedorenko <[email protected]>
net/mlx5: use do_aux_work for PHC overflow checks
Even Xu <[email protected]>
HID: Wacom: Add PCI Wacom device support
Hans de Goede <[email protected]>
mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id
Tetsuo Handa <[email protected]>
tomoyo: don't emit warning in tomoyo_write_control()
Dmitry Antipov <[email protected]>
wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy()
Shawn Lin <[email protected]>
mmc: core: Respect quirk_max_rate for non-UHS SDIO card
Stas Sergeev <[email protected]>
tun: fix group permission check
Leo Stone <[email protected]>
safesetid: check size of policy writes
Kuan-Wei Chiu <[email protected]>
printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
Yazen Ghannam <[email protected]>
x86/amd_nb: Restrict init function to AMD-based systems
Carlos Llamas <[email protected]>
lockdep: Fix upper limit for LOCKDEP_*_BITS configs
Suleiman Souhlal <[email protected]>
sched: Don't try to catch up excess steal time.
Josef Bacik <[email protected]>
btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling
Filipe Manana <[email protected]>
btrfs: fix use-after-free when attempting to join an aborted transaction
Qu Wenruo <[email protected]>
btrfs: output the reason for open_ctree() failure
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Don't free command immediately
Laurent Pinchart <[email protected]>
media: uvcvideo: Fix double free in error path
Alan Stern <[email protected]>
HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections
Jos Wang <[email protected]>
usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Fix Get/SetInterface return value
Sean Rhodes <[email protected]>
drivers/card_reader/rtsx_usb: Restore interrupt based detection
Ricardo B. Marliere <[email protected]>
ktest.pl: Check kernelrelease return in get_version
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: reject mismatching sum of field_len with set key length
Chuck Lever <[email protected]>
NFSD: Reset cb_seq_status after NFS4ERR_DELAY
Lin Yujun <[email protected]>
hexagon: Fix unbalanced spinlock in die()
Willem de Bruijn <[email protected]>
hexagon: fix using plain integer as NULL pointer warning in cmpxchg
Masahiro Yamada <[email protected]>
genksyms: fix memory leak when the same symbol is read from *.symref file
Masahiro Yamada <[email protected]>
genksyms: fix memory leak when the same symbol is added from source
Eric Dumazet <[email protected]>
net: hsr: fix fill_frame_info() regression vs VLAN packets
Kory Maincent <[email protected]>
net: sh_eth: Fix missing rtnl lock in suspend/resume path
Rafał Miłecki <[email protected]>
bgmac: reduce max frame size to support just MTU 1500
Michal Luczaj <[email protected]>
vsock: Allow retrying on connect() failure
Howard Chu <[email protected]>
perf trace: Fix runtime error of index out of bounds
Chenyuan Yang <[email protected]>
net: davicom: fix UAF in dm9000_drv_remove
Jakub Kicinski <[email protected]>
net: netdevsim: try to close UDP port harness races
Eric Dumazet <[email protected]>
net: rose: fix timer races against user threads
Wentao Liang <[email protected]>
PM: hibernate: Add error handling for syscore_suspend()
Eric Dumazet <[email protected]>
ipmr: do not call mr_mfc_uses_dev() for unres entries
Dheeraj Reddy Jonnalagadda <[email protected]>
net: fec: implement TSO descriptor cleanup
Jian Shen <[email protected]>
net: hns3: fix oops when unload drivers paralleling
pangliyuan <[email protected]>
ubifs: skip dumping tnc tree when zroot is null
Oleksij Rempel <[email protected]>
rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read
Joe Hattori <[email protected]>
dmaengine: ti: edma: fix OF node reference leaks in edma_driver
Jianbo Liu <[email protected]>
xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO
Luo Yifan <[email protected]>
tools/bootconfig: Fix the wrong format specifier
Olga Kornievskaia <[email protected]>
NFSv4.2: fix COPY_NOTIFY xdr buf size calculation
Sebastian Andrzej Siewior <[email protected]>
module: Extend the preempt disabled section in dereference_symbol_descriptor().
Su Yue <[email protected]>
ocfs2: mark dquot as inactive if failed to start trans while releasing dquot
Guixin Liu <[email protected]>
scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
Paul Menzel <[email protected]>
scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1
King Dix <[email protected]>
PCI: rcar-ep: Fix incorrect variable used when calling devm_request_mem_region()
Joe Hattori <[email protected]>
staging: media: imx: fix OF node leak in imx_media_add_of_subdevs()
Joe Hattori <[email protected]>
mtd: hyperbus: hbmc-am654: fix an OF node reference leak
Ricardo Ribalda <[email protected]>
media: uvcvideo: Propagate buf->error to userspace
Jiasheng Jiang <[email protected]>
media: camif-core: Add check for clk_enable()
Jiasheng Jiang <[email protected]>
media: mipi-csis: Add check for clk_enable()
Jiasheng Jiang <[email protected]>
media: marvell: Add check for clk_enable()
Zijun Hu <[email protected]>
PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()
Chen Ni <[email protected]>
media: lmedm04: Handle errors for lme2510_int_read
Malcolm Priestley <[email protected]>
media: lmedm04: Use GFP_KERNEL for URB allocation/submission.
Oliver Neukum <[email protected]>
media: rc: iguanair: handle timeouts
Joe Hattori <[email protected]>
fbdev: omapfb: Fix an OF node leak in dss_of_port_get_parent_device()
Rafał Miłecki <[email protected]>
ARM: dts: mediatek: mt7623: fix IR nodename
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8250: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8994: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8916: correct sleep clock frequency
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-evb: Fix MT6397 PMIC sub-node names
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Fix MT6397 PMIC sub-node names
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Drop regulator-compatible property
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-evb: Drop regulator-compatible property
Dan Carpenter <[email protected]>
rdma/cxgb4: Prevent potential integer overflow on 32bit
Leon Romanovsky <[email protected]>
RDMA/mlx4: Avoid false error about access to uninitialized gids array
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: reserve 192 KiB for TF-A
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: add i2c clock-div property
Fabien Parent <[email protected]>
arm64: dts: mediatek: mt8516: remove 2 invalid i2c clocks
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: fix wdt irq type
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: fix GICv2 range
Chen Ridong <[email protected]>
padata: avoid UAF for reorder_work
Chen Ridong <[email protected]>
padata: add pd get/put refcnt helper
Chen Ridong <[email protected]>
padata: fix UAF in padata_reorder
Puranjay Mohan <[email protected]>
bpf: Send signals asynchronously if !preemptible
Jiachen Zhang <[email protected]>
perf report: Fix misleading help message about --demangle
Arnaldo Carvalho de Melo <[email protected]>
perf top: Don't complain about lack of vmlinux when not resolving some kernel samples
Thomas Weißschuh <[email protected]>
padata: fix sysfs store callback check
Ba Jing <[email protected]>
ktest.pl: Remove unused declarations in run_bisect_test function
Zhongqiu Han <[email protected]>
perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()
Arnaldo Carvalho de Melo <[email protected]>
perf env: Conditionally compile BPF support code on having HAVE_LIBBPF_SUPPORT
Zhongqiu Han <[email protected]>
perf header: Fix one memory leakage in process_bpf_prog_info()
Zhongqiu Han <[email protected]>
perf header: Fix one memory leakage in process_bpf_btf()
George Lander <[email protected]>
ASoC: sun4i-spdif: Add clock multiplier settings
Marco Leogrande <[email protected]>
tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
Nikita Zhandarovich <[email protected]>
net/rose: prevent integer overflows in rose_setsockopt()
Roger Quadros <[email protected]>
net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()
Jamal Hadi Salim <[email protected]>
net: sched: Disallow replacing of child qdisc from one parent to another
Maher Sanalla <[email protected]>
net/mlxfw: Drop hard coded max FW flash image size
Liu Jian <[email protected]>
net: let net.core.dev_weight always be non-zero
Mingwei Zheng <[email protected]>
pwm: stm32: Add check for clk_enable()
Bo Gan <[email protected]>
clk: analogbits: Fix incorrect calculation of vco rate delta
Dmitry Antipov <[email protected]>
wifi: cfg80211: adjust allocation of colocated AP data
Ilan Peer <[email protected]>
wifi: cfg80211: Handle specific BSSID in 6GHz scanning
Dmitry V. Levin <[email protected]>
selftests: harness: fix printing of mismatch values in __EXPECT()
Gautham R. Shenoy <[email protected]>
cpufreq: ACPI: Fix max-frequency computation
WangYuli <[email protected]>
wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
Guangguan Wang <[email protected]>
net/smc: fix data error when recvmsg with MSG_PEEK flag
Andreas Kemnade <[email protected]>
wifi: wlcore: fix unbalanced pm_runtime calls
Joe Hattori <[email protected]>
regulator: of: Implement the unwind path of of_regulator_match()
Octavian Purdila <[email protected]>
team: prevent adding a device which is already a team device lower
Marek Vasut <[email protected]>
clk: imx8mp: Fix clkout1/2 support
Sultan Alsawaf (unemployed) <[email protected]>
cpufreq: schedutil: Fix superfluous updates caused by need_freq_update
Rafael J. Wysocki <[email protected]>
cpufreq: schedutil: Simplify sugov_update_next_freq()
Joe Hattori <[email protected]>
leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()
He Rongguang <[email protected]>
cpupower: fix TSC MHz calculation
Joe Hattori <[email protected]>
ACPI: fan: cleanup resources in the error path of .probe()
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: pci: wait for firmware loading before releasing memory
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: fix memory leaks and invalid access at probe error path
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: destroy workqueue at rtl_deinit_core
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: remove unused check_buddy_priv
Dmitry Antipov <[email protected]>
wifi: rtlwifi: remove unused dualmac control leftovers
Dmitry Antipov <[email protected]>
wifi: rtlwifi: remove unused timer and related code
Jakob Koschel <[email protected]>
rtlwifi: replace usage of found with dedicated list iterator variable
Neil Armstrong <[email protected]>
dt-bindings: mmc: controller: clarify the address-cells description
Mingwei Zheng <[email protected]>
spi: zynq-qspi: Add check for clk_enable()
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: usb: fix workqueue leak when probe fails
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: fix init_sw_vars leak when probe fails
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: wait for firmware loading before releasing memory
Colin Ian King <[email protected]>
rtlwifi: remove redundant assignment to variable err
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: do not complete firmware loading needlessly
Charles Han <[email protected]>
ipmi: ipmb: Add check devm_kasprintf() returned value
Thomas Gleixner <[email protected]>
genirq: Make handle_enforce_irqctx() unconditionally available
Ivan Stepchenko <[email protected]>
drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table
Sui Jingfeng <[email protected]>
drm/etnaviv: Fix page property being used for non writecombine buffers
David Howells <[email protected]>
afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call
Christophe Leroy <[email protected]>
select: Fix unbalanced user_access_end()
Randy Dunlap <[email protected]>
partitions: ldm: remove the initial kernel-doc notation
Keisuke Nishimura <[email protected]>
nvme: Add error check for xa_store in nvme_get_effects_log
Yu Kuai <[email protected]>
nbd: don't allow reconnect after disconnect
David Howells <[email protected]>
afs: Fix directory format encoding struct
David Howells <[email protected]>
afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY
-------------
Diffstat:
Documentation/admin-guide/kernel-parameters.txt | 10 + .../devicetree/bindings/mmc/mmc-controller.yaml | 2 +- Makefile | 9 +- arch/alpha/include/uapi/asm/ptrace.h | 2 + arch/alpha/kernel/asm-offsets.c | 2 + arch/alpha/kernel/entry.S | 24 +-- arch/alpha/kernel/traps.c | 2 +- arch/alpha/mm/fault.c | 4 +- arch/arm/boot/dts/mt7623.dtsi | 2 +- arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 29 +-- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 25 +-- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 38 ++-- arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi | 2 - arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 2 +- arch/arm64/include/asm/mman.h | 9 +- arch/arm64/kernel/cacheinfo.c | 12 +- arch/arm64/kernel/vdso/vdso.lds.S | 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + arch/hexagon/include/asm/cmpxchg.h | 2 +- arch/hexagon/kernel/traps.c | 4 +- arch/m68k/include/asm/vga.h | 8 +- arch/mips/kernel/ftrace.c | 2 +- arch/powerpc/include/asm/book3s/64/hash-4k.h | 28 +++ arch/powerpc/include/asm/book3s/64/pgtable.h | 26 --- arch/powerpc/lib/code-patching.c | 2 +- arch/powerpc/platforms/pseries/eeh_pseries.c | 6 +- arch/s390/include/asm/futex.h | 2 +- arch/s390/kernel/traps.c | 6 +- arch/s390/kvm/vsie.c | 25 ++- arch/x86/Kconfig | 3 +- arch/x86/boot/compressed/Makefile | 1 + arch/x86/events/intel/core.c | 5 +- arch/x86/include/asm/msr-index.h | 3 +- arch/x86/kernel/amd_nb.c | 4 + arch/x86/kernel/cpu/bugs.c | 20 +- arch/x86/kernel/cpu/cacheinfo.c | 2 +- arch/x86/kernel/cpu/cyrix.c | 4 +- arch/x86/kernel/cpu/intel.c | 52 +++-- arch/x86/kernel/i8253.c | 11 +- arch/x86/kernel/static_call.c | 1 - arch/x86/mm/init.c | 23 ++- arch/x86/xen/mmu_pv.c | 79 +++++-- arch/x86/xen/xen-head.S | 5 +- block/blk-cgroup.c | 1 + block/partitions/efi.c | 2 +- block/partitions/ldm.h | 2 +- block/partitions/mac.c | 18 +- crypto/testmgr.h | 227 +++++++++++++++------ drivers/acpi/apei/ghes.c | 10 +- drivers/acpi/fan.c | 10 +- drivers/base/regmap/regmap-irq.c | 2 + drivers/block/nbd.c | 1 + drivers/char/ipmi/ipmb_dev_int.c | 3 + drivers/char/tpm/eventlog/acpi.c | 16 +- drivers/char/tpm/eventlog/efi.c | 13 +- drivers/char/tpm/eventlog/of.c | 3 +- drivers/char/tpm/tpm-chip.c | 1 - drivers/clk/analogbits/wrpll-cln28hpc.c | 2 +- drivers/clk/imx/clk-imx8mp.c | 5 +- drivers/clk/qcom/clk-alpha-pll.c | 2 + drivers/clk/qcom/clk-rpmh.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 6 +- drivers/clocksource/i8253.c | 13 +- drivers/cpufreq/acpi-cpufreq.c | 36 +++- drivers/cpufreq/s3c64xx-cpufreq.c | 11 +- drivers/crypto/hisilicon/qm.c | 46 ++--- drivers/crypto/qce/core.c | 13 +- drivers/dma/ti/edma.c | 3 +- drivers/firmware/Kconfig | 2 +- drivers/firmware/efi/efi.c | 6 +- drivers/firmware/efi/libstub/Makefile | 2 +- drivers/firmware/efi/libstub/randomalloc.c | 3 + drivers/firmware/efi/libstub/relocate.c | 3 + drivers/firmware/efi/mokvar-table.c | 41 ++-- drivers/gpio/gpio-aggregator.c | 20 +- drivers/gpio/gpio-bcm-kona.c | 71 +++++-- drivers/gpio/gpio-pca953x.c | 19 -- drivers/gpio/gpio-rcar.c | 7 +- drivers/gpio/gpio-stmpe.c | 15 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 + .../gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 2 + .../drm/arm/display/komeda/komeda_wb_connector.c | 4 + drivers/gpu/drm/drm_dp_cec.c | 14 +- drivers/gpu/drm/drm_fb_helper.c | 14 +- drivers/gpu/drm/drm_probe_helper.c | 116 ++++++++--- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 16 +- drivers/gpu/drm/radeon/r300.c | 3 +- drivers/gpu/drm/radeon/radeon_asic.h | 1 + drivers/gpu/drm/radeon/rs400.c | 18 +- drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 +- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 4 +- drivers/gpu/drm/tidss/tidss_dispc.c | 22 +- drivers/hid/hid-appleir.c | 2 +- drivers/hid/hid-core.c | 2 + drivers/hid/hid-google-hammer.c | 2 + drivers/hid/hid-multitouch.c | 5 +- drivers/hid/hid-sensor-hub.c | 21 +- drivers/hid/intel-ish-hid/ishtp-hid.c | 4 +- drivers/hid/wacom_wac.c | 5 + drivers/hwmon/ad7314.c | 10 + drivers/hwmon/ntc_thermistor.c | 66 +++--- drivers/hwmon/pmbus/pmbus.c | 2 + drivers/hwmon/xgene-hwmon.c | 2 +- drivers/hwtracing/intel_th/pci.c | 15 ++ drivers/i2c/busses/i2c-npcm7xx.c | 7 + drivers/i2c/i2c-core-acpi.c | 22 ++ drivers/idle/intel_idle.c | 4 + drivers/iio/light/as73211.c | 24 ++- drivers/infiniband/hw/cxgb4/device.c | 6 +- drivers/infiniband/hw/mlx4/main.c | 6 +- drivers/infiniband/hw/mlx5/counters.c | 8 +- drivers/infiniband/hw/mlx5/qp.c | 4 +- drivers/leds/leds-lp8860.c | 2 +- drivers/leds/leds-netxbig.c | 1 + drivers/md/dm-crypt.c | 27 +-- drivers/media/dvb-frontends/cxd2841er.c | 8 +- drivers/media/i2c/ov5640.c | 1 + drivers/media/platform/exynos4-is/mipi-csis.c | 10 +- drivers/media/platform/marvell-ccic/mcam-core.c | 7 +- drivers/media/platform/s3c-camif/camif-core.c | 13 +- drivers/media/rc/iguanair.c | 4 +- drivers/media/test-drivers/vidtv/vidtv_bridge.c | 8 +- drivers/media/usb/dvb-usb-v2/lmedm04.c | 14 +- drivers/media/usb/uvc/uvc_ctrl.c | 85 ++++++-- drivers/media/usb/uvc/uvc_driver.c | 63 +++--- drivers/media/usb/uvc/uvc_queue.c | 3 +- drivers/media/usb/uvc/uvc_status.c | 1 + drivers/media/usb/uvc/uvc_v4l2.c | 2 + drivers/media/usb/uvc/uvcvideo.h | 9 +- drivers/media/v4l2-core/v4l2-mc.c | 2 +- drivers/mfd/lpc_ich.c | 3 +- drivers/misc/eeprom/digsy_mtc_eeprom.c | 2 +- drivers/misc/fastrpc.c | 2 +- drivers/misc/mei/hw-me-regs.h | 2 + drivers/misc/mei/pci-me.c | 2 + drivers/mmc/core/sdio.c | 2 + drivers/mmc/host/sdhci-msm.c | 53 ++++- drivers/mtd/hyperbus/hbmc-am654.c | 19 +- drivers/mtd/nand/onenand/onenand_base.c | 1 + drivers/mtd/nand/raw/cadence-nand-controller.c | 44 +++- drivers/net/caif/caif_virtio.c | 2 +- drivers/net/can/c_can/c_can_platform.c | 5 +- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 4 +- drivers/net/ethernet/broadcom/bgmac.h | 3 +- drivers/net/ethernet/broadcom/tg3.c | 58 ++++++ drivers/net/ethernet/cadence/macb.h | 2 + drivers/net/ethernet/cadence/macb_main.c | 12 +- drivers/net/ethernet/davicom/dm9000.c | 3 +- drivers/net/ethernet/emulex/benet/be.h | 2 +- drivers/net/ethernet/emulex/benet/be_cmds.c | 197 +++++++++--------- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- drivers/net/ethernet/freescale/fec_main.c | 31 ++- drivers/net/ethernet/hisilicon/hns3/hnae3.c | 15 ++ drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 + drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/clock.c | 24 ++- drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 2 - .../net/ethernet/mellanox/mlxsw/spectrum_ethtool.c | 4 +- drivers/net/ethernet/netronome/nfp/bpf/cmsg.c | 2 + drivers/net/ethernet/renesas/sh_eth.c | 4 + drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- drivers/net/geneve.c | 16 +- drivers/net/gtp.c | 5 - drivers/net/loopback.c | 14 ++ drivers/net/netdevsim/ipsec.c | 12 +- drivers/net/netdevsim/netdevsim.h | 1 + drivers/net/netdevsim/udp_tunnels.c | 23 ++- drivers/net/ppp/ppp_generic.c | 28 ++- drivers/net/team/team.c | 11 +- drivers/net/tun.c | 2 +- drivers/net/usb/gl620a.c | 4 +- drivers/net/usb/rtl8150.c | 28 ++- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 5 + .../broadcom/brcm80211/brcmsmac/phy/phy_n.c | 3 + drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 2 +- drivers/net/wireless/mediatek/mt76/usb.c | 4 +- drivers/net/wireless/realtek/rtlwifi/base.c | 42 ++-- drivers/net/wireless/realtek/rtlwifi/base.h | 2 - drivers/net/wireless/realtek/rtlwifi/pci.c | 67 +----- .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 7 +- .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.h | 4 +- drivers/net/wireless/realtek/rtlwifi/usb.c | 13 +- drivers/net/wireless/realtek/rtlwifi/wifi.h | 23 --- drivers/net/wireless/ti/wlcore/main.c | 10 +- drivers/nvme/host/core.c | 16 +- drivers/nvme/host/pci.c | 66 +++++- drivers/nvme/target/tcp.c | 15 +- drivers/nvmem/core.c | 2 + drivers/nvmem/qcom-spmi-sdam.c | 1 + drivers/of/base.c | 8 +- drivers/parport/parport_pc.c | 5 + drivers/pci/controller/pcie-rcar-ep.c | 2 +- drivers/pci/endpoint/pci-epc-core.c | 2 +- drivers/pci/quirks.c | 1 + drivers/phy/samsung/phy-exynos5-usbdrd.c | 12 +- drivers/phy/tegra/xusb-tegra186.c | 11 + drivers/platform/x86/thinkpad_acpi.c | 1 + drivers/power/supply/da9150-fg.c | 4 +- drivers/pps/clients/pps-gpio.c | 4 +- drivers/pps/clients/pps-ktimer.c | 4 +- drivers/pps/clients/pps-ldisc.c | 6 +- drivers/pps/clients/pps_parport.c | 4 +- drivers/pps/kapi.c | 10 +- drivers/pps/kc.c | 10 +- drivers/pps/pps.c | 127 ++++++------ drivers/ptp/ptp_clock.c | 8 + drivers/pwm/pwm-stm32.c | 7 +- drivers/rapidio/devices/rio_mport_cdev.c | 3 +- drivers/rapidio/rio-scan.c | 5 +- drivers/regulator/of_regulator.c | 14 +- drivers/rtc/rtc-pcf85063.c | 11 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +- drivers/scsi/qla2xxx/qla_def.h | 2 + drivers/scsi/qla2xxx/qla_dfs.c | 122 +++++++++-- drivers/scsi/qla2xxx/qla_gbl.h | 3 + drivers/scsi/qla2xxx/qla_init.c | 28 ++- drivers/scsi/storvsc_drv.c | 1 + drivers/scsi/ufs/ufs_bsg.c | 1 + drivers/slimbus/messaging.c | 5 +- drivers/soc/qcom/smem_state.c | 3 +- drivers/soc/qcom/socinfo.c | 2 +- drivers/spi/spi-mxs.c | 3 +- drivers/spi/spi-zynq-qspi.c | 13 +- drivers/staging/media/imx/imx-media-of.c | 8 +- drivers/tee/optee/supp.c | 35 +--- drivers/tty/serial/8250/8250.h | 2 + drivers/tty/serial/8250/8250_dma.c | 16 ++ drivers/tty/serial/8250/8250_pci.c | 10 + drivers/tty/serial/8250/8250_port.c | 9 + drivers/tty/serial/sh-sci.c | 25 ++- drivers/usb/atm/cxacru.c | 13 +- drivers/usb/class/cdc-acm.c | 28 ++- drivers/usb/core/hub.c | 16 +- drivers/usb/core/quirks.c | 10 + drivers/usb/dwc2/gadget.c | 1 + drivers/usb/dwc3/gadget.c | 37 +++- drivers/usb/gadget/composite.c | 17 +- drivers/usb/gadget/function/f_midi.c | 22 +- drivers/usb/gadget/function/f_tcm.c | 66 +++--- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- drivers/usb/host/pci-quirks.c | 9 + drivers/usb/host/xhci-mem.c | 5 +- drivers/usb/host/xhci-pci.c | 17 +- drivers/usb/host/xhci-ring.c | 12 +- drivers/usb/host/xhci.c | 23 ++- drivers/usb/host/xhci.h | 11 +- drivers/usb/renesas_usbhs/common.c | 6 +- drivers/usb/renesas_usbhs/mod_gadget.c | 2 +- drivers/usb/roles/class.c | 5 +- drivers/usb/serial/option.c | 49 +++-- drivers/usb/typec/tcpm/tcpci_rt1711h.c | 11 + drivers/usb/typec/tcpm/tcpm.c | 2 +- drivers/usb/typec/ucsi/ucsi.c | 2 +- drivers/vfio/pci/vfio_pci_rdwr.c | 1 + drivers/vfio/platform/vfio_platform_common.c | 10 + drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 1 + fs/afs/dir.c | 7 +- fs/afs/xdr_fs.h | 2 +- fs/afs/yfsclient.c | 5 +- fs/binfmt_flat.c | 2 +- fs/btrfs/inode.c | 4 +- fs/btrfs/locking.c | 68 +++++- fs/btrfs/relocation.c | 14 +- fs/btrfs/super.c | 2 +- fs/btrfs/transaction.c | 4 +- fs/cifs/smb2ops.c | 4 + fs/f2fs/file.c | 13 ++ fs/nfs/flexfilelayout/flexfilelayout.c | 27 ++- fs/nfs/nfs42xdr.c | 2 + fs/nfsd/nfs2acl.c | 2 + fs/nfsd/nfs3acl.c | 2 + fs/nfsd/nfs4callback.c | 8 +- fs/nilfs2/dir.c | 24 +-- fs/nilfs2/inode.c | 10 +- fs/nilfs2/mdt.c | 6 +- fs/nilfs2/namei.c | 37 ++-- fs/nilfs2/nilfs.h | 10 +- fs/nilfs2/page.c | 55 ++--- fs/nilfs2/page.h | 4 +- fs/nilfs2/segment.c | 4 +- fs/ocfs2/dir.c | 25 ++- fs/ocfs2/quota_global.c | 5 + fs/ocfs2/super.c | 2 +- fs/ocfs2/symlink.c | 5 +- fs/orangefs/orangefs-debugfs.c | 4 +- fs/select.c | 4 +- fs/squashfs/inode.c | 5 +- fs/ubifs/debug.c | 22 +- fs/udf/super.c | 2 +- include/asm-generic/vmlinux.lds.h | 2 +- include/drm/drm_probe_helper.h | 1 + include/linux/efi.h | 1 + include/linux/i8253.h | 1 + include/linux/kallsyms.h | 2 +- include/linux/kvm_host.h | 9 + include/linux/mlx5/driver.h | 1 - include/linux/netdevice.h | 6 + include/linux/pci_ids.h | 4 + include/linux/pps_kernel.h | 3 +- include/linux/usb/hcd.h | 5 +- include/net/dst.h | 23 ++- include/net/flow_dissector.h | 16 ++ include/net/flow_offload.h | 6 + include/net/l3mdev.h | 2 + include/net/net_namespace.h | 15 +- include/trace/events/oom.h | 36 +++- include/uapi/linux/input-event-codes.h | 1 + kernel/acct.c | 141 ++++++++----- kernel/bpf/syscall.c | 18 +- kernel/debug/kdb/kdb_io.c | 2 + kernel/events/core.c | 17 +- kernel/irq/internals.h | 9 +- kernel/padata.c | 45 +++- kernel/power/hibernate.c | 7 +- kernel/printk/printk.c | 2 +- kernel/sched/core.c | 8 +- kernel/sched/cpufreq_schedutil.c | 12 +- kernel/time/clocksource.c | 79 ++++++- kernel/trace/bpf_trace.c | 2 +- kernel/trace/ftrace.c | 27 ++- lib/Kconfig.debug | 8 +- mm/memcontrol.c | 7 +- mm/oom_kill.c | 14 +- mm/page_alloc.c | 1 + net/8021q/vlan.c | 3 +- net/8021q/vlan.h | 2 +- net/8021q/vlan_dev.c | 15 +- net/8021q/vlan_netlink.c | 7 +- net/batman-adv/bat_v.c | 3 +- net/batman-adv/bat_v_elp.c | 124 +++++++---- net/batman-adv/bat_v_elp.h | 2 - net/batman-adv/bat_v_ogm.c | 1 + net/batman-adv/fragmentation.c | 2 +- net/batman-adv/hard-interface.c | 1 + net/batman-adv/icmp_socket.c | 1 + net/batman-adv/main.c | 1 + net/batman-adv/netlink.c | 1 + net/batman-adv/tp_meter.c | 1 + net/batman-adv/types.h | 3 - net/bluetooth/l2cap_core.c | 9 +- net/bluetooth/l2cap_sock.c | 7 +- net/can/j1939/socket.c | 4 +- net/can/j1939/transport.c | 5 +- net/core/drop_monitor.c | 39 ++-- net/core/flow_dissector.c | 49 +++-- net/core/flow_offload.c | 7 + net/core/neighbour.c | 11 +- net/core/skbuff.c | 2 +- net/core/sysctl_net_core.c | 5 +- net/hsr/hsr_forward.c | 7 +- net/ipv4/arp.c | 4 +- net/ipv4/devinet.c | 3 +- net/ipv4/ip_input.c | 1 + net/ipv4/ip_output.c | 1 + net/ipv4/ipmr_base.c | 3 - net/ipv4/route.c | 8 +- net/ipv4/tcp_minisocks.c | 10 +- net/ipv4/tcp_offload.c | 11 +- net/ipv4/udp.c | 4 +- net/ipv4/udp_offload.c | 8 +- net/ipv6/ila/ila_lwt.c | 4 +- net/ipv6/ip6_output.c | 1 + net/ipv6/ndisc.c | 28 +-- net/ipv6/route.c | 7 +- net/ipv6/rpl_iptunnel.c | 67 +++--- net/ipv6/seg6_iptunnel.c | 2 +- net/ipv6/udp.c | 4 +- net/llc/llc_s_ac.c | 49 +++-- net/mptcp/pm_netlink.c | 6 - net/mptcp/protocol.c | 1 + net/ncsi/ncsi-manage.c | 13 +- net/netfilter/nf_tables_api.c | 8 +- net/nfc/nci/hci.c | 2 + net/openvswitch/datapath.c | 12 +- net/rose/af_rose.c | 40 ++-- net/rose/rose_timer.c | 15 ++ net/sched/cls_flower.c | 8 +- net/sched/sch_api.c | 4 + net/sched/sch_cake.c | 140 +++++++------ net/sched/sch_fifo.c | 3 + net/sched/sch_netem.c | 2 +- net/smc/af_smc.c | 2 +- net/smc/smc_rx.c | 37 ++-- net/smc/smc_rx.h | 8 +- net/sunrpc/cache.c | 10 +- net/tipc/crypto.c | 4 +- net/vmw_vsock/af_vsock.c | 82 +++++--- net/wireless/nl80211.c | 5 + net/wireless/reg.c | 3 +- net/wireless/scan.c | 35 ++++ net/xfrm/xfrm_replay.c | 10 +- scripts/Makefile.extrawarn | 5 +- scripts/genksyms/genksyms.c | 11 +- scripts/genksyms/genksyms.h | 2 +- scripts/genksyms/parse.y | 18 +- security/integrity/ima/ima_api.c | 16 +- security/integrity/ima/ima_template_lib.c | 17 +- security/safesetid/securityfs.c | 3 + security/tomoyo/common.c | 2 +- sound/pci/hda/hda_intel.c | 2 + sound/pci/hda/patch_conexant.c | 1 + sound/pci/hda/patch_realtek.c | 78 +++++++ sound/soc/codecs/es8328.c | 15 +- sound/soc/intel/boards/bytcr_rt5640.c | 17 +- sound/soc/sunxi/sun4i-spdif.c | 7 + sound/usb/midi.c | 2 +- sound/usb/usx2y/usbusx2y.c | 11 + sound/usb/usx2y/usbusx2y.h | 26 +++ sound/usb/usx2y/usbusx2yaudio.c | 27 --- tools/bootconfig/main.c | 4 +- tools/perf/bench/epoll-wait.c | 7 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 6 +- tools/perf/util/bpf-event.c | 10 +- tools/perf/util/cs-etm.c | 2 +- tools/perf/util/dso.c | 14 +- tools/perf/util/env.c | 28 ++- tools/perf/util/env.h | 8 +- tools/perf/util/header.c | 29 ++- .../cpupower/utils/idle_monitor/mperf_monitor.c | 15 +- tools/testing/ktest/ktest.pl | 7 +- tools/testing/selftests/bpf/test_tc_tunnel.sh | 1 + .../drivers/net/netdevsim/udp_tunnel_nic.sh | 16 +- tools/testing/selftests/kselftest_harness.h | 24 +-- tools/testing/selftests/net/ipsec.c | 3 +- tools/testing/selftests/net/rtnetlink.sh | 4 +- tools/testing/selftests/net/udpgso.c | 26 +++ 434 files changed, 4060 insertions(+), 2030 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/462 afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit b49194da2aff2c879dec9c59ef8dec0f2b0809ef ]
AFS servers pass back a code indicating EEXIST when they're asked to remove a directory that is not empty rather than ENOTEMPTY because not all the systems that an AFS server can run on have the latter error available and AFS preexisted the addition of that error in general.
Fix afs_rmdir() to translate EEXIST to ENOTEMPTY.
--- fs/afs/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/afs/dir.c +6 -1
@@ -1412,7 +1412,12 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) op->file[1 ].vnode = vnode; } -return afs_do_sync_operation (op); + ret =afs_do_sync_operation (op); + +/* Not all systems that can host afs servers have ENOTEMPTY. */ +if (ret == -EEXIST ) + ret = -ENOTEMPTY ; +return ret; error:return afs_put_operation (op);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 2/462 afs: Fix directory format encoding struct
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 07a10767853adcbdbf436dc91393b729b52c4e81 ]
The AFS directory format structure, union afs_xdr_dir_block::meta, has too many alloc counter slots declared and so pushes the hash table along and over the data. This doesn't cause a problem at the moment because I'm currently ignoring the hash table and only using the correct number of alloc_ctrs in the code anyway. In future, however, I should start using the hash table to try and speed up afs_lookup().
Fix this by using the correct constant to declare the counter array.
--- fs/afs/xdr_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/afs/xdr_fs.h +1 -1
@@ -82,7 +82,7 @@ union afs_xdr_dir_block {struct {struct afs_xdr_dir_hdr hdr; -u8 alloc_ctrs[AFS_DIR_MAX_BLOCKS ]; +u8 alloc_ctrs[AFS_DIR_BLOCKS_WITH_CTR ];__be16 hashtable[AFS_DIR_HASHTBL_SIZE ]; } meta;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 3/462 nbd: dont allow reconnect after disconnect
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 844b8cdc681612ff24df62cdefddeab5772fadf1 ]
Following process can cause nbd_config UAF:
1) grab nbd_config temporarily;
2) nbd_genl_disconnect() flush all recv_work() and release the initial reference:
nbd_genl_disconnect
nbd_disconnect_and_put
nbd_disconnect
flush_workqueue(nbd->recv_workq)
if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF, ...))
nbd_config_put
-> due to step 1), reference is still not zero3) nbd_genl_reconfigure() queue recv_work() again;
nbd_genl_reconfigure
config = nbd_get_config_unlocked(nbd)
if (!config)
-> succeed
if (!test_bit(NBD_RT_BOUND, ...))
-> succeed
nbd_reconnect_socket
queue_work(nbd->recv_workq, &args->work)
4) step 1) release the reference;
5) Finially, recv_work() will trigger UAF:
recv_work
nbd_config_put(nbd)
-> nbd_config is freed
atomic_dec(&config->recv_threads)
-> UAF
Fix the problem by clearing NBD_RT_BOUND in nbd_genl_disconnect(), so that nbd_genl_reconfigure() will fail.
--- drivers/block/nbd.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/nbd.c +1 -0
@@ -2065,6 +2065,7 @@ static void nbd_disconnect_and_put(struct nbd_device *nbd)flush_workqueue (nbd->recv_workq);nbd_clear_que (nbd); nbd->task_setup =NULL ; +clear_bit (NBD_RT_BOUND , &nbd->config->runtime_flags);mutex_unlock (&nbd->config_lock); if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 4/462 nvme: Add error check for xa_store in nvme_get_effects_log
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keisuke Nishimura <[email protected]>
[ Upstream commit ac32057acc7f3d7a238dafaa9b2aa2bc9750080e ]
The xa_store() may fail due to memory allocation failure because there is no guarantee that the index csi is already used. This fix adds an error check of the return value of xa_store() in nvme_get_effects_log().
--- drivers/nvme/host/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +6 -2
@@ -3043,7 +3043,7 @@ int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi,static int nvme_get_effects_log (struct nvme_ctrl *ctrl,u8 csi,struct nvme_effects_log **log) { -struct nvme_effects_log *cel =xa_load (&ctrl->cels, csi); +struct nvme_effects_log *old, *cel =xa_load (&ctrl->cels, csi);int ret;if (cel)
@@ -3060,7 +3060,11 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,return ret; } -xa_store (&ctrl->cels, csi, cel,GFP_KERNEL ); + old =xa_store (&ctrl->cels, csi, cel,GFP_KERNEL ); +if (xa_is_err (old)) { +kfree (cel); +return xa_err (old); + } out: *log = cel;return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 5/462 partitions: ldm: remove the initial kernel-doc notation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit e494e451611a3de6ae95f99e8339210c157d70fb ]
Remove the file's first comment describing what the file is. This comment is not in kernel-doc format so it causes a kernel-doc warning.
ldm.h:13: warning: expecting prototype for ldm(). Prototype was for _FS_PT_LDM_H_() instead
--- block/partitions/ldm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/partitions/ldm.h +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0-or-later -/** +/* * ldm - Part of the Linux-NTFS project. * * Copyright (C) 2001,2002 Richard Russon <[email protected]>
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 6/462 select: Fix unbalanced user_access_end()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe Leroy <[email protected]>
[ Upstream commit 344af27715ddbf357cf76978d674428b88f8e92d ]
While working on implementing user access validation on powerpc I got the following warnings on a pmac32_defconfig build:
CC fs/select.o fs/select.o: warning: objtool: sys_pselect6+0x1bc: redundant UACCESS disable fs/select.o: warning: objtool: sys_pselect6_time32+0x1bc: redundant UACCESS disable
On powerpc/32s, user_read_access_begin/end() are no-ops, but the failure path has a user_access_end() instead of user_read_access_end() which means an access end without any prior access begin.
Replace that user_access_end() by user_read_access_end().
--- fs/select.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/select.c +2 -2
@@ -787,7 +787,7 @@ static inline int get_sigset_argpack(struct sigset_argpack *to, }return 0 ; Efault: -user_access_end (); +user_read_access_end ();return -EFAULT ; }
@@ -1360,7 +1360,7 @@ static inline int get_compat_sigset_argpack(struct compat_sigset_argpack *to, }return 0 ; Efault: -user_access_end (); +user_read_access_end ();return -EFAULT ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 7/462 afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit e30458d690f35abb01de8b3cbc09285deb725d00 ]
Fix a pair of bugs in the fallback handling for the YFS.RemoveFile2 RPC call:
(1) Fix the abort code check to also look for RXGEN_OPCODE. The lack of this masks the second bug.
(2) call->server is now not used for ordinary filesystem RPC calls that
have an operation descriptor. Fix to use call->op->server instead.
--- fs/afs/yfsclient.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/afs/yfsclient.c +3 -2
@@ -689,8 +689,9 @@ static int yfs_deliver_fs_remove_file2(struct afs_call *call)static void yfs_done_fs_remove_file2 (struct afs_call *call) {if (call->error == -ECONNABORTED && - call->abort_code ==RX_INVALID_OPERATION ) { -set_bit (AFS_SERVER_FL_NO_RM2 , &call->server->flags); + (call->abort_code ==RX_INVALID_OPERATION || + call->abort_code ==RXGEN_OPCODE )) { +set_bit (AFS_SERVER_FL_NO_RM2 , &call->op->server->flags); call->op->flags |=AFS_OPERATION_DOWNGRADE ; } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 8/462 drm/etnaviv: Fix page property being used for non writecombine buffers
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sui Jingfeng <[email protected]>
[ Upstream commit 834f304192834d6f0941954f3277ae0ba11a9a86 ]
In the etnaviv_gem_vmap_impl() function, the driver vmap whatever buffers with write combine(WC) page property, this is incorrect. Cached buffers should be mapped with the cached page property and uncached buffers should be mapped with the uncached page property.
--- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gem.c +14 -2
@@ -351,6 +351,7 @@ void *etnaviv_gem_vmap(struct drm_gem_object *obj)static void *etnaviv_gem_vmap_impl (struct etnaviv_gem_object *obj) {struct page **pages; +pgprot_t prot;lockdep_assert_held (&obj->lock);
@@ -358,8 +359,19 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)if (IS_ERR (pages))return NULL ; -return vmap (pages, obj->base.size >>PAGE_SHIFT , -VM_MAP ,pgprot_writecombine (PAGE_KERNEL )); +switch (obj->flags &ETNA_BO_CACHE_MASK ) { +case ETNA_BO_CACHED : + prot =PAGE_KERNEL ; +break ; +case ETNA_BO_UNCACHED : + prot =pgprot_noncached (PAGE_KERNEL ); +break ; +case ETNA_BO_WC : +default : + prot =pgprot_writecombine (PAGE_KERNEL ); + } + +return vmap (pages, obj->base.size >>PAGE_SHIFT ,VM_MAP , prot); }static inline enum dma_data_direction etnaviv_op_to_dma_dir (u32 op)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 9/462 drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Stepchenko <[email protected]>
[ Upstream commit 357445e28ff004d7f10967aa93ddb4bffa5c3688 ]
The function atomctrl_get_smc_sclk_range_table() does not check the return value of smu_atom_get_data_table(). If smu_atom_get_data_table() fails to retrieve SMU_Info table, it returns NULL which is later dereferenced.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
In practice this should never happen as this code only gets called on polaris chips and the vbios data table will always be present on those chips.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +2 -0
@@ -1370,6 +1370,8 @@ int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctrGetIndexIntoMasterTable (DATA , SMU_Info), &size, &frev, &crev); +if (!psmu_info) +return -EINVAL ;for (i =0 ; i < psmu_info->ucSclkEntryNum; i++) { table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 10/462 genirq: Make handle_enforce_irqctx() unconditionally available
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit 8d187a77f04c14fb459a5301d69f733a5a1396bc ]
Commit 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely") sett the flag which enforces interrupt handling in interrupt context and prevents software base resends for ARM GIC v2/v3.
But it missed that the helper function which checks the flag was hidden behind CONFIG_GENERIC_PENDING_IRQ, which is not set by ARM[64].
Make the helper unconditionally available so that the enforcement actually works.
--- kernel/irq/internals.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
kernel/irq/internals.h +3 -6
@@ -429,10 +429,6 @@ static inline struct cpumask *irq_desc_get_pending_mask(struct irq_desc *desc) {return desc->pending_mask; } -static inline bool handle_enforce_irqctx (struct irq_data *data) -{ -return irqd_is_handle_enforce_irqctx (data); -}bool irq_fixup_move_pending (struct irq_desc *desc,bool force_clear);#else /* CONFIG_GENERIC_PENDING_IRQ */ static inline bool irq_can_move_pcntxt (struct irq_data *data)
@@ -459,11 +455,12 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear) {return false; } +#endif /* !CONFIG_GENERIC_PENDING_IRQ */ +static inline bool handle_enforce_irqctx (struct irq_data *data) { -return false; +return irqd_is_handle_enforce_irqctx (data); } -#endif /* !CONFIG_GENERIC_PENDING_IRQ */ #if !defined(CONFIG_IRQ_DOMAIN ) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY )static inline int irq_domain_activate_irq (struct irq_data *data,bool reserve)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 11/462 ipmi: ipmb: Add check devm_kasprintf() returned value
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Han <[email protected]>
[ Upstream commit 2378bd0b264ad3a1f76bd957caf33ee0c7945351 ]
devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked.
Message-ID: <[email protected]>
--- drivers/char/ipmi/ipmb_dev_int.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/char/ipmi/ipmb_dev_int.c +3 -0
@@ -322,6 +322,9 @@ static int ipmb_probe(struct i2c_client *client, ipmb_dev->miscdev.name =devm_kasprintf (&client->dev,GFP_KERNEL ,"%s%d" ,"ipmb-" , client->adapter->nr); +if (!ipmb_dev->miscdev.name) +return -ENOMEM ; + ipmb_dev->miscdev.fops = &ipmb_fops; ipmb_dev->miscdev.parent = &client->dev; ret =misc_register (&ipmb_dev->miscdev);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 12/462 wifi: rtlwifi: do not complete firmware loading needlessly
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit e73e11d303940119e41850a0452a0deda2cc4eb5 ]
The only code waiting for completion is driver removal, which will not be called when probe returns a failure. So this completion is unnecessary.
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 1 - drivers/net/wireless/realtek/rtlwifi/usb.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -1
@@ -2274,7 +2274,6 @@ int rtl_pci_probe(struct pci_dev *pdev,pci_iounmap (pdev, (void __iomem *)rtlpriv->io.pci_mem_start);pci_release_regions (pdev); -complete (&rtlpriv->firmware_loading_complete); fail1:if (hw)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -1
@@ -1085,7 +1085,6 @@ int rtl_usb_probe(struct usb_interface *intf, error_out2:_rtl_usb_io_handler_release (hw);usb_put_dev (udev); -complete (&rtlpriv->firmware_loading_complete);kfree (rtlpriv->usb_data);ieee80211_free_hw (hw);return -ENODEV ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 13/462 wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 8559a9e0c457729fe3edb3176bbf7c7874f482b0 ]
Just like in commit 4dfde294b979 ("rtlwifi: rise completion at the last step of firmware callback"), only signal completion once the function is finished. Otherwise, the module removal waiting for the completion could free the memory that the callback will still use before returning.
--- drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c +4 -3
@@ -67,22 +67,23 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)rtl_dbg (rtlpriv,COMP_ERR ,DBG_LOUD ,"Firmware callback routine entered!\n" ); -complete (&rtlpriv->firmware_loading_complete);if (!firmware) {pr_err ("Firmware %s not available\n" , fw_name); rtlpriv->max_fw_size =0 ; -return ; + goto exit; }if (firmware->size > rtlpriv->max_fw_size) {pr_err ("Firmware is too big!\n" ); rtlpriv->max_fw_size =0 ;release_firmware (firmware); -return ; + goto exit; } pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;memcpy (pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size); pfirmware->sz_fw_tmpbufferlen = firmware->size;release_firmware (firmware); +exit: +complete (&rtlpriv->firmware_loading_complete); }static int rtl92s_init_sw_vars (struct ieee80211_hw *hw)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 14/462 rtlwifi: remove redundant assignment to variable err
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
[ Upstream commit 87431bc1f0f67aa2d23ca1b9682fe54f68549d42 ]
Variable err is assigned -ENODEV followed by an error return path via label error_out that does not access the variable and returns with the -ENODEV error return code. The assignment to err is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Stable-dep-of: b4b26642b31e ("wifi: rtlwifi: wait for firmware loading before releasing memory")
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -1
@@ -1072,7 +1072,6 @@ int rtl_usb_probe(struct usb_interface *intf, err =ieee80211_register_hw (hw);if (err) {pr_err ("Can't register mac80211 hw.\n" ); - err = -ENODEV ; goto error_out; } rtlpriv->mac80211.mac80211_registered =1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 15/462 wifi: rtlwifi: wait for firmware loading before releasing memory
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit b4b26642b31ef282df6ff7ea8531985edfdef12a ]
At probe error path, the firmware loading work may have already been queued. In such a case, it will try to access memory allocated by the probe function, which is about to be released. In such paths, wait for the firmware worker to finish before releasing memory.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/usb.c +3 -1
@@ -1072,13 +1072,15 @@ int rtl_usb_probe(struct usb_interface *intf, err =ieee80211_register_hw (hw);if (err) {pr_err ("Can't register mac80211 hw.\n" ); - goto error_out; + goto error_init_vars; } rtlpriv->mac80211.mac80211_registered =1 ;set_bit (RTL_STATUS_INTERFACE_START , &rtlpriv->status);return 0 ; +error_init_vars: +wait_for_completion (&rtlpriv->firmware_loading_complete); error_out:rtl_deinit_core (hw); error_out2:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 16/462 wifi: rtlwifi: fix init_sw_vars leak when probe fails
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 00260350aed80c002df270c805ca443ec9a719a6 ]
If ieee80211_register_hw fails, the memory allocated for the firmware will not be released. Call deinit_sw_vars as the function that undoes the allocationes done by init_sw_vars.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -0
@@ -1081,6 +1081,7 @@ int rtl_usb_probe(struct usb_interface *intf, error_init_vars:wait_for_completion (&rtlpriv->firmware_loading_complete); + rtlpriv->cfg->ops->deinit_sw_vars (hw); error_out:rtl_deinit_core (hw); error_out2:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/462 wifi: rtlwifi: usb: fix workqueue leak when probe fails
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit f79bc5c67867c19ce2762e7934c20dbb835ed82c ]
rtl_init_core creates a workqueue that is then assigned to rtl_wq. rtl_deinit_core does not destroy it. It is left to rtl_usb_deinit, which must be called in the probe error path.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -0
@@ -1083,6 +1083,7 @@ int rtl_usb_probe(struct usb_interface *intf,wait_for_completion (&rtlpriv->firmware_loading_complete); rtlpriv->cfg->ops->deinit_sw_vars (hw); error_out: +rtl_usb_deinit (hw);rtl_deinit_core (hw); error_out2:_rtl_usb_io_handler_release (hw);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/462 spi: zynq-qspi: Add check for clk_enable()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingwei Zheng <[email protected]>
[ Upstream commit 8332e667099712e05ec87ba2058af394b51ebdc9 ]
Add check for the return value of clk_enable() to catch the potential error.
--- drivers/spi/spi-zynq-qspi.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/spi/spi-zynq-qspi.c +11 -2
@@ -379,12 +379,21 @@ static int zynq_qspi_setup_op(struct spi_device *spi) {struct spi_controller *ctlr = spi->master;struct zynq_qspi *qspi =spi_controller_get_devdata (ctlr); +int ret;if (ctlr->busy)return -EBUSY ; -clk_enable (qspi->refclk); -clk_enable (qspi->pclk); + ret =clk_enable (qspi->refclk); +if (ret) +return ret; + + ret =clk_enable (qspi->pclk); +if (ret) { +clk_disable (qspi->refclk); +return ret; + } +zynq_qspi_write (qspi,ZYNQ_QSPI_ENABLE_OFFSET ,ZYNQ_QSPI_ENABLE_ENABLE_MASK );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/462 dt-bindings: mmc: controller: clarify the address-cells description
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit b2b8e93ec00b8110cb37cbde5400d5abfdaed6a7 ]
The term "slot ID" has nothing to do with the SDIO function number which is specified in the reg property of the subnodes, rephrase the description to be more accurate.
Message-ID: <20241128-topic-amlogic-arm32-upstream-bindings-fixes-convert-meson-mx-sdio-v4-1-11d9f9200a59@linaro.org>
--- Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/mmc-controller.yaml +1 -1
@@ -25,7 +25,7 @@ properties: "#address-cells": const: 1 description: | - The cell is the slot ID if a function subnode is used. + The cell is the SDIO function number if a function subnode is used. "#size-cells": const: 0
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/462 rtlwifi: replace usage of found with dedicated list iterator variable
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakob Koschel <[email protected]>
[ Upstream commit a0ff2a87194a968b9547fd4d824a09092171d1ea ]
To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body.
To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1].
This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit.
Stable-dep-of: 2fdac64c3c35 ("wifi: rtlwifi: remove unused check_buddy_priv")
--- drivers/net/wireless/realtek/rtlwifi/base.c | 13 ++++++------- drivers/net/wireless/realtek/rtlwifi/pci.c | 15 +++++++-------- 2 files changed, 13 insertions(+), 15 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +6 -7
@@ -1995,8 +1995,7 @@ void rtl_collect_scan_list(struct ieee80211_hw *hw, struct sk_buff *skb)struct rtl_mac *mac =rtl_mac (rtl_priv (hw));unsigned long flags; -struct rtl_bssid_entry *entry; -bool entry_found = false; +struct rtl_bssid_entry *entry =NULL , *iter;/* check if it is scanning */ if (!mac->act_scanning)
@@ -2009,10 +2008,10 @@ void rtl_collect_scan_list(struct ieee80211_hw *hw, struct sk_buff *skb)spin_lock_irqsave (&rtlpriv->locks.scan_list_lock, flags); -list_for_each_entry (entry, &rtlpriv->scan_list.list, list) { -if (memcmp (entry->bssid, hdr->addr3,ETH_ALEN ) ==0 ) { -list_del_init (&entry->list); - entry_found = true; +list_for_each_entry (iter, &rtlpriv->scan_list.list, list) { +if (memcmp (iter->bssid, hdr->addr3,ETH_ALEN ) ==0 ) { +list_del_init (&iter->list); + entry = iter;rtl_dbg (rtlpriv,COMP_SCAN ,DBG_LOUD ,"Update BSSID=%pM to scan list (total=%d)\n" , hdr->addr3, rtlpriv->scan_list.num);
@@ -2020,7 +2019,7 @@ void rtl_collect_scan_list(struct ieee80211_hw *hw, struct sk_buff *skb) } } -if (!entry_found) { +if (!entry) { entry =kmalloc (sizeof (*entry),GFP_ATOMIC );if (!entry)
drivers/net/wireless/realtek/rtlwifi/pci.c +7 -8
@@ -300,14 +300,13 @@ static bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw, {struct rtl_priv *rtlpriv =rtl_priv (hw);struct rtl_pci_priv *pcipriv =rtl_pcipriv (hw); -bool find_buddy_priv = false; -struct rtl_priv *tpriv; +struct rtl_priv *tpriv =NULL , *iter;struct rtl_pci_priv *tpcipriv =NULL ;if (!list_empty (&rtlpriv->glb_var->glb_priv_list)) { -list_for_each_entry (tpriv, &rtlpriv->glb_var->glb_priv_list, +list_for_each_entry (iter, &rtlpriv->glb_var->glb_priv_list, list) { - tpcipriv = (struct rtl_pci_priv *)tpriv->priv; + tpcipriv = (struct rtl_pci_priv *)iter->priv;rtl_dbg (rtlpriv,COMP_INIT ,DBG_LOUD ,"pcipriv->ndis_adapter.funcnumber %x\n" , pcipriv->ndis_adapter.funcnumber);
@@ -321,19 +320,19 @@ static bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw, tpcipriv->ndis_adapter.devnumber && pcipriv->ndis_adapter.funcnumber != tpcipriv->ndis_adapter.funcnumber) { - find_buddy_priv = true; + tpriv = iter;break ; } } }rtl_dbg (rtlpriv,COMP_INIT ,DBG_LOUD , -"find_buddy_priv %d\n" , find_buddy_priv); +"find_buddy_priv %d\n" , tpriv !=NULL ); -if (find_buddy_priv) +if (tpriv) *buddy_priv = tpriv; -return find_buddy_priv; +return tpriv !=NULL ; } static void rtl_pci_parse_configuration(struct pci_dev *pdev,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/462 wifi: rtlwifi: remove unused timer and related code
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 358b94f0a7cadd2ec7824531d54dadaa8b71de04 ]
Drop unused 'dualmac_easyconcurrent_retrytimer' of 'struct rtl_works', corresponding 'rtl_easy_concurrent_retrytimer_callback()' handler, 'dualmac_easy_concurrent' function pointer of 'struct rtl_hal_ops' and related call to 'timer_setup()' in '_rtl_init_deferred_work()'.
Stable-dep-of: 2fdac64c3c35 ("wifi: rtlwifi: remove unused check_buddy_priv")
--- drivers/net/wireless/realtek/rtlwifi/base.c | 16 +--------------- drivers/net/wireless/realtek/rtlwifi/base.h | 1 - drivers/net/wireless/realtek/rtlwifi/wifi.h | 2 -- 3 files changed, 1 insertion(+), 18 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +1 -15
@@ -452,8 +452,7 @@ static int _rtl_init_deferred_work(struct ieee80211_hw *hw)/* <1> timer */ timer_setup (&rtlpriv->works.watchdog_timer, rtl_watch_dog_timer_callback,0 ); -timer_setup (&rtlpriv->works.dualmac_easyconcurrent_retrytimer, - rtl_easy_concurrent_retrytimer_callback,0 ); +/* <2> work queue */ rtlpriv->works.hw = hw; rtlpriv->works.rtl_wq = wq;
@@ -2376,19 +2375,6 @@ static void rtl_c2hcmd_wq_callback(struct work_struct *work)rtl_c2hcmd_launcher (hw,1 ); } -void rtl_easy_concurrent_retrytimer_callback (struct timer_list *t) -{ -struct rtl_priv *rtlpriv = -from_timer (rtlpriv, t, works.dualmac_easyconcurrent_retrytimer); -struct ieee80211_hw *hw = rtlpriv->hw; -struct rtl_priv *buddy_priv = rtlpriv->buddy_priv; - -if (buddy_priv ==NULL ) -return ; - - rtlpriv->cfg->ops->dualmac_easy_concurrent (hw); -} -/********************************************************* * * frame process functions
drivers/net/wireless/realtek/rtlwifi/base.h +0 -1
@@ -124,7 +124,6 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,u8 *rtl_find_ie (u8 *data,unsigned int len,u8 ie);void rtl_recognize_peer (struct ieee80211_hw *hw,u8 *data,unsigned int len);u8 rtl_tid_to_ac (u8 tid); -void rtl_easy_concurrent_retrytimer_callback (struct timer_list *t);extern struct rtl_global_var rtl_global_var;void rtl_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);
drivers/net/wireless/realtek/rtlwifi/wifi.h +0 -2
@@ -2300,7 +2300,6 @@ struct rtl_hal_ops { u32 regaddr, u32 bitmask, u32 data);void (*linked_set_reg)(struct ieee80211_hw *hw);void (*chk_switch_dmdp)(struct ieee80211_hw *hw); -void (*dualmac_easy_concurrent)(struct ieee80211_hw *hw);void (*dualmac_switch_to_dmdp)(struct ieee80211_hw *hw);bool (*phy_rf6052_config)(struct ieee80211_hw *hw); void (*phy_rf6052_set_cck_txpower)(struct ieee80211_hw *hw,
@@ -2466,7 +2465,6 @@ struct rtl_works {/*timer */ struct timer_list watchdog_timer; -struct timer_list dualmac_easyconcurrent_retrytimer;struct timer_list fw_clockoff_timer;struct timer_list fast_antenna_training_timer;/*task */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/462 wifi: rtlwifi: remove unused dualmac control leftovers
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 557123259200b30863e1b6a8f24a8c8060b6fc1d ]
Remove 'struct rtl_dualmac_easy_concurrent_ctl' of 'struct rtl_priv' and related code in '_rtl_pci_tx_chk_waitq()'.
Stable-dep-of: 2fdac64c3c35 ("wifi: rtlwifi: remove unused check_buddy_priv")
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 5 ----- drivers/net/wireless/realtek/rtlwifi/wifi.h | 9 --------- 2 files changed, 14 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -5
@@ -443,11 +443,6 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)if (!rtlpriv->rtlhal.earlymode_enable)return ; -if (rtlpriv->dm.supp_phymode_switch && - (rtlpriv->easy_concurrent_ctl.switch_in_process || - (rtlpriv->buddy_priv && - rtlpriv->buddy_priv->easy_concurrent_ctl.switch_in_process))) -return ;/* we just use em for BE/BK/VI/VO */ for (tid =7 ; tid >=0 ; tid--) {u8 hw_queue = ac_to_hwq[rtl_tid_to_ac (tid)];
drivers/net/wireless/realtek/rtlwifi/wifi.h +0 -9
@@ -2496,14 +2496,6 @@ struct rtl_debug {#define MIMO_PS_DYNAMIC 1#define MIMO_PS_NOLIMIT 3 -struct rtl_dualmac_easy_concurrent_ctl { -enum band_type currentbandtype_backfordmdp; -bool close_bbandrf_for_dmsp; -bool change_to_dmdp; -bool change_to_dmsp; -bool switch_in_process; -}; -struct rtl_dmsp_ctl {bool activescan_for_slaveofdmsp;bool scan_for_anothermac_fordmsp;
@@ -2744,7 +2736,6 @@ struct rtl_priv {struct list_head list;struct rtl_priv *buddy_priv;struct rtl_global_var *glb_var; -struct rtl_dualmac_easy_concurrent_ctl easy_concurrent_ctl;struct rtl_dmsp_ctl dmsp_ctl;struct rtl_locks locks;struct rtl_works works;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/462 wifi: rtlwifi: remove unused check_buddy_priv
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 2fdac64c3c35858aa8ac5caa70b232e03456e120 ]
Commit 2461c7d60f9f ("rtlwifi: Update header file") introduced a global list of private data structures.
Later on, commit 26634c4b1868 ("rtlwifi Modify existing bits to match vendor version 2013.02.07") started adding the private data to that list at probe time and added a hook, check_buddy_priv to find the private data from a similar device.
However, that function was never used.
Besides, though there is a lock for that list, it is never used. And when the probe fails, the private data is never removed from the list. This would cause a second probe to access freed memory.
Remove the unused hook, structures and members, which will prevent the potential race condition on the list and its corruption during a second probe when probe fails.
--- drivers/net/wireless/realtek/rtlwifi/base.c | 7 ---- drivers/net/wireless/realtek/rtlwifi/base.h | 1 - drivers/net/wireless/realtek/rtlwifi/pci.c | 44 --------------------- drivers/net/wireless/realtek/rtlwifi/wifi.h | 12 ------ 4 files changed, 64 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +0 -7
@@ -2720,9 +2720,6 @@ MODULE_AUTHOR("Larry Finger <[email protected]>");MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Realtek 802.11n PCI wireless core" ); -struct rtl_global_var rtl_global_var = {}; -EXPORT_SYMBOL_GPL (rtl_global_var); -static int __init rtl_core_module_init (void ) {BUILD_BUG_ON (TX_PWR_BY_RATE_NUM_RATE <TX_PWR_BY_RATE_NUM_SECTION );
@@ -2736,10 +2733,6 @@ static int __init rtl_core_module_init(void)/* add debugfs */ rtl_debugfs_add_topdir (); -/* init some global vars */ -INIT_LIST_HEAD (&rtl_global_var.glb_priv_list); -spin_lock_init (&rtl_global_var.glb_list_lock); -return 0 ; }
drivers/net/wireless/realtek/rtlwifi/base.h +0 -1
@@ -124,7 +124,6 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,u8 *rtl_find_ie (u8 *data,unsigned int len,u8 ie);void rtl_recognize_peer (struct ieee80211_hw *hw,u8 *data,unsigned int len);u8 rtl_tid_to_ac (u8 tid); -extern struct rtl_global_var rtl_global_var;void rtl_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);#endif
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -44
74 lines not on this page · raw message
drivers/net/wireless/realtek/rtlwifi/wifi.h +0 -12
@@ -2335,8 +2335,6 @@ struct rtl_intf_ops {void (*read_efuse_byte)(struct ieee80211_hw *hw,u16 _offset,u8 *pbuf);int (*adapter_start)(struct ieee80211_hw *hw);void (*adapter_stop)(struct ieee80211_hw *hw); -bool (*check_buddy_priv)(struct ieee80211_hw *hw, -struct rtl_priv **buddy_priv); int (*adapter_tx)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
@@ -2580,14 +2578,6 @@ struct dig_t {u32 rssi_max; }; -struct rtl_global_var { -/* from this list we can get -* other adapter's rtl_priv -*/ -struct list_head glb_priv_list; -spinlock_t glb_list_lock; -}; -#define IN_4WAY_TIMEOUT_TIME (30 * MSEC_PER_SEC)/* 30 seconds */ struct rtl_btc_info {
@@ -2733,9 +2723,7 @@ struct rtl_scan_list {struct rtl_priv {struct ieee80211_hw *hw;struct completion firmware_loading_complete; -struct list_head list;struct rtl_priv *buddy_priv; -struct rtl_global_var *glb_var;struct rtl_dmsp_ctl dmsp_ctl;struct rtl_locks locks;struct rtl_works works;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/462 wifi: rtlwifi: destroy workqueue at rtl_deinit_core
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit d8ece6fc3694657e4886191b32ca1690af11adda ]
rtl_wq is allocated at rtl_init_core, so it makes more sense to destroy it at rtl_deinit_core. In the case of USB, where _rtl_usb_init does not require anything to be undone, that is fine. But for PCI, rtl_pci_init, which is called after rtl_init_core, needs to deallocate data, but only if it has been called.
That means that destroying the workqueue needs to be done whether rtl_pci_init has been called or not. And since rtl_pci_deinit was doing it, it has to be moved out of there.
It makes more sense to move it to rtl_deinit_core and have it done in both cases, USB and PCI.
Since this is a requirement for a followup memory leak fix, mark this as fixing such memory leak.
--- drivers/net/wireless/realtek/rtlwifi/base.c | 6 ++++++ drivers/net/wireless/realtek/rtlwifi/pci.c | 2 -- drivers/net/wireless/realtek/rtlwifi/usb.c | 5 ----- 3 files changed, 6 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +6 -0
@@ -576,9 +576,15 @@ static void rtl_free_entries_from_ack_queue(struct ieee80211_hw *hw,void rtl_deinit_core (struct ieee80211_hw *hw) { +struct rtl_priv *rtlpriv =rtl_priv (hw); +rtl_c2hcmd_launcher (hw,0 );rtl_free_entries_from_scan_list (hw);rtl_free_entries_from_ack_queue (hw, false); +if (rtlpriv->works.rtl_wq) { +destroy_workqueue (rtlpriv->works.rtl_wq); + rtlpriv->works.rtl_wq =NULL ; + } }EXPORT_SYMBOL_GPL (rtl_deinit_core);
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -2
@@ -1657,8 +1657,6 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)synchronize_irq (rtlpci->pdev->irq);tasklet_kill (&rtlpriv->works.irq_tasklet);cancel_work_sync (&rtlpriv->works.lps_change_work); - -destroy_workqueue (rtlpriv->works.rtl_wq); }static int rtl_pci_init (struct ieee80211_hw *hw,struct pci_dev *pdev)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -5
@@ -680,11 +680,6 @@ static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw)tasklet_kill (&rtlusb->rx_work_tasklet);cancel_work_sync (&rtlpriv->works.lps_change_work); -if (rtlpriv->works.rtl_wq) { -destroy_workqueue (rtlpriv->works.rtl_wq); - rtlpriv->works.rtl_wq =NULL ; - } -skb_queue_purge (&rtlusb->rx_queue);while ((urb =usb_get_from_anchor (&rtlusb->rx_cleanup_urbs))) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 25/462 wifi: rtlwifi: fix memory leaks and invalid access at probe error path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit e7ceefbfd8d447abc8aca8ab993a942803522c06 ]
Deinitialize at reverse order when probe fails.
When init_sw_vars fails, rtl_deinit_core should not be called, specially now that it destroys the rtl_wq workqueue.
And call rtl_pci_deinit and deinit_sw_vars, otherwise, memory will be leaked.
Remove pci_set_drvdata call as it will already be cleaned up by the core driver code and could lead to memory leaks too. cf. commit 8d450935ae7f ("wireless: rtlwifi: remove unnecessary pci_set_drvdata()") and commit 3d86b93064c7 ("rtlwifi: Fix PCI probe error path orphaned memory").
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +8 -5
@@ -2167,7 +2167,7 @@ int rtl_pci_probe(struct pci_dev *pdev,if (rtlpriv->cfg->ops->init_sw_vars (hw)) {pr_err ("Can't init_sw_vars\n" ); err = -ENODEV ; - goto fail3; + goto fail2; } rtlpriv->cfg->ops->init_sw_leds (hw);
@@ -2185,14 +2185,14 @@ int rtl_pci_probe(struct pci_dev *pdev, err =rtl_pci_init (hw, pdev);if (err) {pr_err ("Failed to init PCI\n" ); - goto fail3; + goto fail4; } err =ieee80211_register_hw (hw);if (err) {pr_err ("Can't register mac80211 hw.\n" ); err = -ENODEV ; - goto fail3; + goto fail5; } rtlpriv->mac80211.mac80211_registered =1 ;
@@ -2215,9 +2215,12 @@ int rtl_pci_probe(struct pci_dev *pdev,set_bit (RTL_STATUS_INTERFACE_START , &rtlpriv->status);return 0 ; -fail3: -pci_set_drvdata (pdev,NULL ); +fail5: +rtl_pci_deinit (hw); +fail4:rtl_deinit_core (hw); +fail3: + rtlpriv->cfg->ops->deinit_sw_vars (hw); fail2:if (rtlpriv->io.pci_mem_start !=0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/462 wifi: rtlwifi: pci: wait for firmware loading before releasing memory
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit b59b86c5d08be7d761c04affcbcec8184738c200 ]
At probe error path, the firmware loading work may have already been queued. In such a case, it will try to access memory allocated by the probe function, which is about to be released. In such paths, wait for the firmware worker to finish before releasing memory.
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/pci.c +1 -0
@@ -2220,6 +2220,7 @@ int rtl_pci_probe(struct pci_dev *pdev, fail4:rtl_deinit_core (hw); fail3: +wait_for_completion (&rtlpriv->firmware_loading_complete); rtlpriv->cfg->ops->deinit_sw_vars (hw); fail2:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/462 ACPI: fan: cleanup resources in the error path of .probe()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit c759bc8e9046f9812238f506d70f07d3ea4206d4 ]
Call thermal_cooling_device_unregister() and sysfs_remove_link() in the error path of acpi_fan_probe() to fix possible memory leak.
This bug was found by an experimental static analysis tool that I am developing.
--- drivers/acpi/fan.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/acpi/fan.c +8 -2
@@ -423,19 +423,25 @@ static int acpi_fan_probe(struct platform_device *pdev) result =sysfs_create_link (&pdev->dev.kobj, &cdev->device.kobj,"thermal_cooling" ); -if (result) +if (result) {dev_err (&pdev->dev,"Failed to create sysfs link 'thermal_cooling'\n" ); + goto err_unregister; + } result =sysfs_create_link (&cdev->device.kobj, &pdev->dev.kobj,"device" );if (result) {dev_err (&pdev->dev,"Failed to create sysfs link 'device'\n" ); - goto err_end; + goto err_remove_link; }return 0 ; +err_remove_link: +sysfs_remove_link (&pdev->dev.kobj,"thermal_cooling" ); +err_unregister: +thermal_cooling_device_unregister (cdev); err_end:if (fan->acpi4) {int i;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/462 cpupower: fix TSC MHz calculation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: He Rongguang <[email protected]>
[ Upstream commit 9d6c0e58514f8b57cd9c2c755e41623d6a966025 ]
Commit 'cpupower: Make TSC read per CPU for Mperf monitor' (c2adb1877b7) changes TSC counter reads per cpu, but left time diff global (from start of all cpus to end of all cpus), thus diff(time) is too large for a cpu's tsc counting, resulting in far less than acutal TSC_Mhz and thus cpupower monitor showing far less than actual cpu realtime frequency.
/proc/cpuinfo shows frequency:
cat /proc/cpuinfo | egrep -e 'processor' -e 'MHz'
...
processor : 171
cpu MHz : 4108.498
...
before fix (System 100% busy):
| Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 | C2 171| 0.77| 99.23| 2279|| 0.00| 0.00| 0.00
after fix (System 100% busy):
| Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 | C2 171| 0.46| 99.54| 4095|| 0.00| 0.00| 0.00
--- .../cpupower/utils/idle_monitor/mperf_monitor.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c +9 -6
@@ -33,7 +33,7 @@ static int mperf_get_count_percent(unsigned int self_id, double *percent, unsigned int cpu);static int mperf_get_count_freq (unsigned int id,unsigned long long *count,unsigned int cpu); -static struct timespec time_start, time_end; +static struct timespec *time_start, *time_end;static cstate_t mperf_cstates[MPERF_CSTATE_COUNT ] = { {
@@ -174,7 +174,7 @@ static int mperf_get_count_percent(unsigned int id, double *percent,dprint ("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n" , mperf_cstates[id].name, mperf_diff, tsc_diff); }else if (max_freq_mode ==MAX_FREQ_SYSFS ) { - timediff = max_frequency *timespec_diff_us (time_start, time_end); + timediff = max_frequency *timespec_diff_us (time_start[cpu], time_end[cpu]); *percent =100.0 * mperf_diff / timediff;dprint ("%s: MAXFREQ - mperf_diff: %llu, time_diff: %llu\n" , mperf_cstates[id].name, mperf_diff, timediff);
@@ -207,7 +207,7 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,if (max_freq_mode ==MAX_FREQ_TSC_REF ) {/* Calculate max_freq from TSC count */ tsc_diff = tsc_at_measure_end[cpu] - tsc_at_measure_start[cpu]; - time_diff =timespec_diff_us (time_start, time_end); + time_diff =timespec_diff_us (time_start[cpu], time_end[cpu]); max_frequency = tsc_diff / time_diff; }
@@ -226,9 +226,8 @@ static int mperf_start(void) {int cpu; -clock_gettime (CLOCK_REALTIME , &time_start); -for (cpu =0 ; cpu < cpu_count; cpu++) { +clock_gettime (CLOCK_REALTIME , &time_start[cpu]);mperf_get_tsc (&tsc_at_measure_start[cpu]);mperf_init_stats (cpu); }
@@ -243,9 +242,9 @@ static int mperf_stop(void)for (cpu =0 ; cpu < cpu_count; cpu++) {mperf_measure_stats (cpu);mperf_get_tsc (&tsc_at_measure_end[cpu]); +clock_gettime (CLOCK_REALTIME , &time_end[cpu]); } -clock_gettime (CLOCK_REALTIME , &time_end);return 0 ; }
@@ -349,6 +348,8 @@ struct cpuidle_monitor *mperf_register(void) aperf_current_count =calloc (cpu_count,sizeof (unsigned long long )); tsc_at_measure_start =calloc (cpu_count,sizeof (unsigned long long )); tsc_at_measure_end =calloc (cpu_count,sizeof (unsigned long long )); + time_start =calloc (cpu_count,sizeof (struct timespec )); + time_end =calloc (cpu_count,sizeof (struct timespec )); mperf_monitor.name_len =strlen (mperf_monitor.name);return &mperf_monitor; }
@@ -361,6 +362,8 @@ void mperf_unregister(void)free (aperf_current_count);free (tsc_at_measure_start);free (tsc_at_measure_end); +free (time_start); +free (time_end);free (is_valid); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/462 leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 0508316be63bb735f59bdc8fe4527cadb62210ca ]
netxbig_leds_get_of_pdata() does not release the OF node obtained by of_parse_phandle() when of_find_device_by_node() fails. Add an of_node_put() call to fix the leak.
This bug was found by an experimental static analysis tool that I am developing.
--- drivers/leds/leds-netxbig.c | 1 + 1 file changed, 1 insertion(+)
drivers/leds/leds-netxbig.c +1 -0
@@ -440,6 +440,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev, } gpio_ext_pdev =of_find_device_by_node (gpio_ext_np);if (!gpio_ext_pdev) { +of_node_put (gpio_ext_np);dev_err (dev,"Failed to find platform device for gpio-ext\n" );return -ENODEV ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 30/462 cpufreq: schedutil: Simplify sugov_update_next_freq()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 90ac908a418b836427d6eaf84fbc5062881747fd ]
Rearrange a conditional to make it more straightforward.
Stable-dep-of: 8e461a1cb43d ("cpufreq: schedutil: Fix superfluous updates caused by need_freq_update")
--- kernel/sched/cpufreq_schedutil.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/sched/cpufreq_schedutil.c +3 -5
@@ -102,12 +102,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)static bool sugov_update_next_freq (struct sugov_policy *sg_policy,u64 time,unsigned int next_freq) { -if (!sg_policy->need_freq_update) { -if (sg_policy->next_freq == next_freq) -return false; - }else { +if (sg_policy->need_freq_update) sg_policy->need_freq_update =cpufreq_driver_test_flags (CPUFREQ_NEED_UPDATE_LIMITS ); - } +else if (sg_policy->next_freq == next_freq) +return false; sg_policy->next_freq = next_freq; sg_policy->last_freq_update_time = time;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 31/462 cpufreq: schedutil: Fix superfluous updates caused by need_freq_update
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sultan Alsawaf (unemployed) <[email protected]>
[ Upstream commit 8e461a1cb43d69d2fc8a97e61916dce571e6bb31 ]
A redundant frequency update is only truly needed when there is a policy limits change with a driver that specifies CPUFREQ_NEED_UPDATE_LIMITS.
In spite of that, drivers specifying CPUFREQ_NEED_UPDATE_LIMITS receive a frequency update _all the time_, not just for a policy limits change, because need_freq_update is never cleared.
Furthermore, ignore_dl_rate_limit()'s usage of need_freq_update also leads to a redundant frequency update, regardless of whether or not the driver specifies CPUFREQ_NEED_UPDATE_LIMITS, when the next chosen frequency is the same as the current one.
Fix the superfluous updates by only honoring CPUFREQ_NEED_UPDATE_LIMITS when there's a policy limits change, and clearing need_freq_update when a requisite redundant update occurs.
This is neatly achieved by moving up the CPUFREQ_NEED_UPDATE_LIMITS test and instead setting need_freq_update to false in sugov_update_next_freq().
--- kernel/sched/cpufreq_schedutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/cpufreq_schedutil.c +2 -2
@@ -90,7 +90,7 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)if (unlikely (sg_policy->limits_changed)) { sg_policy->limits_changed = false; - sg_policy->need_freq_update = true; + sg_policy->need_freq_update =cpufreq_driver_test_flags (CPUFREQ_NEED_UPDATE_LIMITS );return true; }
@@ -103,7 +103,7 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time, unsigned int next_freq) {if (sg_policy->need_freq_update) - sg_policy->need_freq_update =cpufreq_driver_test_flags (CPUFREQ_NEED_UPDATE_LIMITS ); + sg_policy->need_freq_update = false;else if (sg_policy->next_freq == next_freq)return false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/462 clk: imx8mp: Fix clkout1/2 support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit a9b7c84d22fb1687d63ca2a386773015cf59436b ]
The CLKOUTn may be fed from PLL1/2/3, but the PLL1/2/3 has to be enabled first by setting PLL_CLKE bit 11 in CCM_ANALOG_SYS_PLLn_GEN_CTRL register. The CCM_ANALOG_SYS_PLLn_GEN_CTRL bit 11 is modeled by plln_out clock. Fix the clock tree and place the clkout1/2 under plln_sel instead of plain plln to let the clock subsystem correctly control the bit 11 and enable the PLL in case the CLKOUTn is supplied by PLL1/2/3.
--- drivers/clk/imx/clk-imx8mp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-imx8mp.c +3 -2
@@ -410,8 +410,9 @@ static const char * const imx8mp_dram_core_sels[] = {"dram_pll_out", "dram_alt_rstatic const char *const imx8mp_clkout_sels[] = {"audio_pll1_out" ,"audio_pll2_out" ,"video_pll1_out" ,"dummy" ,"dummy" ,"gpu_pll_out" ,"vpu_pll_out" , -"arm_pll_out" ,"sys_pll1" ,"sys_pll2" ,"sys_pll3" , -"dummy" ,"dummy" ,"osc_24m" ,"dummy" ,"osc_32k" }; +"arm_pll_out" ,"sys_pll1_out" ,"sys_pll2_out" , +"sys_pll3_out" ,"dummy" ,"dummy" ,"osc_24m" , +"dummy" ,"osc_32k" };static struct clk_hw **hws;static struct clk_hw_onecell_data *clk_hw_data;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/462 team: prevent adding a device which is already a team device lower
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Octavian Purdila <[email protected]>
[ Upstream commit 3fff5da4ca2164bb4d0f1e6cd33f6eb8a0e73e50 ]
Prevent adding a device which is already a team device lower, e.g. adding veth0 if vlan1 was already added and veth0 is a lower of vlan1.
This is not useful in practice and can lead to recursive locking:
$ ip link add veth0 type veth peer name veth1 $ ip link set veth0 up $ ip link set veth1 up $ ip link add link veth0 name veth0.1 type vlan protocol 802.1Q id 1 $ ip link add team0 type team $ ip link set veth0.1 down $ ip link set veth0.1 master team0 team0: Port device veth0.1 added $ ip link set veth0 down $ ip link set veth0 master team0
============================================
WARNING: possible recursive locking detected
6.13.0-rc2-virtme-00441-ga14a429069bb #46 Not tainted
--------------------------------------------
ip/7684 is trying to acquire lock:ffff888016848e00 (team->team_lock_key){+.+.}-{4:4}, at: team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973)
but task is already holding lock:ffff888016848e00 (team->team_lock_key){+.+.}-{4:4}, at: team_add_slave (drivers/net/team/team_core.c:1147 drivers/net/team/team_core.c:1977)
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----lock(team->team_lock_key);lock(team->team_lock_key);
*** DEADLOCK ***
May be due to missing lock nesting notation
2 locks held by ip/7684:
stack backtrace: CPU: 3 UID: 0 PID: 7684 Comm: ip Not tainted 6.13.0-rc2-virtme-00441-ga14a429069bb #46 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <TASK>
dump_stack_lvl (lib/dump_stack.c:122)
print_deadlock_bug.cold (kernel/locking/lockdep.c:3040) __lock_acquire (kernel/locking/lockdep.c:3893 kernel/locking/lockdep.c:5226) ? netlink_broadcast_filtered (net/netlink/af_netlink.c:1548)
lock_acquire.part.0 (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5851) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? trace_lock_acquire (./include/trace/events/lock.h:24 (discriminator 2)) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? lock_acquire (kernel/locking/lockdep.c:5822) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) __mutex_lock (kernel/locking/mutex.c:587 kernel/locking/mutex.c:735) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? fib_sync_up (net/ipv4/fib_semantics.c:2167) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973)
notifier_call_chain (kernel/notifier.c:85) call_netdevice_notifiers_info (net/core/dev.c:1996) __dev_notify_flags (net/core/dev.c:8993)
? __dev_change_flags (net/core/dev.c:8975) dev_change_flags (net/core/dev.c:9027) vlan_device_event (net/8021q/vlan.c:85 net/8021q/vlan.c:470) ? br_device_event (net/bridge/br.c:143) notifier_call_chain (kernel/notifier.c:85) call_netdevice_notifiers_info (net/core/dev.c:1996)
dev_open (net/core/dev.c:1519 net/core/dev.c:1505) team_add_slave (drivers/net/team/team_core.c:1219 drivers/net/team/team_core.c:1977)
? __pfx_team_add_slave (drivers/net/team/team_core.c:1972) do_set_master (net/core/rtnetlink.c:2917) do_setlink.isra.0 (net/core/rtnetlink.c:3117)
--- drivers/net/team/team.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/team/team.c +7 -0
@@ -1165,6 +1165,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev,return -EBUSY ; } +if (netdev_has_upper_dev (port_dev, dev)) { +NL_SET_ERR_MSG (extack,"Device is already a lower device of the team interface" ); +netdev_err (dev,"Device %s is already a lower device of the team interface\n" , + portname); +return -EBUSY ; + } +if (port_dev->features &NETIF_F_VLAN_CHALLENGED &&vlan_uses_dev (dev)) {NL_SET_ERR_MSG (extack,"Device is VLAN challenged and team device has VLAN set up" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/462 regulator: of: Implement the unwind path of of_regulator_match()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit dddca3b2fc676113c58b04aaefe84bfb958ac83e ]
of_regulator_match() does not release the OF node reference in the error path, resulting in an OF node leak. Therefore, call of_node_put() on the obtained nodes before returning the EINVAL error.
Since it is possible that some drivers call this function and do not exit on failure, such as s2mps11_pmic_driver, clear the init_data and of_node in the error path.
This was reported by an experimental verification tool that I am developing. As I do not have access to actual devices nor the QEMU board configuration to test drivers that call this function, no runtime test was able to be performed.
--- drivers/regulator/of_regulator.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/regulator/of_regulator.c +13 -1
@@ -377,7 +377,7 @@ int of_regulator_match(struct device *dev, struct device_node *node,"failed to parse DT for regulator %pOFn\n" , child);of_node_put (child); -return -EINVAL ; + goto err_put; } match->of_node =of_node_get (child); count++;
@@ -386,6 +386,18 @@ int of_regulator_match(struct device *dev, struct device_node *node, }return count; + +err_put: +for (i =0 ; i < num_matches; i++) { +struct of_regulator_match *match = &matches[i]; + + match->init_data =NULL ; +if (match->of_node) { +of_node_put (match->of_node); + match->of_node =NULL ; + } + } +return -EINVAL ; }EXPORT_SYMBOL_GPL (of_regulator_match);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/462 wifi: wlcore: fix unbalanced pm_runtime calls
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Kemnade <[email protected]>
[ Upstream commit 996c934c8c196144af386c4385f61fcd5349af28 ]
If firmware boot failes, runtime pm is put too often:
[12092.708099] wlcore: ERROR firmware boot failed despite 3 retries [12092.708099] wl18xx_driver wl18xx.1.auto: Runtime PM usage count underflow!
Fix that by redirecting all error gotos before runtime_get so that runtime is not put.
--- drivers/net/wireless/ti/wlcore/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/ti/wlcore/main.c +5 -5
@@ -2552,24 +2552,24 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,if (test_bit (WL1271_FLAG_RECOVERY_IN_PROGRESS , &wl->flags) ||test_bit (WLVIF_FLAG_INITIALIZED , &wlvif->flags)) { ret = -EBUSY ; - goto out; + goto out_unlock; } ret =wl12xx_init_vif_data (wl, vif);if (ret <0 ) - goto out; + goto out_unlock; wlvif->wl = wl; role_type =wl12xx_get_role_type (wl, wlvif);if (role_type ==WL12XX_INVALID_ROLE_TYPE ) { ret = -EINVAL ; - goto out; + goto out_unlock; } ret =wlcore_allocate_hw_queue_base (wl, wlvif);if (ret <0 ) - goto out; + goto out_unlock;/* * TODO: after the nvs issue will be solved, move this block
@@ -2584,7 +2584,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ret =wl12xx_init_fw (wl);if (ret <0 ) - goto out; + goto out_unlock; }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/462 net/smc: fix data error when recvmsg with MSG_PEEK flag
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangguan Wang <[email protected]>
[ Upstream commit a4b6539038c1aa1ae871aacf6e41b566c3613993 ]
When recvmsg with MSG_PEEK flag, the data will be copied to user's buffer without advancing consume cursor and without reducing the length of rx available data. Once the expected peek length is larger than the value of bytes_to_rcv, in the loop of do while in smc_rx_recvmsg, the first loop will copy bytes_to_rcv bytes of data from the position local_tx_ctrl.cons, the second loop will copy the min(bytes_to_rcv, read_remaining) bytes from the position local_tx_ctrl.cons again because of the lacking of process with advancing consume cursor and reducing the length of available data. So do the subsequent loops. The data copied in the second loop and the subsequent loops will result in data error, as it should not be copied if no more data arrives and it should be copied from the position advancing bytes_to_rcv bytes from the local_tx_ctrl.cons if more data arrives.
This issue can be reproduce by the following python script:server.py:
import socket
import timeserver_ip = '0.0.0.0'server_port = 12346server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.bind((server_ip, server_port)) server_socket.listen(1)
print('Server is running and listening for connections...') conn, addr = server_socket.accept()print('Connected by', addr)
while True:
data = conn.recv(1024)
if not data:
break
print('Received request:', data.decode()) conn.sendall(b'Hello, client!\n')
time.sleep(5)
conn.sendall(b'Hello, again!\n')conn.close()
client.py:
import socketserver_ip = '<server ip>'server_port = 12346
resp=b'Hello, client!\nHello, again!\n'client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect((server_ip, server_port))
request = 'Hello, server!' client_socket.sendall(request.encode())peek_data = client_socket.recv(len(resp),
socket.MSG_PEEK | socket.MSG_WAITALL)print('Peeked data:', peek_data.decode()) client_socket.close()
--- net/smc/af_smc.c | 2 +- net/smc/smc_rx.c | 37 +++++++++++++++++++++---------------- net/smc/smc_rx.h | 8 ++++---- 3 files changed, 26 insertions(+), 21 deletions(-)
net/smc/af_smc.c +1 -1
@@ -1968,7 +1968,7 @@ static int smc_accept(struct socket *sock, struct socket *new_sock,release_sock (clcsk); }else if (!atomic_read (&smc_sk (nsk)->conn.bytes_to_rcv)) {lock_sock (nsk); -smc_rx_wait (smc_sk (nsk), &timeo, smc_rx_data_available); +smc_rx_wait (smc_sk (nsk), &timeo,0 , smc_rx_data_available);release_sock (nsk); } }
net/smc/smc_rx.c +21 -16
@@ -174,22 +174,23 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,return bytes; } -static int smc_rx_data_available_and_no_splice_pend (struct smc_connection *conn) +static int smc_rx_data_available_and_no_splice_pend (struct smc_connection *conn,size_t peeked) { -return atomic_read (&conn->bytes_to_rcv) && +return smc_rx_data_available (conn, peeked) && !atomic_read (&conn->splice_pending); }/* blocks rcvbuf consumer until >=len bytes available or timeout or interrupted * @smc smc socket * @timeo pointer to max seconds to wait, pointer to value 0 for no timeout +* @peeked number of bytes already peeked * @fcrit add'l criterion to evaluate as function pointer * Returns: * 1 if at least 1 byte available in rcvbuf or if socket error/shutdown. * 0 otherwise (nothing in rcvbuf nor timeout, e.g. interrupted). */ -int smc_rx_wait (struct smc_sock *smc,long *timeo, -int (*fcrit)(struct smc_connection *conn)) +int smc_rx_wait (struct smc_sock *smc,long *timeo,size_t peeked, +int (*fcrit)(struct smc_connection *conn,size_t baseline)) {DEFINE_WAIT_FUNC (wait, woken_wake_function);struct smc_connection *conn = &smc->conn;
@@ -198,7 +199,7 @@ int smc_rx_wait(struct smc_sock *smc, long *timeo,struct sock *sk = &smc->sk;int rc; -if (fcrit (conn)) +if (fcrit (conn, peeked))return 1 ;sk_set_bit (SOCKWQ_ASYNC_WAITDATA , sk);add_wait_queue (sk_sleep (sk), &wait);
@@ -207,7 +208,7 @@ int smc_rx_wait(struct smc_sock *smc, long *timeo, cflags->peer_conn_abort ||READ_ONCE (sk->sk_shutdown) &RCV_SHUTDOWN || conn->killed || -fcrit (conn), +fcrit (conn, peeked), &wait);remove_wait_queue (sk_sleep (sk), &wait);sk_clear_bit (SOCKWQ_ASYNC_WAITDATA , sk);
@@ -257,11 +258,11 @@ static int smc_rx_recv_urg(struct smc_sock *smc, struct msghdr *msg, int len,return -EAGAIN ; } -static bool smc_rx_recvmsg_data_available (struct smc_sock *smc) +static bool smc_rx_recvmsg_data_available (struct smc_sock *smc,size_t peeked) {struct smc_connection *conn = &smc->conn; -if (smc_rx_data_available (conn)) +if (smc_rx_data_available (conn, peeked))return true;else if (conn->urg_state ==SMC_URG_VALID )/* we received a single urgent Byte - skip */
@@ -279,10 +280,10 @@ static bool smc_rx_recvmsg_data_available(struct smc_sock *smc)int smc_rx_recvmsg (struct smc_sock *smc,struct msghdr *msg,struct pipe_inode_info *pipe,size_t len,int flags) { -size_t copylen, read_done =0 , read_remaining = len; +size_t copylen, read_done =0 , read_remaining = len, peeked_bytes =0 ;size_t chunk_len, chunk_off, chunk_len_sum;struct smc_connection *conn = &smc->conn; -int (*func)(struct smc_connection *conn); +int (*func)(struct smc_connection *conn,size_t baseline);union smc_host_cursor cons;int readable, chunk;char *rcvbuf_base;
@@ -313,14 +314,14 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,if (conn->killed)break ; -if (smc_rx_recvmsg_data_available (smc)) +if (smc_rx_recvmsg_data_available (smc, peeked_bytes)) goto copy;if (sk->sk_shutdown &RCV_SHUTDOWN ) {/* smc_cdc_msg_recv_action() could have run after * above smc_rx_recvmsg_data_available() */ -if (smc_rx_recvmsg_data_available (smc)) +if (smc_rx_recvmsg_data_available (smc, peeked_bytes)) goto copy;break ; }
@@ -354,26 +355,28 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, } } -if (!smc_rx_data_available (conn)) { -smc_rx_wait (smc, &timeo, smc_rx_data_available); +if (!smc_rx_data_available (conn, peeked_bytes)) { +smc_rx_wait (smc, &timeo, peeked_bytes, smc_rx_data_available);continue ; } copy:/* initialize variables for 1st iteration of subsequent loop */ /* could be just 1 byte, even after waiting on data above */ - readable =atomic_read (&conn->bytes_to_rcv); + readable =smc_rx_data_available (conn, peeked_bytes); splbytes =atomic_read (&conn->splice_pending);if (!readable || (msg && splbytes)) {if (splbytes) func = smc_rx_data_available_and_no_splice_pend;else func = smc_rx_data_available; -smc_rx_wait (smc, &timeo, func); +smc_rx_wait (smc, &timeo, peeked_bytes, func);continue ; }smc_curs_copy (&cons, &conn->local_tx_ctrl.cons, conn); +if ((flags &MSG_PEEK ) && peeked_bytes) +smc_curs_add (conn->rmb_desc->len, &cons, peeked_bytes);/* subsequent splice() calls pick up where previous left */ if (splbytes)smc_curs_add (conn->rmb_desc->len, &cons, splbytes);
@@ -410,6 +413,8 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, } read_remaining -= chunk_len; read_done += chunk_len; +if (flags &MSG_PEEK ) + peeked_bytes += chunk_len;if (chunk_len_sum == copylen)break ;/* either on 1st or 2nd iteration */
net/smc/smc_rx.h +4 -4
@@ -21,11 +21,11 @@ void smc_rx_init(struct smc_sock *smc);int smc_rx_recvmsg (struct smc_sock *smc,struct msghdr *msg,struct pipe_inode_info *pipe,size_t len,int flags); -int smc_rx_wait (struct smc_sock *smc,long *timeo, -int (*fcrit)(struct smc_connection *conn)); -static inline int smc_rx_data_available (struct smc_connection *conn) +int smc_rx_wait (struct smc_sock *smc,long *timeo,size_t peeked, +int (*fcrit)(struct smc_connection *conn,size_t baseline)); +static inline int smc_rx_data_available (struct smc_connection *conn,size_t peeked) { -return atomic_read (&conn->bytes_to_rcv); +return atomic_read (&conn->bytes_to_rcv) - peeked; }#endif /* SMC_RX_H */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/462 wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: WangYuli <[email protected]>
[ Upstream commit f1b1e133a770fcdbd89551651232b034d2f7a27a ]
When initializing the network card, unplugging the device will trigger an -EPROTO error, resulting in a flood of error messages being printed frantically.
The exception is printed as follows:
mt76x2u 2-2.4:1.0: vendor request req:47 off:9018 failed:-71
mt76x2u 2-2.4:1.0: vendor request req:47 off:9018 failed:-71
...It will continue to print more than 2000 times for about 5 minutes, causing the usb device to be unable to be disconnected. During this period, the usb port cannot recognize the new device because the old device has not disconnected.
There may be other operating methods that cause -EPROTO, but -EPROTO is a low-level hardware error. It is unwise to repeat vendor requests expecting to read correct data. It is a better choice to treat -EPROTO and -ENODEV the same way.
Similar to commit 9b0f100c1970 ("mt76: usb: process URBs with status EPROTO properly") do no schedule rx_worker for urb marked with status set -EPROTO. I also reproduced this situation when plugging and unplugging the device, and this patch is effective.
Just do not vendor request again for urb marked with status set -EPROTO.
--- drivers/net/wireless/mediatek/mt76/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +2 -2
@@ -34,9 +34,9 @@ static int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, ret =usb_control_msg (udev, pipe, req, req_type, val, offset, buf, len,MT_VEND_REQ_TOUT_MS ); -if (ret == -ENODEV ) +if (ret == -ENODEV || ret == -EPROTO )set_bit (MT76_REMOVED , &dev->phy.state); -if (ret >=0 || ret == -ENODEV ) +if (ret >=0 || ret == -ENODEV || ret == -EPROTO )return ret;usleep_range (5000 ,10000 ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/462 cpufreq: ACPI: Fix max-frequency computation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gautham R. Shenoy <[email protected]>
[ Upstream commit 0834667545962ef1c5e8684ed32b45d9c574acd3 ]
Commit 3c55e94c0ade ("cpufreq: ACPI: Extend frequency tables to cover boost frequencies") introduced an assumption in acpi_cpufreq_cpu_init() that the first entry in the P-state table was the nominal frequency. This assumption is incorrect. The frequency corresponding to the P0 P-State need not be the same as the nominal frequency advertised via CPPC.
Since the driver is using the CPPC.highest_perf and CPPC.nominal_perf to compute the boost-ratio, it makes sense to use CPPC.nominal_freq to compute the max-frequency. CPPC.nominal_freq is advertised on platforms supporting CPPC revisions 3 or higher.
Hence, fallback to using the first entry in the P-State table only on platforms that do not advertise CPPC.nominal_freq.
--- drivers/cpufreq/acpi-cpufreq.c | 36 +++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-)
drivers/cpufreq/acpi-cpufreq.c +27 -9
@@ -630,7 +630,14 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)#endif #ifdef CONFIG_ACPI_CPPC_LIB -static u64 get_max_boost_ratio (unsigned int cpu) +/* +* get_max_boost_ratio: Computes the max_boost_ratio as the ratio +* between the highest_perf and the nominal_perf. +* +* Returns the max_boost_ratio for @cpu. Returns the CPPC nominal +* frequency via @nominal_freq if it is non-NULL pointer. +*/ +static u64 get_max_boost_ratio (unsigned int cpu,u64 *nominal_freq) {struct cppc_perf_caps perf_caps;u64 highest_perf, nominal_perf;
@@ -649,6 +656,9 @@ static u64 get_max_boost_ratio(unsigned int cpu) highest_perf = perf_caps.highest_perf; nominal_perf = perf_caps.nominal_perf; +if (nominal_freq) + *nominal_freq = perf_caps.nominal_freq; +if (!highest_perf || !nominal_perf) {pr_debug ("CPU%d: highest or nominal performance missing\n" , cpu);return 0 ;
@@ -661,8 +671,12 @@ static u64 get_max_boost_ratio(unsigned int cpu) return div_u64(highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf); } +#else -static inline u64 get_max_boost_ratio (unsigned int cpu) {return 0 ; } +static inline u64 get_max_boost_ratio (unsigned int cpu,u64 *nominal_freq) +{ +return 0 ; +}#endif static int acpi_cpufreq_cpu_init (struct cpufreq_policy *policy)
@@ -672,9 +686,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)struct acpi_cpufreq_data *data;unsigned int cpu = policy->cpu;struct cpuinfo_x86 *c = &cpu_data (cpu); +u64 max_boost_ratio, nominal_freq =0 ;unsigned int valid_states =0 ;unsigned int result =0 ; -u64 max_boost_ratio;unsigned int i;#ifdef CONFIG_SMP static int blacklisted;
@@ -824,16 +838,20 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) } freq_table[valid_states].frequency =CPUFREQ_TABLE_END ; - max_boost_ratio =get_max_boost_ratio (cpu); + max_boost_ratio =get_max_boost_ratio (cpu, &nominal_freq);if (max_boost_ratio) { -unsigned int freq = freq_table[0 ].frequency; +unsigned int freq = nominal_freq;/* -* Because the loop above sorts the freq_table entries in the -* descending order, freq is the maximum frequency in the table. -* Assume that it corresponds to the CPPC nominal frequency and -* use it to set cpuinfo.max_freq. +* The loop above sorts the freq_table entries in the +* descending order. If ACPI CPPC has not advertised +* the nominal frequency (this is possible in CPPC +* revisions prior to 3), then use the first entry in +* the pstate table as a proxy for nominal frequency. */ +if (!freq) + freq = freq_table[0 ].frequency; + policy->cpuinfo.max_freq = freq * max_boost_ratio >>SCHED_CAPACITY_SHIFT ; }else {/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/462 selftests: harness: fix printing of mismatch values in __EXPECT()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry V. Levin <[email protected]>
[ Upstream commit 02bc220dc6dc7c56edc4859bc5dd2c08b95d5fb5 ]
intptr_t and uintptr_t are not big enough types on 32-bit architectures when printing 64-bit values, resulting to the following incorrect diagnostic output:
# get_syscall_info.c:209:get_syscall_info:Expected exp_args[2] (3134324433) == info.entry.args[1] (3134324433)
Replace intptr_t and uintptr_t with intmax_t and uintmax_t, respectively. With this fix, the same test produces more usable diagnostic output:
# get_syscall_info.c:209:get_syscall_info:Expected exp_args[2] (3134324433) == info.entry.args[1] (18446744072548908753)
--- tools/testing/selftests/kselftest_harness.h | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-)
tools/testing/selftests/kselftest_harness.h +12 -12
@@ -695,33 +695,33 @@/* Report with actual signedness to avoid weird output. */ \switch (is_signed_type (__exp) *2 +is_signed_type (__seen)) { \case 0 : { \ -unsigned long long __exp_print = (uintptr_t )__exp; \ -unsigned long long __seen_print = (uintptr_t )__seen; \ -__TH_LOG ("Expected %s (%llu) %s %s (%llu)" , \ +uintmax_t __exp_print = (uintmax_t )__exp; \ +uintmax_t __seen_print = (uintmax_t )__seen; \ +__TH_LOG ("Expected %s (%ju) %s %s (%ju)" , \ _expected_str, __exp_print, #_t, \ _seen_str, __seen_print); \break ; \ } \case 1 : { \ -unsigned long long __exp_print = (uintptr_t )__exp; \ -long long __seen_print = (intptr_t )__seen; \ -__TH_LOG ("Expected %s (%llu) %s %s (%lld)" , \ +uintmax_t __exp_print = (uintmax_t )__exp; \ +intmax_t __seen_print = (intmax_t )__seen; \ +__TH_LOG ("Expected %s (%ju) %s %s (%jd)" , \ _expected_str, __exp_print, #_t, \ _seen_str, __seen_print); \break ; \ } \case 2 : { \ -long long __exp_print = (intptr_t )__exp; \ -unsigned long long __seen_print = (uintptr_t )__seen; \ -__TH_LOG ("Expected %s (%lld) %s %s (%llu)" , \ +intmax_t __exp_print = (intmax_t )__exp; \ +uintmax_t __seen_print = (uintmax_t )__seen; \ +__TH_LOG ("Expected %s (%jd) %s %s (%ju)" , \ _expected_str, __exp_print, #_t, \ _seen_str, __seen_print); \break ; \ } \case 3 : { \ -long long __exp_print = (intptr_t )__exp; \ -long long __seen_print = (intptr_t )__seen; \ -__TH_LOG ("Expected %s (%lld) %s %s (%lld)" , \ +intmax_t __exp_print = (intmax_t )__exp; \ +intmax_t __seen_print = (intmax_t )__seen; \ +__TH_LOG ("Expected %s (%jd) %s %s (%jd)" , \ _expected_str, __exp_print, #_t, \ _seen_str, __seen_print); \break ; \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/462 wifi: cfg80211: Handle specific BSSID in 6GHz scanning
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilan Peer <[email protected]>
[ Upstream commit 0fca7784b7a14d4ede64f479662afb98876ec7f8 ]
When the scan parameters for a 6GHz scan specify a unicast BSSID address, and the corresponding AP is found in the scan list, add a corresponding entry in the collocated AP list, so this AP would be directly probed even if it was not advertised as a collocated AP.
This is needed for handling a scan request that is intended for a ML probe flow, where user space can requests a scan to retrieve information for other links in the AP MLD.
Stable-dep-of: 1a0d24775cde ("wifi: cfg80211: adjust allocation of colocated AP data")
--- net/wireless/scan.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
net/wireless/scan.c +37 -0
@@ -796,10 +796,47 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev)list_for_each_entry (intbss, &rdev->bss_list, list) {struct cfg80211_bss *res = &intbss->pub;const struct cfg80211_bss_ies *ies; +const struct element *ssid_elem; +struct cfg80211_colocated_ap *entry; +u32 s_ssid_tmp; +int ret; ies =rcu_access_pointer (res->ies); count +=cfg80211_parse_colocated_ap (ies, &coloc_ap_list); + +/* In case the scan request specified a specific BSSID +* and the BSS is found and operating on 6GHz band then +* add this AP to the collocated APs list. +* This is relevant for ML probe requests when the lower +* band APs have not been discovered. +*/ +if (is_broadcast_ether_addr (rdev_req->bssid) || + !ether_addr_equal (rdev_req->bssid, res->bssid) || + res->channel->band !=NL80211_BAND_6GHZ ) +continue ; + + ret =cfg80211_calc_short_ssid (ies, &ssid_elem, + &s_ssid_tmp); +if (ret) +continue ; + + entry =kzalloc (sizeof (*entry) +IEEE80211_MAX_SSID_LEN , +GFP_ATOMIC ); + +if (!entry) +continue ; + +memcpy (entry->bssid, res->bssid,ETH_ALEN ); + entry->short_ssid = s_ssid_tmp; +memcpy (entry->ssid, ssid_elem->data, + ssid_elem->datalen); + entry->ssid_len = ssid_elem->datalen; + entry->short_ssid_valid = true; + entry->center_freq = res->channel->center_freq; + +list_add_tail (&entry->list, &coloc_ap_list); + count++; }spin_unlock_bh (&rdev->bss_lock); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 41/462 wifi: cfg80211: adjust allocation of colocated AP data
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 1a0d24775cdee2b8dc14bfa4f4418c930ab1ac57 ]
In 'cfg80211_scan_6ghz()', an instances of 'struct cfg80211_colocated_ap' are allocated as if they would have 'ssid' as trailing VLA member. Since this is not so, extra IEEE80211_MAX_SSID_LEN bytes are not needed. Briefly tested with KUnit.
--- net/wireless/scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/wireless/scan.c +1 -3
@@ -821,9 +821,7 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev)if (ret)continue ; - entry =kzalloc (sizeof (*entry) +IEEE80211_MAX_SSID_LEN , -GFP_ATOMIC ); - + entry =kzalloc (sizeof (*entry),GFP_ATOMIC );if (!entry)continue ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 42/462 clk: analogbits: Fix incorrect calculation of vco rate delta
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bo Gan <[email protected]>
[ Upstream commit d7f12857f095ef38523399d47e68787b357232f6 ]
In wrpll_configure_for_rate() we try to determine the best PLL configuration for a target rate. However, in the loop where we try values of R, we should compare the derived vco with target_vco_rate. However, we were in fact comparing it with target_rate, which is actually after Q shift. This is incorrect, and sometimes can result in suboptimal clock rates. Fix it.
--- drivers/clk/analogbits/wrpll-cln28hpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/analogbits/wrpll-cln28hpc.c +1 -1
@@ -287,7 +287,7 @@ int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate, vco = vco_pre * f; } - delta =abs (target_rate - vco); + delta =abs (target_vco_rate - vco);if (delta < best_delta) { best_delta = delta; best_r = r;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 43/462 pwm: stm32: Add check for clk_enable()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingwei Zheng <[email protected]>
[ Upstream commit e8c59791ebb60790c74b2c3ab520f04a8a57219a ]
Add check for the return value of clk_enable() to catch the potential error.
--- drivers/pwm/pwm-stm32.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/pwm/pwm-stm32.c +5 -2
@@ -634,8 +634,11 @@ static int stm32_pwm_probe(struct platform_device *pdev) priv->chip.npwm =stm32_pwm_detect_channels (priv, &num_enabled);/* Initialize clock refcount to number of enabled PWM channels. */ -for (i =0 ; i < num_enabled; i++) -clk_enable (priv->clk); +for (i =0 ; i < num_enabled; i++) { + ret =clk_enable (priv->clk); +if (ret) +return ret; + } ret =pwmchip_add (&priv->chip);if (ret <0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 44/462 net: let net.core.dev_weight always be non-zero
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Jian <[email protected]>
[ Upstream commit d1f9f79fa2af8e3b45cffdeef66e05833480148a ]
The following problem was encountered during stability test:
(NULL net_device): NAPI poll function process_backlog+0x0/0x530 \
returned 1, exceeding its budget of 0.
------------[ cut here ]------------ list_add double add: new=ffff88905f746f48, prev=ffff88905f746f48, \ next=ffff88905f746e40. WARNING: CPU: 18 PID: 5462 at lib/list_debug.c:35 \ __list_add_valid_or_report+0xf3/0x130 CPU: 18 UID: 0 PID: 5462 Comm: ping Kdump: loaded Not tainted 6.13.0-rc7+ RIP: 0010:__list_add_valid_or_report+0xf3/0x130 Call Trace: ? __warn+0xcd/0x250 ? __list_add_valid_or_report+0xf3/0x130 enqueue_to_backlog+0x923/0x1070 netif_rx_internal+0x92/0x2b0 __netif_rx+0x15/0x170 loopback_xmit+0x2ef/0x450 dev_hard_start_xmit+0x103/0x490 __dev_queue_xmit+0xeac/0x1950 ip_finish_output2+0x6cc/0x1620 ip_output+0x161/0x270 ip_push_pending_frames+0x155/0x1a0 raw_sendmsg+0xe13/0x1550 __sys_sendto+0x3bf/0x4e0 __x64_sys_sendto+0xdc/0x1b0 do_syscall_64+0x5b/0x170 entry_SYSCALL_64_after_hwframe+0x76/0x7e
The reproduction command is as follows:
sysctl -w net.core.dev_weight=0
ping 127.0.0.1
This is because when the napi's weight is set to 0, process_backlog() may return 0 and clear the NAPI_STATE_SCHED bit of napi->state, causing this napi to be re-polled in net_rx_action() until __do_softirq() times out. Since the NAPI_STATE_SCHED bit has been cleared, napi_schedule_rps() can be retriggered in enqueue_to_backlog(), causing this issue.
Making the napi's weight always non-zero solves this problem.
Triggering this issue requires system-wide admin (setting is not namespaced).
--- net/core/sysctl_net_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/sysctl_net_core.c +4 -1
@@ -239,7 +239,7 @@ static int proc_do_dev_weight(struct ctl_table *table, int write,int ret, weight;mutex_lock (&dev_weight_mutex); - ret =proc_dointvec (table, write, buffer, lenp, ppos); + ret =proc_dointvec_minmax (table, write, buffer, lenp, ppos);if (!ret && write) { weight =READ_ONCE (weight_p);WRITE_ONCE (dev_rx_weight, weight * dev_weight_rx_bias);
@@ -351,6 +351,7 @@ static struct ctl_table net_core_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_do_dev_weight, + .extra1 = SYSCTL_ONE, }, { .procname = "dev_weight_rx_bias",
@@ -358,6 +359,7 @@ static struct ctl_table net_core_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_do_dev_weight, + .extra1 = SYSCTL_ONE, }, { .procname = "dev_weight_tx_bias",
@@ -365,6 +367,7 @@ static struct ctl_table net_core_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_do_dev_weight, + .extra1 = SYSCTL_ONE, }, { .procname = "netdev_max_backlog",
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/462 net/mlxfw: Drop hard coded max FW flash image size
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maher Sanalla <[email protected]>
[ Upstream commit 70d81f25cc92cc4e914516c9935ae752f27d78ad ]
Currently, mlxfw kernel module limits FW flash image size to be 10MB at most, preventing the ability to burn recent BlueField-3 FW that exceeds the said size limit.
Thus, drop the hard coded limit. Instead, rely on FW's max_component_size threshold that is reported in MCQI register as the size limit for FW image.
--- drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c +0 -2
@@ -14,7 +14,6 @@#define MLXFW_FSM_STATE_WAIT_TIMEOUT_MS 30000#define MLXFW_FSM_STATE_WAIT_ROUNDS \ (MLXFW_FSM_STATE_WAIT_TIMEOUT_MS / MLXFW_FSM_STATE_WAIT_CYCLE_MS) -#define MLXFW_FSM_MAX_COMPONENT_SIZE (10 * (1 << 20))static const int mlxfw_fsm_state_errno[] = { [MLXFW_FSM_STATE_ERR_ERROR ] = -EIO ,
@@ -229,7 +228,6 @@ static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev,return err; } - comp_max_size =min_t (u32, comp_max_size,MLXFW_FSM_MAX_COMPONENT_SIZE );if (comp->data_size > comp_max_size) {MLXFW_ERR_MSG (mlxfw_dev, extack,"Component size is bigger than limit" , -EINVAL );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/462 net: sched: Disallow replacing of child qdisc from one parent to another
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit bc50835e83f60f56e9bec2b392fb5544f250fb6f ]
Lion Ackermann was able to create a UAF which can be abused for privilege escalation with the following script
Step 1. create root qdisc
tc qdisc add dev lo root handle 1:0 drr
step2. a class for packet aggregation do demonstrate uaf tc class add dev lo classid 1:1 drr
step3. a class for nesting
tc class add dev lo classid 1:2 drr
step4. a class to graft qdisc to
tc class add dev lo classid 1:3 drr
step5.
tc qdisc add dev lo parent 1:1 handle 2:0 plug limit 1024
step6.
tc qdisc add dev lo parent 1:2 handle 3:0 drr
step7.
tc class add dev lo classid 3:1 drr
step 8.
tc qdisc add dev lo parent 3:1 handle 4:0 pfifo
step 9. Display the class/qdisc layout
tc class ls dev lo
class drr 1:1 root leaf 2: quantum 64Kb
class drr 1:2 root leaf 3: quantum 64Kb
class drr 3:1 root leaf 4: quantum 64Kb
tc qdisc ls
qdisc drr 1: dev lo root refcnt 2
qdisc plug 2: dev lo parent 1:1
qdisc pfifo 4: dev lo parent 3:1 limit 1000p
qdisc drr 3: dev lo parent 1:2
step10. trigger the bug <=== prevented by this patch tc qdisc replace dev lo parent 1:3 handle 4:0
step 11. Redisplay again the qdiscs/classes
tc class ls dev lo
class drr 1:1 root leaf 2: quantum 64Kb
class drr 1:2 root leaf 3: quantum 64Kb
class drr 1:3 root leaf 4: quantum 64Kb
class drr 3:1 root leaf 4: quantum 64Kb
tc qdisc ls
qdisc drr 1: dev lo root refcnt 2
qdisc plug 2: dev lo parent 1:1
qdisc pfifo 4: dev lo parent 3:1 refcnt 2 limit 1000p qdisc drr 3: dev lo parent 1:2
Observe that a) parent for 4:0 does not change despite the replace request. There can only be one parent. b) refcount has gone up by two for 4:0 and
c) both class 1:3 and 3:1 are pointing to it.
Step 12. send one packet to plug
echo "" | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888,priority=$((0x10001)) step13. send one packet to the grafted fifo
echo "" | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888,priority=$((0x10003))
step14. lets trigger the uaf
tc class delete dev lo classid 1:3
tc class delete dev lo classid 1:1
The semantics of "replace" is for a del/add _on the same node_ and not a delete from one node(3:1) and add to another node (1:3) as in step10. While we could "fix" with a more complex approach there could be consequences to expectations so the patch takes the preventive approach of "disallow such config".
Joint work with Lion Ackermann <[email protected]>
--- net/sched/sch_api.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sched/sch_api.c +4 -0
@@ -1603,6 +1603,10 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, q =qdisc_lookup (dev, tcm->tcm_handle);if (!q) goto create_n_graft; +if (q->parent != tcm->tcm_parent) { +NL_SET_ERR_MSG (extack,"Cannot move an existing qdisc to a different parent" ); +return -EINVAL ; + }if (n->nlmsg_flags &NLM_F_EXCL ) {NL_SET_ERR_MSG (extack,"Exclusivity flag on, cannot override" );return -EEXIST ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/462 net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
[ Upstream commit 4395a44acb15850e492dd1de9ec4b6479d96bc80 ]
When getting the IRQ we use k3_udma_glue_tx_get_irq() which returns negative error value on error. So not NULL check is not sufficient to deteremine if IRQ is valid. Check that IRQ is greater then zero to ensure it is valid.
There is no issue at probe time but at runtime user can invoke .set_channels which results in the following call chain. am65_cpsw_set_channels()
am65_cpsw_nuss_update_tx_rx_chns()
am65_cpsw_nuss_remove_tx_chns() am65_cpsw_nuss_init_tx_chns()
At this point if am65_cpsw_nuss_init_tx_chns() fails due to k3_udma_glue_tx_get_irq() then tx_chn->irq will be set to a negative value.
Then, at subsequent .set_channels with higher channel count we will attempt to free an invalid IRQ in am65_cpsw_nuss_remove_tx_chns() leading to a kernel warning.
The issue is present in the original commit that introduced this driver, although there, am65_cpsw_nuss_update_tx_rx_chns() existed as am65_cpsw_nuss_update_tx_chns().
--- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/am65-cpsw-nuss.c +1 -1
@@ -1425,7 +1425,7 @@ void am65_cpsw_nuss_remove_tx_chns(struct am65_cpsw_common *common)for (i =0 ; i < common->tx_ch_num; i++) {struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i]; -if (tx_chn->irq) +if (tx_chn->irq >0 )devm_free_irq (dev, tx_chn->irq, tx_chn);netif_napi_del (&tx_chn->napi_tx);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/462 net/rose: prevent integer overflows in rose_setsockopt()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Zhandarovich <[email protected]>
[ Upstream commit d640627663bfe7d8963c7615316d7d4ef60f3b0b ]
In case of possible unpredictably large arguments passed to rose_setsockopt() and multiplied by extra values on top of that, integer overflows may occur.
Do the safest minimum and fix these issues by checking the contents of 'opt' and returning -EINVAL if they are too large. Also, switch to unsigned int and remove useless check for negative 'opt' in ROSE_IDLE case.
--- net/rose/af_rose.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
net/rose/af_rose.c +8 -8
@@ -396,15 +396,15 @@ static int rose_setsockopt(struct socket *sock, int level, int optname, {struct sock *sk = sock->sk;struct rose_sock *rose =rose_sk (sk); -int opt; +unsigned int opt;if (level !=SOL_ROSE )return -ENOPROTOOPT ; -if (optlen <sizeof (int )) +if (optlen <sizeof (unsigned int ))return -EINVAL ; -if (copy_from_sockptr (&opt, optval,sizeof (int ))) +if (copy_from_sockptr (&opt, optval,sizeof (unsigned int )))return -EFAULT ;switch (optname) {
@@ -413,31 +413,31 @@ static int rose_setsockopt(struct socket *sock, int level, int optname,return 0 ;case ROSE_T1 : -if (opt <1 ) +if (opt <1 || opt >UINT_MAX /HZ )return -EINVAL ; rose->t1 = opt *HZ ;return 0 ;case ROSE_T2 : -if (opt <1 ) +if (opt <1 || opt >UINT_MAX /HZ )return -EINVAL ; rose->t2 = opt *HZ ;return 0 ;case ROSE_T3 : -if (opt <1 ) +if (opt <1 || opt >UINT_MAX /HZ )return -EINVAL ; rose->t3 = opt *HZ ;return 0 ;case ROSE_HOLDBACK : -if (opt <1 ) +if (opt <1 || opt >UINT_MAX /HZ )return -EINVAL ; rose->hb = opt *HZ ;return 0 ;case ROSE_IDLE : -if (opt <0 ) +if (opt >UINT_MAX / (60 *HZ ))return -EINVAL ; rose->idle = opt *60 *HZ ;return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/462 tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marco Leogrande <[email protected]>
[ Upstream commit e2f0791124a1b6ca8d570110cbd487969d9d41ef ]
Commit f803bcf9208a ("selftests/bpf: Prevent client connect before server bind in test_tc_tunnel.sh") added code that waits for the netcat server to start before the netcat client attempts to connect to it. However, not all calls to 'server_listen' were guarded.
This patch adds the existing 'wait_for_port' guard after the remaining call to 'server_listen'.
--- tools/testing/selftests/bpf/test_tc_tunnel.sh | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/test_tc_tunnel.sh +1 -0
@@ -286,6 +286,7 @@ else client_connect verify_data server_listen + wait_for_port ${port} ${netcat_opt} fi # bpf_skb_net_shrink does not take tunnel flags yet, cannot update L3.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/462 ASoC: sun4i-spdif: Add clock multiplier settings
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: George Lander <[email protected]>
[ Upstream commit 0a2319308de88b9e819c0b43d0fccd857123eb31 ]
There have been intermittent issues with the SPDIF output on H3 and H2+ devices which has been fixed by setting the s_clk to 4 times the audio pll.
Add a quirk for the clock multiplier as not every supported SoC requires it. Without the multiplier, the audio at normal sampling rates was distorted and did not play at higher sampling rates.
--- sound/soc/sunxi/sun4i-spdif.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/sunxi/sun4i-spdif.c +7 -0
@@ -175,6 +175,7 @@ struct sun4i_spdif_quirks {unsigned int reg_dac_txdata;bool has_reset;unsigned int val_fctl_ftx; +unsigned int mclk_multiplier; };struct sun4i_spdif_dev {
@@ -311,6 +312,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,default :return -EINVAL ; } + mclk *= host->quirks->mclk_multiplier; ret =clk_set_rate (host->spdif_clk, mclk);if (ret <0 ) {
@@ -345,6 +347,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,default :return -EINVAL ; } + mclk_div *= host->quirks->mclk_multiplier; reg_val =0 ; reg_val |=SUN4I_SPDIF_TXCFG_ASS ;
@@ -427,24 +430,28 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = { .reg_dac_txdata =SUN4I_SPDIF_TXFIFO , .val_fctl_ftx =SUN4I_SPDIF_FCTL_FTX , + .mclk_multiplier =1 , };static const struct sun4i_spdif_quirks sun6i_a31_spdif_quirks = { .reg_dac_txdata =SUN4I_SPDIF_TXFIFO , .val_fctl_ftx =SUN4I_SPDIF_FCTL_FTX , .has_reset = true, + .mclk_multiplier =1 , };static const struct sun4i_spdif_quirks sun8i_h3_spdif_quirks = { .reg_dac_txdata =SUN8I_SPDIF_TXFIFO , .val_fctl_ftx =SUN4I_SPDIF_FCTL_FTX , .has_reset = true, + .mclk_multiplier =4 , };static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = { .reg_dac_txdata =SUN8I_SPDIF_TXFIFO , .val_fctl_ftx =SUN50I_H6_SPDIF_FCTL_FTX , .has_reset = true, + .mclk_multiplier =1 , };static const struct of_device_id sun4i_spdif_of_match[] = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/462 perf header: Fix one memory leakage in process_bpf_btf()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhongqiu Han <[email protected]>
[ Upstream commit 875d22980a062521beed7b5df71fb13a1af15d83 ]
If __perf_env__insert_btf() returns false due to a duplicate btf node insertion, the temporary node will leak. Add a check to ensure the memory is freed if the function returns false.
--- tools/perf/util/header.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/header.c +2 -1
@@ -2980,7 +2980,8 @@ static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused)if (__do_read (ff, node->data, data_size)) goto out; -__perf_env__insert_btf (env, node); +if (!__perf_env__insert_btf (env, node)) +free (node); node =NULL ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 52/462 perf header: Fix one memory leakage in process_bpf_prog_info()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhongqiu Han <[email protected]>
[ Upstream commit a7da6c7030e1aec32f0a41c7b4fa70ec96042019 ]
Function __perf_env__insert_bpf_prog_info() will return without inserting bpf prog info node into perf env again due to a duplicate bpf prog info node insertion, causing the temporary info_linear and info_node memory to leak. Modify the return type of this function to bool and add a check to ensure the memory is freed if the function returns false.
--- tools/perf/util/env.c | 5 +++-- tools/perf/util/env.h | 2 +- tools/perf/util/header.c | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-)
tools/perf/util/env.c +3 -2
@@ -23,7 +23,7 @@ void perf_env__insert_bpf_prog_info(struct perf_env *env,up_write (&env->bpf_progs.lock); } -void __perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node) +bool __perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node) {__u32 prog_id = info_node->info_linear->info.id;struct bpf_prog_info_node *node;
@@ -41,13 +41,14 @@ void __perf_env__insert_bpf_prog_info(struct perf_env *env, struct bpf_prog_info p = &(*p)->rb_right; }else {pr_debug ("duplicated bpf prog info %u\n" , prog_id); -return ; +return false; } }rb_link_node (&info_node->rb_node, parent, p);rb_insert_color (&info_node->rb_node, &env->bpf_progs.infos); env->bpf_progs.infos_cnt++; +return true; } struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
tools/perf/util/env.h +1 -1
@@ -139,7 +139,7 @@ const char *perf_env__raw_arch(struct perf_env *env);int perf_env__nr_cpus_avail (struct perf_env *env);void perf_env__init (struct perf_env *env); -void __perf_env__insert_bpf_prog_info (struct perf_env *env, +bool __perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node);void perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node);
tools/perf/util/header.c +4 -1
@@ -2927,7 +2927,10 @@ static int process_bpf_prog_info(struct feat_fd *ff, void *data __maybe_unused)/* after reading from file, translate offset to address */ bpf_program__bpil_offs_to_addr (info_linear); info_node->info_linear = info_linear; -__perf_env__insert_bpf_prog_info (env, info_node); +if (!__perf_env__insert_bpf_prog_info (env, info_node)) { +free (info_linear); +free (info_node); + } }up_write (&env->bpf_progs.lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 53/462 perf env: Conditionally compile BPF support code on having HAVE_LIBBPF_SUPPORT
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <[email protected]>
[ Upstream commit ef0580ecd8b0306acf09b7a7508d72cafc67896d ]
If libbpf isn't selected, no need for a bunch of related code, that were not even being used, as code using these perf_env methods was also enclosed in HAVE_LIBBPF_SUPPORT.
Stable-dep-of: 03edb7020bb9 ("perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()")
--- tools/perf/util/dso.c | 14 ++++++++++---- tools/perf/util/env.c | 15 ++++++++++++--- tools/perf/util/env.h | 4 ++-- tools/perf/util/header.c | 21 ++++++++------------- 4 files changed, 32 insertions(+), 22 deletions(-)
tools/perf/util/dso.c +10 -4
@@ -11,8 +11,10 @@#include <errno.h> #include <fcntl.h> #include <stdlib.h> +#ifdef HAVE_LIBBPF_SUPPORT #include <bpf/libbpf.h> #include "bpf-event.h" +#endif #include "compress.h" #include "env.h" #include "namespaces.h"
@@ -728,6 +730,7 @@ bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by)return false; } +#ifdef HAVE_LIBBPF_SUPPORT static ssize_t bpf_read (struct dso *dso,u64 offset,char *data) {struct bpf_prog_info_node *node;
@@ -765,6 +768,7 @@ static int bpf_size(struct dso *dso) dso->data.file_size = node->info_linear->info.jited_prog_len; return 0; } +#endif // HAVE_LIBBPF_SUPPORT static void dso_cache__free (struct dso *dso)
@@ -894,10 +898,12 @@ static struct dso_cache *dso_cache__populate(struct dso *dso, *ret = -ENOMEM ;return NULL ; } - +#ifdef HAVE_LIBBPF_SUPPORT if (dso->binary_type ==DSO_BINARY_TYPE__BPF_PROG_INFO ) *ret =bpf_read (dso, cache_offset, cache->data); -else if (dso->binary_type ==DSO_BINARY_TYPE__OOL ) + else +#endif +if (dso->binary_type ==DSO_BINARY_TYPE__OOL ) *ret =DSO__DATA_CACHE_SIZE ;else *ret =file_read (dso, machine, cache_offset, cache->data);
@@ -1018,10 +1024,10 @@ int dso__data_file_size(struct dso *dso, struct machine *machine)if (dso->data.status ==DSO_DATA_STATUS_ERROR )return -1 ; - +#ifdef HAVE_LIBBPF_SUPPORT if (dso->binary_type ==DSO_BINARY_TYPE__BPF_PROG_INFO )return bpf_size (dso); - +#endif return file_size (dso, machine); }
tools/perf/util/env.c +12 -3
@@ -5,16 +5,18 @@#include "util/header.h" #include <linux/ctype.h> #include <linux/zalloc.h> -#include "bpf-event.h" #include "cgroup.h" #include <errno.h> #include <sys/utsname.h> -#include <bpf/libbpf.h> #include <stdlib.h> #include <string.h> struct perf_env perf_env; +#ifdef HAVE_LIBBPF_SUPPORT +#include "bpf-event.h" +#include <bpf/libbpf.h> +void perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node) {
@@ -182,6 +184,11 @@ static void perf_env__purge_bpf(struct perf_env *env) up_write(&env->bpf_progs.lock); } +#else // HAVE_LIBBPF_SUPPORT +static void perf_env__purge_bpf (struct perf_env *env__maybe_unused ) +{ +} +#endif // HAVE_LIBBPF_SUPPORT void perf_env__exit (struct perf_env *env) {
@@ -218,11 +225,13 @@ void perf_env__exit(struct perf_env *env)zfree (&env->memory_nodes); } -void perf_env__init (struct perf_env *env) +void perf_env__init (struct perf_env *env__maybe_unused ) { +#ifdef HAVE_LIBBPF_SUPPORT env->bpf_progs.infos =RB_ROOT ; env->bpf_progs.btfs =RB_ROOT ;init_rwsem (&env->bpf_progs.lock); +#endif }int perf_env__set_cmdline (struct perf_env *env,int argc,const char *argv[])
tools/perf/util/env.h +2 -2
@@ -77,7 +77,7 @@ struct perf_env {struct numa_node *numa_nodes;struct memory_node *memory_nodes;unsigned long long memory_bsize; - +#ifdef HAVE_LIBBPF_SUPPORT /* * bpf_info_lock protects bpf rbtrees. This is needed because the * trees are accessed by different threads in perf-top
@@ -89,7 +89,7 @@ struct perf_env {struct rb_root btfs;u32 btfs_cnt; } bpf_progs; - +#endif // HAVE_LIBBPF_SUPPORT /* same reason as above (for perf-top) */ struct {struct rw_semaphore lock;
tools/perf/util/header.c +8 -13
@@ -19,7 +19,9 @@#include <sys/utsname.h> #include <linux/time64.h> #include <dirent.h> +#ifdef HAVE_LIBBPF_SUPPORT #include <bpf/libbpf.h> +#endif #include <perf/cpumap.h> #include "dso.h"
@@ -987,13 +989,6 @@ static int write_bpf_prog_info(struct feat_fd *ff,up_read (&env->bpf_progs.lock);return ret; } -#else // HAVE_LIBBPF_SUPPORT -static int write_bpf_prog_info (struct feat_fd *ff__maybe_unused , -struct evlist *evlist__maybe_unused ) -{ -return 0 ; -} -#endif // HAVE_LIBBPF_SUPPORT static int write_bpf_btf (struct feat_fd *ff,struct evlist *evlist__maybe_unused )
@@ -1027,6 +1022,7 @@ static int write_bpf_btf(struct feat_fd *ff,up_read (&env->bpf_progs.lock); return ret; } +#endif // HAVE_LIBBPF_SUPPORT static int cpu_cache_level__sort (const void *a,const void *b) {
@@ -1638,6 +1634,7 @@ static void print_dir_format(struct feat_fd *ff, FILE *fp)fprintf (fp,"# directory data version : %" PRIu64"\n" , data->dir.version); } +#ifdef HAVE_LIBBPF_SUPPORT static void print_bpf_prog_info (struct feat_fd *ff,FILE *fp) {struct perf_env *env = &ff->ph->env;
@@ -1683,6 +1680,7 @@ static void print_bpf_btf(struct feat_fd *ff, FILE *fp) up_read(&env->bpf_progs.lock); } +#endif // HAVE_LIBBPF_SUPPORT static void free_event_desc (struct evsel *events) {
@@ -2941,12 +2939,6 @@ static int process_bpf_prog_info(struct feat_fd *ff, void *data __maybe_unused)up_write (&env->bpf_progs.lock);return err; } -#else // HAVE_LIBBPF_SUPPORT -static int process_bpf_prog_info (struct feat_fd *ff__maybe_unused ,void *data__maybe_unused ) -{ -return 0 ; -} -#endif // HAVE_LIBBPF_SUPPORT static int process_bpf_btf (struct feat_fd *ff,void *data__maybe_unused ) {
@@ -2994,6 +2986,7 @@ static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused)free (node); return err; } +#endif // HAVE_LIBBPF_SUPPORT static int process_compressed (struct feat_fd *ff,void *data__maybe_unused )
@@ -3124,8 +3117,10 @@ const struct perf_header_feature_ops feat_ops[HEADER_LAST_FEATURE] = {FEAT_OPR (MEM_TOPOLOGY , mem_topology, true),FEAT_OPR (CLOCKID , clockid, false),FEAT_OPN (DIR_FORMAT , dir_format, false), +#ifdef HAVE_LIBBPF_SUPPORTFEAT_OPR (BPF_PROG_INFO , bpf_prog_info, false),FEAT_OPR (BPF_BTF , bpf_btf, false), +#endifFEAT_OPR (COMPRESSED , compressed, false),FEAT_OPR (CPU_PMU_CAPS , cpu_pmu_caps, false), FEAT_OPR(CLOCK_DATA, clock_data, false),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 54/462 perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhongqiu Han <[email protected]>
[ Upstream commit 03edb7020bb920f1935c3f30acad0bb27fdb99af ]
If perf_env__insert_bpf_prog_info() returns false due to a duplicate bpf prog info node insertion, the temporary info_node and info_linear memory will leak. Add a check to ensure the memory is freed if the function returns false.
--- tools/perf/util/bpf-event.c | 10 ++++++++-- tools/perf/util/env.c | 8 ++++++-- tools/perf/util/env.h | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-)
tools/perf/util/bpf-event.c +8 -2
@@ -280,7 +280,10 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session, } info_node->info_linear = info_linear; -perf_env__insert_bpf_prog_info (env, info_node); +if (!perf_env__insert_bpf_prog_info (env, info_node)) { +free (info_linear); +free (info_node); + } info_linear =NULL ;/*
@@ -468,7 +471,10 @@ static void perf_env__add_bpf_info(struct perf_env *env, u32 id) info_node =malloc (sizeof (struct bpf_prog_info_node ));if (info_node) { info_node->info_linear = info_linear; -perf_env__insert_bpf_prog_info (env, info_node); +if (!perf_env__insert_bpf_prog_info (env, info_node)) { +free (info_linear); +free (info_node); + } }else free (info_linear);
tools/perf/util/env.c +6 -2
@@ -17,12 +17,16 @@ struct perf_env perf_env;#include "bpf-event.h" #include <bpf/libbpf.h> -void perf_env__insert_bpf_prog_info (struct perf_env *env, +bool perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node) { +bool ret; +down_write (&env->bpf_progs.lock); -__perf_env__insert_bpf_prog_info (env, info_node); + ret =__perf_env__insert_bpf_prog_info (env, info_node);up_write (&env->bpf_progs.lock); + +return ret; }bool __perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node)
tools/perf/util/env.h +1 -1
@@ -141,7 +141,7 @@ int perf_env__nr_cpus_avail(struct perf_env *env);void perf_env__init (struct perf_env *env);bool __perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node); -void perf_env__insert_bpf_prog_info (struct perf_env *env, +bool perf_env__insert_bpf_prog_info (struct perf_env *env,struct bpf_prog_info_node *info_node);struct bpf_prog_info_node *perf_env__find_bpf_prog_info (struct perf_env *env,__u32 prog_id);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 55/462 ktest.pl: Remove unused declarations in run_bisect_test function
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ba Jing <[email protected]>
[ Upstream commit 776735b954f49f85fd19e1198efa421fae2ad77c ]
Since $output and $ret are not used in the subsequent code, the declarations should be removed.
--- tools/testing/ktest/ktest.pl | 2 -- 1 file changed, 2 deletions(-)
tools/testing/ktest/ktest.pl +0 -2
@@ -2892,8 +2892,6 @@ sub run_bisect_test { my $failed = 0; my $result; - my $output; - my $ret; $in_bisect = 1;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 56/462 padata: fix sysfs store callback check
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <[email protected]>
[ Upstream commit 9ff6e943bce67d125781fe4780a5d6f072dc44c0 ]
padata_sysfs_store() was copied from padata_sysfs_show() but this check was not adapted. Today there is no attribute which can fail this check, but if there is one it may as well be correct.
--- kernel/padata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/padata.c +1 -1
@@ -972,7 +972,7 @@ static ssize_t padata_sysfs_store(struct kobject *kobj, struct attribute *attr, pinst =kobj2pinst (kobj); pentry =attr2pentry (attr); -if (pentry->show) +if (pentry->store) ret = pentry->store (pinst, attr, buf, count);return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 57/462 perf top: Dont complain about lack of vmlinux when not resolving some kernel samples
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <[email protected]>
[ Upstream commit 058b38ccd2af9e5c95590b018e8425fa148d7aca ]
Recently we got a case where a kernel sample wasn't being resolved due to a bug that was not setting the end address on kernel functions implemented in assembly (see Link: tag), and then those were not being found by machine__resolve() -> map__find_symbol().
So we ended up with:
# perf top --stdio PerfTop: 0 irqs/s kernel: 0% exact: 0% lost: 0/0 drop: 0/0 [cycles/P] -----------------------------------------------------------------------
Warning:
A vmlinux file was not found.
Kernel samples will not be resolved.
^Z
[1]+ Stopped perf top --stdio
#
But then resolving all other kernel symbols.
So just fixup the logic to only print that warning when there are no symbols in the kernel map.
--- tools/perf/builtin-top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-top.c +1 -1
@@ -809,7 +809,7 @@ static void perf_event__process_sample(struct perf_tool *tool,* invalid --vmlinux ;-) */ if (!machine->kptr_restrict_warned && !top->vmlinux_warned && -__map__is_kernel (al.map) &&map__has_symbols (al.map)) { +__map__is_kernel (al.map) && !map__has_symbols (al.map)) {if (symbol_conf.vmlinux_name) {char serr[256 ];dso__strerror_load (al.map->dso, serr,sizeof (serr));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 58/462 perf report: Fix misleading help message about --demangle
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiachen Zhang <[email protected]>
[ Upstream commit ac0ac75189a4d6a29a2765a7adbb62bc6cc650c7 ]
The wrong help message may mislead users. This commit fixes it.
--- tools/perf/builtin-report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-report.c +1 -1
@@ -1276,7 +1276,7 @@ int cmd_report(int argc, const char **argv)OPT_STRING (0 ,"objdump" , &report.annotation_opts.objdump_path,"path" ,"objdump binary to use for disassembly and annotations" ),OPT_BOOLEAN (0 ,"demangle" , &symbol_conf.demangle, -"Disable symbol demangling" ), +"Symbol demangling. Enabled by default, use --no-demangle to disable." ),OPT_BOOLEAN (0 ,"demangle-kernel" , &symbol_conf.demangle_kernel,"Enable kernel symbol demangling" ), OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 59/462 bpf: Send signals asynchronously if !preemptible
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Puranjay Mohan <[email protected]>
[ Upstream commit 87c544108b612512b254c8f79aa5c0a8546e2cc4 ]
BPF programs can execute in all kinds of contexts and when a program running in a non-preemptible context uses the bpf_send_signal() kfunc, it will cause issues because this kfunc can sleep.
Change irqs_disabled() to !preemptible().
--- kernel/trace/bpf_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/bpf_trace.c +1 -1
@@ -1081,7 +1081,7 @@ static int bpf_send_signal_common(u32 sig, enum pid_type type)if (unlikely (is_global_init (current)))return -EPERM ; -if (irqs_disabled ()) { +if (!preemptible ()) {/* Do an early check on signal validity. Otherwise, * the error is lost in deferred irq_work. */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 60/462 padata: fix UAF in padata_reorder
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ridong <[email protected]>
[ Upstream commit e01780ea4661172734118d2a5f41bc9720765668 ]
A bug was found when run ltp test:
BUG: KASAN: slab-use-after-free in padata_find_next+0x29/0x1a0 Read of size 4 at addr ffff88bbfe003524 by task kworker/u113:2/3039206 CPU: 0 PID: 3039206 Comm: kworker/u113:2 Kdump: loaded Not tainted 6.6.0+ Workqueue: pdecrypt_parallel padata_parallel_worker Call Trace: <TASK> dump_stack_lvl+0x32/0x50 print_address_description.constprop.0+0x6b/0x3d0 print_report+0xdd/0x2c0 kasan_report+0xa5/0xd0 padata_find_next+0x29/0x1a0 padata_reorder+0x131/0x220 padata_parallel_worker+0x3d/0xc0 process_one_work+0x2ec/0x5a0
If 'mdelay(10)' is added before calling 'padata_find_next' in the 'padata_reorder' function, this issue could be reproduced easily with ltp test (pcrypt_aead01).
This can be explained as bellow:
pcrypt_aead_encrypt
...padata_do_parallelrefcount_inc(&pd->refcnt); // add refcnt
...padata_do_serialpadata_reorder // pd
while (1) {padata_find_next(pd, true); // using pdqueue_work_on
...padata_serial_worker crypto_del_algpadata_put_pd_cnt // sub refcnt
padata_free_shell padata_put_pd(ps->pd); // pd is freed
// loop again, but pd is freed
// call padata_find_next, UAF
}
In the padata_reorder function, when it loops in 'while', if the alg is deleted, the refcnt may be decreased to 0 before entering 'padata_find_next', which leads to UAF.
As mentioned in [1], do_serial is supposed to be called with BHs disabled and always happen under RCU protection, to address this issue, add synchronize_rcu() in 'padata_free_shell' wait for all _do_serial calls to finish.
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/linux-kernel/jfjz5d7zwbytztackem7ibzalm5lnxldi2eofeiczqmqs2m7o6@fq426cwnjtkm/
--- kernel/padata.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/padata.c +6 -0
@@ -1123,6 +1123,12 @@ void padata_free_shell(struct padata_shell *ps)if (!ps)return ; +/* +* Wait for all _do_serial calls to finish to avoid touching +* freed pd's and ps's. +*/ +synchronize_rcu (); +mutex_lock (&ps->pinst->lock);list_del (&ps->list); pd =rcu_dereference_protected (ps->pd,1 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 61/462 padata: add pd get/put refcnt helper
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ridong <[email protected]>
[ Upstream commit ae154202cc6a189b035359f3c4e143d5c24d5352 ]
Add helpers for pd to get/put refcnt to make code consice.
Stable-dep-of: dd7d37ccf6b1 ("padata: avoid UAF for reorder_work")
--- kernel/padata.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
kernel/padata.c +20 -7
@@ -60,6 +60,22 @@ struct padata_mt_job_state {static void padata_free_pd (struct parallel_data *pd);static void __init padata_mt_helper (struct work_struct *work); +static inline void padata_get_pd (struct parallel_data *pd) +{ +refcount_inc (&pd->refcnt); +} + +static inline void padata_put_pd_cnt (struct parallel_data *pd,int cnt) +{ +if (refcount_sub_and_test (cnt, &pd->refcnt)) +padata_free_pd (pd); +} + +static inline void padata_put_pd (struct parallel_data *pd) +{ +padata_put_pd_cnt (pd,1 ); +} +static int padata_index_to_cpu (struct parallel_data *pd,int cpu_index) {int cpu, target_cpu;
@@ -211,7 +227,7 @@ int padata_do_parallel(struct padata_shell *ps,if ((pinst->flags &PADATA_RESET )) goto out; -refcount_inc (&pd->refcnt); +padata_get_pd (pd); padata->pd = pd; padata->cb_cpu = *cb_cpu;
@@ -385,8 +401,7 @@ static void padata_serial_worker(struct work_struct *serial_work) }local_bh_enable (); -if (refcount_sub_and_test (cnt, &pd->refcnt)) -padata_free_pd (pd); +padata_put_pd_cnt (pd, cnt); }/**
@@ -683,8 +698,7 @@ static int padata_replace(struct padata_instance *pinst)synchronize_rcu ();list_for_each_entry_continue_reverse (ps, &pinst->pslist, list) -if (refcount_dec_and_test (&ps->opd->refcnt)) -padata_free_pd (ps->opd); +padata_put_pd (ps->opd); pinst->flags &= ~PADATA_RESET ;
@@ -1132,8 +1146,7 @@ void padata_free_shell(struct padata_shell *ps)mutex_lock (&ps->pinst->lock);list_del (&ps->list); pd =rcu_dereference_protected (ps->pd,1 ); -if (refcount_dec_and_test (&pd->refcnt)) -padata_free_pd (pd); +padata_put_pd (pd);mutex_unlock (&ps->pinst->lock);kfree (ps);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 62/462 padata: avoid UAF for reorder_work
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ridong <[email protected]>
[ Upstream commit dd7d37ccf6b11f3d95e797ebe4e9e886d0332600 ]
Although the previous patch can avoid ps and ps UAF for _do_serial, it can not avoid potential UAF issue for reorder_work. This issue can happen just as below:
crypto_request crypto_request crypto_del_algpadata_do_serial
...
padata_reorder
// processes all remaining
// requests then breaks
while (1) {
if (!padata)
break;
...
}
padata_do_serial
// new request added
list_add
// sees the new request
queue_work(reorder_work)
padata_reorder
queue_work_on(squeue->work)...
<kworker context> padata_serial_worker // completes new request, // no more outstanding // requests crypto_del_alg // free pd
<kworker context>invoke_padata_reorder
// UAF of pd
To avoid UAF for 'reorder_work', get 'pd' ref before put 'reorder_work' into the 'serial_wq' and put 'pd' ref until the 'serial_wq' finish.
--- kernel/padata.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
kernel/padata.c +9 -1
@@ -357,8 +357,14 @@ static void padata_reorder(struct parallel_data *pd)smp_mb (); reorder =per_cpu_ptr (pd->reorder_list, pd->cpu); -if (!list_empty (&reorder->list) &&padata_find_next (pd, false)) +if (!list_empty (&reorder->list) &&padata_find_next (pd, false)) { +/* +* Other context(eg. the padata_serial_worker) can finish the request. +* To avoid UAF issue, add pd ref here, and put pd ref after reorder_work finish. +*/ +padata_get_pd (pd);queue_work (pinst->serial_wq, &pd->reorder_work); + } }static void invoke_padata_reorder (struct work_struct *work)
@@ -369,6 +375,8 @@ static void invoke_padata_reorder(struct work_struct *work) pd = container_of(work, struct parallel_data, reorder_work);padata_reorder (pd);local_bh_enable (); +/* Pairs with putting the reorder_work in the serial_wq */ +padata_put_pd (pd); }static void padata_serial_worker (struct work_struct *serial_work)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 63/462 arm64: dts: mediatek: mt8516: fix GICv2 range
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Val Packett <[email protected]>
[ Upstream commit e3ee31e4409f051c021a30122f3c470f093a7386 ]
On the MT8167 which is based on the MT8516 DTS, the following error was appearing on boot, breaking interrupt operation:
GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
Similar to what's been proposed for MT7622 which has the same issue, fix by using the range reported by force_probe.
--- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8516.dtsi +1 -1
@@ -262,7 +262,7 @@ interrupt-parent = <&gic>; interrupt-controller; reg = <0 0x10310000 0 0x1000>, - <0 0x10320000 0 0x1000>, + <0 0x1032f000 0 0x2000>, <0 0x10340000 0 0x2000>, <0 0x10360000 0 0x2000>; interrupts = <GIC_PPI 9
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 64/462 arm64: dts: mediatek: mt8516: fix wdt irq type
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Val Packett <[email protected]>
[ Upstream commit 03a80442030e7147391738fb6cbe5fa0b3b91bb1 ]
The GICv2 does not support EDGE_FALLING interrupts, so the watchdog would refuse to attach due to a failing check coming from the GIC driver.
--- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8516.dtsi +1 -1
@@ -206,7 +206,7 @@ compatible = "mediatek,mt8516-wdt", "mediatek,mt6589-wdt"; reg = <0 0x10007000 0 0x1000>; - interrupts = <GIC_SPI 198 IRQ_TYPE_EDGE_FALLING>; + interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>; #reset-cells = <1>; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 65/462 arm64: dts: mediatek: mt8516: remove 2 invalid i2c clocks
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabien Parent <[email protected]>
[ Upstream commit 9cf6a26ae352a6a150662c0c4ddff87664cc6e3c ]
The two clocks "main-source" and "main-sel" are not present in the driver and not defined in the binding documentation. Remove them as they are not used and not described in the documentation.
Stable-dep-of: eb72341fd92b ("arm64: dts: mediatek: mt8516: add i2c clock-div property")
--- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 27 ++++++------------------ 1 file changed, 6 insertions(+), 21 deletions(-)
arch/arm64/boot/dts/mediatek/mt8516.dtsi +6 -21
@@ -308,14 +308,9 @@ reg = <0 0x11009000 0 0x90>, <0 0x11000180 0 0x80>; interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_LOW>; - clocks = <&topckgen CLK_TOP_AHB_INFRA_D2>, - <&infracfg CLK_IFR_I2C0_SEL>, - <&topckgen CLK_TOP_I2C0>, + clocks = <&topckgen CLK_TOP_I2C0>, <&topckgen CLK_TOP_APDMA>; - clock-names = "main-source", - "main-sel", - "main", - "dma"; + clock-names = "main", "dma"; #address-cells = <1>; #size-cells = <0>; status = "disabled";
@@ -327,14 +322,9 @@ reg = <0 0x1100a000 0 0x90>, <0 0x11000200 0 0x80>; interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_LOW>; - clocks = <&topckgen CLK_TOP_AHB_INFRA_D2>, - <&infracfg CLK_IFR_I2C1_SEL>, - <&topckgen CLK_TOP_I2C1>, + clocks = <&topckgen CLK_TOP_I2C1>, <&topckgen CLK_TOP_APDMA>; - clock-names = "main-source", - "main-sel", - "main", - "dma"; + clock-names = "main", "dma"; #address-cells = <1>; #size-cells = <0>; status = "disabled";
@@ -346,14 +336,9 @@ reg = <0 0x1100b000 0 0x90>, <0 0x11000280 0 0x80>; interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_LOW>; - clocks = <&topckgen CLK_TOP_AHB_INFRA_D2>, - <&infracfg CLK_IFR_I2C2_SEL>, - <&topckgen CLK_TOP_I2C2>, + clocks = <&topckgen CLK_TOP_I2C2>, <&topckgen CLK_TOP_APDMA>; - clock-names = "main-source", - "main-sel", - "main", - "dma"; + clock-names = "main", "dma"; #address-cells = <1>; #size-cells = <0>; status = "disabled";
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 66/462 arm64: dts: mediatek: mt8516: add i2c clock-div property
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Val Packett <[email protected]>
[ Upstream commit eb72341fd92b7af510d236e5a8554d855ed38d3c ]
Move the clock-div property from the pumpkin board dtsi to the SoC's since it belongs to the SoC itself and is required on other devices.
--- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 3 +++ arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt8516.dtsi +3 -0
@@ -308,6 +308,7 @@ reg = <0 0x11009000 0 0x90>, <0 0x11000180 0 0x80>; interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_LOW>; + clock-div = <2>; clocks = <&topckgen CLK_TOP_I2C0>, <&topckgen CLK_TOP_APDMA>; clock-names = "main", "dma";
@@ -322,6 +323,7 @@ reg = <0 0x1100a000 0 0x90>, <0 0x11000200 0 0x80>; interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_LOW>; + clock-div = <2>; clocks = <&topckgen CLK_TOP_I2C1>, <&topckgen CLK_TOP_APDMA>; clock-names = "main", "dma";
@@ -336,6 +338,7 @@ reg = <0 0x1100b000 0 0x90>, <0 0x11000280 0 0x80>; interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_LOW>; + clock-div = <2>; clocks = <&topckgen CLK_TOP_I2C2>, <&topckgen CLK_TOP_APDMA>; clock-names = "main", "dma";
arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi +0 -2
@@ -48,7 +48,6 @@ }; &i2c0 { - clock-div = <2>; pinctrl-names = "default"; pinctrl-0 = <&i2c0_pins_a>; status = "okay";
@@ -157,7 +156,6 @@ }; &i2c2 { - clock-div = <2>; pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins_a>; status = "okay";
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 67/462 arm64: dts: mediatek: mt8516: reserve 192 KiB for TF-A
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Val Packett <[email protected]>
[ Upstream commit 2561c7d5d497b988deccc36fe5eac7fd50b937f8 ]
The Android DTB for the related MT8167 reserves 0x30000. This is likely correct for MT8516 Android devices as well, and there's never any harm in reserving 64KiB more.
--- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt8516.dtsi +2 -2
@@ -144,10 +144,10 @@ #size-cells = <2>; ranges; - /* 128 KiB reserved for ARM Trusted Firmware (BL31) */ + /* 192 KiB reserved for ARM Trusted Firmware (BL31) */ bl31_secmon_reserved: secmon@43000000 { no-map; - reg = <0 0x43000000 0 0x20000>; + reg = <0 0x43000000 0 0x30000>; }; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 68/462 RDMA/mlx4: Avoid false error about access to uninitialized gids array
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
[ Upstream commit 1f53d88cbb0dcc7df235bf6611ae632b254fccd8 ]
Smatch generates the following false error report:drivers/infiniband/hw/mlx4/main.c:393 mlx4_ib_del_gid() error: uninitialized symbol 'gids'.
Traditionally, we are not changing kernel code and asking people to fix the tools. However in this case, the fix can be done by simply rearranging the code to be more clear.
--- drivers/infiniband/hw/mlx4/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/mlx4/main.c +3 -3
@@ -391,10 +391,10 @@ static int mlx4_ib_del_gid(const struct ib_gid_attr *attr, void **context) }spin_unlock_bh (&iboe->lock); -if (!ret && hw_update) { +if (gids) ret =mlx4_ib_update_gids (gids, ibdev, attr->port_num); -kfree (gids); - } + +kfree (gids);return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 69/462 rdma/cxgb4: Prevent potential integer overflow on 32bit
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit bd96a3935e89486304461a21752f824fc25e0f0b ]
The "gl->tot_len" variable is controlled by the user. It comes from process_responses(). On 32bit systems, the "gl->tot_len + sizeof(struct cpl_pass_accept_req) + sizeof(struct rss_header)" addition could have an integer wrapping bug. Use size_add() to prevent this.
--- drivers/infiniband/hw/cxgb4/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/cxgb4/device.c +4 -2
@@ -1114,8 +1114,10 @@ static inline struct sk_buff *copy_gl_to_skb_pkt(const struct pkt_gl *gl,* The math here assumes sizeof cpl_pass_accept_req >= sizeof * cpl_rx_pkt. */ - skb =alloc_skb (gl->tot_len +sizeof (struct cpl_pass_accept_req ) + -sizeof (struct rss_header ) - pktshift,GFP_ATOMIC ); + skb =alloc_skb (size_add (gl->tot_len, +sizeof (struct cpl_pass_accept_req ) + +sizeof (struct rss_header )) - pktshift, +GFP_ATOMIC );if (unlikely (!skb))return NULL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 70/462 arm64: dts: mediatek: mt8173-evb: Drop regulator-compatible property
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit a6d5983e40f5d5b219337569cdd269727f5a3e2e ]
The "regulator-compatible" property has been deprecated since 2012 in commit 13511def87b9 ("regulator: deprecate regulator-compatible DT property"), which is so old it's not even mentioned in the converted regulator bindings YAML file. It is also not listed in the MT6397 regulator bindings. Having them present produces a whole bunch of validation errors:
Unevaluated properties are not allowed ('regulator-compatible' was unexpected)
Drop the "regulator-compatible" property from the board dts. The property values are the same as the node name, so everything should continue to work.
--- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 23 --------------------- 1 file changed, 23 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173-evb.dts +0 -23
@@ -307,7 +307,6 @@ compatible = "mediatek,mt6397-regulator"; mt6397_vpca15_reg: buck_vpca15 { - regulator-compatible = "buck_vpca15"; regulator-name = "vpca15"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -316,7 +315,6 @@ }; mt6397_vpca7_reg: buck_vpca7 { - regulator-compatible = "buck_vpca7"; regulator-name = "vpca7"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -325,7 +323,6 @@ }; mt6397_vsramca15_reg: buck_vsramca15 { - regulator-compatible = "buck_vsramca15"; regulator-name = "vsramca15"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -334,7 +331,6 @@ }; mt6397_vsramca7_reg: buck_vsramca7 { - regulator-compatible = "buck_vsramca7"; regulator-name = "vsramca7"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -343,7 +339,6 @@ }; mt6397_vcore_reg: buck_vcore { - regulator-compatible = "buck_vcore"; regulator-name = "vcore"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -352,7 +347,6 @@ }; mt6397_vgpu_reg: buck_vgpu { - regulator-compatible = "buck_vgpu"; regulator-name = "vgpu"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -361,7 +355,6 @@ }; mt6397_vdrm_reg: buck_vdrm { - regulator-compatible = "buck_vdrm"; regulator-name = "vdrm"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1400000>;
@@ -370,7 +363,6 @@ }; mt6397_vio18_reg: buck_vio18 { - regulator-compatible = "buck_vio18"; regulator-name = "vio18"; regulator-min-microvolt = <1620000>; regulator-max-microvolt = <1980000>;
@@ -379,19 +371,16 @@ }; mt6397_vtcxo_reg: ldo_vtcxo { - regulator-compatible = "ldo_vtcxo"; regulator-name = "vtcxo"; regulator-always-on; }; mt6397_va28_reg: ldo_va28 { - regulator-compatible = "ldo_va28"; regulator-name = "va28"; regulator-always-on; }; mt6397_vcama_reg: ldo_vcama { - regulator-compatible = "ldo_vcama"; regulator-name = "vcama"; regulator-min-microvolt = <1500000>; regulator-max-microvolt = <2800000>;
@@ -399,18 +388,15 @@ }; mt6397_vio28_reg: ldo_vio28 { - regulator-compatible = "ldo_vio28"; regulator-name = "vio28"; regulator-always-on; }; mt6397_vusb_reg: ldo_vusb { - regulator-compatible = "ldo_vusb"; regulator-name = "vusb"; }; mt6397_vmc_reg: ldo_vmc { - regulator-compatible = "ldo_vmc"; regulator-name = "vmc"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>;
@@ -418,7 +404,6 @@ }; mt6397_vmch_reg: ldo_vmch { - regulator-compatible = "ldo_vmch"; regulator-name = "vmch"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3300000>;
@@ -426,7 +411,6 @@ }; mt6397_vemc_3v3_reg: ldo_vemc3v3 { - regulator-compatible = "ldo_vemc3v3"; regulator-name = "vemc_3v3"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3300000>;
@@ -434,7 +418,6 @@ }; mt6397_vgp1_reg: ldo_vgp1 { - regulator-compatible = "ldo_vgp1"; regulator-name = "vcamd"; regulator-min-microvolt = <1220000>; regulator-max-microvolt = <3300000>;
@@ -442,7 +425,6 @@ }; mt6397_vgp2_reg: ldo_vgp2 { - regulator-compatible = "ldo_vgp2"; regulator-name = "vcamio"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <3300000>;
@@ -450,7 +432,6 @@ }; mt6397_vgp3_reg: ldo_vgp3 { - regulator-compatible = "ldo_vgp3"; regulator-name = "vcamaf"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <3300000>;
@@ -458,7 +439,6 @@ }; mt6397_vgp4_reg: ldo_vgp4 { - regulator-compatible = "ldo_vgp4"; regulator-name = "vgp4"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <3300000>;
@@ -466,7 +446,6 @@ }; mt6397_vgp5_reg: ldo_vgp5 { - regulator-compatible = "ldo_vgp5"; regulator-name = "vgp5"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <3000000>;
@@ -474,7 +453,6 @@ }; mt6397_vgp6_reg: ldo_vgp6 { - regulator-compatible = "ldo_vgp6"; regulator-name = "vgp6"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <3300000>;
@@ -482,7 +460,6 @@ }; mt6397_vibr_reg: ldo_vibr { - regulator-compatible = "ldo_vibr"; regulator-name = "vibr"; regulator-min-microvolt = <1300000>; regulator-max-microvolt = <3300000>;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 71/462 arm64: dts: mediatek: mt8173-elm: Drop regulator-compatible property
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit 4b907b3ea5fba240808136cc5599d14b52230b39 ]
The "regulator-compatible" property has been deprecated since 2012 in commit 13511def87b9 ("regulator: deprecate regulator-compatible DT property"), which is so old it's not even mentioned in the converted regulator bindings YAML file. It is also not listed in the MT6397 regulator bindings. Having them present produces a whole bunch of validation errors:
Unevaluated properties are not allowed ('regulator-compatible' was unexpected)
Drop the "regulator-compatible" property from the board dts. The property values are the same as the node name, so everything should continue to work.
--- arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 23 -------------------- 1 file changed, 23 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi +0 -23
@@ -921,7 +921,6 @@ compatible = "mediatek,mt6397-regulator"; mt6397_vpca15_reg: buck_vpca15 { - regulator-compatible = "buck_vpca15"; regulator-name = "vpca15"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -931,7 +930,6 @@ }; mt6397_vpca7_reg: buck_vpca7 { - regulator-compatible = "buck_vpca7"; regulator-name = "vpca7"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -941,7 +939,6 @@ }; mt6397_vsramca15_reg: buck_vsramca15 { - regulator-compatible = "buck_vsramca15"; regulator-name = "vsramca15"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -950,7 +947,6 @@ }; mt6397_vsramca7_reg: buck_vsramca7 { - regulator-compatible = "buck_vsramca7"; regulator-name = "vsramca7"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -959,7 +955,6 @@ }; mt6397_vcore_reg: buck_vcore { - regulator-compatible = "buck_vcore"; regulator-name = "vcore"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -968,7 +963,6 @@ }; mt6397_vgpu_reg: buck_vgpu { - regulator-compatible = "buck_vgpu"; regulator-name = "vgpu"; regulator-min-microvolt = < 700000>; regulator-max-microvolt = <1350000>;
@@ -977,7 +971,6 @@ }; mt6397_vdrm_reg: buck_vdrm { - regulator-compatible = "buck_vdrm"; regulator-name = "vdrm"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1400000>;
@@ -986,7 +979,6 @@ }; mt6397_vio18_reg: buck_vio18 { - regulator-compatible = "buck_vio18"; regulator-name = "vio18"; regulator-min-microvolt = <1620000>; regulator-max-microvolt = <1980000>;
@@ -995,18 +987,15 @@ }; mt6397_vtcxo_reg: ldo_vtcxo { - regulator-compatible = "ldo_vtcxo"; regulator-name = "vtcxo"; regulator-always-on; }; mt6397_va28_reg: ldo_va28 { - regulator-compatible = "ldo_va28"; regulator-name = "va28"; }; mt6397_vcama_reg: ldo_vcama { - regulator-compatible = "ldo_vcama"; regulator-name = "vcama"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
@@ -1014,18 +1003,15 @@ }; mt6397_vio28_reg: ldo_vio28 { - regulator-compatible = "ldo_vio28"; regulator-name = "vio28"; regulator-always-on; }; mt6397_vusb_reg: ldo_vusb { - regulator-compatible = "ldo_vusb"; regulator-name = "vusb"; }; mt6397_vmc_reg: ldo_vmc { - regulator-compatible = "ldo_vmc"; regulator-name = "vmc"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>;
@@ -1033,7 +1019,6 @@ }; mt6397_vmch_reg: ldo_vmch { - regulator-compatible = "ldo_vmch"; regulator-name = "vmch"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3300000>;
@@ -1041,7 +1026,6 @@ }; mt6397_vemc_3v3_reg: ldo_vemc3v3 { - regulator-compatible = "ldo_vemc3v3"; regulator-name = "vemc_3v3"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3300000>;
@@ -1049,7 +1033,6 @@ }; mt6397_vgp1_reg: ldo_vgp1 { - regulator-compatible = "ldo_vgp1"; regulator-name = "vcamd"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
@@ -1057,7 +1040,6 @@ }; mt6397_vgp2_reg: ldo_vgp2 { - regulator-compatible = "ldo_vgp2"; regulator-name = "vcamio"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>;
@@ -1065,7 +1047,6 @@ }; mt6397_vgp3_reg: ldo_vgp3 { - regulator-compatible = "ldo_vgp3"; regulator-name = "vcamaf"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
@@ -1073,7 +1054,6 @@ }; mt6397_vgp4_reg: ldo_vgp4 { - regulator-compatible = "ldo_vgp4"; regulator-name = "vgp4"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <3300000>;
@@ -1081,7 +1061,6 @@ }; mt6397_vgp5_reg: ldo_vgp5 { - regulator-compatible = "ldo_vgp5"; regulator-name = "vgp5"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <3000000>;
@@ -1089,7 +1068,6 @@ }; mt6397_vgp6_reg: ldo_vgp6 { - regulator-compatible = "ldo_vgp6"; regulator-name = "vgp6"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>;
@@ -1098,7 +1076,6 @@ }; mt6397_vibr_reg: ldo_vibr { - regulator-compatible = "ldo_vibr"; regulator-name = "vibr"; regulator-min-microvolt = <1300000>; regulator-max-microvolt = <3300000>;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 72/462 arm64: dts: mediatek: mt8173-elm: Fix MT6397 PMIC sub-node names
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit beb06b727194f68b0a4b5183e50c88265ce185af ]
The MT6397 PMIC bindings specify exact names for its sub-nodes. The names used in the current dts don't match, causing a validation error.
Fix up the names. Also drop the label for the regulators node, since any reference should be against the individual regulator sub-nodes.
--- arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi +3 -3
@@ -905,7 +905,7 @@ interrupt-controller; #interrupt-cells = <2>; - clock: mt6397clock { + clock: clocks { compatible = "mediatek,mt6397-clk"; #clock-cells = <1>; };
@@ -917,7 +917,7 @@ #gpio-cells = <2>; }; - regulator: mt6397regulator { + regulators { compatible = "mediatek,mt6397-regulator"; mt6397_vpca15_reg: buck_vpca15 {
@@ -1083,7 +1083,7 @@ }; }; - rtc: mt6397rtc { + rtc: rtc { compatible = "mediatek,mt6397-rtc"; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 73/462 arm64: dts: mediatek: mt8173-evb: Fix MT6397 PMIC sub-node names
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit 9545ba142865b9099d43c972b9ebcf463606499a ]
The MT6397 PMIC bindings specify exact names for its sub-nodes. The names used in the current dts don't match, causing a validation error.
Fix up the names. Also drop the label for the regulators node, since any reference should be against the individual regulator sub-nodes.
--- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8173-evb.dts +1 -1
@@ -303,7 +303,7 @@ interrupt-controller; #interrupt-cells = <2>; - mt6397regulator: mt6397regulator { + regulators { compatible = "mediatek,mt6397-regulator"; mt6397_vpca15_reg: buck_vpca15 {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 74/462 arm64: dts: qcom: msm8916: correct sleep clock frequency
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit f088b921890cef28862913e5627bb2e2b5f82125 ]
The MSM8916 platform uses PM8916 to provide sleep clock. According to the documentation, that clock has 32.7645 kHz frequency. Correct the sleep clock definition.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +1 -1
@@ -104,7 +104,7 @@ sleep_clk: sleep-clk { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <32768>; + clock-frequency = <32764>; }; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 75/462 arm64: dts: qcom: msm8994: correct sleep clock frequency
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit a4148d869d47d8c86da0291dd95d411a5ebe90c8 ]
The MSM8994 platform uses PM8994/6 to provide sleep clock. According to the documentation, that clock has 32.7645 kHz frequency. Correct the sleep clock definition.
--- arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8994.dtsi +1 -1
@@ -24,7 +24,7 @@ sleep_clk: sleep-clk { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <32768>; + clock-frequency = <32764>; clock-output-names = "sleep_clk"; }; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 76/462 arm64: dts: qcom: sm8250: correct sleep clock frequency
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 75420e437eed69fa95d1d7c339dad86dea35319a ]
The SM8250 platform uses PM8150 to provide sleep clock. According to the documentation, that clock has 32.7645 kHz frequency. Correct the sleep clock definition.
--- arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +1 -1
@@ -75,7 +75,7 @@ sleep_clk: sleep-clk { compatible = "fixed-clock"; - clock-frequency = <32768>; + clock-frequency = <32764>; #clock-cells = <0>; }; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 77/462 ARM: dts: mediatek: mt7623: fix IR nodename
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafał Miłecki <[email protected]>
[ Upstream commit 90234cf9b37c57201a24b78c217a91a8af774109 ]
Fix following validation error:arch/arm/boot/dts/mediatek/mt7623a-rfb-emmc.dtb: cir@10013000: $nodename:0: 'cir@10013000' does not match '^ir(-receiver)?(@[a-f0-9]+)?$'
from schema $id: http://devicetree.org/schemas/media/mediatek,mt7622-cir.yaml#
--- arch/arm/boot/dts/mt7623.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/mt7623.dtsi +1 -1
@@ -309,7 +309,7 @@ clock-names = "spi", "wrap"; }; - cir: cir@10013000 { + cir: ir-receiver@10013000 { compatible = "mediatek,mt7623-cir"; reg = <0 0x10013000 0 0x1000>; interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/462 fbdev: omapfb: Fix an OF node leak in dss_of_port_get_parent_device()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit de124b61e179e690277116e6be512e4f422b5dd8 ]
dss_of_port_get_parent_device() leaks an OF node reference when i >= 2 and struct device_node *np is present. Since of_get_next_parent() obtains a reference of the returned OF node, call of_node_put() before returning NULL.
This was found by an experimental verifier that I am developing, and no runtime test was able to be performed due to that lack of actual devices.
--- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 1 + 1 file changed, 1 insertion(+)
drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +1 -0
@@ -102,6 +102,7 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port) np =of_get_next_parent (np); } +of_node_put (np);return NULL ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/462 media: rc: iguanair: handle timeouts
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
[ Upstream commit b98d5000c50544f14bacb248c34e5219fbe81287 ]
In case of a timeout the IO must be cancelled or the next IO using the URB will fail and/or overwrite an operational URB.
The automatic bisection fails because it arrives
at a commit that correctly lets the test case run
without an error.
--- drivers/media/rc/iguanair.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/rc/iguanair.c +3 -1
@@ -197,8 +197,10 @@ static int iguanair_send(struct iguanair *ir, unsigned size)if (rc)return rc; -if (wait_for_completion_timeout (&ir->completion,TIMEOUT ) ==0 ) +if (wait_for_completion_timeout (&ir->completion,TIMEOUT ) ==0 ) { +usb_kill_urb (ir->urb_out);return -ETIMEDOUT ; + }return rc; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/462 media: lmedm04: Use GFP_KERNEL for URB allocation/submission.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Malcolm Priestley <[email protected]>
[ Upstream commit add5861769f912af0181f5fbd79dbf19c8211c20 ]
lme2510_int_read is not atomically called so use GFP_KERNEL for usb_alloc_urb and usb_submit_urb which is the first in the chain of interrupt submissions.
Stable-dep-of: a2836d3fe220 ("media: lmedm04: Handle errors for lme2510_int_read")
--- drivers/media/usb/dvb-usb-v2/lmedm04.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/dvb-usb-v2/lmedm04.c +2 -2
@@ -373,7 +373,7 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)struct lme2510_state *lme_int =adap_to_priv (adap);struct usb_host_endpoint *ep; - lme_int->lme_urb =usb_alloc_urb (0 ,GFP_ATOMIC ); + lme_int->lme_urb =usb_alloc_urb (0 ,GFP_KERNEL );if (lme_int->lme_urb ==NULL )return -ENOMEM ;
@@ -393,7 +393,7 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)if (usb_endpoint_type (&ep->desc) ==USB_ENDPOINT_XFER_BULK ) lme_int->lme_urb->pipe =usb_rcvbulkpipe (d->udev,0xa ); -usb_submit_urb (lme_int->lme_urb,GFP_ATOMIC ); +usb_submit_urb (lme_int->lme_urb,GFP_KERNEL );info ("INT Interrupt Service Started" );return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/462 media: lmedm04: Handle errors for lme2510_int_read
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ni <[email protected]>
[ Upstream commit a2836d3fe220220ff8c495ca9722f89cea8a67e7 ]
Add check for the return value of usb_pipe_endpoint() and usb_submit_urb() in order to catch the errors.
--- drivers/media/usb/dvb-usb-v2/lmedm04.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/media/usb/dvb-usb-v2/lmedm04.c +11 -1
@@ -372,6 +372,7 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)struct dvb_usb_device *d =adap_to_d (adap);struct lme2510_state *lme_int =adap_to_priv (adap);struct usb_host_endpoint *ep; +int ret; lme_int->lme_urb =usb_alloc_urb (0 ,GFP_KERNEL );
@@ -389,11 +390,20 @@ static int lme2510_int_read(struct dvb_usb_adapter *adap)/* Quirk of pipe reporting PIPE_BULK but behaves as interrupt */ ep =usb_pipe_endpoint (d->udev, lme_int->lme_urb->pipe); +if (!ep) { +usb_free_urb (lme_int->lme_urb); +return -ENODEV ; + }if (usb_endpoint_type (&ep->desc) ==USB_ENDPOINT_XFER_BULK ) lme_int->lme_urb->pipe =usb_rcvbulkpipe (d->udev,0xa ); -usb_submit_urb (lme_int->lme_urb,GFP_KERNEL ); + ret =usb_submit_urb (lme_int->lme_urb,GFP_KERNEL ); +if (ret) { +usb_free_urb (lme_int->lme_urb); +return ret; + } +info ("INT Interrupt Service Started" );return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 82/462 PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
[ Upstream commit d4929755e4d02bd3de3ae5569dab69cb9502c54f ]
The devm_pci_epc_destroy() comment says destroys the EPC device, but it does not actually do that since devres_destroy() does not call devm_pci_epc_release(), and it also can not fully undo what the API devm_pci_epc_create() does, so it is faulty.
Fortunately, the faulty API has not been used by current kernel tree. Use devres_release() instead of devres_destroy() so the EPC device will be released.
--- drivers/pci/endpoint/pci-epc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/pci-epc-core.c +1 -1
@@ -616,7 +616,7 @@ void devm_pci_epc_destroy(struct device *dev, struct pci_epc *epc) {int r; - r =devres_destroy (dev, devm_pci_epc_release, devm_pci_epc_match, + r =devres_release (dev, devm_pci_epc_release, devm_pci_epc_match, epc);dev_WARN_ONCE (dev, r,"couldn't find PCI EPC resource\n" ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 83/462 media: marvell: Add check for clk_enable()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiasheng Jiang <[email protected]>
[ Upstream commit 11f68d2ba2e1521a608af773bf788e8cfa260f68 ]
Add check for the return value of clk_enable() to guarantee the success.
--- drivers/media/platform/marvell-ccic/mcam-core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/platform/marvell-ccic/mcam-core.c +6 -1
@@ -935,7 +935,12 @@ static int mclk_enable(struct clk_hw *hw) ret =pm_runtime_resume_and_get (cam->dev);if (ret <0 )return ret; -clk_enable (cam->clk[0 ]); + ret =clk_enable (cam->clk[0 ]); +if (ret) { +pm_runtime_put (cam->dev); +return ret; + } +mcam_reg_write (cam,REG_CLKCTRL , (mclk_src <<29 ) | mclk_div);mcam_ctlr_power_up (cam);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/462 media: mipi-csis: Add check for clk_enable()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiasheng Jiang <[email protected]>
[ Upstream commit 125ad1aeec77eb55273b420be6894b284a01e4b6 ]
Add check for the return value of clk_enable() to gurantee the success.
--- drivers/media/platform/exynos4-is/mipi-csis.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/media/platform/exynos4-is/mipi-csis.c +8 -2
@@ -939,13 +939,19 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime) state->supplies); goto unlock; } -clk_enable (state->clock[CSIS_CLK_GATE ]); + ret =clk_enable (state->clock[CSIS_CLK_GATE ]); +if (ret) { +phy_power_off (state->phy); +regulator_bulk_disable (CSIS_NUM_SUPPLIES , + state->supplies); + goto unlock; + } }if (state->flags &ST_STREAMING )s5pcsis_start_stream (state); state->flags &= ~ST_SUSPENDED ; - unlock: +unlock:mutex_unlock (&state->lock);return ret ? -EAGAIN :0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 85/462 media: camif-core: Add check for clk_enable()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiasheng Jiang <[email protected]>
[ Upstream commit 77ed2470ac09c2b0a33cf3f98cc51d18ba9ed976 ]
Add check for the return value of clk_enable() to gurantee the success.
--- drivers/media/platform/s3c-camif/camif-core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/media/platform/s3c-camif/camif-core.c +11 -2
@@ -529,10 +529,19 @@ static int s3c_camif_remove(struct platform_device *pdev)static int s3c_camif_runtime_resume (struct device *dev) {struct camif_dev *camif =dev_get_drvdata (dev); +int ret; + + ret =clk_enable (camif->clock[CLK_GATE ]); +if (ret) +return ret; -clk_enable (camif->clock[CLK_GATE ]);/* null op on s3c244x */ -clk_enable (camif->clock[CLK_CAM ]); + ret =clk_enable (camif->clock[CLK_CAM ]); +if (ret) { +clk_disable (camif->clock[CLK_GATE ]); +return ret; + } +return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 86/462 media: uvcvideo: Propagate buf->error to userspace
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 87ce177654e388451850905a1d376658aebe8699 ]
Now we return VB2_BUF_STATE_DONE for valid and invalid frames. Propagate the correct value, so the user can know if the frame is valid or not via struct v4l2_buffer->flags.
--- drivers/media/usb/uvc/uvc_queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/usb/uvc/uvc_queue.c +2 -1
@@ -486,7 +486,8 @@ static void uvc_queue_buffer_complete(struct kref *ref) buf->state = buf->error ?UVC_BUF_STATE_ERROR :UVC_BUF_STATE_DONE ;vb2_set_plane_payload (&buf->buf.vb2_buf,0 , buf->bytesused); -vb2_buffer_done (&buf->buf.vb2_buf,VB2_BUF_STATE_DONE ); +vb2_buffer_done (&buf->buf.vb2_buf, buf->error ?VB2_BUF_STATE_ERROR : +VB2_BUF_STATE_DONE ); }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 87/462 mtd: hyperbus: hbmc-am654: fix an OF node reference leak
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit bf5821909eb9c7f5d07d5c6e852ead2c373c94a0 ]
In am654_hbmc_platform_driver, .remove() and the error path of .probe() do not decrement the refcount of an OF node obtained by
of_get_next_child(). Fix this by adding of_node_put() calls.
--- drivers/mtd/hyperbus/hbmc-am654.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/mtd/hyperbus/hbmc-am654.c +13 -6
@@ -174,26 +174,30 @@ static int am654_hbmc_probe(struct platf priv->hbdev.np =of_get_next_child (np,NULL ); ret =of_address_to_resource (priv->hbdev.np,0 , &res);if (ret) -return ret; + goto put_node;if (of_property_read_bool (dev->of_node,"mux-controls" )) {struct mux_control *control =devm_mux_control_get (dev,NULL ); -if (IS_ERR (control)) -return PTR_ERR (control); +if (IS_ERR (control)) { + ret =PTR_ERR (control); + goto put_node; + } ret =mux_control_select (control,1 );if (ret) {dev_err (dev,"Failed to select HBMC mux\n" ); -return ret; + goto put_node; } priv->mux_ctrl = control; } priv->hbdev.map.size =resource_size (&res); priv->hbdev.map.virt =devm_ioremap_resource (dev, &res); -if (IS_ERR (priv->hbdev.map.virt)) -return PTR_ERR (priv->hbdev.map.virt); +if (IS_ERR (priv->hbdev.map.virt)) { + ret =PTR_ERR (priv->hbdev.map.virt); + goto disable_mux; + } priv->ctlr.dev = dev; priv->ctlr.ops = &am654_hbmc_ops;
@@ -226,6 +230,8 @@ release_dma: disable_mux:if (priv->mux_ctrl)mux_control_deselect (priv->mux_ctrl); +put_node: +of_node_put (priv->hbdev.np);return ret; }
@@ -241,6 +247,7 @@ static int am654_hbmc_remove(struct platif (dev_priv->rx_chan)dma_release_channel (dev_priv->rx_chan); +of_node_put (priv->hbdev.np);return ret; }
Greg Kroah-Hartman
maintainerPATCH 88/462 staging: media: imx: fix OF node leak in imx_media_add_of_subdevs()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 094f5c315f756b19198e6c401aa821ac0e868750 ]
imx_media_add_of_subdevs() calls of_parse_phandle() and passes the obtained node to imx_media_of_add_csi(). The passed node is used in v4l2_async_nf_add_fwnode(), which increments the refcount of the node. Therefore, while the current implementation only releases the node when imx_media_of_add_csi() fails, but should always release it. Call of_node_put() right after imx_media_of_add_csi().
--- drivers/staging/media/imx/imx-media-of.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/media/imx/imx-media-of.c +2 -6
@@ -55,22 +55,18 @@ int imx_media_add_of_subdevs(struct imx_media_dev *imxmd,break ; ret =imx_media_of_add_csi (imxmd, csi_np); +of_node_put (csi_np);if (ret) {/* unavailable or already added is not an error */ if (ret == -ENODEV || ret == -EEXIST ) { -of_node_put (csi_np);continue ; }/* other error, can't continue */ - goto err_out; +return ret; } }return 0 ; - -err_out: -of_node_put (csi_np); -return ret; }EXPORT_SYMBOL_GPL (imx_media_add_of_subdevs);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 89/462 PCI: rcar-ep: Fix incorrect variable used when calling devm_request_mem_region()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: King Dix <[email protected]>
[ Upstream commit 2d2da5a4c1b4509f6f7e5a8db015cd420144beb4 ]
The rcar_pcie_parse_outbound_ranges() uses the devm_request_mem_region() macro to request a needed resource. A string variable that lives on the stack is then used to store a dynamically computed resource name, which is then passed on as one of the macro arguments. This can lead to undefined behavior.
Depending on the current contents of the memory, the manifestations of errors may vary. One possible output may be as follows:
$ cat /proc/iomem 30000000-37ffffff : 38000000-3fffffff :
Sometimes, garbage may appear after the colon.
In very rare cases, if no NULL-terminator is found in memory, the system might crash because the string iterator will overrun which can lead to access of unmapped memory above the stack.
Thus, fix this by replacing outbound_name with the name of the previously requested resource. With the changes applied, the output will be as follows:
$ cat /proc/iomem 30000000-37ffffff : memory2 38000000-3fffffff : memory3
--- drivers/pci/controller/pcie-rcar-ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pcie-rcar-ep.c +1 -1
@@ -110,7 +110,7 @@ static int rcar_pcie_parse_outbound_ranges(struct rcar_pcie_endpoint *ep, }if (!devm_request_mem_region (&pdev->dev, res->start,resource_size (res), - outbound_name)) { + res->name)) {dev_err (pcie->dev,"Cannot request memory region %s.\n" , outbound_name);return -EIO ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 90/462 scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Menzel <[email protected]>
[ Upstream commit ad7c3c0cb8f61d6d5a48b83e62ca4a9fd2f26153 ]
Currently, the code does:
if (x == 0) {
x &= ~0x3;
x |= 0x1;
}Zeroing bits 0 and 1 of a variable that is 0 is not necessary. So directly set the variable to 1.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +1 -2
@@ -4771,8 +4771,7 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)if (!ioc->is_gen35_ioc && ioc->manu_pg11.EEDPTagMode ==0 ) {pr_err ("%s: overriding NVDATA EEDPTagMode setting\n" , ioc->name); - ioc->manu_pg11.EEDPTagMode &= ~0x3 ; - ioc->manu_pg11.EEDPTagMode |=0x1 ; + ioc->manu_pg11.EEDPTagMode =0x1 ;mpt3sas_config_set_manufacturing_pg11 (ioc, &mpi_reply, &ioc->manu_pg11); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 91/462 scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <[email protected]>
[ Upstream commit fcf247deb3c3e1c6be5774e3fa03bbd018eff1a9 ]
We should remove the bsg device when bsg_setup_queue() fails to release the resources.
--- drivers/scsi/ufs/ufs_bsg.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/ufs/ufs_bsg.c +1 -0
@@ -213,6 +213,7 @@ int ufs_bsg_probe(struct ufs_hba *hba) q =bsg_setup_queue (bsg_dev,dev_name (bsg_dev), ufs_bsg_request,NULL ,0 );if (IS_ERR (q)) { ret =PTR_ERR (q); +device_del (bsg_dev); goto out; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 92/462 ocfs2: mark dquot as inactive if failed to start trans while releasing dquot
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Su Yue <[email protected]>
[ Upstream commit 276c61385f6bc3223a5ecd307cf4aba2dfbb9a31 ]
While running fstests generic/329, the kernel workqueue quota_release_workfn is dead looping in calling ocfs2_release_dquot(). The ocfs2 state is already readonly but ocfs2_release_dquot wants to start a transaction but fails and returns.
=====================================================================
[ 2918.123602 ][ T275 ] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
[ 2918.124034 ][ T275 ] (kworker/u135:1,275,11):ocfs2_release_dquot:765
ERROR: status = -30
[ 2918.124452 ][ T275 ] (kworker/u135:1,275,11):ocfs2_release_dquot:795
ERROR: status = -30
[ 2918.124883 ][ T275 ] (kworker/u135:1,275,11):ocfs2_start_trans:357
ERROR: status = -30
[ 2918.125276 ][ T275 ] OCFS2: abort (device dm-0): ocfs2_start_trans:
Detected aborted journal
[ 2918.125710 ][ T275 ] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
=====================================================================
ocfs2_release_dquot() is much like dquot_release(), which is called by ext4 to handle similar situation. So here fix it by marking the dquot as inactive like what dquot_release() does.
--- fs/ocfs2/quota_global.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/ocfs2/quota_global.c +5 -0
@@ -749,6 +749,11 @@ static int ocfs2_release_dquot(struct dquot *dquot) handle =ocfs2_start_trans (osb,ocfs2_calc_qdel_credits (dquot->dq_sb, dquot->dq_id.type));if (IS_ERR (handle)) { +/* +* Mark dquot as inactive to avoid endless cycle in +* quota_release_workfn(). +*/ +clear_bit (DQ_ACTIVE_B , &dquot->dq_flags); status =PTR_ERR (handle);mlog_errno (status); goto out_ilock;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 93/462 module: Extend the preempt disabled section in dereference_symbol_descriptor().
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit a145c848d69f9c6f32008d8319edaa133360dd74 ]
dereference_symbol_descriptor() needs to obtain the module pointer belonging to pointer in order to resolve that pointer.
The returned mod pointer is obtained under RCU-sched/ preempt_disable() guarantees and needs to be used within this section to ensure that the module is not removed in the meantime.
Extend the preempt_disable() section to also cover dereference_module_function_descriptor().
--- include/linux/kallsyms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kallsyms.h +1 -1
@@ -63,10 +63,10 @@ static inline void *dereference_symbol_descriptor(void *ptr)preempt_disable (); mod =__module_address ((unsigned long )ptr); -preempt_enable ();if (mod) ptr =dereference_module_function_descriptor (mod, ptr); +preempt_enable ();#endif return ptr; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/462 NFSv4.2: fix COPY_NOTIFY xdr buf size calculation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olga Kornievskaia <[email protected]>
[ Upstream commit e8380c2d06055665b3df6c03964911375d7f9290 ]
We need to include sequence size in the compound.
--- fs/nfs/nfs42xdr.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/nfs42xdr.c +2 -0
@@ -122,9 +122,11 @@ decode_putfh_maxsz + \ decode_offload_cancel_maxsz)#define NFS4_enc_copy_notify_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_copy_notify_maxsz)#define NFS4_dec_copy_notify_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_copy_notify_maxsz)#define NFS4_enc_deallocate_sz (compound_encode_hdr_maxsz + \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 95/462 tools/bootconfig: Fix the wrong format specifier
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luo Yifan <[email protected]>
[ Upstream commit f6ab7384d554ba80ff4793259d75535874b366f5 ]
Use '%u' instead of '%d' for unsigned int.
--- tools/bootconfig/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/bootconfig/main.c +2 -2
@@ -207,7 +207,7 @@ static int load_xbc_from_initrd(int fd, char **buf)/* Wrong Checksum */ rcsum =checksum ((unsigned char *)*buf, size);if (csum != rcsum) { -pr_err ("checksum error: %d != %d\n" , csum, rcsum); +pr_err ("checksum error: %u != %u\n" , csum, rcsum);return -EINVAL ; }
@@ -375,7 +375,7 @@ static int apply_xbc(const char *path, const char *xbc_path)printf ("Apply %s to %s\n" , xbc_path, path);printf ("\tNumber of nodes: %d\n" , ret);printf ("\tSize: %u bytes\n" , (unsigned int )size); -printf ("\tChecksum: %d\n" , (unsigned int )csum); +printf ("\tChecksum: %u\n" , (unsigned int )csum);/* TODO: Check the options by schema */ xbc_destroy_all ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 96/462 xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianbo Liu <[email protected]>
[ Upstream commit c05c5e5aa163f4682ca97a2f0536575fc7dbdecb ]
When skb needs GSO and wrap around happens, if xo->seq.low (seqno of the first skb segment) is before the last seq number but oseq (seqno of the last segment) is after it, xo->seq.low is still bigger than replay_esn->oseq while oseq is smaller than it, so the update of replay_esn->oseq_hi is missed for this case wrap around because of the change in the cited commit.
For example, if sending a packet with gso_segs=3 while old replay_esn->oseq=0xfffffffe, we calculate:
xo->seq.low = 0xfffffffe + 1 = 0x0xffffffff
oseq = 0xfffffffe + 3 = 0x1(oseq < replay_esn->oseq) is true, but (xo->seq.low < replay_esn->oseq) is false, so replay_esn->oseq_hi is not incremented.
To fix this issue, change the outer checking back for the update of replay_esn->oseq_hi. And add new checking inside for the update of packet's oseq_hi.
--- net/xfrm/xfrm_replay.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/xfrm/xfrm_replay.c +6 -4
@@ -657,10 +657,12 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff oseq +=skb_shinfo (skb)->gso_segs; } -if (unlikely (xo->seq.low < replay_esn->oseq)) { -XFRM_SKB_CB (skb)->seq.output.hi = ++oseq_hi; - xo->seq.hi = oseq_hi; - replay_esn->oseq_hi = oseq_hi; +if (unlikely (oseq < replay_esn->oseq)) { + replay_esn->oseq_hi = ++oseq_hi; +if (xo->seq.low < replay_esn->oseq) { +XFRM_SKB_CB (skb)->seq.output.hi = oseq_hi; + xo->seq.hi = oseq_hi; + }if (replay_esn->oseq_hi ==0 ) { replay_esn->oseq--; replay_esn->oseq_hi--;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 97/462 dmaengine: ti: edma: fix OF node reference leaks in edma_driver
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit e883c64778e5a9905fce955681f8ee38c7197e0f ]
The .probe() of edma_driver calls of_parse_phandle_with_fixed_args() but does not release the obtained OF nodes. Thus add a of_node_put() call.
This bug was found by an experimental verification tool that I am developing.
--- drivers/dma/ti/edma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma/ti/edma.c +1 -2
@@ -217,7 +217,6 @@ struct edma_desc {struct edma_cc ;struct edma_tc { -struct device_node *node;u16 id; };
@@ -2524,13 +2523,13 @@ static int edma_probe(struct platform_device *pdev)if (ret || i == ecc->num_tc)break ; - ecc->tc_list[i].node = tc_args.np; ecc->tc_list[i].id = i; queue_priority_mapping[i][1 ] = tc_args.args[0 ];if (queue_priority_mapping[i][1 ] > lowest_priority) { lowest_priority = queue_priority_mapping[i][1 ]; info->default_queue = i; } +of_node_put (tc_args.np); }/* See if we have optional dma-channel-mask array */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 98/462 rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleksij Rempel <[email protected]>
[ Upstream commit 3ab8c5ed4f84fa20cd16794fe8dc31f633fbc70c ]
The nvmem interface supports variable buffer sizes, while the regmap interface operates with fixed-size storage. If an nvmem client uses a buffer size less than 4 bytes, regmap_read will write out of bounds as it expects the buffer to point at an unsigned int.
Fix this by using an intermediary unsigned int to hold the value.
--- drivers/rtc/rtc-pcf85063.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/rtc/rtc-pcf85063.c +10 -1
@@ -328,7 +328,16 @@ static const struct rtc_class_ops pcf85063_rtc_ops_alarm = {static int pcf85063_nvmem_read (void *priv,unsigned int offset,void *val,size_t bytes) { -return regmap_read (priv,PCF85063_REG_RAM , val); +unsigned int tmp; +int ret; + + ret =regmap_read (priv,PCF85063_REG_RAM , &tmp); +if (ret <0 ) +return ret; + + *(u8 *)val = tmp; + +return 0 ; } static int pcf85063_nvmem_write(void *priv, unsigned int offset,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 99/462 ubifs: skip dumping tnc tree when zroot is null
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: pangliyuan <[email protected]>
[ Upstream commit bdb0ca39e0acccf6771db49c3f94ed787d05f2d7 ]
Clearing slab cache will free all znode in memory and make c->zroot.znode = NULL, then dumping tnc tree will access c->zroot.znode which cause null pointer dereference.
--- fs/ubifs/debug.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
fs/ubifs/debug.c +13 -9
@@ -925,16 +925,20 @@ void ubifs_dump_tnc(struct ubifs_info *c)pr_err ("\n" );pr_err ("(pid %d) start dumping TNC tree\n" , current->pid); - znode =ubifs_tnc_levelorder_next (c, c->zroot.znode,NULL ); - level = znode->level; -pr_err ("== Level %d ==\n" , level); -while (znode) { -if (level != znode->level) { - level = znode->level; -pr_err ("== Level %d ==\n" , level); +if (c->zroot.znode) { + znode =ubifs_tnc_levelorder_next (c, c->zroot.znode,NULL ); + level = znode->level; +pr_err ("== Level %d ==\n" , level); +while (znode) { +if (level != znode->level) { + level = znode->level; +pr_err ("== Level %d ==\n" , level); + } +ubifs_dump_znode (c, znode); + znode =ubifs_tnc_levelorder_next (c, c->zroot.znode, znode); } -ubifs_dump_znode (c, znode); - znode =ubifs_tnc_levelorder_next (c, c->zroot.znode, znode); + }else { +pr_err ("empty TNC tree in memory\n" ); }pr_err ("(pid %d) finish dumping TNC tree\n" , current->pid); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 100/462 net: hns3: fix oops when unload drivers paralleling
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jian Shen <[email protected]>
[ Upstream commit 92e5995773774a3e70257e9c95ea03518268bea5 ]
When unload hclge driver, it tries to disable sriov first for each ae_dev node from hnae3_ae_dev_list. If user unloads hns3 driver at the time, because it removes all the ae_dev nodes, and it may cause oops.
But we can't simply use hnae3_common_lock for this. Because in the process flow of pci_disable_sriov(), it will trigger the remove flow of VF, which will also take hnae3_common_lock.
To fixes it, introduce a new mutex to protect the unload process.
--- drivers/net/ethernet/hisilicon/hns3/hnae3.c | 15 +++++++++++++++ drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 ++ 5 files changed, 23 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hnae3.c +15 -0
@@ -40,6 +40,21 @@ EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare);*/ static DEFINE_MUTEX (hnae3_common_lock); +/* ensure the drivers being unloaded one by one */ +static DEFINE_MUTEX (hnae3_unload_lock); + +void hnae3_acquire_unload_lock (void ) +{ +mutex_lock (&hnae3_unload_lock); +} +EXPORT_SYMBOL (hnae3_acquire_unload_lock); + +void hnae3_release_unload_lock (void ) +{ +mutex_unlock (&hnae3_unload_lock); +} +EXPORT_SYMBOL (hnae3_release_unload_lock); +static bool hnae3_client_match (enum hnae3_client_type client_type) { if (client_type == HNAE3_CLIENT_KNIC ||
drivers/net/ethernet/hisilicon/hns3/hnae3.h +2 -0
@@ -764,4 +764,6 @@ int hnae3_register_client(struct hnae3_client *client);void hnae3_set_client_init_flag (struct hnae3_client *client,struct hnae3_ae_dev *ae_dev,unsigned int inited); +void hnae3_acquire_unload_lock (void ); +void hnae3_release_unload_lock (void );#endif
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +2 -0
@@ -4751,9 +4751,11 @@ module_init(hns3_init_module);*/ static void __exit hns3_exit_module(void) { +hnae3_acquire_unload_lock ();pci_unregister_driver (&hns3_driver);hnae3_unregister_client (&client);hns3_dbg_unregister_debugfs (); +hnae3_release_unload_lock (); }module_exit (hns3_exit_module);
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +2 -0
@@ -11539,9 +11539,11 @@ static int hclge_init(void)static void hclge_exit (void ) { +hnae3_acquire_unload_lock ();hnae3_unregister_ae_algo_prepare (&ae_algo);hnae3_unregister_ae_algo (&ae_algo);destroy_workqueue (hclge_wq); +hnae3_release_unload_lock (); }module_init (hclge_init);module_exit (hclge_exit);
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +2 -0
@@ -3726,8 +3726,10 @@ static int hclgevf_init(void)static void hclgevf_exit (void ) { +hnae3_acquire_unload_lock ();hnae3_unregister_ae_algo (&ae_algovf);destroy_workqueue (hclgevf_wq); +hnae3_release_unload_lock (); }module_init (hclgevf_init);module_exit (hclgevf_exit);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 101/462 net: fec: implement TSO descriptor cleanup
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dheeraj Reddy Jonnalagadda <[email protected]>
[ Upstream commit 61dc1fd9205bc9d9918aa933a847b08e80b4dc20 ]
Implement cleanup of descriptors in the TSO error path of fec_enet_txq_submit_tso(). The cleanup
- Unmaps DMA buffers for data descriptors skipping TSO header
- Clears all buffer descriptors
- Handles extended descriptors by clearing cbd_esc when enabled
--- drivers/net/ethernet/freescale/fec_main.c | 31 ++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +30 -1
@@ -728,6 +728,8 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,struct fec_enet_private *fep =netdev_priv (ndev);int hdr_len, total_len, data_left;struct bufdesc *bdp = txq->bd.cur; +struct bufdesc *tmp_bdp; +struct bufdesc_ex *ebdp;struct tso_t tso;unsigned int index =0 ;int ret;
@@ -801,7 +803,34 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,return 0 ; err_release: -/* TODO: Release all used data descriptors for TSO */ +/* Release all used data descriptors for TSO */ + tmp_bdp = txq->bd.cur; + +while (tmp_bdp != bdp) { +/* Unmap data buffers */ +if (tmp_bdp->cbd_bufaddr && + !IS_TSO_HEADER (txq,fec32_to_cpu (tmp_bdp->cbd_bufaddr))) +dma_unmap_single (&fep->pdev->dev, +fec32_to_cpu (tmp_bdp->cbd_bufaddr), +fec16_to_cpu (tmp_bdp->cbd_datlen), +DMA_TO_DEVICE ); + +/* Clear standard buffer descriptor fields */ + tmp_bdp->cbd_sc =0 ; + tmp_bdp->cbd_datlen =0 ; + tmp_bdp->cbd_bufaddr =0 ; + +/* Handle extended descriptor if enabled */ +if (fep->bufdesc_ex) { + ebdp = (struct bufdesc_ex *)tmp_bdp; + ebdp->cbd_esc =0 ; + } + + tmp_bdp =fec_enet_get_nextdesc (tmp_bdp, &txq->bd); + } + +dev_kfree_skb_any (skb); +return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 102/462 ipmr: do not call mr_mfc_uses_dev() for unres entries
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 15a901361ec3fb1c393f91880e1cbf24ec0a88bd ]
syzbot found that calling mr_mfc_uses_dev() for unres entries would crash [1], because c->mfc_un.res.minvif / c->mfc_un.res.maxvif alias to "struct sk_buff_head unresolved", which contain two pointers.
This code never worked, lets remove it.
[1]
Unable to handle kernel paging request at virtual address ffff5fff2d536613 KASAN: maybe wild-memory-access in range [0xfffefff96a9b3098-0xfffefff96a9b309f] Modules linked in: CPU: 1 UID: 0 PID: 7321 Comm: syz.0.16 Not tainted 6.13.0-rc7-syzkaller-g1950a0af2d55 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mr_mfc_uses_dev net/ipv4/ipmr_base.c:290 [inline] pc : mr_table_dump+0x5a4/0x8b0 net/ipv4/ipmr_base.c:334 lr : mr_mfc_uses_dev net/ipv4/ipmr_base.c:289 [inline] lr : mr_table_dump+0x694/0x8b0 net/ipv4/ipmr_base.c:334 Call trace: mr_mfc_uses_dev net/ipv4/ipmr_base.c:290 [inline] (P) mr_table_dump+0x5a4/0x8b0 net/ipv4/ipmr_base.c:334 (P) mr_rtm_dumproute+0x254/0x454 net/ipv4/ipmr_base.c:382 ipmr_rtm_dumproute+0x248/0x4b4 net/ipv4/ipmr.c:2648 rtnl_dump_all+0x2e4/0x4e8 net/core/rtnetlink.c:4327 rtnl_dumpit+0x98/0x1d0 net/core/rtnetlink.c:6791 netlink_dump+0x4f0/0xbc0 net/netlink/af_netlink.c:2317 netlink_recvmsg+0x56c/0xe64 net/netlink/af_netlink.c:1973 sock_recvmsg_nosec net/socket.c:1033 [inline] sock_recvmsg net/socket.c:1055 [inline] sock_read_iter+0x2d8/0x40c net/socket.c:1125 new_sync_read fs/read_write.c:484 [inline] vfs_read+0x740/0x970 fs/read_write.c:565 ksys_read+0x15c/0x26c fs/read_write.c:708
--- net/ipv4/ipmr_base.c | 3 --- 1 file changed, 3 deletions(-)
net/ipv4/ipmr_base.c +0 -3
@@ -321,9 +321,6 @@ int mr_table_dump(struct mr_table *mrt, struct sk_buff *skb,list_for_each_entry (mfc, &mrt->mfc_unres_queue, list) {if (e < s_e) goto next_entry2; -if (filter->dev && - !mr_mfc_uses_dev (mrt, mfc, filter->dev)) - goto next_entry2; err =fill (mrt, skb,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq, mfc,RTM_NEWROUTE , flags);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 103/462 PM: hibernate: Add error handling for syscore_suspend()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit e20a70c572539a486dbd91b225fa6a194a5e2122 ]
In hibernation_platform_enter(), the code did not check the return value of syscore_suspend(), potentially leading to a situation where syscore_resume() would be called even if syscore_suspend() failed. This could cause unpredictable behavior or system instability.
Modify the code sequence in question to properly handle errors returned by syscore_suspend(). If an error occurs in the suspend path, the code now jumps to label 'Enable_irqs' skipping the syscore_resume() call and only enabling interrupts after setting the system state to SYSTEM_RUNNING.
--- kernel/power/hibernate.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/power/hibernate.c +6 -1
@@ -590,7 +590,11 @@ int hibernation_platform_enter(void)local_irq_disable (); system_state =SYSTEM_SUSPEND ; -syscore_suspend (); + + error =syscore_suspend (); +if (error) + goto Enable_irqs; +if (pm_wakeup_pending ()) { error = -EAGAIN ; goto Power_up;
@@ -602,6 +606,7 @@ int hibernation_platform_enter(void) Power_up:syscore_resume (); + Enable_irqs: system_state =SYSTEM_RUNNING ;local_irq_enable ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 104/462 net: rose: fix timer races against user threads
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 5de7665e0a0746b5ad7943554b34db8f8614a196 ]
Rose timers only acquire the socket spinlock, without checking if the socket is owned by one user thread.
Add a check and rearm the timers if needed.
BUG: KASAN: slab-use-after-free in rose_timer_expiry+0x31d/0x360 net/rose/rose_timer.c:174 Read of size 2 at addr ffff88802f09b82a by task swapper/0/0 CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.13.0-rc5-syzkaller-00172-gd1bf27c4e176 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: <IRQ> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 rose_timer_expiry+0x31d/0x360 net/rose/rose_timer.c:174 call_timer_fn+0x187/0x650 kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1844 [inline] __run_timers kernel/time/timer.c:2418 [inline] __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2430 run_timer_base kernel/time/timer.c:2439 [inline] run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2449 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 </IRQ>
--- net/rose/rose_timer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
net/rose/rose_timer.c +15 -0
@@ -122,6 +122,10 @@ static void rose_heartbeat_expiry(struct timer_list *t)struct rose_sock *rose =rose_sk (sk);bh_lock_sock (sk); +if (sock_owned_by_user (sk)) { +sk_reset_timer (sk, &sk->sk_timer, jiffies +HZ /20 ); + goto out; + }switch (rose->state) {case ROSE_STATE_0 :/* Magic here: If we listen() and a new link dies before it
@@ -152,6 +156,7 @@ static void rose_heartbeat_expiry(struct timer_list *t) }rose_start_heartbeat (sk); +out:bh_unlock_sock (sk);sock_put (sk); }
@@ -162,6 +167,10 @@ static void rose_timer_expiry(struct timer_list *t)struct sock *sk = &rose->sock;bh_lock_sock (sk); +if (sock_owned_by_user (sk)) { +sk_reset_timer (sk, &rose->timer, jiffies +HZ /20 ); + goto out; + }switch (rose->state) {case ROSE_STATE_1 :/* T1 */ case ROSE_STATE_4 :/* T2 */
@@ -182,6 +191,7 @@ static void rose_timer_expiry(struct timer_list *t) }break ; } +out:bh_unlock_sock (sk);sock_put (sk); }
@@ -192,6 +202,10 @@ static void rose_idletimer_expiry(struct timer_list *t)struct sock *sk = &rose->sock;bh_lock_sock (sk); +if (sock_owned_by_user (sk)) { +sk_reset_timer (sk, &rose->idletimer, jiffies +HZ /20 ); + goto out; + }rose_clear_queues (sk);rose_write_internal (sk,ROSE_CLEAR_REQUEST );
@@ -207,6 +221,7 @@ static void rose_idletimer_expiry(struct timer_list *t) sk->sk_state_change (sk);sock_set_flag (sk,SOCK_DEAD ); } +out:bh_unlock_sock (sk);sock_put (sk); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 105/462 net: netdevsim: try to close UDP port harness races
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
[ Upstream commit 50bf398e1ceacb9a7f85bd3bdca065ebe5cb6159 ]
syzbot discovered that we remove the debugfs files after we free the netdev. Try to clean up the relevant dir while the device is still around.
--- drivers/net/netdevsim/netdevsim.h | 1 + drivers/net/netdevsim/udp_tunnels.c | 23 +++++++++++-------- .../drivers/net/netdevsim/udp_tunnel_nic.sh | 16 ++++++------- 3 files changed, 23 insertions(+), 17 deletions(-)
drivers/net/netdevsim/netdevsim.h +1 -0
@@ -87,6 +87,7 @@ struct netdevsim {u32 sleep;u32 __ports[2 ][NSIM_UDP_TUNNEL_N_PORTS ];u32 (*ports)[NSIM_UDP_TUNNEL_N_PORTS ]; +struct dentry *ddir;struct debugfs_u32_array dfs_ports[2 ]; } udp_ports;
drivers/net/netdevsim/udp_tunnels.c +14 -9
@@ -112,9 +112,11 @@ nsim_udp_tunnels_info_reset_write(struct file *file, const char __user *data,struct net_device *dev = file->private_data;struct netdevsim *ns =netdev_priv (dev); -memset (ns->udp_ports.ports,0 ,sizeof (ns->udp_ports.__ports));rtnl_lock (); -udp_tunnel_nic_reset_ntf (dev); +if (dev->reg_state ==NETREG_REGISTERED ) { +memset (ns->udp_ports.ports,0 ,sizeof (ns->udp_ports.__ports)); +udp_tunnel_nic_reset_ntf (dev); + }rtnl_unlock ();return count;
@@ -144,23 +146,23 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,else ns->udp_ports.ports = nsim_dev->udp_ports.__ports; -debugfs_create_u32 ("udp_ports_inject_error" ,0600 , - ns->nsim_dev_port->ddir, + ns->udp_ports.ddir =debugfs_create_dir ("udp_ports" , + ns->nsim_dev_port->ddir); + +debugfs_create_u32 ("inject_error" ,0600 , ns->udp_ports.ddir, &ns->udp_ports.inject_error); ns->udp_ports.dfs_ports[0 ].array = ns->udp_ports.ports[0 ]; ns->udp_ports.dfs_ports[0 ].n_elements =NSIM_UDP_TUNNEL_N_PORTS ; -debugfs_create_u32_array ("udp_ports_table0" ,0400 , - ns->nsim_dev_port->ddir, +debugfs_create_u32_array ("table0" ,0400 , ns->udp_ports.ddir, &ns->udp_ports.dfs_ports[0 ]); ns->udp_ports.dfs_ports[1 ].array = ns->udp_ports.ports[1 ]; ns->udp_ports.dfs_ports[1 ].n_elements =NSIM_UDP_TUNNEL_N_PORTS ; -debugfs_create_u32_array ("udp_ports_table1" ,0400 , - ns->nsim_dev_port->ddir, +debugfs_create_u32_array ("table1" ,0400 , ns->udp_ports.ddir, &ns->udp_ports.dfs_ports[1 ]); -debugfs_create_file ("udp_ports_reset" ,0200 , ns->nsim_dev_port->ddir, +debugfs_create_file ("reset" ,0200 , ns->udp_ports.ddir, dev, &nsim_udp_tunnels_info_reset_fops);/* Note: it's not normal to allocate the info struct like this!
@@ -196,6 +198,9 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,void nsim_udp_tunnels_info_destroy (struct net_device *dev) { +struct netdevsim *ns =netdev_priv (dev); + +debugfs_remove_recursive (ns->udp_ports.ddir);kfree (dev->udp_tunnel_nic_info); dev->udp_tunnel_nic_info =NULL ; }
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +8 -8
@@ -142,7 +142,7 @@ function pre_ethtool { } function check_table { - local path=$NSIM_DEV_DFS/ports/$port/udp_ports_table$1 + local path=$NSIM_DEV_DFS/ports/$port/udp_ports/table$1 local -n expected=$2 local last=$3
@@ -212,7 +212,7 @@ function check_tables { } function print_table { - local path=$NSIM_DEV_DFS/ports/$port/udp_ports_table$1 + local path=$NSIM_DEV_DFS/ports/$port/udp_ports/table$1 read -a have < $path tree $NSIM_DEV_DFS/
@@ -640,7 +640,7 @@ for port in 0 1; do NSIM_NETDEV=`get_netdev_name old_netdevs` ifconfig $NSIM_NETDEV up - echo 110 > $NSIM_DEV_DFS/ports/$port/udp_ports_inject_error + echo 110 > $NSIM_DEV_DFS/ports/$port/udp_ports/inject_error msg="1 - create VxLANs v6" exp0=( 0 0 0 0 )
@@ -662,7 +662,7 @@ for port in 0 1; do new_geneve gnv0 20000 msg="2 - destroy GENEVE" - echo 2 > $NSIM_DEV_DFS/ports/$port/udp_ports_inject_error + echo 2 > $NSIM_DEV_DFS/ports/$port/udp_ports/inject_error exp1=( `mke 20000 2` 0 0 0 ) del_dev gnv0
@@ -763,7 +763,7 @@ for port in 0 1; do msg="create VxLANs v4" new_vxlan vxlan0 10000 $NSIM_NETDEV - echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset + echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset check_tables msg="NIC device goes down"
@@ -774,7 +774,7 @@ for port in 0 1; do fi check_tables - echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset + echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset check_tables msg="NIC device goes up again"
@@ -788,7 +788,7 @@ for port in 0 1; do del_dev vxlan0 check_tables - echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset + echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset check_tables msg="destroy NIC"
@@ -895,7 +895,7 @@ msg="vacate VxLAN in overflow table" exp0=( `mke 10000 1` `mke 10004 1` 0 `mke 10003 1` ) del_dev vxlan2 -echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports_reset +echo 1 > $NSIM_DEV_DFS/ports/$port/udp_ports/reset check_tables msg="tunnels destroyed 2"
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 106/462 net: davicom: fix UAF in dm9000_drv_remove
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chenyuan Yang <[email protected]>
[ Upstream commit 19e65c45a1507a1a2926649d2db3583ed9d55fd9 ]
dm is netdev private data and it cannot be
used after free_netdev() call. Using dm after free_netdev() can cause UAF bug. Fix it by moving free_netdev() at the end of the function.
This is similar to the issue fixed in commit ad297cd2db89 ("net: qcom/emac: fix UAF in emac_remove").
This bug is detected by our static analysis tool.
--- drivers/net/ethernet/davicom/dm9000.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/davicom/dm9000.c +2 -1
@@ -1779,10 +1779,11 @@ dm9000_drv_remove(struct platform_device *pdev)unregister_netdev (ndev);dm9000_release_board (pdev, dm); -free_netdev (ndev);/* free device structure */ if (dm->power_supply)regulator_disable (dm->power_supply); +free_netdev (ndev);/* free device structure */ +dev_dbg (&pdev->dev,"released and freed device\n" );return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 107/462 perf trace: Fix runtime error of index out of bounds
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Howard Chu <[email protected]>
[ Upstream commit c7b87ce0dd10b64b68a0b22cb83bbd556e28fe81 ]
libtraceevent parses and returns an array of argument fields, sometimes larger than RAW_SYSCALL_ARGS_NUM (6) because it includes "__syscall_nr", idx will traverse to index 6 (7th element) whereas sc->fmt->arg holds 6 elements max, creating an out-of-bounds access. This runtime error is found by UBsan. The error message:
$ sudo UBSAN_OPTIONS=print_stacktrace=1 ./perf trace -a --max-events=1
builtin-trace.c:1966:35: runtime error: index 6 out of bounds for type 'syscall_arg_fmt [6]'
#0 0x5c04956be5fe in syscall__alloc_arg_fmts /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:1966
#1 0x5c04956c0510 in trace__read_syscall_info /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:2110
#2 0x5c04956c372b in trace__syscall_info /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:2436
#3 0x5c04956d2f39 in trace__init_syscalls_bpf_prog_array_maps /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:3897
#4 0x5c04956d6d25 in trace__run /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:4335
#5 0x5c04956e112e in cmd_trace /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:5502
#6 0x5c04956eda7d in run_builtin /home/howard/hw/linux-perf/tools/perf/perf.c:351
#7 0x5c04956ee0a8 in handle_internal_command /home/howard/hw/linux-perf/tools/perf/perf.c:404
#8 0x5c04956ee37f in run_argv /home/howard/hw/linux-perf/tools/perf/perf.c:448
#9 0x5c04956ee8e9 in main /home/howard/hw/linux-perf/tools/perf/perf.c:556
#10 0x79eb3622a3b7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#11 0x79eb3622a47a in __libc_start_main_impl ../csu/libc-start.c:360
#12 0x5c04955422d4 in _start (/home/howard/hw/linux-perf/tools/perf/perf+0x4e02d4) (BuildId: 5b6cab2d59e96a4341741765ad6914a4d784dbc6)0.000 ( 0.014 ms): Chrome_ChildIO/117244 write(fd: 238, buf: !, count: 1) = 1
--- tools/perf/builtin-trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/builtin-trace.c +5 -1
@@ -1803,8 +1803,12 @@ static int trace__read_syscall_info(struct trace *trace, int id)return PTR_ERR (sc->tp_format); } +/* +* The tracepoint format contains __syscall_nr field, so it's one more +* than the actual number of syscall arguments. +*/ if (syscall__alloc_arg_fmts (sc,IS_ERR (sc->tp_format) ? -RAW_SYSCALL_ARGS_NUM : sc->tp_format->format.nr_fields)) +RAW_SYSCALL_ARGS_NUM : sc->tp_format->format.nr_fields -1 ))return -ENOMEM ; sc->args = sc->tp_format->format.fields;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 108/462 vsock: Allow retrying on connect() failure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Luczaj <[email protected]>
[ Upstream commit aa388c72113b7458127b709bdd7d3628af26e9b4 ]
sk_err is set when a (connectible) connect() fails. Effectively, this makes an otherwise still healthy SS_UNCONNECTED socket impossible to use for any subsequent connection attempts.
Clear sk_err upon trying to establish a connection.
--- net/vmw_vsock/af_vsock.c | 5 +++++ 1 file changed, 5 insertions(+)
net/vmw_vsock/af_vsock.c +5 -0
@@ -1340,6 +1340,11 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,if (err <0 ) goto out; +/* sk_err might have been set as a result of an earlier +* (failed) connect attempt. +*/ + sk->sk_err =0 ; +/* Mark sock as connecting and set the error code to in * progress in case this is a non-blocking connect. */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 109/462 bgmac: reduce max frame size to support just MTU 1500
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafał Miłecki <[email protected]>
[ Upstream commit 752e5fcc2e77358936d36ef8e522d6439372e201 ]
bgmac allocates new replacement buffer before handling each received frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU time. Ideally bgmac should just respect currently set MTU but it isn't the case right now. For now just revert back to the old limited frame size.
This change bumps NAT masquerade speed by ~95%.
Since commit 8218f62c9c9b ("mm: page_frag: use initial zero offset for page_frag_alloc_align()"), the bgmac driver fails to open its network interface successfully and runs out of memory in the following call stack:
bgmac_open
-> bgmac_dma_init
-> bgmac_dma_rx_skb_for_slot
-> netdev_alloc_fragBGMAC_RX_ALLOC_SIZE = 10048 and PAGE_FRAG_CACHE_MAX_SIZE = 32768.
Eventually we land into __page_frag_alloc_align() with the following parameters across multiple successive calls:
__page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=0 __page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=10048 __page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=20096 __page_frag_alloc_align: fragsz=10048, align_mask=-1, size=32768, offset=30144
So in that case we do indeed have offset + fragsz (40192) > size (32768) and so we would eventually return NULL. Reverting to the older 1500 bytes MTU allows the network driver to be usable again.
--- drivers/net/ethernet/broadcom/bgmac.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bgmac.h +1 -2
@@ -366,8 +366,7 @@#define BGMAC_RX_FRAME_OFFSET 30/* There are 2 unused bytes between header and real data */ #define BGMAC_RX_BUF_OFFSET (NET_SKB_PAD + NET_IP_ALIGN - \ BGMAC_RX_FRAME_OFFSET) -/* Jumbo frame size with FCS */ -#define BGMAC_RX_MAX_FRAME_SIZE 9724 +#define BGMAC_RX_MAX_FRAME_SIZE 1536#define BGMAC_RX_BUF_SIZE (BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE)#define BGMAC_RX_ALLOC_SIZE (SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 110/462 net: sh_eth: Fix missing rtnl lock in suspend/resume path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kory Maincent <[email protected]>
[ Upstream commit b95102215a8d0987789715ce11c0d4ec031cbfbe ]
Fix the suspend/resume path by ensuring the rtnl lock is held where required. Calls to sh_eth_close, sh_eth_open and wol operations must be performed under the rtnl lock to prevent conflicts with ongoing ndo operations.
--- drivers/net/ethernet/renesas/sh_eth.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/renesas/sh_eth.c +4 -0
@@ -3446,10 +3446,12 @@ static int sh_eth_suspend(struct device *dev)netif_device_detach (ndev); +rtnl_lock ();if (mdp->wol_enabled) ret =sh_eth_wol_setup (ndev);else ret =sh_eth_close (ndev); +rtnl_unlock ();return ret; }
@@ -3463,10 +3465,12 @@ static int sh_eth_resume(struct device *dev)if (!netif_running (ndev))return 0 ; +rtnl_lock ();if (mdp->wol_enabled) ret =sh_eth_wol_restore (ndev);else ret =sh_eth_open (ndev); +rtnl_unlock ();if (ret <0 )return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 111/462 net: hsr: fix fill_frame_info() regression vs VLAN packets
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 0f5697f1a3f99bc2b674b8aa3c5da822c5673c11 ]
Stephan Wurm reported that my recent patch broke VLAN support.
Apparently skb->mac_len is not correct for VLAN traffic as shown by debug traces [1].
Use instead pskb_may_pull() to make sure the expected header is present in skb->head.
Many thanks to Stephan for his help.
[1]
kernel: skb len=170 headroom=2 headlen=170 tailroom=20
mac=(2,14) mac_len=14 net=(16,-1) trans=-1
shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
csum(0x0 start=0 offset=0 ip_summed=0 complete_sw=0 valid=0 level=0)
hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0
priority=0x0 mark=0x0 alloc_cpu=0 vlan_all=0x0
encapsulation=0 inner(proto=0x0000, mac=0, net=0, trans=0)kernel: dev name=prp0 feat=0x0000000000007000
kernel: sk family=17 type=3 proto=0
kernel: skb headroom: 00000000: 74 00
kernel: skb linear: 00000000: 01 0c cd 01 00 01 00 d0 93 53 9c cb 81 00 80 00
kernel: skb linear: 00000010: 88 b8 00 01 00 98 00 00 00 00 61 81 8d 80 16 52
kernel: skb linear: 00000020: 45 47 44 4e 43 54 52 4c 2f 4c 4c 4e 30 24 47 4f
kernel: skb linear: 00000030: 24 47 6f 43 62 81 01 14 82 16 52 45 47 44 4e 43
kernel: skb linear: 00000040: 54 52 4c 2f 4c 4c 4e 30 24 44 73 47 6f 6f 73 65
kernel: skb linear: 00000050: 83 07 47 6f 49 64 65 6e 74 84 08 67 8d f5 93 7e
kernel: skb linear: 00000060: 76 c8 00 85 01 01 86 01 00 87 01 00 88 01 01 89
kernel: skb linear: 00000070: 01 00 8a 01 02 ab 33 a2 15 83 01 00 84 03 03 00
kernel: skb linear: 00000080: 00 91 08 67 8d f5 92 77 4b c6 1f 83 01 00 a2 1a
kernel: skb linear: 00000090: a2 06 85 01 00 83 01 00 84 03 03 00 00 91 08 67
kernel: skb linear: 000000a0: 8d f5 92 77 4b c6 1f 83 01 00
kernel: skb tailroom: 00000000: 80 18 02 00 fe 4e 00 00 01 01 08 0a 4f fd 5e d1
kernel: skb tailroom: 00000010: 4f fd 5e cd
--- net/hsr/hsr_forward.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/hsr/hsr_forward.c +5 -2
@@ -525,9 +525,12 @@ static int fill_frame_info(struct hsr_frame_info *frame, frame->is_vlan = true;if (frame->is_vlan) { - if (skb->mac_len < offsetofend(struct hsr_vlan_ethhdr, vlanhdr)) +/* Note: skb->mac_len might be wrong here. */ +if (!pskb_may_pull (skb, +skb_mac_offset (skb) + + offsetofend(struct hsr_vlan_ethhdr, vlanhdr)))return -EINVAL ; - vlan_hdr = (struct hsr_vlan_ethhdr *)ethhdr; + vlan_hdr = (struct hsr_vlan_ethhdr *)skb_mac_header (skb); proto = vlan_hdr->vlanhdr.h_vlan_encapsulated_proto;/* FIXME: */ netdev_warn_once (skb->dev,"VLAN not yet supported" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 112/462 genksyms: fix memory leak when the same symbol is added from source
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
[ Upstream commit 45c9c4101d3d2fdfa00852274bbebba65fcc3cf2 ]
When a symbol that is already registered is added again, __add_symbol() returns without freeing the symbol definition, making it unreachable.
The following test cases demonstrate different memory leak points.
[Test Case 1]
Forward declaration with exactly the same definition
$ cat foo.c
#include <linux/export.h>
void foo(void);
void foo(void) {}
EXPORT_SYMBOL(foo);[Test Case 2]
Forward declaration with a different definition (e.g. attribute)
$ cat foo.c
#include <linux/export.h>
void foo(void);
__attribute__((__section__(".ref.text"))) void foo(void) {}
EXPORT_SYMBOL(foo);[Test Case 3]
Preserving an overridden symbol (compile with KBUILD_PRESERVE=1)
$ cat foo.c
#include <linux/export.h>
void foo(void);
void foo(void) { }
EXPORT_SYMBOL(foo);$ cat foo.symref override foo void foo ( int )
The memory leaks in Test Case 1 and 2 have existed since the introduction of genksyms into the kernel tree. [1]
The memory leak in Test Case 3 was introduced by commit 5dae9a550a74 ("genksyms: allow to ignore symbol checksum changes").
When multiple init_declarators are reduced to an init_declarator_list, the decl_spec must be duplicated. Otherwise, the following Test Case 4 would result in a double-free bug.
[Test Case 4]
$ cat foo.c #include <linux/export.h>
extern int foo, bar;
int foo, bar; EXPORT_SYMBOL(foo);
In this case, 'foo' and 'bar' share the same decl_spec, 'int'. It must be unshared before being passed to add_symbol().
--- scripts/genksyms/genksyms.c | 3 +++ scripts/genksyms/parse.y | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
scripts/genksyms/genksyms.c +3 -0
@@ -241,6 +241,7 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type, "unchanged\n"); } sym->is_declared =1 ; +free_list (defn,NULL );return sym; }else if (!sym->is_declared) {if (sym->is_override && flag_preserve) {
@@ -249,6 +250,7 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,print_type_name (type, name);fprintf (stderr," modversion change\n" ); sym->is_declared =1 ; +free_list (defn,NULL );return sym; }else { status = is_unknown_symbol(sym) ?
@@ -256,6 +258,7 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type, } }else {error_with_pos ("redefinition of %s" , name); +free_list (defn,NULL );return sym; }break ;
scripts/genksyms/parse.y +12 -2
@@ -149,14 +149,19 @@ simple_declaration: ; init_declarator_list_opt: - /* empty */ { $$ = NULL; } - | init_declarator_list + /* empty */ { $$ = NULL; } + | init_declarator_list { free_list(decl_spec, NULL); $$ = $1; } ; init_declarator_list: init_declarator { struct string_list *decl = *$1; *$1 = NULL; + + /* avoid sharing among multiple init_declarators */ + if (decl_spec) + decl_spec = copy_list_range(decl_spec, NULL); + add_symbol(current_name, is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); current_name = NULL;
@@ -167,6 +172,11 @@ init_declarator_list: *$3 = NULL; free_list(*$2, NULL); *$2 = decl_spec; + + /* avoid sharing among multiple init_declarators */ + if (decl_spec) + decl_spec = copy_list_range(decl_spec, NULL); + add_symbol(current_name, is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); current_name = NULL;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 113/462 genksyms: fix memory leak when the same symbol is read from *.symref file
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
[ Upstream commit be2fa44b5180a1f021efb40c55fdf63c249c3209 ]
When a symbol that is already registered is read again from *.symref file, __add_symbol() removes the previous one from the hash table without freeing it.
[Test Case]
$ cat foo.c
#include <linux/export.h>
void foo(void);
void foo(void) {}
EXPORT_SYMBOL(foo);$ cat foo.symref foo void foo ( void ) foo void foo ( void )
When a symbol is removed from the hash table, it must be freed along with its ->name and ->defn members. However, sym->name cannot be freed because it is sometimes shared with node->string, but not always. If sym->name and node->string share the same memory, free(sym->name) could lead to a double-free bug.
To resolve this issue, always assign a strdup'ed string to sym->name.
--- scripts/genksyms/genksyms.c | 8 ++++++-- scripts/genksyms/genksyms.h | 2 +- scripts/genksyms/parse.y | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-)
scripts/genksyms/genksyms.c +6 -2
@@ -274,11 +274,15 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,break ; } } + +free_list (sym->defn,NULL ); +free (sym->name); +free (sym); --nsyms; } sym =xmalloc (sizeof (*sym)); - sym->name = name; + sym->name =xstrdup (name); sym->type = type; sym->defn = defn; sym->expansion_trail =NULL ;
@@ -485,7 +489,7 @@ static void read_reference(FILE *f) defn = def; def =read_node (f); } - subsym =add_reference_symbol (xstrdup (sym->string), sym->tag, + subsym =add_reference_symbol (sym->string, sym->tag, defn, is_extern); subsym->is_override = is_override;free_node (sym);
scripts/genksyms/genksyms.h +1 -1
@@ -32,7 +32,7 @@ struct string_list {struct symbol {struct symbol *hash_next; -const char *name; +char *name;enum symbol_type type;struct string_list *defn;struct symbol *expansion_trail;
scripts/genksyms/parse.y +2 -2
@@ -479,12 +479,12 @@ enumerator_list: enumerator: IDENT { - const char *name = strdup((*$1)->string); + const char *name = (*$1)->string; add_symbol(name, SYM_ENUM_CONST, NULL, 0); } | IDENT '=' EXPRESSION_PHRASE { - const char *name = strdup((*$1)->string); + const char *name = (*$1)->string; struct string_list *expr = copy_list_range(*$3, *$2); add_symbol(name, SYM_ENUM_CONST, expr, 0); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 114/462 hexagon: fix using plain integer as NULL pointer warning in cmpxchg
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit 8a20030038742b9915c6d811a4e6c14b126cafb4 ]
Sparse reports
net/ipv4/inet_diag.c:1511:17: sparse: sparse: Using plain integer as NULL pointer
Due to this code calling cmpxchg on a non-integer type struct inet_diag_handler *
return !cmpxchg((const struct inet_diag_handler**)&inet_diag_table[type],
NULL, h) ? 0 : -EEXIST;
While hexagon's cmpxchg assigns an integer value to a variable of this type.
__typeof__(*(ptr)) __oldval = 0;
Update this assignment to cast 0 to the correct type.
The original issue is easily reproduced at head with the below block, and is absent after this change.
make LLVM=1 ARCH=hexagon defconfig
make C=1 LLVM=1 ARCH=hexagon net/ipv4/inet_diag.o
--- arch/hexagon/include/asm/cmpxchg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/hexagon/include/asm/cmpxchg.h +1 -1
@@ -56,7 +56,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,__typeof__ (ptr) __ptr = (ptr); \ __typeof__(*(ptr)) __old = (old); \ __typeof__(*(ptr)) __new = (new); \ - __typeof__(*(ptr)) __oldval = 0; \ + __typeof__(*(ptr)) __oldval = (__typeof__(*(ptr))) 0; \ \ asmvolatile ( \ "1: %0 = memw_locked(%1);\n" \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 115/462 hexagon: Fix unbalanced spinlock in die()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Yujun <[email protected]>
[ Upstream commit 03410e87563a122075c3721acc7d5510e41d8332 ]
die executes holding the spinlock of &die.lock and unlock it after printing the oops message.
However in the code if the notify_die() returns NOTIFY_STOP , die() exit with returning 1 but never unlocked the spinlock.
Fix this by adding spin_unlock_irq(&die.lock) before returning.
--- arch/hexagon/kernel/traps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/hexagon/kernel/traps.c +3 -1
@@ -199,8 +199,10 @@ int die(const char *str, struct pt_regs *regs, long err)printk (KERN_EMERG "Oops: %s[#%d]:\n" , str, ++die.counter);if (notify_die (DIE_OOPS , str, regs, err,pt_cause (regs),SIGSEGV ) == -NOTIFY_STOP ) +NOTIFY_STOP ) { +spin_unlock_irq (&die.lock);return 1 ; + }print_modules ();show_regs (regs);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 116/462 NFSD: Reset cb_seq_status after NFS4ERR_DELAY
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit 961b4b5e86bf56a2e4b567f81682defa5cba957e upstream.
I noticed that once an NFSv4.1 callback operation gets a NFS4ERR_DELAY status on CB_SEQUENCE and then the connection is lost, the callback client loops, resending it indefinitely.
The switch arm in nfsd4_cb_sequence_done() that handles NFS4ERR_DELAY uses rpc_restart_call() to rearm the RPC state machine for the retransmit, but that path does not call the rpc_prepare_call callback again. Thus cb_seq_status is set to -10008 by the first NFS4ERR_DELAY result, but is never set back to 1 for the retransmits.
nfsd4_cb_sequence_done() thinks it's getting nothing but a long series of CB_SEQUENCE NFS4ERR_DELAY replies.
--- fs/nfsd/nfs4callback.c | 1 + 1 file changed, 1 insertion(+)
fs/nfsd/nfs4callback.c +1 -0
@@ -1202,6 +1202,7 @@ static bool nfsd4_cb_sequence_done(struc ret = false;break ;case -NFS4ERR_DELAY : + cb->cb_seq_status =1 ;if (!rpc_restart_call (task)) goto out;
Greg Kroah-Hartman
maintainerPATCH 117/462 netfilter: nf_tables: reject mismatching sum of field_len with set key length
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit 1b9335a8000fb70742f7db10af314104b6ace220 upstream.
The field length description provides the length of each separated key field in the concatenation, each field gets rounded up to 32-bits to calculate the pipapo rule width from pipapo_init(). The set key length provides the total size of the key aligned to 32-bits.
Register-based arithmetics still allows for combining mismatching set key length and field length description, eg. set key length 10 and field description [ 5, 4 ] leading to pipapo width of 12.
--- net/netfilter/nf_tables_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/nf_tables_api.c +4 -4
@@ -4346,7 +4346,7 @@ static int nft_set_desc_concat_parse(constatic int nft_set_desc_concat (struct nft_set_desc *desc,const struct nlattr *nla) { -u32 num_regs =0 , key_num_regs =0 ; +u32 len =0 , num_regs;struct nlattr *attr;int rem, err, i;
@@ -4360,12 +4360,12 @@ static int nft_set_desc_concat(struct nf }for (i =0 ; i < desc->field_count; i++) - num_regs +=DIV_ROUND_UP (desc->field_len[i],sizeof (u32)); + len +=round_up (desc->field_len[i],sizeof (u32)); - key_num_regs =DIV_ROUND_UP (desc->klen,sizeof (u32)); -if (key_num_regs != num_regs) +if (len != desc->klen)return -EINVAL ; + num_regs =DIV_ROUND_UP (desc->klen,sizeof (u32));if (num_regs >NFT_REG32_COUNT )return -E2BIG ;
Greg Kroah-Hartman
maintainerPATCH 118/462 ktest.pl: Check kernelrelease return in get_version
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo B. Marliere <[email protected]>
commit a4e17a8f239a545c463f8ec27db4ed6e74b31841 upstream.
In the case of a test that uses the special option ${KERNEL_VERSION} in one of its settings but has no configuration available in ${OUTPUT_DIR}, for example if it's a new empty directory, then the make kernelrelease call will fail and the subroutine will chomp an empty string, silently. Fix that by adding an empty configuration and retrying.
--- tools/testing/ktest/ktest.pl | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/ktest/ktest.pl +5 -0
@@ -2350,6 +2350,11 @@ sub get_version { return if ($have_version); doprint "$make kernelrelease ... "; $version = `$make -s kernelrelease | tail -1`; + if (!length($version)) { + run_command "$make allnoconfig" or return 0; + doprint "$make kernelrelease ... "; + $version = `$make -s kernelrelease | tail -1`; + } chomp($version); doprint "$version\n"; $have_version = 1;
Greg Kroah-Hartman
maintainerPATCH 119/462 drivers/card_reader/rtsx_usb: Restore interrupt based detection
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Rhodes <[email protected]>
commit 235b630eda072d7e7b102ab346d6b8a2c028a772 upstream.
This commit reintroduces interrupt-based card detection previously used in the rts5139 driver. This functionality was removed in commit 00d8521dcd23 ("staging: remove rts5139 driver code").
Reintroducing this mechanism fixes presence detection for certain card readers, which with the current driver, will taken approximately 20 seconds to enter S3 as mmc_rescan has to be frozen.
--- drivers/misc/cardreader/rtsx_usb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/misc/cardreader/rtsx_usb.c +15 -0
@@ -286,6 +286,7 @@ static int rtsx_usb_get_status_with_bulkint rtsx_usb_get_card_status (struct rtsx_ucr *ucr,u16 *status) {int ret; +u8 interrupt_val =0 ;u16 *buf;if (!status)
@@ -308,6 +309,20 @@ int rtsx_usb_get_card_status(struct rtsx ret =rtsx_usb_get_status_with_bulk (ucr, status); } +rtsx_usb_read_register (ucr,CARD_INT_PEND , &interrupt_val); +/* Cross check presence with interrupts */ +if (*status &XD_CD ) +if (!(interrupt_val &XD_INT )) + *status &= ~XD_CD ; + +if (*status &SD_CD ) +if (!(interrupt_val &SD_INT )) + *status &= ~SD_CD ; + +if (*status &MS_CD ) +if (!(interrupt_val &MS_INT )) + *status &= ~MS_CD ; +/* usb_control_msg may return positive when success */ if (ret <0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 120/462 usb: gadget: f_tcm: Fix Get/SetInterface return value
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit 3b997089903b909684114aca6f79d683e5c64a0e upstream.
Check to make sure that the GetInterface and SetInterface are for valid interface. Return proper alternate setting number on GetInterface.
--- drivers/usb/gadget/function/f_tcm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_tcm.c +10 -2
@@ -2102,9 +2102,14 @@ static void tcm_delayed_set_alt(struct wstatic int tcm_get_alt (struct usb_function *f,unsigned intf) { -if (intf == bot_intf_desc.bInterfaceNumber) +struct f_uas *fu =to_f_uas (f); + +if (fu->iface != intf) +return -EOPNOTSUPP ; + +if (fu->flags &USBG_IS_BOT )return USB_G_ALT_INT_BBB ; -if (intf == uasp_intf_desc.bInterfaceNumber) +else if (fu->flags &USBG_IS_UAS )return USB_G_ALT_INT_UAS ;return -EOPNOTSUPP ;
@@ -2114,6 +2119,9 @@ static int tcm_set_alt(struct usb_functi {struct f_uas *fu =to_f_uas (f); +if (fu->iface != intf) +return -EOPNOTSUPP ; +if ((alt ==USB_G_ALT_INT_BBB ) || (alt ==USB_G_ALT_INT_UAS )) {struct guas_setup_wq *work;
Greg Kroah-Hartman
maintainerPATCH 121/462 usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jos Wang <[email protected]>
commit 2eb3da037c2c20fa30bc502bc092479b2a1aaae2 upstream.
As PD2.0 spec ("8.3.3.2.3 PE_SRC_Send_Capabilities state"), after the Source receives the GoodCRC Message from the Sink in response to the Source_Capabilities message, it should start the SenderResponseTimer, after the timer times out, the state machine transitions to the HARD_RESET state.
--- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
@@ -3195,7 +3195,7 @@ static void run_state_machine(struct tcp port->caps_count =0 ; port->pd_capable = true;tcpm_set_state_cond (port,SRC_SEND_CAPABILITIES_TIMEOUT , -PD_T_SEND_SOURCE_CAP ); +PD_T_SENDER_RESPONSE ); }break ;case SRC_SEND_CAPABILITIES_TIMEOUT :
Greg Kroah-Hartman
maintainerPATCH 122/462 HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 64f2657b579343cf923aa933f08074e6258eb07b upstream.
A report in 2019 by the syzbot fuzzer was found to be connected to two errors in the HID core associated with Resolution Multipliers. One of the errors was fixed by commit ea427a222d8b ("HID: core: Fix deadloop in hid_apply_multiplier."), but the other has not been fixed.
This error arises because hid_apply_multipler() assumes that every Resolution Multiplier control is contained in a Logical Collection, i.e., there's no way the routine can ever set multiplier_collection to NULL. This is in spite of the fact that the function starts with a big comment saying:
* "The Resolution Multiplier control must be contained in the same
* Logical Collection as the control(s) to which it is to be applied.
...
* If no Logical Collection is
* defined, the Resolution Multiplier is associated with all
* controls in the report."
* HID Usage Table, v1.12, Section 4.3.1, p30
*
* Thus, search from the current collection upwards until we find a
* logical collection...
The comment and the code overlook the possibility that none of the collections found may be a Logical Collection.
The fix is to set the multiplier_collection pointer to NULL if the collection found isn't a Logical Collection.
--- drivers/hid/hid-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hid-core.c +2 -0
@@ -1124,6 +1124,8 @@ static void hid_apply_multiplier(structwhile (multiplier_collection->parent_idx !=-1 && multiplier_collection->type !=HID_COLLECTION_LOGICAL ) multiplier_collection = &hid->collection[multiplier_collection->parent_idx]; +if (multiplier_collection->type !=HID_COLLECTION_LOGICAL ) + multiplier_collection =NULL ; effective_multiplier =hid_calculate_multiplier (hid, multiplier);
Greg Kroah-Hartman
maintainerPATCH 123/462 media: uvcvideo: Fix double free in error path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
commit c6ef3a7fa97ec823a1e1af9085cf13db9f7b3bac upstream.
If the uvc_status_init() function fails to allocate the int_urb, it will free the dev->status pointer but doesn't reset the pointer to NULL. This results in the kfree() call in uvc_status_cleanup() trying to double-free the memory. Fix it by resetting the dev->status pointer to NULL after freeing it.
Reviewed by: Ricardo Ribalda <[email protected]>
--- drivers/media/usb/uvc/uvc_status.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/uvc/uvc_status.c +1 -0
@@ -269,6 +269,7 @@ int uvc_status_init(struct uvc_device *d dev->int_urb =usb_alloc_urb (0 ,GFP_KERNEL );if (dev->int_urb ==NULL ) {kfree (dev->status); + dev->status =NULL ;return -ENOMEM ; }
Greg Kroah-Hartman
maintainerPATCH 124/462 usb: gadget: f_tcm: Dont free command immediately
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit c225d006a31949d673e646d585d9569bc28feeb9 upstream.
Don't prematurely free the command. Wait for the status completion of the sense status. It can be freed then. Otherwise we will double-free the command.
--- drivers/usb/gadget/function/f_tcm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/gadget/function/f_tcm.c +0 -2
@@ -1068,7 +1068,6 @@ static void usbg_cmd_work(struct work_st out:transport_send_check_condition_and_sense (se_cmd,TCM_UNSUPPORTED_SCSI_OPCODE ,1 ); -transport_generic_free_cmd (&cmd->se_cmd,0 ); } static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
@@ -1199,7 +1198,6 @@ static void bot_cmd_work(struct work_str out:transport_send_check_condition_and_sense (se_cmd,TCM_UNSUPPORTED_SCSI_OPCODE ,1 ); -transport_generic_free_cmd (&cmd->se_cmd,0 ); } static int bot_submit_command(struct f_uas *fu,
Greg Kroah-Hartman
maintainerPATCH 125/462 btrfs: output the reason for open_ctree() failure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit d0f038104fa37380e2a725e669508e43d0c503e9 upstream.
There is a recent ML report that mounting a large fs backed by hardware RAID56 controller (with one device missing) took too much time, and systemd seems to kill the mount attempt.
In that case, the only error message is:
BTRFS error (device sdj): open_ctree failed
There is no reason on why the failure happened, making it very hard to understand the reason.
At least output the error number (in the particular case it should be -EINTR) to provide some clue.
--- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/super.c +1 -1
@@ -1340,7 +1340,7 @@ static int btrfs_fill_super(struct super err =open_ctree (sb, fs_devices, (char *)data);if (err) { -btrfs_err (fs_info,"open_ctree failed" ); +btrfs_err (fs_info,"open_ctree failed: %d" , err);return err; }
Greg Kroah-Hartman
maintainerPATCH 126/462 btrfs: fix use-after-free when attempting to join an aborted transaction
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit e2f0943cf37305dbdeaf9846e3c941451bcdef63 ]
When we are trying to join the current transaction and if it's aborted, we read its 'aborted' field after unlocking fs_info->trans_lock and without holding any extra reference count on it. This means that a concurrent task that is aborting the transaction may free the transaction before we read its 'aborted' field, leading to a use-after-free.
Fix this by reading the 'aborted' field while holding fs_info->trans_lock since any freeing task must first acquire that lock and set fs_info->running_transaction to NULL before freeing the transaction.
This was reported by syzbot and Dmitry with the following stack traces from KASAN:
==================================================================
BUG: KASAN: slab-use-after-free in join_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
Read of size 4 at addr ffff888011839024 by task kworker/u4:9/1128
CPU: 0 UID: 0 PID: 1128 Comm: kworker/u4:9 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: events_unbound btrfs_async_reclaim_data_space
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x169/0x550 mm/kasan/report.c:489
kasan_report+0x143/0x180 mm/kasan/report.c:602
join_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
start_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
flush_space+0x448/0xcf0 fs/btrfs/space-info.c:803
btrfs_async_reclaim_data_space+0x159/0x510 fs/btrfs/space-info.c:1321
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
worker_thread+0x870/0xd30 kernel/workqueue.c:3398
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
</TASK>
Allocated by task 5315:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394
kasan_kmalloc include/linux/kasan.h:260 [inline]
__kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4329
kmalloc_noprof include/linux/slab.h:901 [inline]
join_transaction+0x144/0xda0 fs/btrfs/transaction.c:308
start_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
btrfs_create_common+0x1b2/0x2e0 fs/btrfs/inode.c:6572
lookup_open fs/namei.c:3649 [inline]
open_last_lookups fs/namei.c:3748 [inline]
path_openat+0x1c03/0x3590 fs/namei.c:3984
do_filp_open+0x27f/0x4e0 fs/namei.c:4014
do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
do_sys_open fs/open.c:1417 [inline]
__do_sys_creat fs/open.c:1495 [inline]
__se_sys_creat fs/open.c:1489 [inline]
__x64_sys_creat+0x123/0x170 fs/open.c:1489
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 5336:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582
poison_slab_object mm/kasan/common.c:247 [inline]
__kasan_slab_free+0x59/0x70 mm/kasan/common.c:264
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2353 [inline]
slab_free mm/slub.c:4613 [inline]
kfree+0x196/0x430 mm/slub.c:4761
cleanup_transaction fs/btrfs/transaction.c:2063 [inline]
btrfs_commit_transaction+0x2c97/0x3720 fs/btrfs/transaction.c:2598
insert_balance_item+0x1284/0x20b0 fs/btrfs/volumes.c:3757
btrfs_balance+0x992/0x10c0 fs/btrfs/volumes.c:4633
btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3670
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888011839000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 36 bytes inside of
freed 2048-byte region [ffff888011839000, ffff888011839800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11838
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801ac42000 ffffea0000493400 dead000000000002
raw: 0000000000000000 0000000000080008 00000001f5000000 0000000000000000
head: 00fff00000000040 ffff88801ac42000 ffffea0000493400 dead000000000002
head: 0000000000000000 0000000000080008 00000001f5000000 0000000000000000
head: 00fff00000000003 ffffea0000460e01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 57, tgid 57 (kworker/0:2), ts 67248182943, free_ts 67229742023
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558
prep_new_page mm/page_alloc.c:1566 [inline]
get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476
__alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753
alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269
alloc_slab_page+0x6a/0x110 mm/slub.c:2423
allocate_slab+0x5a/0x2b0 mm/slub.c:2589
new_slab mm/slub.c:2642 [inline]
___slab_alloc+0xc27/0x14a0 mm/slub.c:3830
__slab_alloc+0x58/0xa0 mm/slub.c:3920
__slab_alloc_node mm/slub.c:3995 [inline]
slab_alloc_node mm/slub.c:4156 [inline]
__do_kmalloc_node mm/slub.c:4297 [inline]
__kmalloc_node_track_caller_noprof+0x2e9/0x4c0 mm/slub.c:4317
kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:609
__alloc_skb+0x1f3/0x440 net/core/skbuff.c:678
alloc_skb include/linux/skbuff.h:1323 [inline]
alloc_skb_with_frags+0xc3/0x820 net/core/skbuff.c:6612
sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2884
sock_alloc_send_skb include/net/sock.h:1803 [inline]
mld_newpack+0x1c3/0xaf0 net/ipv6/mcast.c:1747
add_grhead net/ipv6/mcast.c:1850 [inline]
add_grec+0x1492/0x19a0 net/ipv6/mcast.c:1988
mld_send_cr net/ipv6/mcast.c:2114 [inline]
mld_ifc_work+0x691/0xd90 net/ipv6/mcast.c:2651
page last free pid 5300 tgid 5300 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1127 [inline]
free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659
__slab_free+0x2c2/0x380 mm/slub.c:4524
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4119 [inline]
slab_alloc_node mm/slub.c:4168 [inline]
__do_kmalloc_node mm/slub.c:4297 [inline]
__kmalloc_noprof+0x236/0x4c0 mm/slub.c:4310
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1037 [inline]
fib_create_info+0xc14/0x25b0 net/ipv4/fib_semantics.c:1435
fib_table_insert+0x1f6/0x1f20 net/ipv4/fib_trie.c:1231
fib_magic+0x3d8/0x620 net/ipv4/fib_frontend.c:1112
fib_add_ifaddr+0x40c/0x5e0 net/ipv4/fib_frontend.c:1156
fib_netdev_event+0x375/0x490 net/ipv4/fib_frontend.c:1494
notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85
__dev_notify_flags+0x207/0x400
dev_change_flags+0xf0/0x1a0 net/core/dev.c:9045
do_setlink+0xc90/0x4210 net/core/rtnetlink.c:3109
rtnl_changelink net/core/rtnetlink.c:3723 [inline]
__rtnl_newlink net/core/rtnetlink.c:3875 [inline]
rtnl_newlink+0x1bb6/0x2210 net/core/rtnetlink.c:4012
Memory state around the buggy address:
ffff888011838f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888011838f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888011839000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888011839080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888011839100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================--- fs/btrfs/transaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/btrfs/transaction.c +3 -1
@@ -285,8 +285,10 @@ static noinline int join_transaction(struct btrfs_fs_info *fs_info, cur_trans = fs_info->running_transaction;if (cur_trans) {if (TRANS_ABORTED (cur_trans)) { +const int abort_error = cur_trans->aborted; +spin_unlock (&fs_info->trans_lock); -return cur_trans->aborted; +return abort_error; }if (btrfs_blocked_trans_types[cur_trans->state] & type) {spin_unlock (&fs_info->trans_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 127/462 btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 6a4730b325aaa48f7a5d5ba97aff0a955e2d9cec ]
This BUG_ON is meant to catch backref cache problems, but these can arise from either bugs in the backref cache or corruption in the extent tree. Fix it to be a proper error.
--- fs/btrfs/relocation.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
fs/btrfs/relocation.c +12 -2
@@ -3976,8 +3976,18 @@ int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,WARN_ON (!first_cow && level ==0 ); node = rc->backref_cache.path[level]; -BUG_ON (node->bytenr != buf->start && - node->new_bytenr != buf->start); + +/* +* If node->bytenr != buf->start and node->new_bytenr != +* buf->start then we've got the wrong backref node for what we +* expected to see here and the cache is incorrect. +*/ +if (unlikely (node->bytenr != buf->start && node->new_bytenr != buf->start)) { +btrfs_err (fs_info, +"bytenr %llu was found but our backref cache was expecting %llu or %llu" , + buf->start, node->bytenr, node->new_bytenr); +return -EUCLEAN ; + }btrfs_backref_drop_node_buffer (node);atomic_inc (&cow->refs);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 128/462 sched: Dont try to catch up excess steal time.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suleiman Souhlal <[email protected]>
[ Upstream commit 108ad0999085df2366dd9ef437573955cb3f5586 ]
When steal time exceeds the measured delta when updating clock_task, we currently try to catch up the excess in future updates. However, this results in inaccurate run times for the future things using clock_task, in some situations, as they end up getting additional steal time that did not actually happen.
This is because there is a window between reading the elapsed time in update_rq_clock() and sampling the steal time in update_rq_clock_task(). If the VCPU gets preempted between those two points, any additional steal time is accounted to the outgoing task even though the calculated delta did not actually contain any of that "stolen" time. When this race happens, we can end up with steal time that exceeds the calculated delta, and the previous code would try to catch up that excess steal time in future clock updates, which is given to the next, incoming task, even though it did not actually have any time stolen.
This behavior is particularly bad when steal time can be very long, which we've seen when trying to extend steal time to contain the duration that the host was suspended [0]. When this happens, clock_task stays frozen, during which the running task stays running for the whole duration, since its run time doesn't increase.
However the race can happen even under normal operation.
Ideally we would read the elapsed cpu time and the steal time atomically, to prevent this race from happening in the first place, but doing so is non-trivial.
Since the time between those two points isn't otherwise accounted anywhere, neither to the outgoing task nor the incoming task (because the "end of outgoing task" and "start of incoming task" timestamps are the same), I would argue that the right thing to do is to simply drop any excess steal time, in order to prevent these issues.
[0] https://lore.kernel.org/kvm/[email protected]/
--- kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched/core.c +4 -2
@@ -279,13 +279,15 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)#endif #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING if (static_key_false ((¶virt_steal_rq_enabled))) { - steal =paravirt_steal_clock (cpu_of (rq)); +u64 prev_steal; + + steal = prev_steal =paravirt_steal_clock (cpu_of (rq)); steal -= rq->prev_steal_time_rq;if (unlikely (steal > delta)) steal = delta; - rq->prev_steal_time_rq += steal; + rq->prev_steal_time_rq = prev_steal; delta -= steal; }#endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 129/462 lockdep: Fix upper limit for LOCKDEP_*_BITS configs
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
[ Upstream commit e638072e61726cae363d48812815197a2a0e097f ]
Lockdep has a set of configs used to determine the size of the static arrays that it uses. However, the upper limit that was initially setup for these configs is too high (30 bit shift). This equates to several GiB of static memory for individual symbols. Using such high values leads to linker errors:
$ make defconfig $ ./scripts/config -e PROVE_LOCKING --set-val LOCKDEP_BITS 30 $ make olddefconfig all [...] ld: kernel image bigger than KERNEL_IMAGE_SIZE ld: section .bss VMA wraps around address space
Adjust the upper limits to the maximum values that avoid these issues. The need for anything more, likely points to a problem elsewhere. Note that LOCKDEP_CHAINS_BITS was intentionally left out as its upper limit had a different symptom and has already been fixed [1].
--- lib/Kconfig.debug | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/Kconfig.debug +4 -4
@@ -1315,7 +1315,7 @@ config LOCKDEP_SMALL config LOCKDEP_BITS int "Bitsize for MAX_LOCKDEP_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 24 default 15 help Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message.
@@ -1331,7 +1331,7 @@ config LOCKDEP_CHAINS_BITS config LOCKDEP_STACK_TRACE_BITS int "Bitsize for MAX_STACK_TRACE_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 19 help Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message.
@@ -1339,7 +1339,7 @@ config LOCKDEP_STACK_TRACE_BITS config LOCKDEP_STACK_TRACE_HASH_BITS int "Bitsize for STACK_TRACE_HASH_SIZE" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 14 help Try increasing this value if you need large MAX_STACK_TRACE_ENTRIES.
@@ -1347,7 +1347,7 @@ config LOCKDEP_STACK_TRACE_HASH_BITS config LOCKDEP_CIRCULAR_QUEUE_BITS int "Bitsize for elements in circular_queue struct" depends on LOCKDEP - range 10 30 + range 10 26 default 12 help Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 130/462 x86/amd_nb: Restrict init function to AMD-based systems
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yazen Ghannam <[email protected]>
[ Upstream commit bee9e840609cc67d0a7d82f22a2130fb7a0a766d ]
The code implicitly operates on AMD-based systems by matching on PCI IDs. However, the use of these IDs is going away.
Add an explicit CPU vendor check instead of relying on PCI IDs.
--- arch/x86/kernel/amd_nb.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/kernel/amd_nb.c +4 -0
@@ -536,6 +536,10 @@ static __init void fix_erratum_688(void)static __init int init_amd_nbs (void ) { +if (boot_cpu_data.x86_vendor !=X86_VENDOR_AMD && + boot_cpu_data.x86_vendor !=X86_VENDOR_HYGON ) +return 0 ; +amd_cache_northbridges ();amd_cache_gart ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 131/462 printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuan-Wei Chiu <[email protected]>
[ Upstream commit 3d6f83df8ff2d5de84b50377e4f0d45e25311c7a ]
Shifting 1 << 31 on a 32-bit int causes signed integer overflow, which leads to undefined behavior. To prevent this, cast 1 to u32 before performing the shift, ensuring well-defined behavior.
This change explicitly avoids any potential overflow by ensuring that the shift occurs on an unsigned 32-bit integer.
--- kernel/printk/printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/printk/printk.c +1 -1
@@ -420,7 +420,7 @@ static u64 clear_seq;/* record buffer */ #define LOG_ALIGN __alignof__(unsigned long)#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) -#define LOG_BUF_LEN_MAX (u32)(1 << 31) +#define LOG_BUF_LEN_MAX ((u32)1 << 31)static char __log_buf[__LOG_BUF_LEN]__aligned(LOG_ALIGN) ;static char *log_buf = __log_buf;static u32 log_buf_len = __LOG_BUF_LEN;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 132/462 safesetid: check size of policy writes
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leo Stone <[email protected]>
[ Upstream commit f09ff307c7299392f1c88f763299e24bc99811c7 ]
syzbot attempts to write a buffer with a large size to a sysfs entry with writes handled by handle_policy_update(), triggering a warning in kmalloc.
Check the size specified for write buffers before allocating.
--- security/safesetid/securityfs.c | 3 +++ 1 file changed, 3 insertions(+)
security/safesetid/securityfs.c +3 -0
@@ -143,6 +143,9 @@ static ssize_t handle_policy_update(struct file *file,char *buf, *p, *end;int err; +if (len >=KMALLOC_MAX_SIZE ) +return -EINVAL ; + pol =kmalloc (sizeof (struct setid_ruleset ),GFP_KERNEL );if (!pol)return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 133/462 tun: fix group permission check
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stas Sergeev <[email protected]>
[ Upstream commit 3ca459eaba1bf96a8c7878de84fa8872259a01e3 ]
Currently tun checks the group permission even if the user have matched. Besides going against the usual permission semantic, this has a very interesting implication: if the tun group is not among the supplementary groups of the tun user, then effectively no one can access the tun device. CAP_SYS_ADMIN still can, but its the same as not setting the tun ownership.
This patch relaxes the group checking so that either the user match or the group match is enough. This avoids the situation when no one can access the device even though the ownership is properly set.
Also I simplified the logic by removing the redundant inversions:tun_not_capable() --> !tun_capable()
--- drivers/net/tun.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/tun.c +9 -5
@@ -586,14 +586,18 @@ static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb,return ret; } -static inline bool tun_not_capable (struct tun_struct *tun) +static inline bool tun_capable (struct tun_struct *tun) {const struct cred *cred =current_cred ();struct net *net =dev_net (tun->dev); -return ((uid_valid (tun->owner) && !uid_eq (cred->euid, tun->owner)) || - (gid_valid (tun->group) && !in_egroup_p (tun->group))) && - !ns_capable (net->user_ns,CAP_NET_ADMIN ); +if (ns_capable (net->user_ns,CAP_NET_ADMIN )) +return 1 ; +if (uid_valid (tun->owner) &&uid_eq (cred->euid, tun->owner)) +return 1 ; +if (gid_valid (tun->group) &&in_egroup_p (tun->group)) +return 1 ; +return 0 ; }static void tun_set_real_num_queues (struct tun_struct *tun)
@@ -2772,7 +2776,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) !!(tun->flags & IFF_MULTI_QUEUE))return -EINVAL ; -if (tun_not_capable (tun)) +if (!tun_capable (tun))return -EPERM ; err =security_tun_dev_open (tun->security);if (err <0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 134/462 mmc: core: Respect quirk_max_rate for non-UHS SDIO card
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shawn Lin <[email protected]>
[ Upstream commit a2a44f8da29352f76c99c6904ee652911b8dc7dd ]
The card-quirk was added to limit the clock-rate for a card with UHS-mode support, although let's respect the quirk for non-UHS mode too, to make the behaviour consistent.
Message-ID: <[email protected]>
--- drivers/mmc/core/sdio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/core/sdio.c +2 -0
@@ -443,6 +443,8 @@ static unsigned mmc_sdio_get_max_clock(struct mmc_card *card)if (card->type ==MMC_TYPE_SD_COMBO ) max_dtr =min (max_dtr,mmc_sd_get_max_clock (card)); + max_dtr =min_not_zero (max_dtr, card->quirk_max_rate); +return max_dtr; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 135/462 wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 3f4a0948c3524ae50f166dbc6572a3296b014e62 ]
In 'wlc_phy_iqcal_gainparams_nphy()', add gain range check to WARN() instead of possible out-of-bounds 'tbl_iqcal_gainparams_nphy' access. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c +3 -0
@@ -23427,6 +23427,9 @@ wlc_phy_iqcal_gainparams_nphy(struct brcms_phy *pi, u16 core_no,break ; } +if (WARN_ON (k ==NPHY_IQCAL_NUMGAINS )) +return ; + params->txgm = tbl_iqcal_gainparams_nphy[band_idx][k][1 ]; params->pga = tbl_iqcal_gainparams_nphy[band_idx][k][2 ]; params->pad = tbl_iqcal_gainparams_nphy[band_idx][k][3 ];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 136/462 tomoyo: dont emit warning in tomoyo_write_control()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 3df7546fc03b8f004eee0b9e3256369f7d096685 ]
syzbot is reporting too large allocation warning at tomoyo_write_control(), for one can write a very very long line without new line character. To fix this warning, I use __GFP_NOWARN rather than checking for KMALLOC_MAX_SIZE, for practically a valid line should be always shorter than 32KB where the "too small to fail" memory-allocation rule applies.
One might try to write a valid line that is longer than 32KB, but such request will likely fail with -ENOMEM. Therefore, I feel that separately returning -EINVAL when a line is longer than KMALLOC_MAX_SIZE is redundant. There is no need to distinguish over-32KB and over-KMALLOC_MAX_SIZE.
--- security/tomoyo/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/tomoyo/common.c +1 -1
@@ -2673,7 +2673,7 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head,if (head->w.avail >= head->writebuf_size -1 ) {const int len = head->writebuf_size *2 ; -char *cp =kzalloc (len,GFP_NOFS ); +char *cp =kzalloc (len,GFP_NOFS | __GFP_NOWARN);if (!cp) { error = -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 137/462 mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 1e89d21f8189d286f80b900e1b7cf57cb1f3037e ]
On N4100 / N4120 Gemini Lake SoCs the ISA bridge PCI device-id is 31e8 rather the 3197 found on e.g. the N4000 / N4020.
While at fix the existing GLK PCI-id table entry breaking the table being sorted by device-id.
--- drivers/mfd/lpc_ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mfd/lpc_ich.c +2 -1
@@ -687,8 +687,9 @@ static const struct pci_device_id lpc_ich_ids[] = { { PCI_VDEVICE(INTEL, 0x2917), LPC_ICH9ME}, { PCI_VDEVICE(INTEL, 0x2918), LPC_ICH9}, { PCI_VDEVICE(INTEL, 0x2919), LPC_ICH9M}, - { PCI_VDEVICE(INTEL, 0x3197), LPC_GLK}, { PCI_VDEVICE(INTEL, 0x2b9c), LPC_COUGARMOUNTAIN}, + { PCI_VDEVICE(INTEL, 0x3197), LPC_GLK}, + { PCI_VDEVICE(INTEL, 0x31e8), LPC_GLK}, { PCI_VDEVICE(INTEL, 0x3a14), LPC_ICH10DO}, { PCI_VDEVICE(INTEL, 0x3a16), LPC_ICH10R}, { PCI_VDEVICE(INTEL, 0x3a18), LPC_ICH10},
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 138/462 HID: Wacom: Add PCI Wacom device support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Even Xu <[email protected]>
[ Upstream commit c4c123504a65583e3689b3de04a61dc5272e453a ]
Add PCI device ID of wacom device into driver support list.
--- drivers/hid/wacom_wac.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hid/wacom_wac.c +5 -0
@@ -4851,6 +4851,10 @@ static const struct wacom_features wacom_features_0x94 = HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ .driver_data = (kernel_ulong_t)&wacom_features_##prod +#define PCI_DEVICE_WACOM (prod) \ + HID_DEVICE(BUS_PCI, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ + .driver_data = (kernel_ulong_t)&wacom_features_##prod +#define USB_DEVICE_LENOVO (prod) \ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ .driver_data = (kernel_ulong_t)&wacom_features_##prod
@@ -5020,6 +5024,7 @@ const struct hid_device_id wacom_ids[] = { { USB_DEVICE_WACOM(HID_ANY_ID) }, { I2C_DEVICE_WACOM(HID_ANY_ID) }, + { PCI_DEVICE_WACOM(HID_ANY_ID) }, { BT_DEVICE_WACOM(HID_ANY_ID) }, { } };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 139/462 net/mlx5: use do_aux_work for PHC overflow checks
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vadim Fedorenko <[email protected]>
[ Upstream commit e61e6c415ba9ff2b32bb6780ce1b17d1d76238f1 ]
The overflow_work is using system wq to do overflow checks and updates for PHC device timecounter, which might be overhelmed by other tasks. But there is dedicated kthread in PTP subsystem designed for such things. This patch changes the work queue to proper align with PTP subsystem and to avoid overloading system work queue.
The adjfine() function acts the same way as overflow check worker, we can postpone ptp aux worker till the next overflow period after adjfine() was called.
--- .../ethernet/mellanox/mlx5/core/lib/clock.c | 24 ++++++++++--------- include/linux/mlx5/driver.h | 1 - 2 files changed, 13 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +13 -11
@@ -150,17 +150,16 @@ static void mlx5_pps_out(struct work_struct *work) } } -static void mlx5_timestamp_overflow (struct work_struct *work) +static long mlx5_timestamp_overflow (struct ptp_clock_info *ptp_info) { -struct delayed_work *dwork =to_delayed_work (work);struct mlx5_core_dev *mdev;struct mlx5_timer *timer;struct mlx5_clock *clock;unsigned long flags; - timer = container_of(dwork, struct mlx5_timer, overflow_work); - clock = container_of(timer, struct mlx5_clock, timer); + clock = container_of(ptp_info, struct mlx5_clock, ptp_info); mdev = container_of(clock, struct mlx5_core_dev, clock); + timer = &clock->timer;if (mdev->state ==MLX5_DEVICE_STATE_INTERNAL_ERROR ) goto out;
@@ -171,7 +170,7 @@ static void mlx5_timestamp_overflow(struct work_struct *work)write_sequnlock_irqrestore (&clock->lock, flags); out: -schedule_delayed_work (&timer->overflow_work, timer->overflow_period); +return timer->overflow_period; }static int mlx5_ptp_settime (struct ptp_clock_info *ptp,const struct timespec64 *ts)
@@ -253,6 +252,7 @@ static int mlx5_ptp_adjfreq(struct ptp_clock_info *ptp, s32 delta) timer->nominal_c_mult + diff;mlx5_update_clock_info_page (mdev);write_sequnlock_irqrestore (&clock->lock, flags); +ptp_schedule_worker (clock->ptp, timer->overflow_period);return 0 ; }
@@ -467,6 +467,7 @@ static const struct ptp_clock_info mlx5_ptp_clock_info = { .settime64 = mlx5_ptp_settime, .enable = NULL, .verify = NULL, + .do_aux_work = mlx5_timestamp_overflow, }; static int mlx5_query_mtpps_pin_mode(struct mlx5_core_dev *mdev, u8 pin,
@@ -649,12 +650,11 @@ static void mlx5_init_overflow_period(struct mlx5_clock *clock)do_div (ns,NSEC_PER_SEC /HZ ); timer->overflow_period = ns; -INIT_DELAYED_WORK (&timer->overflow_work, mlx5_timestamp_overflow); -if (timer->overflow_period) -schedule_delayed_work (&timer->overflow_work,0 ); -else +if (!timer->overflow_period) { + timer->overflow_period =HZ ;mlx5_core_warn (mdev, -"invalid overflow period, overflow_work is not scheduled\n" ); +"invalid overflow period, overflow_work is scheduled once per second\n" ); + }if (clock_info) clock_info->overflow_period = timer->overflow_period;
@@ -718,6 +718,9 @@ void mlx5_init_clock(struct mlx5_core_dev *mdev)MLX5_NB_INIT (&clock->pps_nb, mlx5_pps_event,PPS_EVENT );mlx5_eq_notifier_register (mdev, &clock->pps_nb); + +if (clock->ptp) +ptp_schedule_worker (clock->ptp,0 ); }void mlx5_cleanup_clock (struct mlx5_core_dev *mdev)
@@ -734,7 +737,6 @@ void mlx5_cleanup_clock(struct mlx5_core_dev *mdev) }cancel_work_sync (&clock->pps_info.out_work); -cancel_delayed_work_sync (&clock->timer.overflow_work);if (mdev->clock_info) {free_page ((unsigned long )mdev->clock_info);
include/linux/mlx5/driver.h +0 -1
@@ -651,7 +651,6 @@ struct mlx5_timer {struct timecounter tc;u32 nominal_c_mult;unsigned long overflow_period; -struct delayed_work overflow_work; };struct mlx5_clock {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 140/462 i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randolph Ha <[email protected]>
[ Upstream commit bfd74cd1fbc026f04446e67d6915c7e199c2bffd ]
When a 400KHz freq is used on this model of ELAN touchpad in Linux, excessive smoothing (similar to when the touchpad's firmware detects a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo V15 G4) ACPI tables specify a 400KHz frequency for this device and some I2C busses (e.g, Designware I2C) default to a 400KHz freq, force the speed to 100KHz as a workaround.
For future investigation: This problem may be related to the default HCNT/LCNT values given by some busses' drivers, because they are not specified in the aforementioned devices' ACPI tables, and because the device works without issues on Windows at what is expected to be a 400KHz frequency. The root cause of the issue is not known.
--- drivers/i2c/i2c-core-acpi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/i2c/i2c-core-acpi.c +22 -0
@@ -299,6 +299,25 @@ static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = { {} }; +static const struct acpi_device_id i2c_acpi_force_100khz_device_ids[] = { +/* +* When a 400KHz freq is used on this model of ELAN touchpad in Linux, +* excessive smoothing (similar to when the touchpad's firmware detects +* a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo +* V15 G4) ACPI tables specify a 400KHz frequency for this device and +* some I2C busses (e.g, Designware I2C) default to a 400KHz freq, +* force the speed to 100KHz as a workaround. +* +* For future investigation: This problem may be related to the default +* HCNT/LCNT values given by some busses' drivers, because they are not +* specified in the aforementioned devices' ACPI tables, and because +* the device works without issues on Windows at what is expected to be +* a 400KHz frequency. The root cause of the issue is not known. +*/ + {"ELAN06FA" ,0 }, + {} +}; +static acpi_status i2c_acpi_lookup_speed (acpi_handle handle,u32 level,void *data,void **return_value) {
@@ -320,6 +339,9 @@ static acpi_status i2c_acpi_lookup_speed(acpi_handle handle, u32 level,if (acpi_match_device_ids (adev, i2c_acpi_force_400khz_device_ids) ==0 ) lookup->force_speed =I2C_MAX_FAST_MODE_FREQ ; +if (acpi_match_device_ids (adev, i2c_acpi_force_100khz_device_ids) ==0 ) + lookup->force_speed =I2C_MAX_STANDARD_MODE_FREQ ; +return AE_OK ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 141/462 APEI: GHES: Have GHES honor the panic= setting
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <[email protected]>
[ Upstream commit 5c0e00a391dd0099fe95991bb2f962848d851916 ]
The GHES driver overrides the panic= setting by force-rebooting the system after a fatal hw error has been reported. The intent being that such an error would be reported earlier.
However, this is not optimal when a hard-to-debug issue requires long time to reproduce and when that happens, the box will get rebooted after 30 seconds and thus destroy the whole hw context of when the error happened.
So rip out the default GHES panic timeout and honor the global one.
In the panic disabled (panic=0) case, the error will still be logged to dmesg for later inspection and if panic after a hw error is really required, then that can be controlled the usual way - use panic= on the cmdline or set it in the kernel .config's CONFIG_PANIC_TIMEOUT.
--- drivers/acpi/apei/ghes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/apei/ghes.c +5 -5
@@ -155,8 +155,6 @@ static unsigned long ghes_estatus_pool_size_request;static struct ghes_estatus_cache *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE ];static atomic_t ghes_estatus_cache_alloced; -static int ghes_panic_timeout__read_mostly =30 ; -static void __iomem *ghes_map (u64 pfn,enum fixed_addresses fixmap_idx) {phys_addr_t paddr;
@@ -858,14 +856,16 @@ static void __ghes_panic(struct ghes *ghes,struct acpi_hest_generic_status *estatus, u64 buf_paddr, enum fixed_addresses fixmap_idx) { + const char *msg = GHES_PFX "Fatal hardware error"; +__ghes_print_estatus (KERN_EMERG , ghes->generic, estatus);ghes_clear_estatus (ghes, estatus, buf_paddr, fixmap_idx); -/* reboot to log the error! */ if (!panic_timeout) - panic_timeout = ghes_panic_timeout; -panic ("Fatal hardware error!" ); +pr_emerg ("%s but panic disabled\n" , msg); + +panic (msg); }static int ghes_proc (struct ghes *ghes)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 142/462 mmc: sdhci-msm: Correctly set the load for the regulator
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuanjie Yang <[email protected]>
[ Upstream commit 20a0c37e44063997391430c4ae09973e9cbc3911 ]
Qualcomm regulator supports two power supply modes: HPM and LPM. Currently, the sdhci-msm.c driver does not set the load to adjust the current for eMMC and SD. If the regulator dont't set correct load in LPM state, it will lead to the inability to properly initialize eMMC and SD.
Set the correct regulator current for eMMC and SD to ensure that the device can work normally even when the regulator is in LPM.
--- drivers/mmc/host/sdhci-msm.c | 53 ++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-msm.c +51 -2
@@ -131,9 +131,18 @@/* Timeout value to avoid infinite waiting for pwr_irq */ #define MSM_PWR_IRQ_TIMEOUT_MS 5000 +/* Max load for eMMC Vdd supply */ +#define MMC_VMMC_MAX_LOAD_UA 570000 +/* Max load for eMMC Vdd-io supply */ #define MMC_VQMMC_MAX_LOAD_UA 325000 +/* Max load for SD Vdd supply */ +#define SD_VMMC_MAX_LOAD_UA 800000 + +/* Max load for SD Vdd-io supply */ +#define SD_VQMMC_MAX_LOAD_UA 22000 +#define msm_host_readl (msm_host, host, offset) \ msm_host->var_ops->msm_readl_relaxed(host, offset)
@@ -1383,11 +1392,48 @@ static int sdhci_msm_set_pincfg(struct sdhci_msm_host *msm_host, bool level)return ret; } -static int sdhci_msm_set_vmmc (struct mmc_host *mmc) +static void msm_config_vmmc_regulator (struct mmc_host *mmc,bool hpm) +{ +int load; + +if (!hpm) + load =0 ; +else if (!mmc->card) + load =max (MMC_VMMC_MAX_LOAD_UA ,SD_VMMC_MAX_LOAD_UA ); +else if (mmc_card_mmc (mmc->card)) + load =MMC_VMMC_MAX_LOAD_UA ; +else if (mmc_card_sd (mmc->card)) + load =SD_VMMC_MAX_LOAD_UA ; +else +return ; + +regulator_set_load (mmc->supply.vmmc, load); +} + +static void msm_config_vqmmc_regulator (struct mmc_host *mmc,bool hpm) +{ +int load; + +if (!hpm) + load =0 ; +else if (!mmc->card) + load =max (MMC_VQMMC_MAX_LOAD_UA ,SD_VQMMC_MAX_LOAD_UA ); +else if (mmc_card_sd (mmc->card)) + load =SD_VQMMC_MAX_LOAD_UA ; +else +return ; + +regulator_set_load (mmc->supply.vqmmc, load); +} + +static int sdhci_msm_set_vmmc (struct sdhci_msm_host *msm_host, +struct mmc_host *mmc,bool hpm) {if (IS_ERR (mmc->supply.vmmc))return 0 ; +msm_config_vmmc_regulator (mmc, hpm); +return mmc_regulator_set_ocr (mmc, mmc->supply.vmmc, mmc->ios.vdd); }
@@ -1400,6 +1446,8 @@ static int msm_toggle_vqmmc(struct sdhci_msm_host *msm_host,if (msm_host->vqmmc_enabled == level)return 0 ; +msm_config_vqmmc_regulator (mmc, level); +if (level) {/* Set the IO voltage regulator to default voltage level */ if (msm_host->caps_0 &CORE_3_0V_SUPPORT )
@@ -1622,7 +1670,8 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq) }if (pwr_state) { - ret =sdhci_msm_set_vmmc (mmc); + ret =sdhci_msm_set_vmmc (msm_host, mmc, + pwr_state &REQ_BUS_ON );if (!ret) ret =sdhci_msm_set_vqmmc (msm_host, mmc, pwr_state &REQ_BUS_ON );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 143/462 tipc: re-order conditions in tipc_crypto_key_rcv()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 5fe71fda89745fc3cd95f70d06e9162b595c3702 ]
On a 32bit system the "keylen + sizeof(struct tipc_aead_key)" math could have an integer wrapping issue. It doesn't matter because the "keylen" is checked on the next line, but just to make life easier for static analysis tools, let's re-order these conditions and avoid the integer overflow.
--- net/tipc/crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/tipc/crypto.c +2 -2
@@ -2297,8 +2297,8 @@ static bool tipc_crypto_key_rcv(struct tipc_crypto *rx, struct tipc_msg *hdr) keylen =ntohl (*((__be32 *)(data +TIPC_AEAD_ALG_NAME )));/* Verify the supplied size values */ -if (unlikely (size != keylen +sizeof (struct tipc_aead_key ) || - keylen >TIPC_AEAD_KEY_SIZE_MAX )) { +if (unlikely (keylen >TIPC_AEAD_KEY_SIZE_MAX || + size != keylen +sizeof (struct tipc_aead_key ))) {pr_debug ("%s: invalid MSG_CRYPTO key size\n" , rx->name); goto exit; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 144/462 selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Ye <[email protected]>
[ Upstream commit 3a0b7fa095212b51ed63892540c4f249991a2d74 ]
Address Null pointer dereference / undefined behavior in rtattr_pack (note that size is 0 in the bad case).
Flagged by cppcheck as:
tools/testing/selftests/net/ipsec.c:230:25: warning: Possible null pointer
dereference: payload [nullPointer]
memcpy(RTA_DATA(attr), payload, size);
^
tools/testing/selftests/net/ipsec.c:1618:54: note: Calling function 'rtattr_pack',
4th argument 'NULL' value is 0
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_IF_ID, NULL, 0)) {
^
tools/testing/selftests/net/ipsec.c:230:25: note: Null pointer dereference
memcpy(RTA_DATA(attr), payload, size);
^--- tools/testing/selftests/net/ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/net/ipsec.c +2 -1
@@ -189,7 +189,8 @@ static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz, attr->rta_len =RTA_LENGTH (size); attr->rta_type = rta_type; -memcpy (RTA_DATA (attr), payload, size); +if (payload) +memcpy (RTA_DATA (attr), payload, size);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 145/462 Input: allocate keycode for phone linking
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Illia Ostapyshyn <[email protected]>
[ Upstream commit 1bebc7869c99d466f819dd2cffaef0edf7d7a035 ]
The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s Gen 5 laptops includes a symbol showing a smartphone and a laptop chained together. According to the user manual, it starts the Microsoft Phone Link software used to connect to Android/iOS devices and relay messages/calls or sync data.
As there are no suitable keycodes for this action, introduce a new one.
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
@@ -519,6 +519,7 @@#define KEY_NOTIFICATION_CENTER 0x1bc/* Show/hide the notification center */ #define KEY_PICKUP_PHONE 0x1bd/* Answer incoming call */ #define KEY_HANGUP_PHONE 0x1be/* Decline incoming call */ +#define KEY_LINK_PHONE 0x1bf/* AL Phone Syncing */ #define KEY_DEL_EOL 0x1c0#define KEY_DEL_EOS 0x1c1
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 146/462 x86/mm: Dont disable PCID when INVLPG has been fixed by microcode
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xi Ruoyao <[email protected]>
commit f24f669d03f884a6ef95cca84317d0f329e93961 upstream.
Per the "Processor Specification Update" documentations referred by the intel-microcode-20240312 release note, this microcode release has fixed the issue for all affected models.
So don't disable PCID if the microcode is new enough. The precise minimum microcode revision fixing the issue was provided by Pawan Intel.
[ dhansen: comment and changelog tweaks ]
--- arch/x86/mm/init.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
arch/x86/mm/init.c +14 -9
@@ -258,28 +258,33 @@ static void __init probe_page_size_mask( }/* -* INVLPG may not properly flush Global entries -* on these CPUs when PCIDs are enabled. +* INVLPG may not properly flush Global entries on +* these CPUs. New microcode fixes the issue. */ static const struct x86_cpu_id invlpg_miss_ids[] = { -X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE ,0 ), -X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_L ,0 ), -X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_N ,0 ), -X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE ,0 ), -X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE_P ,0 ), -X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE_S ,0 ), +X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE ,0x2e ), +X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_L ,0x42c ), +X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_N ,0x11 ), +X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE ,0x118 ), +X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE_P ,0x4117 ), +X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE_S ,0x2e ), {} };static void setup_pcid (void ) { +const struct x86_cpu_id *invlpg_miss_match; +if (!IS_ENABLED (CONFIG_X86_64 ))return ;if (!boot_cpu_has (X86_FEATURE_PCID ))return ; -if (x86_match_cpu (invlpg_miss_ids)) { + invlpg_miss_match =x86_match_cpu (invlpg_miss_ids); + +if (invlpg_miss_match && + boot_cpu_data.microcode < invlpg_miss_match->driver_data) {pr_info ("Incomplete global flushes, disabling PCID" );setup_clear_cpu_cap (X86_FEATURE_PCID );return ;
Greg Kroah-Hartman
maintainerPATCH 147/462 net: usb: rtl8150: use new tasklet API
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emil Renner Berthing <[email protected]>
[ Upstream commit 1999ad32d4ff00581007543adffc465694b2e77b ]
This converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Stable-dep-of: 90b7f2961798 ("net: usb: rtl8150: enable basic endpoint checking")
--- drivers/net/usb/rtl8150.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/usb/rtl8150.c +3 -3
@@ -577,9 +577,9 @@ static void free_skb_pool(rtl8150_t *dev)dev_kfree_skb (dev->rx_skb_pool[i]); } -static void rx_fixup (unsigned long data) +static void rx_fixup (struct tasklet_struct *t) { -struct rtl8150 *dev = (struct rtl8150 *)data; +struct rtl8150 *dev =from_tasklet (dev, t, tl);struct sk_buff *skb;int status;
@@ -879,7 +879,7 @@ static int rtl8150_probe(struct usb_interface *intf,return -ENOMEM ; } -tasklet_init (&dev->tl, rx_fixup, (unsigned long )dev); +tasklet_setup (&dev->tl, rx_fixup);spin_lock_init (&dev->rx_pool_lock); dev->udev = udev;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 148/462 net: usb: rtl8150: enable basic endpoint checking
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Zhandarovich <[email protected]>
[ Upstream commit 90b7f2961798793275b4844348619b622f983907 ]
Syzkaller reports [1] encountering a common issue of utilizing a wrong usb endpoint type during URB submitting stage. This, in turn, triggers a warning shown below.
For now, enable simple endpoint checking (specifically, bulk and interrupt eps, testing control one is not essential) to mitigate the issue with a view to do other related cosmetic changes later, if they are necessary.
[1] Syzkaller report:
usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: CPU: 1 PID: 2586 at drivers/usb/core/urb.c:503 usb_submit_urb+0xe4b/0x1730 driv> Modules linked in: CPU: 1 UID: 0 PID: 2586 Comm: dhcpcd Not tainted 6.11.0-rc4-syzkaller-00069-gfc88bb11617> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:usb_submit_urb+0xe4b/0x1730 drivers/usb/core/urb.c:503 Code: 84 3c 02 00 00 e8 05 e4 fc fc 4c 89 ef e8 fd 25 d7 fe 45 89 e0 89 e9 4c 89 f2 48 8> RSP: 0018:ffffc9000441f740 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff888112487a00 RCX: ffffffff811a99a9 RDX: ffff88810df6ba80 RSI: ffffffff811a99b6 RDI: 0000000000000001 RBP: 0000000000000003 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: ffff8881023bf0a8 R14: ffff888112452a20 R15: ffff888112487a7c FS: 00007fc04eea5740(0000) GS:ffff8881f6300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0a1de9f870 CR3: 000000010dbd0000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> rtl8150_open+0x300/0xe30 drivers/net/usb/rtl8150.c:733 __dev_open+0x2d4/0x4e0 net/core/dev.c:1474 __dev_change_flags+0x561/0x720 net/core/dev.c:8838 dev_change_flags+0x8f/0x160 net/core/dev.c:8910 devinet_ioctl+0x127a/0x1f10 net/ipv4/devinet.c:1177 inet_ioctl+0x3aa/0x3f0 net/ipv4/af_inet.c:1003 sock_do_ioctl+0x116/0x280 net/socket.c:1222 sock_ioctl+0x22e/0x6c0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc04ef73d49
...
This change has not been tested on real hardware.
--- drivers/net/usb/rtl8150.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/net/usb/rtl8150.c +22 -0
@@ -71,6 +71,14 @@#define MSR_SPEED (1<<3)#define MSR_LINK (1<<2) +/* USB endpoints */ +enum rtl8150_usb_ep { +RTL8150_USB_EP_CONTROL =0 , +RTL8150_USB_EP_BULK_IN =1 , +RTL8150_USB_EP_BULK_OUT =2 , +RTL8150_USB_EP_INT_IN =3 , +}; +/* Interrupt pipe data */ #define INT_TSR 0x00#define INT_RSR 0x01
@@ -866,6 +874,13 @@ static int rtl8150_probe(struct usb_interface *intf,struct usb_device *udev =interface_to_usbdev (intf);rtl8150_t *dev;struct net_device *netdev; +static const u8 bulk_ep_addr[] = { +RTL8150_USB_EP_BULK_IN |USB_DIR_IN , +RTL8150_USB_EP_BULK_OUT |USB_DIR_OUT , +0 }; +static const u8 int_ep_addr[] = { +RTL8150_USB_EP_INT_IN |USB_DIR_IN , +0 }; netdev =alloc_etherdev (sizeof (rtl8150_t));if (!netdev)
@@ -879,6 +894,13 @@ static int rtl8150_probe(struct usb_interface *intf,return -ENOMEM ; } +/* Verify that all required endpoints are present */ +if (!usb_check_bulk_endpoints (intf, bulk_ep_addr) || + !usb_check_int_endpoints (intf, int_ep_addr)) { +dev_err (&intf->dev,"couldn't find required endpoints\n" ); + goto out; + } +tasklet_setup (&dev->tl, rx_fixup);spin_lock_init (&dev->rx_pool_lock);
Signature · 1 line
2.39.5