5.15.106-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 5.15.106-rc1 review
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.15.106-rc1
Jan Beulich <[email protected]>
x86/PVH: avoid 32-bit build warning when obtaining VGA console info
Matthieu Baerts <[email protected]>
hsr: ratelimit only when errors are printed
Andrii Nakryiko <[email protected]>
libbpf: Fix btf_dump's packed struct determination
Andrii Nakryiko <[email protected]>
selftests/bpf: Add few corner cases to test padding handling of btf_dump
Andrii Nakryiko <[email protected]>
libbpf: Fix BTF-to-C converter's padding logic
Eduard Zingerman <[email protected]>
selftests/bpf: Test btf dump for struct with padding only fields
Damien Le Moal <[email protected]>
zonefs: Fix error message in zonefs_file_dio_append()
Sean Christopherson <[email protected]>
KVM: x86: Purge "highest ISR" cache when updating APICv state
Sean Christopherson <[email protected]>
KVM: x86: Inject #GP on x2APIC WRMSR that sets reserved bits 63:32
Sean Christopherson <[email protected]>
KVM: VMX: Move preemption timer <=> hrtimer dance to common x86
Heiko Carstens <[email protected]>
s390/uaccess: add missing earlyclobber annotations to __clear_user()
Marc Zyngier <[email protected]>
KVM: arm64: Disable interrupts while walking userspace PTs
Fangzhi Zuo <[email protected]>
drm/amd/display: Add DSC Support for Synaptics Cascaded MST Hub
Lucas Stach <[email protected]>
drm/etnaviv: fix reference leak when mmaping imported buffer
Douglas Raillard <[email protected]>
rcu: Fix rcu_torture_read ftrace event
Max Filippov <[email protected]>
xtensa: fix KASAN report for show_stack
huangwenhui <[email protected]>
ALSA: hda/realtek: Add quirk for Lenovo ZhaoYang CF4620Z
Tim Crawford <[email protected]>
ALSA: hda/realtek: Add quirks for some Clevo laptops
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix regression on detection of Roland VS-100
Takashi Iwai <[email protected]>
ALSA: hda/conexant: Partial revert of a quirk for Lenovo
Trond Myklebust <[email protected]>
NFSv4: Fix hangs when recovering open state after a server reboot
Jens Axboe <[email protected]>
powerpc: Don't try to copy PPR for task with NULL pt_regs
Johan Hovold <[email protected]>
pinctrl: at91-pio4: fix domain name assignment
Kornel Dulęba <[email protected]>
pinctrl: amd: Disable and mask interrupts on resume
Josua Mayer <[email protected]>
net: phy: dp83869: fix default value for tx-/rx-internal-delay
Juergen Gross <[email protected]>
xen/netback: don't do grant copy across page boundary
Oleksij Rempel <[email protected]>
can: j1939: prevent deadlock by moving j1939_sk_errqueue()
Damien Le Moal <[email protected]>
zonefs: Always invalidate last cached page on append write
Anand Jain <[email protected]>
btrfs: scan device in non-exclusive mode
Filipe Manana <[email protected]>
btrfs: fix race between quota disable and quota assign ioctls
Hans de Goede <[email protected]>
Input: goodix - add Lenovo Yoga Book X90F to nine_bytes_report DMI table
David Disseldorp <[email protected]>
cifs: fix DFS traversal oops without CONFIG_CIFS_DFS_UPCALL
Paulo Alcantara <[email protected]>
cifs: prevent infinite recursion in CIFSGetDFSRefer()
Jason A. Donenfeld <[email protected]>
Input: focaltech - use explicitly signed char type
msizanoen <[email protected]>
Input: alps - fix compatibility with -funsigned-char
Lu Baolu <[email protected]>
iommu/vt-d: Allow zero SAGAW if second-stage not supported
Horatiu Vultur <[email protected]>
pinctrl: ocelot: Fix alt mode for ocelot
Felix Fietkau <[email protected]>
net: ethernet: mtk_eth_soc: fix flow block refcounting logic
Steffen Bätz <[email protected]>
net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
Michael Chan <[email protected]>
bnxt_en: Add missing 200G link speed reporting
Kalesh AP <[email protected]>
bnxt_en: Fix typo in PCI id to device description string mapping
Kalesh AP <[email protected]>
bnxt_en: Fix reporting of test result in ethtool selftest
Radoslaw Tyl <[email protected]>
i40e: fix registers dump after run ethtool adapter self test
Alex Elder <[email protected]>
net: ipa: compute DMA pool size properly
Tasos Sahanidis <[email protected]>
ALSA: ymfpci: Fix BUG_ON in probe function
Tasos Sahanidis <[email protected]>
ALSA: ymfpci: Create card with device-managed snd_devm_card_new()
Jakob Koschel <[email protected]>
ice: fix invalid check for empty list in ice_sched_assoc_vsi_to_agg()
Junfeng Guo <[email protected]>
ice: add profile conflict check for AVF FDIR
Wolfram Sang <[email protected]>
smsc911x: avoid PHY being resumed when interface is not up
Sven Auhagen <[email protected]>
net: mvpp2: parser fix PPPoE
Sven Auhagen <[email protected]>
net: mvpp2: parser fix QinQ
Sven Auhagen <[email protected]>
net: mvpp2: classifier flow fix fragmentation flags
Alyssa Ross <[email protected]>
loop: LOOP_CONFIGURE: send uevents for partitions
Christoph Hellwig <[email protected]>
loop: suppress uevents while reconfiguring the device
Tony Krowiak <[email protected]>
s390/vfio-ap: fix memory leak in vfio_ap device driver
Ivan Orlov <[email protected]>
can: bcm: bcm_tx_setup(): fix KMSAN uninit-value in vfs_write
Rajvi Jingar <[email protected]>
platform/x86/intel/pmc: Alder Lake PCH slp_s0_residency fix
Imre Deak <[email protected]>
drm/i915/tc: Fix the ICL PHY ownership check in TC-cold state
Vladimir Oltean <[email protected]>
net: stmmac: don't reject VLANs when IFF_PROMISC is set
Faicker Mo <[email protected]>
net/net_failover: fix txq exceeding warning
Christophe JAILLET <[email protected]>
regulator: Handle deferred clk
ChunHao Lin <[email protected]>
r8169: fix RTL8168H and RTL8107E rx crc error
Oleksij Rempel <[email protected]>
net: dsa: microchip: ksz8863_smi: fix bulk access
SongJingyi <[email protected]>
ptp_qoriq: fix memory leak in probe()
Jerry Snitselaar <[email protected]>
scsi: mpt3sas: Don't print sense pool info twice
Tomas Henzl <[email protected]>
scsi: megaraid_sas: Fix crash after a double completion
Íñigo Huguet <[email protected]>
sfc: ef10: don't overwrite offload features at NIC reset
Siddharth Kawar <[email protected]>
SUNRPC: fix shutdown of NFS TCP client socket
Arseniy Krasnov <[email protected]>
mtd: rawnand: meson: invalidate cache on polling ECC bit
Mark Pearson <[email protected]>
platform/x86: think-lmi: Add possible_values for ThinkStation
Mark Pearson <[email protected]>
platform/x86: think-lmi: only display possible_values if available
Mark Pearson <[email protected]>
platform/x86: think-lmi: use correct possible_values delimiters
Mark Pearson <[email protected]>
platform/x86: think-lmi: add missing type attribute
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix recursive locking at XRUN during syncing
Álvaro Fernández Rojas <[email protected]>
mips: bmips: BCM6358: disable RAC flush for TP1
Harshit Mogalapalli <[email protected]>
ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()
Anton Gusev <[email protected]>
tracing: Fix wrong return in kprobe_event_gen_test.c
Antti Laakso <[email protected]>
tools/power turbostat: fix decoding of HWP_STATUS
Prarit Bhargava <[email protected]>
tools/power turbostat: Fix /dev/cpu_dma_latency warnings
Wei Chen <[email protected]>
fbdev: au1200fb: Fix potential divide by zero
Wei Chen <[email protected]>
fbdev: lxfb: Fix potential divide by zero
Wei Chen <[email protected]>
fbdev: intelfb: Fix potential divide by zero
Wei Chen <[email protected]>
fbdev: nvidia: Fix potential divide by zero
Linus Torvalds <[email protected]>
sched_getaffinity: don't assume 'cpumask_size()' is fully initialized
Wei Chen <[email protected]>
fbdev: tgafb: Fix potential divide by zero
Kuninori Morimoto <[email protected]>
ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set()
Kuninori Morimoto <[email protected]>
ALSA: asihpi: check pao in control_message()
Kristian Overskeid <[email protected]>
net: hsr: Don't log netdev_err message on unknown prp dst node
Jan Beulich <[email protected]>
x86/PVH: obtain VGA console info in Dom0
NeilBrown <[email protected]>
md: avoid signed overflow in slot_store()
Ravulapati Vishnu Vardhan Rao <[email protected]>
ASoC: codecs: tx-macro: Fix for KASAN: slab-out-of-bounds
Herbert Xu <[email protected]>
xfrm: Zero padding when dumping algos and encap
Ivan Bornyakov <[email protected]>
bus: imx-weim: fix branch condition evaluates to a garbage value
Namjae Jeon <[email protected]>
ksmbd: don't terminate inactive sessions after a few seconds
Marco Elver <[email protected]>
kcsan: avoid passing -g for test
Anders Roxell <[email protected]>
kernel: kcsan: kcsan_test: build without structleak plugin
Wesley Cheng <[email protected]>
usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC
Michael Grzeschik <[email protected]>
usb: dwc3: gadget: move cmd_endtransfer to extra function
Eric Biggers <[email protected]>
fsverity: don't drop pagecache at end of FS_IOC_ENABLE_VERITY
-------------
Diffstat:
Makefile | 4 +- arch/arm64/kvm/mmu.c | 45 +++++- arch/mips/bmips/dma.c | 5 + arch/mips/bmips/setup.c | 8 + arch/powerpc/kernel/ptrace/ptrace-view.c | 6 + arch/s390/lib/uaccess.c | 2 +- arch/x86/kvm/lapic.c | 11 +- arch/x86/kvm/vmx/vmx.c | 6 - arch/x86/kvm/x86.c | 21 +++ arch/x86/xen/Makefile | 2 +- arch/x86/xen/enlighten_pv.c | 3 +- arch/x86/xen/enlighten_pvh.c | 13 ++ arch/x86/xen/vga.c | 5 +- arch/x86/xen/xen-ops.h | 7 +- arch/xtensa/kernel/traps.c | 16 +- drivers/block/loop.c | 21 ++- drivers/bus/imx-weim.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 19 +++ .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.h | 12 ++ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 10 +- drivers/gpu/drm/i915/display/intel_tc.c | 4 +- drivers/input/mouse/alps.c | 16 +- drivers/input/mouse/focaltech.c | 8 +- drivers/input/touchscreen/goodix.c | 14 +- drivers/iommu/intel/dmar.c | 3 +- drivers/md/md.c | 3 + drivers/mtd/nand/raw/meson_nand.c | 8 +- drivers/net/dsa/microchip/ksz8863_smi.c | 9 -- drivers/net/dsa/mv88e6xxx/chip.c | 9 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 + drivers/net/ethernet/intel/i40e/i40e_diag.c | 11 +- drivers/net/ethernet/intel/i40e/i40e_diag.h | 2 +- drivers/net/ethernet/intel/ice/ice_sched.c | 8 +- drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 73 +++++++++ drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 30 ++-- drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c | 86 +++++------ drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 +- drivers/net/ethernet/realtek/r8169_phy_config.c | 3 + drivers/net/ethernet/sfc/ef10.c | 38 +++-- drivers/net/ethernet/sfc/efx.c | 17 +- drivers/net/ethernet/smsc/smsc911x.c | 7 +- drivers/net/ethernet/stmicro/stmmac/common.h | 1 - drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 61 +------- drivers/net/ieee802154/ca8210.c | 3 +- drivers/net/ipa/gsi_trans.c | 2 +- drivers/net/net_failover.c | 8 +- drivers/net/phy/dp83869.c | 6 +- drivers/net/xen-netback/common.h | 2 +- drivers/net/xen-netback/netback.c | 25 ++- drivers/pinctrl/pinctrl-amd.c | 36 +++-- drivers/pinctrl/pinctrl-at91-pio4.c | 1 - drivers/pinctrl/pinctrl-ocelot.c | 2 +- drivers/platform/x86/intel/pmc/core.c | 13 +- drivers/platform/x86/think-lmi.c | 60 +++++++- drivers/ptp/ptp_qoriq.c | 2 +- drivers/regulator/fixed.c | 2 +- drivers/s390/crypto/vfio_ap_drv.c | 3 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 5 - drivers/usb/dwc3/gadget.c | 79 ++++++---- drivers/video/fbdev/au1200fb.c | 3 + drivers/video/fbdev/geode/lxfb_core.c | 3 + drivers/video/fbdev/intelfb/intelfbdrv.c | 3 + drivers/video/fbdev/nvidia/nvidia.c | 2 + drivers/video/fbdev/tgafb.c | 3 + fs/btrfs/ioctl.c | 2 + fs/btrfs/qgroup.c | 11 +- fs/btrfs/volumes.c | 11 +- fs/cifs/cifsfs.h | 5 +- fs/cifs/cifssmb.c | 9 +- fs/ksmbd/connection.c | 4 +- fs/ksmbd/connection.h | 3 +- fs/ksmbd/transport_rdma.c | 2 +- fs/ksmbd/transport_tcp.c | 35 +++-- fs/nfs/nfs4proc.c | 5 +- fs/verity/enable.c | 24 +-- fs/zonefs/super.c | 16 +- include/trace/events/rcu.h | 2 +- include/xen/interface/platform.h | 3 + kernel/compat.c | 2 +- kernel/kcsan/Makefile | 3 +- kernel/sched/core.c | 4 +- kernel/trace/kprobe_event_gen_test.c | 4 +- net/can/bcm.c | 16 +- net/can/j1939/transport.c | 8 +- net/hsr/hsr_framereg.c | 2 +- net/sunrpc/xprtsock.c | 1 + net/xfrm/xfrm_user.c | 45 +++++- sound/core/pcm_lib.c | 2 + sound/pci/asihpi/hpi6205.c | 2 +- sound/pci/hda/patch_ca0132.c | 4 +- sound/pci/hda/patch_conexant.c | 6 +- sound/pci/hda/patch_realtek.c | 5 + sound/pci/ymfpci/ymfpci.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- sound/soc/codecs/lpass-tx-macro.c | 11 +- sound/usb/endpoint.c | 22 ++- sound/usb/endpoint.h | 4 +- sound/usb/format.c | 8 +- sound/usb/pcm.c | 2 +- tools/lib/bpf/btf_dump.c | 154 +++++++++++++------ tools/power/x86/turbostat/turbostat.8 | 2 + tools/power/x86/turbostat/turbostat.c | 4 +- .../bpf/progs/btf_dump_test_case_bitfields.c | 2 +- .../bpf/progs/btf_dump_test_case_packing.c | 80 +++++++++- .../bpf/progs/btf_dump_test_case_padding.c | 171 ++++++++++++++++++--- 108 files changed, 1157 insertions(+), 454 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/99 fsverity: dont drop pagecache at end of FS_IOC_ENABLE_VERITY
From: Eric Biggers <[email protected]>
[ Upstream commit a075bacde257f755bea0e53400c9f1cdd1b8e8e6 ]
The full pagecache drop at the end of FS_IOC_ENABLE_VERITY is causing performance problems and is hindering adoption of fsverity. It was intended to solve a race condition where unverified pages might be left in the pagecache. But actually it doesn't solve it fully.
Since the incomplete solution for this race condition has too much performance impact for it to be worth it, let's remove it for now.
--- fs/verity/enable.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
fs/verity/enable.c +13 -11
@@ -391,25 +391,27 @@ int fsverity_ioctl_enable(struct file *filp, const void __user *uarg) goto out_drop_write; err =enable_verity (filp, &arg); -if (err) - goto out_allow_write_access;/* -* Some pages of the file may have been evicted from pagecache after -* being used in the Merkle tree construction, then read into pagecache -* again by another process reading from the file concurrently. Since -* these pages didn't undergo verification against the file digest which -* fs-verity now claims to be enforcing, we have to wipe the pagecache -* to ensure that all future reads are verified. +* We no longer drop the inode's pagecache after enabling verity. This +* used to be done to try to avoid a race condition where pages could be +* evicted after being used in the Merkle tree construction, then +* re-instantiated by a concurrent read. Such pages are unverified, and +* the backing storage could have filled them with different content, so +* they shouldn't be used to fulfill reads once verity is enabled. +* +* But, dropping the pagecache has a big performance impact, and it +* doesn't fully solve the race condition anyway. So for those reasons, +* and also because this race condition isn't very important relatively +* speaking (especially for small-ish files, where the chance of a page +* being used, evicted, *and* re-instantiated all while enabling verity +* is quite small), we no longer drop the inode's pagecache. */ -filemap_write_and_wait (inode->i_mapping); -invalidate_inode_pages2 (inode->i_mapping);/* * allow_write_access() is needed to pair with deny_write_access(). * Regardless, the filesystem won't allow writing to verity files. */ -out_allow_write_access:allow_write_access (filp); out_drop_write:mnt_drop_write_file (filp);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 2/99 usb: dwc3: gadget: move cmd_endtransfer to extra function
In reply to Greg Kroah-HartmanFrom: Michael Grzeschik <[email protected]>
[ Upstream commit e192cc7b52399d1b073f88cd3ba128b74d3a57f1 ]
This patch adds the extra function __dwc3_stop_active_transfer to consolidate the same codepath.
Stable-dep-of: d8a2bb4eb758 ("usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC")
--- drivers/usb/dwc3/gadget.c | 69 +++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 32 deletions(-)
drivers/usb/dwc3/gadget.c +37 -32
@@ -1639,6 +1639,40 @@ static int __dwc3_gadget_get_frame(struct dwc3 *dwc)return DWC3_DSTS_SOFFN (reg); } +/** +* __dwc3_stop_active_transfer - stop the current active transfer +* @dep: isoc endpoint +* @force: set forcerm bit in the command +* @interrupt: command complete interrupt after End Transfer command +* +* When setting force, the ForceRM bit will be set. In that case +* the controller won't update the TRB progress on command +* completion. It also won't clear the HWO bit in the TRB. +* The command will also not complete immediately in that case. +*/ +static int __dwc3_stop_active_transfer (struct dwc3_ep *dep,bool force,bool interrupt) +{ +struct dwc3_gadget_ep_cmd_params params; +u32 cmd; +int ret; + + cmd =DWC3_DEPCMD_ENDTRANSFER ; + cmd |= force ?DWC3_DEPCMD_HIPRI_FORCERM :0 ; + cmd |= interrupt ?DWC3_DEPCMD_CMDIOC :0 ; + cmd |=DWC3_DEPCMD_PARAM (dep->resource_index); +memset (¶ms,0 ,sizeof (params)); + ret =dwc3_send_gadget_ep_cmd (dep, cmd, ¶ms); +WARN_ON_ONCE (ret); + dep->resource_index =0 ; + +if (!interrupt) + dep->flags &= ~DWC3_EP_TRANSFER_STARTED ; +else if (!ret) + dep->flags |=DWC3_EP_END_TRANSFER_PENDING ; + +return ret; +} +/** * dwc3_gadget_start_isoc_quirk - workaround invalid frame number * @dep: isoc endpoint
@@ -1808,21 +1842,8 @@ static int __dwc3_gadget_start_isoc(struct dwc3_ep *dep)* status, issue END_TRANSFER command and retry on the next XferNotReady * event. */ -if (ret == -EAGAIN ) { -struct dwc3_gadget_ep_cmd_params params; -u32 cmd; - - cmd =DWC3_DEPCMD_ENDTRANSFER | -DWC3_DEPCMD_CMDIOC | -DWC3_DEPCMD_PARAM (dep->resource_index); - - dep->resource_index =0 ; -memset (¶ms,0 ,sizeof (params)); - - ret =dwc3_send_gadget_ep_cmd (dep, cmd, ¶ms); -if (!ret) - dep->flags |=DWC3_EP_END_TRANSFER_PENDING ; - } +if (ret == -EAGAIN ) + ret =__dwc3_stop_active_transfer (dep, false, true);return ret; }
@@ -3605,10 +3626,6 @@ static void dwc3_reset_gadget(struct dwc3 *dwc)static void dwc3_stop_active_transfer (struct dwc3_ep *dep,bool force,bool interrupt) { -struct dwc3_gadget_ep_cmd_params params; -u32 cmd; -int ret; -if (!(dep->flags &DWC3_EP_TRANSFER_STARTED ) || (dep->flags &DWC3_EP_END_TRANSFER_PENDING ))return ;
@@ -3640,19 +3657,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,* This mode is NOT available on the DWC_usb31 IP. */ - cmd =DWC3_DEPCMD_ENDTRANSFER ; - cmd |= force ?DWC3_DEPCMD_HIPRI_FORCERM :0 ; - cmd |= interrupt ?DWC3_DEPCMD_CMDIOC :0 ; - cmd |=DWC3_DEPCMD_PARAM (dep->resource_index); -memset (¶ms,0 ,sizeof (params)); - ret =dwc3_send_gadget_ep_cmd (dep, cmd, ¶ms); -WARN_ON_ONCE (ret); - dep->resource_index =0 ; - -if (!interrupt) - dep->flags &= ~DWC3_EP_TRANSFER_STARTED ; -else - dep->flags |=DWC3_EP_END_TRANSFER_PENDING ; +__dwc3_stop_active_transfer (dep, force, interrupt); }static void dwc3_clear_stall_all_ep (struct dwc3 *dwc)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 3/99 usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC
In reply to Greg Kroah-HartmanFrom: Wesley Cheng <[email protected]>
[ Upstream commit d8a2bb4eb75866275b5cf7de2e593ac3449643e2 ]
Previously, there was a 100uS delay inserted after issuing an end transfer command for specific controller revisions. This was due to the fact that there was a GUCTL2 bit field which enabled synchronous completion of the end transfer command once the CMDACT bit was cleared in the DEPCMD register. Since this bit does not exist for all controller revisions and the current implementation heavily relies on utizling the EndTransfer command completion interrupt, add the delay back in for uses where the interrupt on completion bit is not set, and increase the duration to 1ms for the controller to complete the command.
An issue was seen where the USB request buffer was unmapped while the DWC3 controller was still accessing the TRB. However, it was confirmed that the end transfer command was successfully submitted. (no end transfer timeout) In situations, such as dwc3_gadget_soft_disconnect() and __dwc3_gadget_ep_disable(), the dwc3_remove_request() is utilized, which will issue the end transfer command, and follow up with dwc3_gadget_giveback(). At least for the USB ep disable path, it is required for any pending and started requests to be completed and returned to the function driver in the same context of the disable call. Without the GUCTL2 bit, it is not ensured that the end transfer is completed before the buffers are unmapped.
--- drivers/usb/dwc3/gadget.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/usb/dwc3/gadget.c +11 -3
@@ -1652,6 +1652,7 @@ static int __dwc3_gadget_get_frame(struct dwc3 *dwc)*/ static int __dwc3_stop_active_transfer (struct dwc3_ep *dep,bool force,bool interrupt) { +struct dwc3 *dwc = dep->dwc;struct dwc3_gadget_ep_cmd_params params;u32 cmd;int ret;
@@ -1665,10 +1666,13 @@ static int __dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool intWARN_ON_ONCE (ret); dep->resource_index =0 ; -if (!interrupt) +if (!interrupt) { + if (!DWC3_IP_IS(DWC3) || DWC3_VER_IS_PRIOR(DWC3, 310A)) +mdelay (1 ); dep->flags &= ~DWC3_EP_TRANSFER_STARTED ; -else if (!ret) + }else if (!ret) { dep->flags |=DWC3_EP_END_TRANSFER_PENDING ; + }return ret; }
@@ -3654,7 +3658,11 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,* enabled, the EndTransfer command will have completed upon * returning from this function. * -* This mode is NOT available on the DWC_usb31 IP. +* This mode is NOT available on the DWC_usb31 IP. In this +* case, if the IOC bit is not set, then delay by 1ms +* after issuing the EndTransfer command. This allows for the +* controller to handle the command completely before DWC3 +* remove requests attempts to unmap USB request buffers. */ __dwc3_stop_active_transfer (dep, force, interrupt);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 4/99 kernel: kcsan: kcsan_test: build without structleak plugin
In reply to Greg Kroah-HartmanFrom: Anders Roxell <[email protected]>
[ Upstream commit 6fcd4267a840d0536b8e5334ad5f31e4105fce85 ]
Building kcsan_test with structleak plugin enabled makes the stack frame size to grow.
kernel/kcsan/kcsan_test.c:704:1: error: the frame size of 3296 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
Turn off the structleak plugin checks for kcsan_test.
Stable-dep-of: 5eb39cde1e24 ("kcsan: avoid passing -g for test")
--- kernel/kcsan/Makefile | 1 + 1 file changed, 1 insertion(+)
kernel/kcsan/Makefile +1 -0
@@ -14,4 +14,5 @@ obj-y := core.o debugfs.o report.o obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer +CFLAGS_kcsan_test.o += $(DISABLE_STRUCTLEAK_PLUGIN) obj-$(CONFIG_KCSAN_KUNIT_TEST) += kcsan_test.o
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 5/99 kcsan: avoid passing -g for test
In reply to Greg Kroah-HartmanFrom: Marco Elver <[email protected]>
[ Upstream commit 5eb39cde1e2487ba5ec1802dc5e58a77e700d99e ]
Nathan reported that when building with GNU as and a version of clang that defaults to DWARF5, the assembler will complain with:
Error: non-constant .uleb128 is not supported
This is because -g defaults to the compiler debug info default. If the assembler does not support some of the directives used, the above errors occur. To fix, remove the explicit passing of -g.
All the test wants is that stack traces print valid function names, and debug info is not required for that. (I currently cannot recall why I added the explicit -g.)
--- kernel/kcsan/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kcsan/Makefile +1 -1
@@ -13,6 +13,6 @@ CFLAGS_core.o := $(call cc-option,-fno-conserve-stack) \ obj-y := core.o debugfs.o report.o obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o -CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer +CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -fno-omit-frame-pointer CFLAGS_kcsan_test.o += $(DISABLE_STRUCTLEAK_PLUGIN) obj-$(CONFIG_KCSAN_KUNIT_TEST) += kcsan_test.o
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 6/99 ksmbd: dont terminate inactive sessions after a few seconds
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
[ Upstream commit be6f42fad5f5fd1fea9d562df82c38ad6ed3bfe9 ]
Steve reported that inactive sessions are terminated after a few seconds. ksmbd terminate when receiving -EAGAIN error from kernel_recvmsg(). -EAGAIN means there is no data available in timeout. So ksmbd should keep connection with unlimited retries instead of terminating inactive sessions.
--- fs/ksmbd/connection.c | 4 ++-- fs/ksmbd/connection.h | 3 ++- fs/ksmbd/transport_rdma.c | 2 +- fs/ksmbd/transport_tcp.c | 35 +++++++++++++++++++++++------------ 4 files changed, 28 insertions(+), 16 deletions(-)
fs/ksmbd/connection.c +2 -2
@@ -292,7 +292,7 @@ int ksmbd_conn_handler_loop(void *p)kvfree (conn->request_buf); conn->request_buf =NULL ; - size = t->ops->read (t, hdr_buf,sizeof (hdr_buf)); + size = t->ops->read (t, hdr_buf,sizeof (hdr_buf),-1 );if (size !=sizeof (hdr_buf))break ;
@@ -335,7 +335,7 @@ int ksmbd_conn_handler_loop(void *p)* We already read 4 bytes to find out PDU size, now * read in PDU */ - size = t->ops->read (t, conn->request_buf +4 , pdu_size); + size = t->ops->read (t, conn->request_buf +4 , pdu_size,2 );if (size <0 ) {pr_err ("sock_read failed: %d\n" , size);break ;
fs/ksmbd/connection.h +2 -1
@@ -122,7 +122,8 @@ struct ksmbd_conn_ops {struct ksmbd_transport_ops {int (*prepare)(struct ksmbd_transport *t);void (*disconnect)(struct ksmbd_transport *t); -int (*read)(struct ksmbd_transport *t,char *buf,unsigned int size); +int (*read)(struct ksmbd_transport *t,char *buf, +unsigned int size,int max_retries);int (*writev)(struct ksmbd_transport *t,struct kvec *iovs,int niov,int size,bool need_invalidate_rkey,unsigned int remote_key);
fs/ksmbd/transport_rdma.c +1 -1
@@ -663,7 +663,7 @@ static int smb_direct_post_recv(struct smb_direct_transport *t, }static int smb_direct_read (struct ksmbd_transport *t,char *buf, -unsigned int size) +unsigned int size,int unused) {struct smb_direct_recvmsg *recvmsg;struct smb_direct_data_transfer *data_transfer;
fs/ksmbd/transport_tcp.c +23 -12
@@ -291,16 +291,18 @@ static int ksmbd_tcp_run_kthread(struct interface *iface)/** * ksmbd_tcp_readv() - read data from socket in given iovec -* @t: TCP transport instance -* @iov_orig: base IO vector -* @nr_segs: number of segments in base iov -* @to_read: number of bytes to read from socket +* @t: TCP transport instance +* @iov_orig: base IO vector +* @nr_segs: number of segments in base iov +* @to_read: number of bytes to read from socket +* @max_retries: maximum retry count * * Return: on success return number of bytes read from socket, * otherwise return error number */ static int ksmbd_tcp_readv (struct tcp_transport *t,struct kvec *iov_orig, -unsigned int nr_segs,unsigned int to_read) +unsigned int nr_segs,unsigned int to_read, +int max_retries) {int length =0 ;int total_read;
@@ -308,7 +310,6 @@ static int ksmbd_tcp_readv(struct tcp_transport *t, struct kvec *iov_orig,struct msghdr ksmbd_msg;struct kvec *iov;struct ksmbd_conn *conn =KSMBD_TRANS (t)->conn; -int max_retry =2 ; iov =get_conn_iovec (t, nr_segs);if (!iov)
@@ -335,14 +336,23 @@ static int ksmbd_tcp_readv(struct tcp_transport *t, struct kvec *iov_orig, }else if (conn->status ==KSMBD_SESS_NEED_RECONNECT ) { total_read = -EAGAIN ;break ; - }else if ((length == -ERESTARTSYS || length == -EAGAIN ) && - max_retry) { + }else if (length == -ERESTARTSYS || length == -EAGAIN ) { +/* +* If max_retries is negative, Allow unlimited +* retries to keep connection with inactive sessions. +*/ +if (max_retries ==0 ) { + total_read = length; +break ; + }else if (max_retries >0 ) { + max_retries--; + } +usleep_range (1000 ,2000 ); length =0 ; - max_retry--;continue ; }else if (length <=0 ) { - total_read = -EAGAIN ; + total_read = length;break ; } }
@@ -358,14 +368,15 @@ static int ksmbd_tcp_readv(struct tcp_transport *t, struct kvec *iov_orig,* Return: on success return number of bytes read from socket, * otherwise return error number */ -static int ksmbd_tcp_read (struct ksmbd_transport *t,char *buf,unsigned int to_read) +static int ksmbd_tcp_read (struct ksmbd_transport *t,char *buf, +unsigned int to_read,int max_retries) {struct kvec iov; iov.iov_base = buf; iov.iov_len = to_read; -return ksmbd_tcp_readv (TCP_TRANS (t), &iov,1 , to_read); +return ksmbd_tcp_readv (TCP_TRANS (t), &iov,1 , to_read, max_retries); } static int ksmbd_tcp_writev(struct ksmbd_transport *t, struct kvec *iov,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 7/99 bus: imx-weim: fix branch condition evaluates to a garbage value
In reply to Greg Kroah-HartmanFrom: Ivan Bornyakov <[email protected]>
[ Upstream commit 1adab2922c58e7ff4fa9f0b43695079402cce876 ]
If bus type is other than imx50_weim_devtype and have no child devices, variable 'ret' in function weim_parse_dt() will not be initialized, but will be used as branch condition and return value. Fix this by initializing 'ret' with 0.
This was discovered with help of clang-analyzer, but the situation is quite possible in real life.
--- drivers/bus/imx-weim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/imx-weim.c +1 -1
@@ -192,8 +192,8 @@ static int weim_parse_dt(struct platform_device *pdev, void __iomem *base)const struct of_device_id *of_id =of_match_device (weim_id_table, &pdev->dev);const struct imx_weim_devtype *devtype = of_id->data; +int ret =0 , have_child =0 ;struct device_node *child; -int ret, have_child =0 ;struct cs_timing_state ts = {};u32 reg;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 8/99 xfrm: Zero padding when dumping algos and encap
In reply to Greg Kroah-HartmanFrom: Herbert Xu <[email protected]>
[ Upstream commit 8222d5910dae08213b6d9d4bc9a7f8502855e624 ]
When copying data to user-space we should ensure that only valid data is copied over. Padding in structures may be filled with random (possibly sensitve) data and should never be given directly to user-space.
This patch fixes the copying of xfrm algorithms and the encap template in xfrm_user so that padding is zeroed.
--- net/xfrm/xfrm_user.c | 45 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-)
net/xfrm/xfrm_user.c +41 -4
@@ -906,7 +906,9 @@ static int copy_to_user_aead(struct xfrm_algo_aead *aead, struct sk_buff *skb)return -EMSGSIZE ; ap =nla_data (nla); -memcpy (ap, aead,sizeof (*aead)); +strscpy_pad (ap->alg_name, aead->alg_name,sizeof (ap->alg_name)); + ap->alg_key_len = aead->alg_key_len; + ap->alg_icv_len = aead->alg_icv_len;if (redact_secret && aead->alg_key_len)memset (ap->alg_key,0 , (aead->alg_key_len +7 ) /8 );
@@ -926,7 +928,8 @@ static int copy_to_user_ealg(struct xfrm_algo *ealg, struct sk_buff *skb)return -EMSGSIZE ; ap =nla_data (nla); -memcpy (ap, ealg,sizeof (*ealg)); +strscpy_pad (ap->alg_name, ealg->alg_name,sizeof (ap->alg_name)); + ap->alg_key_len = ealg->alg_key_len;if (redact_secret && ealg->alg_key_len)memset (ap->alg_key,0 , (ealg->alg_key_len +7 ) /8 );
@@ -937,6 +940,40 @@ static int copy_to_user_ealg(struct xfrm_algo *ealg, struct sk_buff *skb)return 0 ; } +static int copy_to_user_calg (struct xfrm_algo *calg,struct sk_buff *skb) +{ +struct nlattr *nla =nla_reserve (skb,XFRMA_ALG_COMP ,sizeof (*calg)); +struct xfrm_algo *ap; + +if (!nla) +return -EMSGSIZE ; + + ap =nla_data (nla); +strscpy_pad (ap->alg_name, calg->alg_name,sizeof (ap->alg_name)); + ap->alg_key_len =0 ; + +return 0 ; +} + +static int copy_to_user_encap (struct xfrm_encap_tmpl *ep,struct sk_buff *skb) +{ +struct nlattr *nla =nla_reserve (skb,XFRMA_ENCAP ,sizeof (*ep)); +struct xfrm_encap_tmpl *uep; + +if (!nla) +return -EMSGSIZE ; + + uep =nla_data (nla); +memset (uep,0 ,sizeof (*uep)); + + uep->encap_type = ep->encap_type; + uep->encap_sport = ep->encap_sport; + uep->encap_dport = ep->encap_dport; + uep->encap_oa = ep->encap_oa; + +return 0 ; +} +static int xfrm_smark_put (struct sk_buff *skb,struct xfrm_mark *m) {int ret =0 ;
@@ -992,12 +1029,12 @@ static int copy_to_user_state_extra(struct xfrm_state *x, goto out; }if (x->calg) { - ret =nla_put (skb,XFRMA_ALG_COMP ,sizeof (*(x->calg)), x->calg); + ret =copy_to_user_calg (x->calg, skb);if (ret) goto out; }if (x->encap) { - ret =nla_put (skb,XFRMA_ENCAP ,sizeof (*x->encap), x->encap); + ret =copy_to_user_encap (x->encap, skb);if (ret) goto out; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 9/99 ASoC: codecs: tx-macro: Fix for KASAN: slab-out-of-bounds
In reply to Greg Kroah-HartmanFrom: Ravulapati Vishnu Vardhan Rao <[email protected]>
[ Upstream commit e5e7e398f6bb7918dab0612eb6991f7bae95520d ]
When we run syzkaller we get below Out of Bound.
"KASAN: slab-out-of-bounds Read in regcache_flat_read"
Below is the backtrace of the issue:
dump_backtrace+0x0/0x4c8
show_stack+0x34/0x44
dump_stack_lvl+0xd8/0x118
print_address_description+0x30/0x2d8
kasan_report+0x158/0x198
__asan_report_load4_noabort+0x44/0x50
regcache_flat_read+0x10c/0x110
regcache_read+0xf4/0x180
_regmap_read+0xc4/0x278
_regmap_update_bits+0x130/0x290
regmap_update_bits_base+0xc0/0x15c
snd_soc_component_update_bits+0xa8/0x22c
snd_soc_component_write_field+0x68/0xd4
tx_macro_digital_mute+0xec/0x140
Actually There is no need to have decimator with 32 bits.
By limiting the variable with short type u8 issue is resolved.--- sound/soc/codecs/lpass-tx-macro.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
sound/soc/codecs/lpass-tx-macro.c +6 -5
@@ -239,7 +239,7 @@ enum {struct tx_mute_work {struct tx_macro *tx; -u32 decimator; +u8 decimator;struct delayed_work dwork; };
@@ -632,7 +632,7 @@ static int tx_macro_mclk_enable(struct tx_macro *tx,return 0 ; } -static bool is_amic_enabled (struct snd_soc_component *component,int decimator) +static bool is_amic_enabled (struct snd_soc_component *component,u8 decimator) {u16 adc_mux_reg, adc_reg, adc_n;
@@ -843,7 +843,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) {struct snd_soc_component *component =snd_soc_dapm_to_component (w->dapm); -unsigned int decimator; +u8 decimator;u16 tx_vol_ctl_reg, dec_cfg_reg, hpf_gate_reg, tx_gain_ctl_reg;u8 hpf_cut_off_freq;int hpf_delay =TX_MACRO_DMIC_HPF_DELAY_MS ;
@@ -1058,7 +1058,8 @@ static int tx_macro_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) {struct snd_soc_component *component = dai->component; -u32 decimator, sample_rate; +u32 sample_rate; +u8 decimator;int tx_fs_rate;struct tx_macro *tx =snd_soc_component_get_drvdata (component);
@@ -1122,7 +1123,7 @@ static int tx_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream) {struct snd_soc_component *component = dai->component;struct tx_macro *tx =snd_soc_component_get_drvdata (component); -u16 decimator; +u8 decimator; decimator = tx->active_decimator[dai->id];
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 10/99 md: avoid signed overflow in slot_store()
In reply to Greg Kroah-HartmanFrom: NeilBrown <[email protected]>
[ Upstream commit 3bc57292278a0b6ac4656cad94c14f2453344b57 ]
slot_store() uses kstrtouint() to get a slot number, but stores the result in an "int" variable (by casting a pointer).
This can result in a negative slot number if the unsigned int value is very large.
A negative number means that the slot is empty, but setting a negative slot number this way will not remove the device from the array. I don't think this is a serious problem, but it could cause confusion and it is best to fix it.
--- drivers/md/md.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/md/md.c +3 -0
@@ -3189,6 +3189,9 @@ slot_store(struct md_rdev *rdev, const char *buf, size_t len) err =kstrtouint (buf,10 , (unsigned int *)&slot);if (err <0 )return err; +if (slot <0 ) +/* overflow */ +return -ENOSPC ; }if (rdev->mddev->pers && slot ==-1 ) {/* Setting 'slot' on an active array requires also
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 11/99 x86/PVH: obtain VGA console info in Dom0
In reply to Greg Kroah-HartmanFrom: Jan Beulich <[email protected]>
[ Upstream commit 934ef33ee75c3846f605f18b65048acd147e3918 ]
A new platform-op was added to Xen to allow obtaining the same VGA console information PV Dom0 is handed. Invoke the new function and have the output data processed by xen_init_vga().
--- arch/x86/xen/Makefile | 2 +- arch/x86/xen/enlighten_pv.c | 3 ++- arch/x86/xen/enlighten_pvh.c | 13 +++++++++++++ arch/x86/xen/vga.c | 5 ++--- arch/x86/xen/xen-ops.h | 7 ++++--- include/xen/interface/platform.h | 3 +++ 6 files changed, 25 insertions(+), 8 deletions(-)
arch/x86/xen/Makefile +1 -1
@@ -45,7 +45,7 @@ obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o -obj-$(CONFIG_XEN_PV_DOM0) += vga.o +obj-$(CONFIG_XEN_DOM0) += vga.o obj-$(CONFIG_SWIOTLB_XEN) += pci-swiotlb-xen.o
arch/x86/xen/enlighten_pv.c +2 -1
@@ -1353,7 +1353,8 @@ asmlinkage __visible void __init xen_start_kernel(void) x86_platform.set_legacy_features = xen_dom0_set_legacy_features; -xen_init_vga (info, xen_start_info->console.dom0.info_size); +xen_init_vga (info, xen_start_info->console.dom0.info_size, + &boot_params.screen_info); xen_start_info->console.domU.mfn =0 ; xen_start_info->console.domU.evtchn =0 ;
arch/x86/xen/enlighten_pvh.c +13 -0
@@ -43,6 +43,19 @@ void __init xen_pvh_init(struct boot_params *boot_params) x86_init.oem.banner = xen_banner;xen_efi_init (boot_params); + +if (xen_initial_domain ()) { +struct xen_platform_op op = { + .cmd = XENPF_get_dom0_console, + }; +long ret =HYPERVISOR_platform_op (&op); + +if (ret >0 ) +xen_init_vga (&op.u.dom0_console, +min (ret *sizeof (char ), +sizeof (op.u.dom0_console)), + &boot_params->screen_info); + } }void __init mem_map_via_hcall (struct boot_params *boot_params_p)
arch/x86/xen/vga.c +2 -3
@@ -9,10 +9,9 @@#include "xen-ops.h" -void __init xen_init_vga (const struct dom0_vga_console_info *info,size_t size) +void __init xen_init_vga (const struct dom0_vga_console_info *info,size_t size, +struct screen_info *screen_info) { -struct screen_info *screen_info = &boot_params.screen_info; -/* This is drawn from a dump from vgacon:startup in * standard Linux. */ screen_info->orig_video_mode =3 ;
arch/x86/xen/xen-ops.h +4 -3
@@ -110,11 +110,12 @@ static inline void xen_uninit_lock_cpu(int cpu)struct dom0_vga_console_info ; -#ifdef CONFIG_XEN_PV_DOM0 -void __init xen_init_vga (const struct dom0_vga_console_info *,size_t size); +#ifdef CONFIG_XEN_DOM0 +void __init xen_init_vga (const struct dom0_vga_console_info *,size_t size, +struct screen_info *);#else static inline void __init xen_init_vga (const struct dom0_vga_console_info *info, -size_t size) +size_t size,struct screen_info *si) { }#endif
include/xen/interface/platform.h +3 -0
@@ -500,6 +500,8 @@ struct xenpf_symdata { };DEFINE_GUEST_HANDLE_STRUCT (xenpf_symdata); +#define XENPF_get_dom0_console 64 +struct xen_platform_op {uint32_t cmd;uint32_t interface_version;/* XENPF_INTERFACE_VERSION */
@@ -523,6 +525,7 @@ struct xen_platform_op {struct xenpf_mem_hotadd mem_add;struct xenpf_core_parking core_parking;struct xenpf_symdata symdata; +struct dom0_vga_console_info dom0_console;uint8_t pad[128 ]; } u; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 12/99 net: hsr: Dont log netdev_err message on unknown prp dst node
In reply to Greg Kroah-HartmanFrom: Kristian Overskeid <[email protected]>
[ Upstream commit 28e8cabe80f3e6e3c98121576eda898eeb20f1b1 ]
If no frames has been exchanged with a node for HSR_NODE_FORGET_TIME, the node will be deleted from the node_db list. If a frame is sent to the node after it is deleted, a netdev_err message for each slave interface is produced. This should not happen with dan nodes because of supervision frames, but can happen often with san nodes, which clutters the kernel log. Since the hsr protocol does not support sans, this is only relevant for the prp protocol.
--- net/hsr/hsr_framereg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/hsr/hsr_framereg.c +1 -1
@@ -385,7 +385,7 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, node_dst =find_node_by_addr_A (&port->hsr->node_db,eth_hdr (skb)->h_dest);if (!node_dst) { -if (net_ratelimit ()) +if (net_ratelimit () && port->hsr->prot_version !=PRP_V1 )netdev_err (skb->dev,"%s: Unknown node\n" , __func__);return ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 13/99 ALSA: asihpi: check pao in control_message()
In reply to Greg Kroah-HartmanFrom: Kuninori Morimoto <[email protected]>
[ Upstream commit 9026c0bf233db53b86f74f4c620715e94eb32a09 ]
control_message() might be called with pao = NULL. Here indicates control_message() as sample.
(B) static void control_message(struct hpi_adapter_obj *pao, ...)
{ ^^^
struct hpi_hw_obj *phw = pao->priv;
... ^^^
}(A) void _HPI_6205(struct hpi_adapter_obj *pao, ...)
{ ^^^
...
case HPI_OBJ_CONTROL:
(B) control_message(pao, phm, phr);
break; ^^^
...
}
void HPI_6205(...)
{
...
(A) _HPI_6205(NULL, phm, phr);
... ^^^^
}Therefore, We will get too many warning via cppcheck, like below
sound/pci/asihpi/hpi6205.c:238:27: warning: Possible null pointer dereference: pao [nullPointer] struct hpi_hw_obj *phw = pao->priv; ^ sound/pci/asihpi/hpi6205.c:433:13: note: Calling function '_HPI_6205', 1st argument 'NULL' value is 0 _HPI_6205(NULL, phm, phr); ^ sound/pci/asihpi/hpi6205.c:401:20: note: Calling function 'control_message', 1st argument 'pao' value is 0 control_message(pao, phm, phr); ^
Set phr->error like many functions doing, and don't call _HPI_6205() with NULL.
--- sound/pci/asihpi/hpi6205.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/asihpi/hpi6205.c +1 -1
@@ -430,7 +430,7 @@ void HPI_6205(struct hpi_message *phm, struct hpi_response *phr) pao =hpi_find_adapter (phm->adapter_index); }else {/* subsys messages don't address an adapter */ -_HPI_6205 (NULL , phm, phr); + phr->error =HPI_ERROR_INVALID_OBJ_INDEX ;return ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 14/99 ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set()
In reply to Greg Kroah-HartmanFrom: Kuninori Morimoto <[email protected]>
[ Upstream commit 98e5eb110095ec77cb6d775051d181edbf9cd3cf ]
tuning_ctl_set() might have buffer overrun at (X) if it didn't break from loop by matching (A).
static int tuning_ctl_set(...)
{
for (i = 0; i < TUNING_CTLS_COUNT; i++)
(A) if (nid == ca0132_tuning_ctls[i].nid)
break;
snd_hda_power_up(...);
(X) dspio_set_param(..., ca0132_tuning_ctls[i].mid, ...);
snd_hda_power_down(...); ^
return 1;
}We will get below error by cppcheck
sound/pci/hda/patch_ca0132.c:4229:2: note: After for loop, i has value 12 for (i = 0; i < TUNING_CTLS_COUNT; i++) ^ sound/pci/hda/patch_ca0132.c:4234:43: note: Array index out of bounds dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20, ^
This patch cares non match case.
--- sound/pci/hda/patch_ca0132.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/pci/hda/patch_ca0132.c +3 -1
@@ -4231,8 +4231,10 @@ static int tuning_ctl_set(struct hda_codec *codec, hda_nid_t nid,for (i =0 ; i <TUNING_CTLS_COUNT ; i++)if (nid == ca0132_tuning_ctls[i].nid) -break ; + goto found; +return -EINVAL ; +found:snd_hda_power_up (codec); dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20, ca0132_tuning_ctls[i].req,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 15/99 fbdev: tgafb: Fix potential divide by zero
In reply to Greg Kroah-HartmanFrom: Wei Chen <[email protected]>
[ Upstream commit f90bd245de82c095187d8c2cabb8b488a39eaecc ]
fb_set_var would by called when user invokes ioctl with cmd FBIOPUT_VSCREENINFO. User-provided data would finally reach tgafb_check_var. In case var->pixclock is assigned to zero, divide by zero would occur when checking whether reciprocal of var->pixclock is too high.
Similar crashes have happened in other fbdev drivers. There is no check and modification on var->pixclock along the call chain to tgafb_check_var. We believe it could also be triggered in driver tgafb from user site.
--- drivers/video/fbdev/tgafb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/tgafb.c +3 -0
@@ -166,6 +166,9 @@ tgafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) {struct tga_par *par = (struct tga_par *)info->par; +if (!var->pixclock) +return -EINVAL ; +if (par->tga_type ==TGA_TYPE_8PLANE ) {if (var->bits_per_pixel !=8 )return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 16/99 sched_getaffinity: dont assume cpumask_size() is fully initialized
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
[ Upstream commit 6015b1aca1a233379625385feb01dd014aca60b5 ]
The getaffinity() system call uses 'cpumask_size()' to decide how big the CPU mask is - so far so good. It is indeed the allocation size of a cpumask.
But the code also assumes that the whole allocation is initialized without actually doing so itself. That's wrong, because we might have fixed-size allocations (making copying and clearing more efficient), but not all of it is then necessarily used if 'nr_cpu_ids' is smaller.
Having checked other users of 'cpumask_size()', they all seem to be ok, either using it purely for the allocation size, or explicitly zeroing the cpumask before using the size in bytes to copy it.
See for example the ublk_ctrl_get_queue_affinity() function that uses the proper 'zalloc_cpumask_var()' to make sure that the whole mask is cleared, whether the storage is on the stack or if it was an external allocation.
Fix this by just zeroing the allocation before using it. Do the same for the compat version of sched_getaffinity(), which had the same logic.
Also, for consistency, make sched_getaffinity() use 'cpumask_bits()' to access the bits. For a cpumask_var_t, it ends up being a pointer to the same data either way, but it's just a good idea to treat it like you would a 'cpumask_t'. The compat case already did that.
--- kernel/compat.c | 2 +- kernel/sched/core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/compat.c +1 -1
@@ -152,7 +152,7 @@ COMPAT_SYSCALL_DEFINE3(sched_getaffinity, compat_pid_t, pid, unsigned int, len,if (len & (sizeof (compat_ulong_t)-1 ))return -EINVAL ; -if (!alloc_cpumask_var (&mask,GFP_KERNEL )) +if (!zalloc_cpumask_var (&mask,GFP_KERNEL ))return -ENOMEM ; ret =sched_getaffinity (pid, mask);
kernel/sched/core.c +2 -2
@@ -8185,14 +8185,14 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,if (len & (sizeof (unsigned long )-1 ))return -EINVAL ; -if (!alloc_cpumask_var (&mask,GFP_KERNEL )) +if (!zalloc_cpumask_var (&mask,GFP_KERNEL ))return -ENOMEM ; ret =sched_getaffinity (pid, mask);if (ret ==0 ) {unsigned int retlen =min (len,cpumask_size ()); -if (copy_to_user (user_mask_ptr, mask, retlen)) +if (copy_to_user (user_mask_ptr,cpumask_bits (mask), retlen)) ret = -EFAULT ;else ret = retlen;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 17/99 fbdev: nvidia: Fix potential divide by zero
In reply to Greg Kroah-HartmanFrom: Wei Chen <[email protected]>
[ Upstream commit 92e2a00f2987483e1f9253625828622edd442e61 ]
variable var->pixclock can be set by user. In case it equals to zero, divide by zero would occur in nvidiafb_set_par.
Similar crashes have happened in other fbdev drivers. There is no check and modification on var->pixclock along the call chain to nvidia_check_var and nvidiafb_set_par. We believe it could also be triggered in driver nvidia from user site.
--- drivers/video/fbdev/nvidia/nvidia.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/video/fbdev/nvidia/nvidia.c +2 -0
@@ -763,6 +763,8 @@ static int nvidiafb_check_var(struct fb_var_screeninfo *var,int pitch, err =0 ;NVTRACE_ENTER (); +if (!var->pixclock) +return -EINVAL ; var->transp.offset =0 ; var->transp.length =0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 18/99 fbdev: intelfb: Fix potential divide by zero
In reply to Greg Kroah-HartmanFrom: Wei Chen <[email protected]>
[ Upstream commit d823685486a3446d061fed7c7d2f80af984f119a ]
Variable var->pixclock is controlled by user and can be assigned to zero. Without proper check, divide by zero would occur in intelfbhw_validate_mode and intelfbhw_mode_to_hw.
Error out if var->pixclock is zero.
--- drivers/video/fbdev/intelfb/intelfbdrv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/intelfb/intelfbdrv.c +3 -0
@@ -1214,6 +1214,9 @@ static int intelfb_check_var(struct fb_var_screeninfo *var, dinfo =GET_DINFO (info); +if (!var->pixclock) +return -EINVAL ; +/* update the pitch */ if (intelfbhw_validate_mode (dinfo, var) !=0 )return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 19/99 fbdev: lxfb: Fix potential divide by zero
In reply to Greg Kroah-HartmanFrom: Wei Chen <[email protected]>
[ Upstream commit 61ac4b86a4c047c20d5cb423ddd87496f14d9868 ]
var->pixclock can be assigned to zero by user. Without proper check, divide by zero would occur in lx_set_clock.
Error out if var->pixclock is zero.
--- drivers/video/fbdev/geode/lxfb_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/geode/lxfb_core.c +3 -0
@@ -234,6 +234,9 @@ static void get_modedb(struct fb_videomode **modedb, unsigned int *size)static int lxfb_check_var (struct fb_var_screeninfo *var,struct fb_info *info) { +if (!var->pixclock) +return -EINVAL ; +if (var->xres >1920 || var->yres >1440 )return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 20/99 fbdev: au1200fb: Fix potential divide by zero
In reply to Greg Kroah-HartmanFrom: Wei Chen <[email protected]>
[ Upstream commit 44a3b36b42acfc433aaaf526191dd12fbb919fdb ]
var->pixclock can be assigned to zero by user. Without proper check, divide by zero would occur when invoking macro PICOS2KHZ in au1200fb_fb_check_var.
Error out if var->pixclock is zero.
--- drivers/video/fbdev/au1200fb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/au1200fb.c +3 -0
@@ -1040,6 +1040,9 @@ static int au1200fb_fb_check_var(struct fb_var_screeninfo *var,u32 pixclock;int screen_size, plane; +if (!var->pixclock) +return -EINVAL ; + plane = fbdev->plane;/* Make sure that the mode respect all LCD controller and
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 21/99 tools/power turbostat: Fix /dev/cpu_dma_latency warnings
In reply to Greg Kroah-HartmanFrom: Prarit Bhargava <[email protected]>
[ Upstream commit 40aafc7d58d3544f152a863a0e9863014b6d5d8c ]
When running as non-root the following error is seen in turbostat:
turbostat: fopen /dev/cpu_dma_latency
: Permission denied
turbostat and the man page have information on how to avoid other permission errors, so these can be fixed the same way.
Provide better /dev/cpu_dma_latency warnings that provide instructions on how to avoid the error, and update the man page.
--- tools/power/x86/turbostat/turbostat.8 | 2 ++ tools/power/x86/turbostat/turbostat.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
tools/power/x86/turbostat/turbostat.8 +2 -0
@@ -296,6 +296,8 @@ Alternatively, non-root users can be enabled to run turbostat this way: # chmod +r /dev/cpu/*/msr +# chmod +r /dev/cpu_dma_latency + .B "turbostat " reads hardware counters, but doesn't write them. So it will not interfere with the OS or other programs, including
tools/power/x86/turbostat/turbostat.c +1 -1
@@ -5237,7 +5237,7 @@ void print_dev_latency(void) retval =read (fd, (void *)&value,sizeof (int ));if (retval !=sizeof (int )) { -warn ("read %s\n" , path); +warn ("read failed %s\n" , path);close (fd);return ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 22/99 tools/power turbostat: fix decoding of HWP_STATUS
In reply to Greg Kroah-HartmanFrom: Antti Laakso <[email protected]>
[ Upstream commit 92c25393586ac799b9b7d9e50434f3c44a7622c4 ]
The "excursion to minimum" information is in bit2
in HWP_STATUS MSR. Fix the bitmask used for
decoding the register.
--- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/x86/turbostat/turbostat.c +1 -1
@@ -4241,7 +4241,7 @@ int print_hwp(struct thread_data *t, struct core_data *c, struct pkg_data *p)fprintf (outf,"cpu%d: MSR_HWP_STATUS: 0x%08llx " "(%sGuaranteed_Perf_Change, %sExcursion_Min)\n" , - cpu, msr, ((msr) &0x1 ) ?"" :"No-" , ((msr) &0x2 ) ?"" :"No-" ); + cpu, msr, ((msr) &0x1 ) ?"" :"No-" , ((msr) &0x4 ) ?"" :"No-" );return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 23/99 tracing: Fix wrong return in kprobe_event_gen_test.c
In reply to Greg Kroah-HartmanFrom: Anton Gusev <[email protected]>
[ Upstream commit bc4f359b3b607daac0290d0038561237a86b38cb ]
Overwriting the error code with the deletion result may cause the function to return 0 despite encountering an error. Commit b111545d26c0 ("tracing: Remove the useless value assignment in test_create_synth_event()") solves a similar issue by returning the original error code, so this patch does the same.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- kernel/trace/kprobe_event_gen_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/kprobe_event_gen_test.c +2 -2
@@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void)if (trace_event_file_is_valid (gen_kprobe_test)) gen_kprobe_test =NULL ;/* We got an error after creating the event, delete it */ - ret =kprobe_event_delete ("gen_kprobe_test" ); +kprobe_event_delete ("gen_kprobe_test" ); goto out; }
@@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void)if (trace_event_file_is_valid (gen_kretprobe_test)) gen_kretprobe_test =NULL ;/* We got an error after creating the event, delete it */ - ret =kprobe_event_delete ("gen_kretprobe_test" ); +kprobe_event_delete ("gen_kretprobe_test" ); goto out; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 24/99 ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
[ Upstream commit 748b2f5e82d17480404b3e2895388fc2925f7caf ]
mac_len is of type unsigned, which can never be less than zero.
mac_len = ieee802154_hdr_peek_addrs(skb, &header); if (mac_len < 0) return mac_len;
Change this to type int as ieee802154_hdr_peek_addrs() can return negative integers, this is found by static analysis with smatch.
--- drivers/net/ieee802154/ca8210.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ieee802154/ca8210.c +1 -2
@@ -1945,10 +1945,9 @@ static int ca8210_skb_tx(struct ca8210_priv *priv ) { -int status;struct ieee802154_hdr header = { };struct secspec secspec; -unsigned int mac_len; +int mac_len, status;dev_dbg (&priv->spi->dev,"%s called\n" , __func__);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 25/99 mips: bmips: BCM6358: disable RAC flush for TP1
In reply to Greg Kroah-HartmanFrom: Álvaro Fernández Rojas <[email protected]>
[ Upstream commit ab327f8acdf8d06601fbf058859a539a9422afff ]
RAC flush causes kernel panics on BCM6358 with EHCI/OHCI when booting from TP1:
[ 3.881739] usb 1-1: new high-speed USB device number 2 using ehci-platform [ 3.895011] Reserved instruction in kernel code[#1]: [ 3.900113] CPU: 0 PID: 1 Comm: init Not tainted 5.10.16 #0 [ 3.905829] $ 0 : 00000000 10008700 00000000 77d94060 [ 3.911238] $ 4 : 7fd1f088 00000000 81431cac 81431ca0 [ 3.916641] $ 8 : 00000000 ffffefff 8075cd34 00000000 [ 3.922043] $12 : 806f8d40 f3e812b7 00000000 000d9aaa [ 3.927446] $16 : 7fd1f068 7fd1f080 7ff559b8 81428470 [ 3.932848] $20 : 00000000 00000000 55590000 77d70000 [ 3.938251] $24 : 00000018 00000010 [ 3.943655] $28 : 81430000 81431e60 81431f28 800157fc [ 3.949058] Hi : 00000000 [ 3.952013] Lo : 00000000 [ 3.955019] epc : 80015808 setup_sigcontext+0x54/0x24c [ 3.960464] ra : 800157fc setup_sigcontext+0x48/0x24c [ 3.965913] Status: 10008703 KERNEL EXL IE [ 3.970216] Cause : 00800028 (ExcCode 0a) [ 3.974340] PrId : 0002a010 (Broadcom BMIPS4350) [ 3.979170] Modules linked in: ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug usbcore nls_base usb_common [ 3.992907] Process init (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=77e22ec8) [ 4.000776] Stack : 81431ef4 7fd1f080 81431f28 81428470 7fd1f068 81431edc 7ff559b8 81428470 [ 4.009467] 81431f28 7fd1f080 55590000 77d70000 77d5498c 80015c70 806f0000 8063ae74 [ 4.018149] 08100002 81431f28 0000000a 08100002 81431f28 0000000a 77d6b418 00000003 [ 4.026831] ffffffff 80016414 80080734 81431ecc 81431ecc 00000001 00000000 04000000 [ 4.035512] 77d54874 00000000 00000000 00000000 00000000 00000012 00000002 00000000 [ 4.044196] ... [ 4.046706] Call Trace: [ 4.049238] [<80015808>] setup_sigcontext+0x54/0x24c [ 4.054356] [<80015c70>] setup_frame+0xdc/0x124 [ 4.059015] [<80016414>] do_notify_resume+0x1dc/0x288 [ 4.064207] [<80011b50>] work_notifysig+0x10/0x18 [ 4.069036] [ 4.070538] Code: 8fc300b4 00001025 26240008 <ac820000> ac830004 3c048063 0c0228aa 24846a00 26240010 [ 4.080686] [ 4.082517] ---[ end trace 22a8edb41f5f983b ]--- [ 4.087374] Kernel panic - not syncing: Fatal exception [ 4.092753] Rebooting in 1 seconds..
Because the bootloader (CFE) is not initializing the Read-ahead cache properly on the second thread (TP1). Since the RAC was not initialized properly, we should avoid flushing it at the risk of corrupting the instruction stream as seen in the trace above.
--- arch/mips/bmips/dma.c | 5 +++++ arch/mips/bmips/setup.c | 8 ++++++++ 2 files changed, 13 insertions(+)
arch/mips/bmips/dma.c +5 -0
@@ -64,6 +64,8 @@ phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dma_addr)return dma_addr; } +bool bmips_rac_flush_disable; +void arch_sync_dma_for_cpu_all (void ) {void __iomem *cbr =BMIPS_GET_CBR ();
@@ -74,6 +76,9 @@ void arch_sync_dma_for_cpu_all(void) boot_cpu_type() != CPU_BMIPS4380)return ; +if (unlikely (bmips_rac_flush_disable)) +return ; +/* Flush stale data out of the readahead cache */ cfg =__raw_readl (cbr +BMIPS_RAC_CONFIG );__raw_writel (cfg |0x100 , cbr +BMIPS_RAC_CONFIG );
arch/mips/bmips/setup.c +8 -0
@@ -34,6 +34,8 @@#define REG_BCM6328_OTP ((void __iomem *)CKSEG1ADDR(0x1000062c))#define BCM6328_TP1_DISABLED BIT(9) +extern bool bmips_rac_flush_disable; +static const unsigned long kbase =VMLINUX_LOAD_ADDRESS &0xfff00000 ;struct bmips_quirk {
@@ -103,6 +105,12 @@ static void bcm6358_quirks(void)* disable SMP for now */ bmips_smp_enabled =0 ; + +/* +* RAC flush causes kernel panics on BCM6358 when booting from TP1 +* because the bootloader is not initializing it properly. +*/ + bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local () & (1 <<31 )); }static void bcm6368_quirks (void )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 26/99 ALSA: usb-audio: Fix recursive locking at XRUN during syncing
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit 8c721c53dda512fdd48eb24d6d99e56deee57898 ]
The recent support of low latency playback in USB-audio driver made the snd_usb_queue_pending_output_urbs() function to be called via PCM ack ops. In the new code path, the function is performed already in the PCM stream lock. The problem is that, when an XRUN is detected, the function calls snd_pcm_xrun() to notify, but snd_pcm_xrun() is supposed to be called only outside the stream lock. As a result, it leads to a deadlock of PCM stream locking.
For avoiding such a recursive locking, this patch adds an additional check to the code paths in PCM core that call the ack callback; now it checks the error code from the callback, and if it's -EPIPE, the XRUN is handled in the PCM core side gracefully. Along with it, the USB-audio driver code is changed to follow that, i.e. -EPIPE is returned instead of the explicit snd_pcm_xrun() call when the function is performed already in the stream lock.
Reviewed-by; Takashi Sakamoto <[email protected]>
--- sound/core/pcm_lib.c | 2 ++ sound/usb/endpoint.c | 22 ++++++++++++++-------- sound/usb/endpoint.h | 4 ++-- sound/usb/pcm.c | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-)
sound/core/pcm_lib.c +2 -0
@@ -2137,6 +2137,8 @@ int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream, ret = substream->ops->ack (substream);if (ret <0 ) { runtime->control->appl_ptr = old_appl_ptr; +if (ret == -EPIPE ) +__snd_pcm_xrun (substream);return ret; } }
sound/usb/endpoint.c +14 -8
@@ -444,8 +444,8 @@ static void push_back_to_ready_list(struct snd_usb_endpoint *ep,* This function is used both for implicit feedback endpoints and in low- * latency playback mode. */ -void snd_usb_queue_pending_output_urbs (struct snd_usb_endpoint *ep, -bool in_stream_lock) +int snd_usb_queue_pending_output_urbs (struct snd_usb_endpoint *ep, +bool in_stream_lock) {bool implicit_fb =snd_usb_endpoint_implicit_feedback_sink (ep);
@@ -469,7 +469,7 @@ void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep,spin_unlock_irqrestore (&ep->lock, flags);if (ctx ==NULL ) -return ; +break ;/* copy over the length information */ if (implicit_fb) {
@@ -484,11 +484,14 @@ void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep,break ;if (err <0 ) {/* push back to ready list again for -EAGAIN */ -if (err == -EAGAIN ) +if (err == -EAGAIN ) {push_back_to_ready_list (ep, ctx); -else +break ; + } + +if (!in_stream_lock)notify_xrun (ep); -return ; +return -EPIPE ; } err =usb_submit_urb (ctx->urb,GFP_ATOMIC );
@@ -496,13 +499,16 @@ void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep,usb_audio_err (ep->chip,"Unable to submit urb #%d: %d at %s\n" , ctx->index, err, __func__); -notify_xrun (ep); -return ; +if (!in_stream_lock) +notify_xrun (ep); +return -EPIPE ; }set_bit (ctx->index, &ep->active_mask);atomic_inc (&ep->submitted_urbs); } + +return 0 ; }/*
sound/usb/endpoint.h +2 -2
@@ -49,7 +49,7 @@ int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);int snd_usb_endpoint_next_packet_size (struct snd_usb_endpoint *ep,struct snd_urb_ctx *ctx,int idx,unsigned int avail); -void snd_usb_queue_pending_output_urbs (struct snd_usb_endpoint *ep, -bool in_stream_lock); +int snd_usb_queue_pending_output_urbs (struct snd_usb_endpoint *ep, +bool in_stream_lock);#endif /* __USBAUDIO_ENDPOINT_H */
sound/usb/pcm.c +1 -1
@@ -1557,7 +1557,7 @@ static int snd_usb_pcm_playback_ack(struct snd_pcm_substream *substream)* outputs here */ if (!ep->active_mask) -snd_usb_queue_pending_output_urbs (ep, true); +return snd_usb_queue_pending_output_urbs (ep, true);return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 27/99 platform/x86: think-lmi: add missing type attribute
In reply to Greg Kroah-HartmanFrom: Mark Pearson <[email protected]>
[ Upstream commit 583329dcf22e568a328a944f20427ccfc95dce01 ]
This driver was missing the mandatory type attribute...oops.
Add it in along with logic to determine whether the attribute is an enumeration type or a string by parsing the possible_values attribute.
Upstream bug https://bugzilla.kernel.org/show_bug.cgi?id=216460
--- drivers/platform/x86/think-lmi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/platform/x86/think-lmi.c +17 -0
@@ -531,6 +531,20 @@ static ssize_t possible_values_show(struct kobject *kobj, struct kobj_attributereturn sysfs_emit (buf,"%s\n" , setting->possible_values); } +static ssize_t type_show (struct kobject *kobj,struct kobj_attribute *attr, +char *buf) +{ +struct tlmi_attr_setting *setting =to_tlmi_attr_setting (kobj); + +if (setting->possible_values) { +/* Figure out what setting type is as BIOS does not return this */ +if (strchr (setting->possible_values,',' )) +return sysfs_emit (buf,"enumeration\n" ); + } +/* Anything else is going to be a string */ +return sysfs_emit (buf,"string\n" ); +} +static ssize_t current_value_store (struct kobject *kobj,struct kobj_attribute *attr,const char *buf,size_t count)
@@ -601,10 +615,13 @@ static struct kobj_attribute attr_possible_values = __ATTR_RO(possible_values);static struct kobj_attribute attr_current_val =__ATTR_RW_MODE (current_value,0600 ); +static struct kobj_attribute attr_type =__ATTR_RO (type); +static struct attribute *tlmi_attrs[] = { &attr_displ_name.attr, &attr_current_val.attr, &attr_possible_values.attr, + &attr_type.attr,NULL };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 28/99 platform/x86: think-lmi: use correct possible_values delimiters
In reply to Greg Kroah-HartmanFrom: Mark Pearson <[email protected]>
[ Upstream commit 45e21289bfc6e257885514790a8a8887da822d40 ]
firmware-attributes class requires that possible values are delimited using ';' but the Lenovo firmware uses ',' instead.
Parse string and replace where appropriate.
--- drivers/platform/x86/think-lmi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/x86/think-lmi.c +8 -1
@@ -538,7 +538,7 @@ static ssize_t type_show(struct kobject *kobj, struct kobj_attribute *attr,if (setting->possible_values) {/* Figure out what setting type is as BIOS does not return this */ -if (strchr (setting->possible_values,',' )) +if (strchr (setting->possible_values,';' ))return sysfs_emit (buf,"enumeration\n" ); }/* Anything else is going to be a string */
@@ -934,6 +934,13 @@ static int tlmi_analyze(void)pr_info ("Error retrieving possible values for %d : %s\n" , i, setting->display_name); } +/* +* firmware-attributes requires that possible_values are separated by ';' but +* Lenovo FW uses ','. Replace appropriately. +*/ +if (setting->possible_values) +strreplace (setting->possible_values,',' ,';' ); +kobject_init (&setting->kobj, &tlmi_attr_setting_ktype); tlmi_priv.setting[i] = setting;kfree (item);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 29/99 platform/x86: think-lmi: only display possible_values if available
In reply to Greg Kroah-HartmanFrom: Mark Pearson <[email protected]>
[ Upstream commit cf337f27f3bfc4aeab4954c468239fd6233c7638 ]
Some attributes don't have any values available. In those cases don't make the possible_values entry visible.
--- drivers/platform/x86/think-lmi.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/platform/x86/think-lmi.c +13 -3
@@ -525,9 +525,6 @@ static ssize_t possible_values_show(struct kobject *kobj, struct kobj_attribute {struct tlmi_attr_setting *setting =to_tlmi_attr_setting (kobj); -if (!tlmi_priv.can_get_bios_selections) -return -EOPNOTSUPP ; -return sysfs_emit (buf,"%s\n" , setting->possible_values); }
@@ -617,6 +614,18 @@ static struct kobj_attribute attr_current_val = __ATTR_RW_MODE(current_value, 06static struct kobj_attribute attr_type =__ATTR_RO (type); +static umode_t attr_is_visible (struct kobject *kobj, +struct attribute *attr,int n) +{ +struct tlmi_attr_setting *setting =to_tlmi_attr_setting (kobj); + +/* We don't want to display possible_values attributes if not available */ +if ((attr == &attr_possible_values.attr) && (!setting->possible_values)) +return 0 ; + +return attr->mode; +} +static struct attribute *tlmi_attrs[] = { &attr_displ_name.attr, &attr_current_val.attr,
@@ -626,6 +635,7 @@ static struct attribute *tlmi_attrs[] = { };static const struct attribute_group tlmi_attr_group = { + .is_visible = attr_is_visible, .attrs = tlmi_attrs, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 30/99 platform/x86: think-lmi: Add possible_values for ThinkStation
In reply to Greg Kroah-HartmanFrom: Mark Pearson <[email protected]>
[ Upstream commit 8a02d70679fc1c434401863333c8ea7dbf201494 ]
ThinkStation platforms don't support the API to return possible_values but instead embed it in the settings string.
Try and extract this information and set the possible_values attribute appropriately.
--- drivers/platform/x86/think-lmi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/platform/x86/think-lmi.c +20 -0
@@ -943,6 +943,26 @@ static int tlmi_analyze(void)if (ret || !setting->possible_values)pr_info ("Error retrieving possible values for %d : %s\n" , i, setting->display_name); + }else { +/* +* Older Thinkstations don't support the bios_selections API. +* Instead they store this as a [Optional:Option1,Option2] section of the +* name string. +* Try and pull that out if it's available. +*/ +char *item, *optstart, *optend; + +if (!tlmi_setting (setting->index, &item,LENOVO_BIOS_SETTING_GUID )) { + optstart =strstr (item,"[Optional:" ); +if (optstart) { + optstart +=strlen ("[Optional:" ); + optend =strstr (optstart,"]" ); +if (optend) + setting->possible_values = +kstrndup (optstart, optend - optstart, +GFP_KERNEL ); + } + } }/* * firmware-attributes requires that possible_values are separated by ';' but
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 31/99 mtd: rawnand: meson: invalidate cache on polling ECC bit
In reply to Greg Kroah-HartmanFrom: Arseniy Krasnov <[email protected]>
[ Upstream commit e732e39ed9929c05fd219035bc9653ba4100d4fa ]
'info_buf' memory is cached and driver polls ECC bit in it. This bit is set by the NAND controller. If 'usleep_range()' returns before device sets this bit, 'info_buf' will be cached and driver won't see update of this bit and will loop forever.
--- drivers/mtd/nand/raw/meson_nand.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/meson_nand.c +7 -1
@@ -172,6 +172,7 @@ struct meson_nfc {dma_addr_t daddr;dma_addr_t iaddr; +u32 info_bytes;unsigned long assigned_cs; };
@@ -499,6 +500,7 @@ static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, nfc->daddr, datalen, dir);return ret; } + nfc->info_bytes = infolen; cmd =GENCMDIADDRL (NFC_CMD_AIL , nfc->iaddr);writel (cmd, nfc->reg_base +NFC_REG_CMD );
@@ -516,8 +518,10 @@ static void meson_nfc_dma_buffer_release(struct nand_chip *nand,struct meson_nfc *nfc =nand_get_controller_data (nand);dma_unmap_single (nfc->dev, nfc->daddr, datalen, dir); -if (infolen) +if (infolen) {dma_unmap_single (nfc->dev, nfc->iaddr, infolen, dir); + nfc->info_bytes =0 ; + } }static int meson_nfc_read_buf (struct nand_chip *nand,u8 *buf,int len)
@@ -706,6 +710,8 @@ static void meson_nfc_check_ecc_pages_valid(struct meson_nfc *nfc,usleep_range (10 ,15 );/* info is updated by nfc dma engine*/ smp_rmb (); +dma_sync_single_for_cpu (nfc->dev, nfc->iaddr, nfc->info_bytes, +DMA_FROM_DEVICE ); ret = *info &ECC_COMPLETE ; }while (!ret); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 32/99 SUNRPC: fix shutdown of NFS TCP client socket
In reply to Greg Kroah-HartmanFrom: Siddharth Kawar <[email protected]>
[ Upstream commit 943d045a6d796175e5d08f9973953b1d2c07d797 ]
NFS server Duplicate Request Cache (DRC) algorithms rely on NFS clients reconnecting using the same local TCP port. Unique NFS operations are identified by the per-TCP connection set of XIDs. This prevents file corruption when non-idempotent NFS operations are retried.
Currently, NFS client TCP connections are using different local TCP ports when reconnecting to NFS servers.
After an NFS server initiates shutdown of the TCP connection, the NFS client's TCP socket is set to NULL after the socket state has reached TCP_LAST_ACK(9). When reconnecting, the new socket attempts to reuse the same local port but fails with EADDRNOTAVAIL (99). This forces the socket to use a different local TCP port to reconnect to the remote NFS server.
State Transition and Events:TCP_CLOSE_WAIT(8)TCP_LAST_ACK(9)
connect(fail EADDRNOTAVAIL(99))TCP_CLOSE(7)
bind on new port
connect success
dmesg excerpts showing reconnect switching from TCP local port of 926 to 763 after commit 7c81e6a9d75b:
[13354.947854] NFS call mkdir testW ... [13405.654781] RPC: xs_tcp_state_change client 00000000037d0f03... [13405.654813] RPC: state 8 conn 1 dead 0 zapped 1 sk_shutdown 1 [13405.654826] RPC: xs_data_ready... [13405.654892] RPC: xs_tcp_state_change client 00000000037d0f03... [13405.654895] RPC: state 9 conn 0 dead 0 zapped 1 sk_shutdown 3 [13405.654899] RPC: xs_tcp_state_change client 00000000037d0f03... [13405.654900] RPC: state 9 conn 0 dead 0 zapped 1 sk_shutdown 3 [13405.654950] RPC: xs_connect scheduled xprt 00000000037d0f03 [13405.654975] RPC: xs_bind 0.0.0.0:926: ok (0) [13405.654980] RPC: worker connecting xprt 00000000037d0f03 via tcp to 10.101.6.228 (port 2049) [13405.654991] RPC: 00000000037d0f03 connect status 99 connected 0 sock state 7 [13405.655001] RPC: xs_tcp_state_change client 00000000037d0f03... [13405.655002] RPC: state 7 conn 0 dead 0 zapped 1 sk_shutdown 3 [13405.655024] RPC: xs_connect scheduled xprt 00000000037d0f03 [13405.655038] RPC: xs_bind 0.0.0.0:763: ok (0) [13405.655041] RPC: worker connecting xprt 00000000037d0f03 via tcp to 10.101.6.228 (port 2049) [13405.655065] RPC: 00000000037d0f03 connect status 115 connected 0 sock state 2
State Transition and Events with patch applied:TCP_CLOSE_WAIT(8)TCP_LAST_ACK(9)TCP_CLOSE(7)
connect(reuse of port succeeds)
dmesg excerpts showing reconnect on same TCP local port of 936 with patch applied:
[ 257.139935] NFS: mkdir(0:59/560857152), testQ [ 257.139937] NFS call mkdir testQ ... [ 307.822702] RPC: state 8 conn 1 dead 0 zapped 1 sk_shutdown 1 [ 307.822714] RPC: xs_data_ready... [ 307.822817] RPC: xs_tcp_state_change client 00000000ce702f14... [ 307.822821] RPC: state 9 conn 0 dead 0 zapped 1 sk_shutdown 3 [ 307.822825] RPC: xs_tcp_state_change client 00000000ce702f14... [ 307.822826] RPC: state 9 conn 0 dead 0 zapped 1 sk_shutdown 3 [ 307.823606] RPC: xs_tcp_state_change client 00000000ce702f14... [ 307.823609] RPC: state 7 conn 0 dead 0 zapped 1 sk_shutdown 3 [ 307.823629] RPC: xs_tcp_state_change client 00000000ce702f14... [ 307.823632] RPC: state 7 conn 0 dead 0 zapped 1 sk_shutdown 3 [ 307.823676] RPC: xs_connect scheduled xprt 00000000ce702f14 [ 307.823704] RPC: xs_bind 0.0.0.0:936: ok (0) [ 307.823709] RPC: worker connecting xprt 00000000ce702f14 via tcp to 10.101.1.30 (port 2049) [ 307.823748] RPC: 00000000ce702f14 connect status 115 connected 0 sock state 2 ... [ 314.916193] RPC: state 7 conn 0 dead 0 zapped 1 sk_shutdown 3 [ 314.916251] RPC: xs_connect scheduled xprt 00000000ce702f14 [ 314.916282] RPC: xs_bind 0.0.0.0:936: ok (0) [ 314.916292] RPC: worker connecting xprt 00000000ce702f14 via tcp to 10.101.1.30 (port 2049) [ 314.916342] RPC: 00000000ce702f14 connect status 115 connected 0 sock state 2
--- net/sunrpc/xprtsock.c | 1 + 1 file changed, 1 insertion(+)
net/sunrpc/xprtsock.c +1 -0
@@ -2140,6 +2140,7 @@ static void xs_tcp_shutdown(struct rpc_xprt *xprt)switch (skst) {case TCP_FIN_WAIT1 :case TCP_FIN_WAIT2 : +case TCP_LAST_ACK :break ;case TCP_ESTABLISHED :case TCP_CLOSE_WAIT :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 33/99 sfc: ef10: dont overwrite offload features at NIC reset
In reply to Greg Kroah-HartmanFrom: Íñigo Huguet <[email protected]>
[ Upstream commit ca4a80e4bb7e87daf33b27d2ab9e4f5311018a89 ]
At NIC reset, some offload features related to encapsulated traffic might have changed (this mainly happens if the firmware-variant is changed with the sfboot userspace tool). Because of this, features are checked and set again at reset time.
However, this was not done right, and some features were improperly overwritten at NIC reset:
- Tunneled IPv6 segmentation was always disabled
- Features disabled with ethtool were reenabled
- Features that becomes unsupported after the reset were not disabled
Also, checking if the device supports IPV6_CSUM to enable TSO6 is no longer necessary because all currently supported devices support it. Additionally, move the assignment of some other features to the EF10_OFFLOAD_FEATURES macro, like it is done in ef100, leaving the selection of features in efx_pci_probe_post_io a bit cleaner.
--- drivers/net/ethernet/sfc/ef10.c | 38 ++++++++++++++++++++++----------- drivers/net/ethernet/sfc/efx.c | 17 ++++++--------- 2 files changed, 33 insertions(+), 22 deletions(-)
drivers/net/ethernet/sfc/ef10.c +26 -12
@@ -1304,7 +1304,8 @@ static void efx_ef10_fini_nic(struct efx_nic *efx)static int efx_ef10_init_nic (struct efx_nic *efx) {struct efx_ef10_nic_data *nic_data = efx->nic_data; -netdev_features_t hw_enc_features =0 ; +struct net_device *net_dev = efx->net_dev; +netdev_features_t tun_feats, tso_feats;int rc;if (nic_data->must_check_datapath_caps) {
@@ -1349,20 +1350,30 @@ static int efx_ef10_init_nic(struct efx_nic *efx) nic_data->must_restore_piobufs = false; } -/* add encapsulated checksum offload features */ +/* encap features might change during reset if fw variant changed */ if (efx_has_cap (efx,VXLAN_NVGRE ) && !efx_ef10_is_vf (efx)) - hw_enc_features |=NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM ; -/* add encapsulated TSO features */ -if (efx_has_cap (efx,TX_TSO_V2_ENCAP )) { -netdev_features_t encap_tso_features; + net_dev->hw_enc_features |=NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM ; +else + net_dev->hw_enc_features &= ~(NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM ); - encap_tso_features =NETIF_F_GSO_UDP_TUNNEL |NETIF_F_GSO_GRE | -NETIF_F_GSO_UDP_TUNNEL_CSUM |NETIF_F_GSO_GRE_CSUM ; + tun_feats =NETIF_F_GSO_UDP_TUNNEL |NETIF_F_GSO_GRE | +NETIF_F_GSO_UDP_TUNNEL_CSUM |NETIF_F_GSO_GRE_CSUM ; + tso_feats =NETIF_F_TSO |NETIF_F_TSO6 ; - hw_enc_features |= encap_tso_features |NETIF_F_TSO ; - efx->net_dev->features |= encap_tso_features; +if (efx_has_cap (efx,TX_TSO_V2_ENCAP )) { +/* If this is first nic_init, or if it is a reset and a new fw +* variant has added new features, enable them by default. +* If the features are not new, maintain their current value. +*/ +if (!(net_dev->hw_features & tun_feats)) + net_dev->features |= tun_feats; + net_dev->hw_enc_features |= tun_feats | tso_feats; + net_dev->hw_features |= tun_feats; + }else { + net_dev->hw_enc_features &= ~(tun_feats | tso_feats); + net_dev->hw_features &= ~tun_feats; + net_dev->features &= ~tun_feats; } - efx->net_dev->hw_enc_features = hw_enc_features;/* don't fail init if RSS setup doesn't work */ rc = efx->type->rx_push_rss_config(efx, false,
@@ -3993,7 +4004,10 @@ static unsigned int ef10_check_caps(const struct efx_nic *efx, NETIF_F_HW_VLAN_CTAG_FILTER | \ NETIF_F_IPV6_CSUM | \ NETIF_F_RXHASH | \ - NETIF_F_NTUPLE) + NETIF_F_NTUPLE | \ + NETIF_F_SG | \ + NETIF_F_RXCSUM | \ + NETIF_F_RXALL)const struct efx_nic_type efx_hunt_a0_vf_nic_type = { .is_vf = true,
drivers/net/ethernet/sfc/efx.c +7 -10
@@ -1003,21 +1003,18 @@ static int efx_pci_probe_post_io(struct efx_nic *efx) }/* Determine netdevice features */ - net_dev->features |= (efx->type->offload_features |NETIF_F_SG | -NETIF_F_TSO |NETIF_F_RXCSUM |NETIF_F_RXALL ); -if (efx->type->offload_features & (NETIF_F_IPV6_CSUM |NETIF_F_HW_CSUM )) { - net_dev->features |=NETIF_F_TSO6 ; -if (efx_has_cap (efx,TX_TSO_V2_ENCAP )) - net_dev->hw_enc_features |=NETIF_F_TSO6 ; - } -/* Check whether device supports TSO */ -if (!efx->type->tso_versions || !efx->type->tso_versions (efx)) - net_dev->features &= ~NETIF_F_ALL_TSO ; + net_dev->features |= efx->type->offload_features; + +/* Add TSO features */ +if (efx->type->tso_versions && efx->type->tso_versions (efx)) + net_dev->features |=NETIF_F_TSO |NETIF_F_TSO6 ; +/* Mask for features that also apply to VLAN devices */ net_dev->vlan_features |= (NETIF_F_HW_CSUM |NETIF_F_SG |NETIF_F_HIGHDMA |NETIF_F_ALL_TSO |NETIF_F_RXCSUM ); +/* Determine user configurable features */ net_dev->hw_features |= net_dev->features & ~efx->fixed_features;/* Disable receiving frames with bad FCS, by default. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 34/99 scsi: megaraid_sas: Fix crash after a double completion
In reply to Greg Kroah-HartmanFrom: Tomas Henzl <[email protected]>
[ Upstream commit 2309df27111a51734cb9240b4d3c25f2f3c6ab06 ]
When a physical disk is attached directly "without JBOD MAP support" (see megasas_get_tm_devhandle()) then there is no real error handling in the driver. Return FAILED instead of SUCCESS.
--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +2 -2
@@ -4737,7 +4737,7 @@ int megasas_task_abort_fusion(struct scsi_cmnd *scmd) devhandle =megasas_get_tm_devhandle (scmd->device);if (devhandle == (u16 )ULONG_MAX ) { - ret =SUCCESS ; + ret =FAILED ;sdev_printk (KERN_INFO , scmd->device,"task abort issued for invalid devhandle\n" );mutex_unlock (&instance->reset_mutex);
@@ -4807,7 +4807,7 @@ int megasas_reset_target_fusion(struct scsi_cmnd *scmd) devhandle =megasas_get_tm_devhandle (scmd->device);if (devhandle == (u16 )ULONG_MAX ) { - ret =SUCCESS ; + ret =FAILED ;sdev_printk (KERN_INFO , scmd->device,"target reset issued for invalid devhandle\n" );mutex_unlock (&instance->reset_mutex);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 35/99 scsi: mpt3sas: Dont print sense pool info twice
In reply to Greg Kroah-HartmanFrom: Jerry Snitselaar <[email protected]>
[ Upstream commit d684a7a26f7d2c7122a4581ac966ed64e88fb29c ]
_base_allocate_sense_dma_pool() already prints out the sense pool information, so don't print it a second time after calling it in _base_allocate_memory_pools(). In addition the version in _base_allocate_memory_pools() was using the wrong size value, sz, which was last assigned when doing some nvme calculations instead of sense_sz to determine the pool size in kilobytes.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +0 -5
@@ -6456,11 +6456,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc)else if (rc == -EAGAIN ) goto try_32bit_dma; total_sz += sense_sz; -ioc_info (ioc, -"sense pool(0x%p)- dma(0x%llx): depth(%d)," -"element_size(%d), pool_size(%d kB)\n" , - ioc->sense, (unsigned long long )ioc->sense_dma, ioc->scsiio_depth, -SCSI_SENSE_BUFFERSIZE , sz /1024 );/* reply pool, 4 byte align */ sz = ioc->reply_free_queue_depth * ioc->reply_sz; rc =_base_allocate_reply_pool (ioc, sz);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 36/99 ptp_qoriq: fix memory leak in probe()
In reply to Greg Kroah-HartmanFrom: SongJingyi <[email protected]>
[ Upstream commit f33642224e38d7e0d59336e10e7b4e370b1c4506 ]
Smatch complains that:drivers/ptp/ptp_qoriq.c ptp_qoriq_probe()
warn: 'base' from ioremap() not released.
Fix this by revising the parameter from 'ptp_qoriq->base' to 'base'. This is only a bug if ptp_qoriq_init() returns on the first -ENODEV error path.
For other error paths ptp_qoriq->base and base are the same. And this change makes the code more readable.
--- drivers/ptp/ptp_qoriq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ptp/ptp_qoriq.c +1 -1
@@ -601,7 +601,7 @@ static int ptp_qoriq_probe(struct platform_device *dev)return 0 ; no_clock: -iounmap (ptp_qoriq->base); +iounmap (base); no_ioremap:release_resource (ptp_qoriq->rsrc); no_resource:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 37/99 net: dsa: microchip: ksz8863_smi: fix bulk access
In reply to Greg Kroah-HartmanFrom: Oleksij Rempel <[email protected]>
[ Upstream commit 392ff7a84cbca34118ca286dfbfe8aee24605897 ]
Current regmap bulk access is broken, resulting to wrong reads/writes if ksz_read64/ksz_write64 functions are used.
Mostly this issue was visible by using ksz8_fdb_dump(), which returned corrupt MAC address.
The reason is that regmap was configured to have max_raw_read/write, even if ksz8863_mdio_read/write functions are able to handle unlimited read/write accesses. On ksz_read64 function we are using multiple 32bit accesses by incrementing each access by 1 instead of 4. Resulting buffer had 01234567.12345678 instead of 01234567.89abcdef.
We have multiple ways to fix it:
- enable 4 byte alignment for 32bit accesses. Since the HW do not have this requirement. It will break driver.
- disable max_raw_* limit.
This patch is removing max_raw_* limit for regmap accesses in ksz8863_smi.
--- drivers/net/dsa/microchip/ksz8863_smi.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/net/dsa/microchip/ksz8863_smi.c +0 -9
@@ -86,22 +86,16 @@ static const struct regmap_bus regmap_smi[] = { { .read = ksz8863_mdio_read, .write = ksz8863_mdio_write, - .max_raw_read = 1, - .max_raw_write = 1, }, { .read = ksz8863_mdio_read, .write = ksz8863_mdio_write, .val_format_endian_default = REGMAP_ENDIAN_BIG, - .max_raw_read = 2, - .max_raw_write = 2, }, { .read = ksz8863_mdio_read, .write = ksz8863_mdio_write, .val_format_endian_default = REGMAP_ENDIAN_BIG, - .max_raw_read = 4, - .max_raw_write = 4, } };
@@ -112,7 +106,6 @@ static const struct regmap_config ksz8863_regmap_config[] = { .pad_bits = 24, .val_bits = 8, .cache_type = REGCACHE_NONE, - .use_single_read = 1, .lock = ksz_regmap_lock, .unlock = ksz_regmap_unlock, },
@@ -122,7 +115,6 @@ static const struct regmap_config ksz8863_regmap_config[] = { .pad_bits = 24, .val_bits = 16, .cache_type = REGCACHE_NONE, - .use_single_read = 1, .lock = ksz_regmap_lock, .unlock = ksz_regmap_unlock, },
@@ -132,7 +124,6 @@ static const struct regmap_config ksz8863_regmap_config[] = { .pad_bits = 24, .val_bits = 32, .cache_type = REGCACHE_NONE, - .use_single_read = 1, .lock = ksz_regmap_lock, .unlock = ksz_regmap_unlock, }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 38/99 r8169: fix RTL8168H and RTL8107E rx crc error
In reply to Greg Kroah-HartmanFrom: ChunHao Lin <[email protected]>
[ Upstream commit 33189f0a94b9639c058781fcf82e4ea3803b1682 ]
When link speed is 10 Mbps and temperature is under -20°C, RTL8168H and RTL8107E may have rx crc error. Disable phy 10 Mbps pll off to fix this issue.
--- drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/realtek/r8169_phy_config.c +3 -0
@@ -970,6 +970,9 @@ static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp,/* disable phy pfm mode */ phy_modify_paged (phydev,0x0a44 ,0x11 ,BIT (7 ),0 ); +/* disable 10m pll off */ +phy_modify_paged (phydev,0x0a43 ,0x10 ,BIT (0 ),0 ); +rtl8168g_disable_aldps (phydev);rtl8168g_config_eee_phy (phydev); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 39/99 regulator: Handle deferred clk
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 02bcba0b9f9da706d5bd1e8cbeb83493863e17b5 ]
devm_clk_get() can return -EPROBE_DEFER. So it is better to return the error code from devm_clk_get(), instead of a hard coded -ENOENT.
This gives more opportunities to successfully probe the driver.
--- drivers/regulator/fixed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/fixed.c +1 -1
@@ -215,7 +215,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) drvdata->enable_clock =devm_clk_get (dev,NULL );if (IS_ERR (drvdata->enable_clock)) {dev_err (dev,"Can't get enable-clock from devicetree\n" ); -return -ENOENT ; +return PTR_ERR (drvdata->enable_clock); } }else if (drvtype && drvtype->has_performance_state) { drvdata->desc.ops = &fixed_voltage_domain_ops;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 40/99 net/net_failover: fix txq exceeding warning
In reply to Greg Kroah-HartmanFrom: Faicker Mo <[email protected]>
[ Upstream commit e3cbdcb0fbb61045ef3ce0e072927cc41737f787 ]
The failover txq is inited as 16 queues.
when a packet is transmitted from the failover device firstly, the failover device will select the queue which is returned from the primary device if the primary device is UP and running. If the primary device txq is bigger than the default 16, it can lead to the following warning:
eth0 selects TX queue 18, but real number of TX queues is 16
The warning backtrace is:
[ 32.146376] CPU: 18 PID: 9134 Comm: chronyd Tainted: G E 6.2.8-1.el7.centos.x86_64 #1 [ 32.147175] Hardware name: Red Hat KVM, BIOS 1.10.2-3.el7_4.1 04/01/2014 [ 32.147730] Call Trace: [ 32.147971] <TASK> [ 32.148183] dump_stack_lvl+0x48/0x70 [ 32.148514] dump_stack+0x10/0x20 [ 32.148820] netdev_core_pick_tx+0xb1/0xe0 [ 32.149180] __dev_queue_xmit+0x529/0xcf0 [ 32.149533] ? __check_object_size.part.0+0x21c/0x2c0 [ 32.149967] ip_finish_output2+0x278/0x560 [ 32.150327] __ip_finish_output+0x1fe/0x2f0 [ 32.150690] ip_finish_output+0x2a/0xd0 [ 32.151032] ip_output+0x7a/0x110 [ 32.151337] ? __pfx_ip_finish_output+0x10/0x10 [ 32.151733] ip_local_out+0x5e/0x70 [ 32.152054] ip_send_skb+0x19/0x50 [ 32.152366] udp_send_skb.isra.0+0x163/0x3a0 [ 32.152736] udp_sendmsg+0xba8/0xec0 [ 32.153060] ? __folio_memcg_unlock+0x25/0x60 [ 32.153445] ? __pfx_ip_generic_getfrag+0x10/0x10 [ 32.153854] ? sock_has_perm+0x85/0xa0 [ 32.154190] inet_sendmsg+0x6d/0x80 [ 32.154508] ? inet_sendmsg+0x6d/0x80 [ 32.154838] sock_sendmsg+0x62/0x70 [ 32.155152] ____sys_sendmsg+0x134/0x290 [ 32.155499] ___sys_sendmsg+0x81/0xc0 [ 32.155828] ? _get_random_bytes.part.0+0x79/0x1a0 [ 32.156240] ? ip4_datagram_release_cb+0x5f/0x1e0 [ 32.156649] ? get_random_u16+0x69/0xf0 [ 32.156989] ? __fget_light+0xcf/0x110 [ 32.157326] __sys_sendmmsg+0xc4/0x210 [ 32.157657] ? __sys_connect+0xb7/0xe0 [ 32.157995] ? __audit_syscall_entry+0xce/0x140 [ 32.158388] ? syscall_trace_enter.isra.0+0x12c/0x1a0 [ 32.158820] __x64_sys_sendmmsg+0x24/0x30 [ 32.159171] do_syscall_64+0x38/0x90 [ 32.159493] entry_SYSCALL_64_after_hwframe+0x72/0xdc
Fix that by reducing txq number as the non-existent primary-dev does.
--- drivers/net/net_failover.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/net_failover.c +2 -6
@@ -130,14 +130,10 @@ static u16 net_failover_select_queue(struct net_device *dev, txq = ops->ndo_select_queue (primary_dev, skb, sb_dev); else txq =netdev_pick_tx (primary_dev, skb,NULL ); - -qdisc_skb_cb (skb)->slave_dev_queue_mapping = skb->queue_mapping; - -return txq; + }else { + txq =skb_rx_queue_recorded (skb) ?skb_get_rx_queue (skb) :0 ; } - txq =skb_rx_queue_recorded (skb) ?skb_get_rx_queue (skb) :0 ; -/* Save the original txq to restore before passing to the driver */ qdisc_skb_cb (skb)->slave_dev_queue_mapping = skb->queue_mapping;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 41/99 net: stmmac: dont reject VLANs when IFF_PROMISC is set
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit a7602e7332b97cfbec7bacb0f1ade99a575fe104 ]
The blamed commit has introduced the following tests to dwmac4_add_hw_vlan_rx_fltr(), called from stmmac_vlan_rx_add_vid():
if (hw->promisc) {
netdev_err(dev,
"Adding VLAN in promisc mode not supported\n");
return -EPERM;
}"VLAN promiscuous" mode is keyed in this driver to IFF_PROMISC, and so, vlan_vid_add() and vlan_vid_del() calls cannot take place in IFF_PROMISC mode. I have the following 2 arguments that this restriction is.... hm, how shall I put it nicely... unproductive :)
First, take the case of a Linux bridge. If the kernel is compiled with CONFIG_BRIDGE_VLAN_FILTERING=y, then this bridge shall have a VLAN database. The bridge shall try to call vlan_add_vid() on its bridge ports for each VLAN in the VLAN table. It will do this irrespectively of whether that port is *currently* VLAN-aware or not. So it will do this even when the bridge was created with vlan_filtering 0.
But the Linux bridge, in VLAN-unaware mode, configures its ports in promiscuous (IFF_PROMISC) mode, so that they accept packets with any MAC DA (a switch must do this in order to forward those packets which are not directly targeted to its MAC address).
As a result, the stmmac driver does not work as a bridge port, when the kernel is compiled with CONFIG_BRIDGE_VLAN_FILTERING=y.
$ ip link add br0 type bridge && ip link set br0 up $ ip link set eth0 master br0 && ip link set eth0 up [ 2333.943296] br0: port 1(eth0) entered blocking state [ 2333.943381] br0: port 1(eth0) entered disabled state [ 2333.943782] device eth0 entered promiscuous mode [ 2333.944080] 4033c000.ethernet eth0: Adding VLAN in promisc mode not supported [ 2333.976509] 4033c000.ethernet eth0: failed to initialize vlan filtering on this port RTNETLINK answers: Operation not permitted
Secondly, take the case of stmmac as DSA master. Some switch tagging protocols are based on 802.1Q VLANs (tag_sja1105.c), and as such, tag_8021q.c uses vlan_vid_add() to work with VLAN-filtering DSA masters. But also, when a DSA port becomes promiscuous (for example when it joins a bridge), the DSA framework also makes the DSA master promiscuous.
Moreover, for every VLAN that a DSA switch sends to the CPU, DSA also programs a VLAN filter on the DSA master, because if the the DSA switch uses a tail tag, then the hardware frame parser of the DSA master will see VLAN as VLAN, and might filter them out, for being unknown.
Due to the above 2 reasons, my belief is that the stmmac driver does not get to choose to not accept vlan_vid_add() calls while IFF_PROMISC is enabled, because the 2 are completely independent and there are code paths in the network stack which directly lead to this situation occurring, without the user's direct input.
In fact, my belief is that "VLAN promiscuous" mode should have never been keyed on IFF_PROMISC in the first place, but rather, on the NETIF_F_HW_VLAN_CTAG_FILTER feature flag which can be toggled by the user through ethtool -k, when present in netdev->hw_features.
In the stmmac driver, NETIF_F_HW_VLAN_CTAG_FILTER is only present in "features", making this feature "on [fixed]".
I have this belief because I am unaware of any definition of promiscuity which implies having an effect on anything other than MAC DA (therefore not VLAN). However, I seem to be rather alone in having this opinion, looking back at the disagreements from this discussion:
https://lore.kernel.org/netdev/[email protected]/
In any case, to remove the vlan_vid_add() dependency on !IFF_PROMISC, one would need to remove the check and see what fails. I guess the test was there because of the way in which dwmac4_vlan_promisc_enable() is implemented.
For context, the dwmac4 supports Perfect Filtering for a limited number of VLANs - dwmac4_get_num_vlan(), priv->hw->num_vlan, with a fallback on Hash Filtering - priv->dma_cap.vlhash - see stmmac_vlan_update(), also visible in cat /sys/kernel/debug/stmmaceth/eth0/dma_cap | grep 'VLAN Hash Filtering'.
The perfect filtering is based on MAC_VLAN_Tag_Filter/MAC_VLAN_Tag_Data registers, accessed in the driver through dwmac4_write_vlan_filter().
The hash filtering is based on the MAC_VLAN_Hash_Table register, named GMAC_VLAN_HASH_TABLE in the driver and accessed by dwmac4_update_vlan_hash(). The control bit for enabling hash filtering is GMAC_VLAN_VTHM (MAC_VLAN_Tag_Ctrl bit VTHM: VLAN Tag Hash Table Match Enable).
Now, the description of dwmac4_vlan_promisc_enable() is that it iterates through the driver's cache of perfect filter entries (hw->vlan_filter[i], added by dwmac4_add_hw_vlan_rx_fltr()), and evicts them from hardware by unsetting their GMAC_VLAN_TAG_DATA_VEN (MAC_VLAN_Tag_Data bit VEN - VLAN Tag Enable) bit. Then it unsets the GMAC_VLAN_VTHM bit, which disables hash matching.
This leaves the MAC, according to table "VLAN Match Status" from the documentation, to always enter these data paths:
VID |VLAN Perfect Filter |VTHM Bit |VLAN Hash Filter |Final VLAN Match
|Match Result | |Match Result |Status
-------|--------------------|---------|-----------------|----------------
VID!=0 |Fail |0 |don't care |PassSo, dwmac4_vlan_promisc_enable() does its job, but by unsetting GMAC_VLAN_VTHM, it conflicts with the other code path which controls this bit: dwmac4_update_vlan_hash(), called through stmmac_update_vlan_hash() from stmmac_vlan_rx_add_vid() and from stmmac_vlan_rx_kill_vid(). This is, I guess, why dwmac4_add_hw_vlan_rx_fltr() is not allowed to run after dwmac4_vlan_promisc_enable() has unset GMAC_VLAN_VTHM: because if it did, then dwmac4_update_vlan_hash() would set GMAC_VLAN_VTHM again, breaking the "VLAN promiscuity".
It turns out that dwmac4_vlan_promisc_enable() is way too complicated for what needs to be done. The MAC_Packet_Filter register also has the VTFE bit (VLAN Tag Filter Enable), which simply controls whether VLAN tagged packets which don't match the filtering tables (either perfect or hash) are dropped or not. At the moment, this driver unconditionally sets GMAC_PACKET_FILTER_VTFE if NETIF_F_HW_VLAN_CTAG_FILTER was detected through the priv->dma_cap.vlhash capability bits of the device, in stmmac_dvr_probe().
I would suggest deleting the unnecessarily complex logic from dwmac4_vlan_promisc_enable(), and simply unsetting GMAC_PACKET_FILTER_VTFE when becoming IFF_PROMISC, which has the same effect of allowing packets with any VLAN tags, but has the additional benefit of being able to run concurrently with stmmac_vlan_rx_add_vid() and stmmac_vlan_rx_kill_vid().
As much as I believe that the VTFE bit should have been exclusively controlled by NETIF_F_HW_VLAN_CTAG_FILTER through ethtool, and not by IFF_PROMISC, changing that is not a punctual fix to the problem, and it would probably break the VFFQ feature added by the later commit e0f9956a3862 ("net: stmmac: Add option for VLAN filter fail queue enable"). From the commit description, VFFQ needs IFF_PROMISC=on and VTFE=off in order to work (and this change respects that). But if VTFE was changed to be controlled through ethtool -k, then a user-visible change would have been introduced in Intel's scripts (a need to run "ethtool -k eth0 rx-vlan-filter off" which did not exist before).
The patch was tested with this set of commands:
ip link set eth0 up
ip link add link eth0 name eth0.100 type vlan id 100
ip addr add 192.168.100.2/24 dev eth0.100 && ip link set eth0.100 up ip link set eth0 promisc on
ip link add link eth0 name eth0.101 type vlan id 101
ip addr add 192.168.101.2/24 dev eth0.101 && ip link set eth0.101 up ip link set eth0 promisc off
ping -c 5 192.168.100.1
ping -c 5 192.168.101.1
ip link set eth0 promisc on
ping -c 5 192.168.100.1
ping -c 5 192.168.101.1
ip link del eth0.100
ip link del eth0.101
# Wait for VLAN-tagged pings from the other end...
# Check with "tcpdump -i eth0 -e -n -p" and we should see them ip link set eth0 promisc off
# Wait for VLAN-tagged pings from the other end...
# Check with "tcpdump -i eth0 -e -n -p" and we shouldn't see them # anymore, but remove the "-p" argument from tcpdump and they're there.
--- drivers/net/ethernet/stmicro/stmmac/common.h | 1 - .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 61 +------------------ 2 files changed, 3 insertions(+), 59 deletions(-)
drivers/net/ethernet/stmicro/stmmac/common.h +0 -1
@@ -530,7 +530,6 @@ struct mac_device_info {unsigned int xlgmac;unsigned int num_vlan;u32 vlan_filter[32 ]; -unsigned int promisc;bool vlan_fail_q_en;u8 vlan_fail_q; };
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +3 -58
88 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 42/99 drm/i915/tc: Fix the ICL PHY ownership check in TC-cold state
In reply to Greg Kroah-HartmanFrom: Imre Deak <[email protected]>
[ Upstream commit 38c583019484f190d5b33f59b8ae810e6b1763c6 ]
The commit renaming icl_tc_phy_is_in_safe_mode() to icl_tc_phy_take_ownership() didn't flip the function's return value accordingly, fix this up.
This didn't cause an actual problem besides state check errors, since the function is only used during HW readout.
--- drivers/gpu/drm/i915/display/intel_tc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_tc.c +2 -2
@@ -386,9 +386,9 @@ static bool icl_tc_phy_is_owned(struct intel_digital_port *dig_port) PORT_TX_DFLEXDPCSSS(dig_port->tc_phy_fia));if (val ==0xffffffff ) {drm_dbg_kms (&i915->drm, -"Port %s: PHY in TCCOLD, assume safe mode\n" , +"Port %s: PHY in TCCOLD, assume not owned\n" , dig_port->tc_port_name); -return true; +return false; }return val &DP_PHY_MODE_STATUS_NOT_SAFE (dig_port->tc_phy_fia_idx);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 43/99 platform/x86/intel/pmc: Alder Lake PCH slp_s0_residency fix
In reply to Greg Kroah-HartmanFrom: Rajvi Jingar <[email protected]>
[ Upstream commit fb5755100a0a5aa5957bdb204fd1e249684557fc ]
For platforms with Alder Lake PCH (Alder Lake S and Raptor Lake S) the slp_s0_residency attribute has been reporting the wrong value. Unlike other platforms, ADL PCH does not have a counter for the time that the SLP_S0 signal was asserted. Instead, firmware uses the aggregate of the Low Power Mode (LPM) substate counters as the S0ix value. Since the LPM counters run at a different frequency, this lead to misreporting of the S0ix time.
Add a check for Alder Lake PCH and adjust the frequency accordingly when display slp_s0_residency.
--- drivers/platform/x86/intel/pmc/core.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/pmc/core.c +12 -1
@@ -958,7 +958,18 @@ static inline void pmc_core_reg_write(struct pmc_dev *pmcdev, int reg_offset,static inline u64 pmc_core_adjust_slp_s0_step (struct pmc_dev *pmcdev,u32 value) { -return (u64 )value * pmcdev->map->slp_s0_res_counter_step; +/* +* ADL PCH does not have the SLP_S0 counter and LPM Residency counters are +* used as a workaround which uses 30.5 usec tick. All other client +* programs have the legacy SLP_S0 residency counter that is using the 122 +* usec tick. +*/ +const int lpm_adj_x2 = pmcdev->map->lpm_res_counter_step_x2; + +if (pmcdev->map == &adl_reg_map) +return (u64 )value *GET_X2_COUNTER ((u64 )lpm_adj_x2); +else +return (u64 )value * pmcdev->map->slp_s0_res_counter_step; }static int set_etr3 (struct pmc_dev *pmcdev)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 44/99 can: bcm: bcm_tx_setup(): fix KMSAN uninit-value in vfs_write
In reply to Greg Kroah-HartmanFrom: Ivan Orlov <[email protected]>
[ Upstream commit 2b4c99f7d9a57ecd644eda9b1fb0a1072414959f ]
Syzkaller reported the following issue:
=====================================================
BUG: KMSAN: uninit-value in aio_rw_done fs/aio.c:1520 [inline] BUG: KMSAN: uninit-value in aio_write+0x899/0x950 fs/aio.c:1600 aio_rw_done fs/aio.c:1520 [inline] aio_write+0x899/0x950 fs/aio.c:1600 io_submit_one+0x1d1c/0x3bf0 fs/aio.c:2019 __do_sys_io_submit fs/aio.c:2078 [inline] __se_sys_io_submit+0x293/0x770 fs/aio.c:2048 __x64_sys_io_submit+0x92/0xd0 fs/aio.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Uninit was created at:
slab_post_alloc_hook mm/slab.h:766 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x71f/0xce0 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc+0x11d/0x3b0 mm/slab_common.c:981 kmalloc_array include/linux/slab.h:636 [inline] bcm_tx_setup+0x80e/0x29d0 net/can/bcm.c:930 bcm_sendmsg+0x3a2/0xce0 net/can/bcm.c:1351 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] sock_write_iter+0x495/0x5e0 net/socket.c:1108 call_write_iter include/linux/fs.h:2189 [inline] aio_write+0x63a/0x950 fs/aio.c:1600 io_submit_one+0x1d1c/0x3bf0 fs/aio.c:2019 __do_sys_io_submit fs/aio.c:2078 [inline] __se_sys_io_submit+0x293/0x770 fs/aio.c:2048 __x64_sys_io_submit+0x92/0xd0 fs/aio.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd CPU: 1 PID: 5034 Comm: syz-executor350 Not tainted 6.2.0-rc6-syzkaller-80422-geda666ff2276 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 =====================================================
We can follow the call chain and find that 'bcm_tx_setup' function calls 'memcpy_from_msg' to copy some content to the newly allocated frame of 'op->frames'. After that the 'len' field of copied structure being compared with some constant value (64 or 8). However, if 'memcpy_from_msg' returns an error, we will compare some uninitialized memory. This triggers 'uninit-value' issue.
This patch will add 'memcpy_from_msg' possible errors processing to avoid uninit-value issue.
Tested via syzkaller
--- net/can/bcm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
net/can/bcm.c +10 -6
@@ -936,6 +936,8 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, cf = op->frames + op->cfsiz * i; err =memcpy_from_msg ((u8 *)cf, msg, op->cfsiz); +if (err <0 ) + goto free_op;if (op->flags &CAN_FD_FRAME ) {if (cf->len >64 )
@@ -945,12 +947,8 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, err = -EINVAL ; } -if (err <0 ) { -if (op->frames != &op->sframe) -kfree (op->frames); -kfree (op); -return err; - } +if (err <0 ) + goto free_op;if (msg_head->flags &TX_CP_CAN_ID ) {/* copy can_id into frame */
@@ -1021,6 +1019,12 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,bcm_tx_start_timer (op);return msg_head->nframes * op->cfsiz +MHSIZ ; + +free_op: +if (op->frames != &op->sframe) +kfree (op->frames); +kfree (op); +return err; }/*
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 45/99 s390/vfio-ap: fix memory leak in vfio_ap device driver
In reply to Greg Kroah-HartmanFrom: Tony Krowiak <[email protected]>
[ Upstream commit 8f8cf767589f2131ae5d40f3758429095c701c84 ]
The device release callback function invoked to release the matrix device uses the dev_get_drvdata(device *dev) function to retrieve the pointer to the vfio_matrix_dev object in order to free its storage. The problem is, this object is not stored as drvdata with the device; since the kfree function will accept a NULL pointer, the memory for the vfio_matrix_dev object is never freed.
Since the device being released is contained within the vfio_matrix_dev object, the container_of macro will be used to retrieve its pointer.
--- drivers/s390/crypto/vfio_ap_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/crypto/vfio_ap_drv.c +2 -1
@@ -86,8 +86,9 @@ static struct ap_driver vfio_ap_drv = {static void vfio_ap_matrix_dev_release (struct device *dev) { -struct ap_matrix_dev *matrix_dev =dev_get_drvdata (dev); +struct ap_matrix_dev *matrix_dev; + matrix_dev = container_of(dev, struct ap_matrix_dev, device);kfree (matrix_dev); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 46/99 loop: suppress uevents while reconfiguring the device
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 498ef5c777d9c89693b70cc453b40c392120ea1b ]
Currently, udev change event is generated for a loop device before the device is ready for IO. Due to serialization on lo->lo_mutex in lo_open() this does not matter because anybody is able to open the device and do IO only after the configuration is finished. However this synchronization in lo_open() is going away so make sure userspace reacting to the change event will see the new device state by generating the event only when the device is setup.
Stable-dep-of: bb430b694226 ("loop: LOOP_CONFIGURE: send uevents for partitions")
--- drivers/block/loop.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
drivers/block/loop.c +21 -4
@@ -736,6 +736,10 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,if (!file)return -EBADF ; + +/* suppress uevents while reconfiguring the device */ +dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),1 ); + is_loop =is_loop_device (file); error =loop_global_lock_killable (lo, is_loop);if (error)
@@ -790,13 +794,18 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,fput (old_file);if (partscan)loop_reread_partitions (lo); -return 0 ; + + error =0 ; +done: +/* enable and uncork uevent now that we are done */ +dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),0 ); +return error; out_err:loop_global_unlock (lo, is_loop); out_putf:fput (file); -return error; + goto done; }/* loop sysfs attributes */
@@ -1203,6 +1212,9 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,/* This is safe, since we have a reference from open(). */ __module_get (THIS_MODULE ); +/* suppress uevents while reconfiguring the device */ +dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),1 ); +/* * If we don't hold exclusive handle for the device, upgrade to it * here to avoid changing device under exclusive owner.
@@ -1309,7 +1321,12 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,loop_reread_partitions (lo);if (!(mode &FMODE_EXCL ))bd_abort_claiming (bdev, loop_configure); -return 0 ; + + error =0 ; +done: +/* enable and uncork uevent now that we are done */ +dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),0 ); +return error; out_unlock:loop_global_unlock (lo, is_loop);
@@ -1320,7 +1337,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,fput (file);/* This is safe: open() is still holding a reference. */ module_put (THIS_MODULE ); -return error; + goto done; }static int __loop_clr_fd (struct loop_device *lo,bool release)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 47/99 loop: LOOP_CONFIGURE: send uevents for partitions
In reply to Greg Kroah-HartmanFrom: Alyssa Ross <[email protected]>
[ Upstream commit bb430b69422640891b0b8db762885730579a4145 ]
LOOP_CONFIGURE is, as far as I understand it, supposed to be a way to combine LOOP_SET_FD and LOOP_SET_STATUS64 into a single syscall. When using LOOP_SET_FD+LOOP_SET_STATUS64, a single uevent would be sent for each partition found on the loop device after the second ioctl(), but when using LOOP_CONFIGURE, no such uevent was being sent.
In the old setup, uevents are disabled for LOOP_SET_FD, but not for LOOP_SET_STATUS64. This makes sense, as it prevents uevents being sent for a partially configured device during LOOP_SET_FD - they're only sent at the end of LOOP_SET_STATUS64. But for LOOP_CONFIGURE, uevents were disabled for the entire operation, so that final notification was never issued. To fix this, reduce the critical section to exclude the loop_reread_partitions() call, which causes the uevents to be issued, to after uevents are re-enabled, matching the behaviour of the LOOP_SET_FD+LOOP_SET_STATUS64 combination.
I noticed this because Busybox's losetup program recently changed from using LOOP_SET_FD+LOOP_SET_STATUS64 to LOOP_CONFIGURE, and this broke my setup, for which I want a notification from the kernel any time a new partition becomes available.
--- drivers/block/loop.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/block/loop.c +9 -9
@@ -1212,9 +1212,6 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,/* This is safe, since we have a reference from open(). */ __module_get (THIS_MODULE ); -/* suppress uevents while reconfiguring the device */ -dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),1 ); -/* * If we don't hold exclusive handle for the device, upgrade to it * here to avoid changing device under exclusive owner.
@@ -1268,6 +1265,9 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, goto out_unlock; } +/* suppress uevents while reconfiguring the device */ +dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),1 ); +disk_force_media_change (lo->lo_disk,DISK_EVENT_MEDIA_CHANGE );set_disk_ro (lo->lo_disk, (lo->lo_flags &LO_FLAGS_READ_ONLY ) !=0 );
@@ -1316,17 +1316,17 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,if (partscan) lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN ; +/* enable and uncork uevent now that we are done */ +dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),0 ); +loop_global_unlock (lo, is_loop);if (partscan)loop_reread_partitions (lo); +if (!(mode &FMODE_EXCL ))bd_abort_claiming (bdev, loop_configure); - error =0 ; -done: -/* enable and uncork uevent now that we are done */ -dev_set_uevent_suppress (disk_to_dev (lo->lo_disk),0 ); -return error; +return 0 ; out_unlock:loop_global_unlock (lo, is_loop);
@@ -1337,7 +1337,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,fput (file);/* This is safe: open() is still holding a reference. */ module_put (THIS_MODULE ); - goto done; +return error; }static int __loop_clr_fd (struct loop_device *lo,bool release)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 48/99 net: mvpp2: classifier flow fix fragmentation flags
In reply to Greg Kroah-HartmanFrom: Sven Auhagen <[email protected]>
[ Upstream commit 9a251cae51d57289908222e6c322ca61fccc25fd ]
Add missing IP Fragmentation Flag.
--- .../net/ethernet/marvell/mvpp2/mvpp2_cls.c | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +18 -12
@@ -62,35 +62,38 @@ static const struct mvpp2_cls_flow cls_flows[MVPP2_N_PRS_FLOWS] = {MVPP2_DEF_FLOW (MVPP22_FLOW_TCP4 ,MVPP2_FL_IP4_TCP_FRAG_UNTAG ,MVPP22_CLS_HEK_IP4_2T ,MVPP2_PRS_RI_VLAN_NONE |MVPP2_PRS_RI_L3_IP4 | -MVPP2_PRS_RI_L4_TCP , +MVPP2_PRS_RI_IP_FRAG_TRUE |MVPP2_PRS_RI_L4_TCP ,MVPP2_PRS_IP_MASK |MVPP2_PRS_RI_VLAN_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_TCP4 ,MVPP2_FL_IP4_TCP_FRAG_UNTAG ,MVPP22_CLS_HEK_IP4_2T ,MVPP2_PRS_RI_VLAN_NONE |MVPP2_PRS_RI_L3_IP4_OPT | -MVPP2_PRS_RI_L4_TCP , +MVPP2_PRS_RI_IP_FRAG_TRUE |MVPP2_PRS_RI_L4_TCP ,MVPP2_PRS_IP_MASK |MVPP2_PRS_RI_VLAN_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_TCP4 ,MVPP2_FL_IP4_TCP_FRAG_UNTAG ,MVPP22_CLS_HEK_IP4_2T ,MVPP2_PRS_RI_VLAN_NONE |MVPP2_PRS_RI_L3_IP4_OTHER | -MVPP2_PRS_RI_L4_TCP , +MVPP2_PRS_RI_IP_FRAG_TRUE |MVPP2_PRS_RI_L4_TCP ,MVPP2_PRS_IP_MASK |MVPP2_PRS_RI_VLAN_MASK ),/* TCP over IPv4 flows, fragmented, with vlan tag */ MVPP2_DEF_FLOW (MVPP22_FLOW_TCP4 ,MVPP2_FL_IP4_TCP_FRAG_TAG ,MVPP22_CLS_HEK_IP4_2T |MVPP22_CLS_HEK_TAGGED , -MVPP2_PRS_RI_L3_IP4 |MVPP2_PRS_RI_L4_TCP , +MVPP2_PRS_RI_L3_IP4 |MVPP2_PRS_RI_IP_FRAG_TRUE | +MVPP2_PRS_RI_L4_TCP ,MVPP2_PRS_IP_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_TCP4 ,MVPP2_FL_IP4_TCP_FRAG_TAG ,MVPP22_CLS_HEK_IP4_2T |MVPP22_CLS_HEK_TAGGED , -MVPP2_PRS_RI_L3_IP4_OPT |MVPP2_PRS_RI_L4_TCP , +MVPP2_PRS_RI_L3_IP4_OPT |MVPP2_PRS_RI_IP_FRAG_TRUE | +MVPP2_PRS_RI_L4_TCP ,MVPP2_PRS_IP_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_TCP4 ,MVPP2_FL_IP4_TCP_FRAG_TAG ,MVPP22_CLS_HEK_IP4_2T |MVPP22_CLS_HEK_TAGGED , -MVPP2_PRS_RI_L3_IP4_OTHER |MVPP2_PRS_RI_L4_TCP , +MVPP2_PRS_RI_L3_IP4_OTHER |MVPP2_PRS_RI_IP_FRAG_TRUE | +MVPP2_PRS_RI_L4_TCP , MVPP2_PRS_IP_MASK),/* UDP over IPv4 flows, Not fragmented, no vlan tag */
@@ -132,35 +135,38 @@ static const struct mvpp2_cls_flow cls_flows[MVPP2_N_PRS_FLOWS] = {MVPP2_DEF_FLOW (MVPP22_FLOW_UDP4 ,MVPP2_FL_IP4_UDP_FRAG_UNTAG ,MVPP22_CLS_HEK_IP4_2T ,MVPP2_PRS_RI_VLAN_NONE |MVPP2_PRS_RI_L3_IP4 | -MVPP2_PRS_RI_L4_UDP , +MVPP2_PRS_RI_IP_FRAG_TRUE |MVPP2_PRS_RI_L4_UDP ,MVPP2_PRS_IP_MASK |MVPP2_PRS_RI_VLAN_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_UDP4 ,MVPP2_FL_IP4_UDP_FRAG_UNTAG ,MVPP22_CLS_HEK_IP4_2T ,MVPP2_PRS_RI_VLAN_NONE |MVPP2_PRS_RI_L3_IP4_OPT | -MVPP2_PRS_RI_L4_UDP , +MVPP2_PRS_RI_IP_FRAG_TRUE |MVPP2_PRS_RI_L4_UDP ,MVPP2_PRS_IP_MASK |MVPP2_PRS_RI_VLAN_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_UDP4 ,MVPP2_FL_IP4_UDP_FRAG_UNTAG ,MVPP22_CLS_HEK_IP4_2T ,MVPP2_PRS_RI_VLAN_NONE |MVPP2_PRS_RI_L3_IP4_OTHER | -MVPP2_PRS_RI_L4_UDP , +MVPP2_PRS_RI_IP_FRAG_TRUE |MVPP2_PRS_RI_L4_UDP ,MVPP2_PRS_IP_MASK |MVPP2_PRS_RI_VLAN_MASK ),/* UDP over IPv4 flows, fragmented, with vlan tag */ MVPP2_DEF_FLOW (MVPP22_FLOW_UDP4 ,MVPP2_FL_IP4_UDP_FRAG_TAG ,MVPP22_CLS_HEK_IP4_2T |MVPP22_CLS_HEK_TAGGED , -MVPP2_PRS_RI_L3_IP4 |MVPP2_PRS_RI_L4_UDP , +MVPP2_PRS_RI_L3_IP4 |MVPP2_PRS_RI_IP_FRAG_TRUE | +MVPP2_PRS_RI_L4_UDP ,MVPP2_PRS_IP_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_UDP4 ,MVPP2_FL_IP4_UDP_FRAG_TAG ,MVPP22_CLS_HEK_IP4_2T |MVPP22_CLS_HEK_TAGGED , -MVPP2_PRS_RI_L3_IP4_OPT |MVPP2_PRS_RI_L4_UDP , +MVPP2_PRS_RI_L3_IP4_OPT |MVPP2_PRS_RI_IP_FRAG_TRUE | +MVPP2_PRS_RI_L4_UDP ,MVPP2_PRS_IP_MASK ),MVPP2_DEF_FLOW (MVPP22_FLOW_UDP4 ,MVPP2_FL_IP4_UDP_FRAG_TAG ,MVPP22_CLS_HEK_IP4_2T |MVPP22_CLS_HEK_TAGGED , -MVPP2_PRS_RI_L3_IP4_OTHER |MVPP2_PRS_RI_L4_UDP , +MVPP2_PRS_RI_L3_IP4_OTHER |MVPP2_PRS_RI_IP_FRAG_TRUE | +MVPP2_PRS_RI_L4_UDP , MVPP2_PRS_IP_MASK),/* TCP over IPv6 flows, not fragmented, no vlan tag */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 49/99 net: mvpp2: parser fix QinQ
In reply to Greg Kroah-HartmanFrom: Sven Auhagen <[email protected]>
[ Upstream commit a587a84813b90372cb0a7565e201a4075da67919 ]
The mvpp2 parser entry for QinQ has the inner and outer VLAN in the wrong order.
Fix the problem by swapping them.
--- drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +2 -2
@@ -1539,8 +1539,8 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv)if (!priv->prs_double_vlans)return -ENOMEM ; -/* Double VLAN: 0x8100, 0x88A8 */ - err =mvpp2_prs_double_vlan_add (priv,ETH_P_8021Q ,ETH_P_8021AD , +/* Double VLAN: 0x88A8, 0x8100 */ + err =mvpp2_prs_double_vlan_add (priv,ETH_P_8021AD ,ETH_P_8021Q ,MVPP2_PRS_PORT_MASK );if (err)return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 50/99 net: mvpp2: parser fix PPPoE
In reply to Greg Kroah-HartmanFrom: Sven Auhagen <[email protected]>
[ Upstream commit 031a416c2170866be5132ae42e14453d669b0cb1 ]
In PPPoE add all IPv4 header option length to the parser and adjust the L3 and L4 offset accordingly. Currently the L4 match does not work with PPPoE and all packets are matched as L3 IP4 OPT.
--- .../net/ethernet/marvell/mvpp2/mvpp2_prs.c | 82 ++++++++----------- 1 file changed, 34 insertions(+), 48 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +34 -48
@@ -1607,59 +1607,45 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv)static int mvpp2_prs_pppoe_init (struct mvpp2 *priv) {struct mvpp2_prs_entry pe; -int tid; - -/* IPv4 over PPPoE with options */ - tid =mvpp2_prs_tcam_first_free (priv,MVPP2_PE_FIRST_FREE_TID , -MVPP2_PE_LAST_FREE_TID ); -if (tid <0 ) -return tid; - -memset (&pe,0 ,sizeof (pe)); -mvpp2_prs_tcam_lu_set (&pe,MVPP2_PRS_LU_PPPOE ); - pe.index = tid; - -mvpp2_prs_match_etype (&pe,0 ,PPP_IP ); - -mvpp2_prs_sram_next_lu_set (&pe,MVPP2_PRS_LU_IP4 ); -mvpp2_prs_sram_ri_update (&pe,MVPP2_PRS_RI_L3_IP4_OPT , -MVPP2_PRS_RI_L3_PROTO_MASK ); -/* goto ipv4 dest-address (skip eth_type + IP-header-size - 4) */ -mvpp2_prs_sram_shift_set (&pe,MVPP2_ETH_TYPE_LEN + -sizeof (struct iphdr ) -4 , -MVPP2_PRS_SRAM_OP_SEL_SHIFT_ADD ); -/* Set L3 offset */ -mvpp2_prs_sram_offset_set (&pe,MVPP2_PRS_SRAM_UDF_TYPE_L3 , -MVPP2_ETH_TYPE_LEN , -MVPP2_PRS_SRAM_OP_SEL_UDF_ADD ); - -/* Update shadow table and hw entry */ -mvpp2_prs_shadow_set (priv, pe.index,MVPP2_PRS_LU_PPPOE ); -mvpp2_prs_hw_write (priv, &pe); +int tid, ihl; -/* IPv4 over PPPoE without options */ - tid =mvpp2_prs_tcam_first_free (priv,MVPP2_PE_FIRST_FREE_TID , -MVPP2_PE_LAST_FREE_TID ); -if (tid <0 ) -return tid; +/* IPv4 over PPPoE with header length >= 5 */ +for (ihl =MVPP2_PRS_IPV4_IHL_MIN ; ihl <=MVPP2_PRS_IPV4_IHL_MAX ; ihl++) { + tid =mvpp2_prs_tcam_first_free (priv,MVPP2_PE_FIRST_FREE_TID , +MVPP2_PE_LAST_FREE_TID ); +if (tid <0 ) +return tid; - pe.index = tid; +memset (&pe,0 ,sizeof (pe)); +mvpp2_prs_tcam_lu_set (&pe,MVPP2_PRS_LU_PPPOE ); + pe.index = tid; -mvpp2_prs_tcam_data_byte_set (&pe,MVPP2_ETH_TYPE_LEN , -MVPP2_PRS_IPV4_HEAD | -MVPP2_PRS_IPV4_IHL_MIN , -MVPP2_PRS_IPV4_HEAD_MASK | -MVPP2_PRS_IPV4_IHL_MASK ); +mvpp2_prs_match_etype (&pe,0 ,PPP_IP ); +mvpp2_prs_tcam_data_byte_set (&pe,MVPP2_ETH_TYPE_LEN , +MVPP2_PRS_IPV4_HEAD | ihl, +MVPP2_PRS_IPV4_HEAD_MASK | +MVPP2_PRS_IPV4_IHL_MASK ); -/* Clear ri before updating */ - pe.sram[MVPP2_PRS_SRAM_RI_WORD ] =0x0 ; - pe.sram[MVPP2_PRS_SRAM_RI_CTRL_WORD ] =0x0 ; -mvpp2_prs_sram_ri_update (&pe,MVPP2_PRS_RI_L3_IP4 , -MVPP2_PRS_RI_L3_PROTO_MASK ); +mvpp2_prs_sram_next_lu_set (&pe,MVPP2_PRS_LU_IP4 ); +mvpp2_prs_sram_ri_update (&pe,MVPP2_PRS_RI_L3_IP4 , +MVPP2_PRS_RI_L3_PROTO_MASK ); +/* goto ipv4 dst-address (skip eth_type + IP-header-size - 4) */ +mvpp2_prs_sram_shift_set (&pe,MVPP2_ETH_TYPE_LEN + +sizeof (struct iphdr ) -4 , +MVPP2_PRS_SRAM_OP_SEL_SHIFT_ADD ); +/* Set L3 offset */ +mvpp2_prs_sram_offset_set (&pe,MVPP2_PRS_SRAM_UDF_TYPE_L3 , +MVPP2_ETH_TYPE_LEN , +MVPP2_PRS_SRAM_OP_SEL_UDF_ADD ); +/* Set L4 offset */ +mvpp2_prs_sram_offset_set (&pe,MVPP2_PRS_SRAM_UDF_TYPE_L4 , +MVPP2_ETH_TYPE_LEN + (ihl *4 ), +MVPP2_PRS_SRAM_OP_SEL_UDF_ADD ); -/* Update shadow table and hw entry */ -mvpp2_prs_shadow_set (priv, pe.index,MVPP2_PRS_LU_PPPOE ); -mvpp2_prs_hw_write (priv, &pe); +/* Update shadow table and hw entry */ +mvpp2_prs_shadow_set (priv, pe.index,MVPP2_PRS_LU_PPPOE ); +mvpp2_prs_hw_write (priv, &pe); + }/* IPv6 over PPPoE */ tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 51/99 smsc911x: avoid PHY being resumed when interface is not up
In reply to Greg Kroah-HartmanFrom: Wolfram Sang <[email protected]>
[ Upstream commit f22c993f31fa9615df46e49cd768b713d39a852f ]
SMSC911x doesn't need mdiobus suspend/resume, that's why it sets 'mac_managed_pm'. However, setting it needs to be moved from init to probe, so mdiobus PM functions will really never be called (e.g. when the interface is not up yet during suspend/resume).
--- drivers/net/ethernet/smsc/smsc911x.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +5 -2
@@ -1037,8 +1037,6 @@ static int smsc911x_mii_probe(struct net_device *dev)return ret; } -/* Indicate that the MAC is responsible for managing PHY PM */ - phydev->mac_managed_pm = true;phy_attached_info (phydev);phy_set_max_speed (phydev,SPEED_100 );
@@ -1066,6 +1064,7 @@ static int smsc911x_mii_init(struct platform_device *pdev, struct net_device *dev) {struct smsc911x_data *pdata =netdev_priv (dev); +struct phy_device *phydev;int err = -ENXIO ; pdata->mii_bus =mdiobus_alloc ();
@@ -1108,6 +1107,10 @@ static int smsc911x_mii_init(struct platform_device *pdev, goto err_out_free_bus_2; } + phydev =phy_find_first (pdata->mii_bus); +if (phydev) + phydev->mac_managed_pm = true; +return 0 ; err_out_free_bus_2:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 52/99 ice: add profile conflict check for AVF FDIR
In reply to Greg Kroah-HartmanFrom: Junfeng Guo <[email protected]>
[ Upstream commit 29486b6df3e6a63b57d1ed1dce06051267282ff4 ]
Add profile conflict check while adding some FDIR rules to avoid unexpected flow behavior, rules may have conflict including:
IPv4 <---> {IPv4_UDP, IPv4_TCP, IPv4_SCTP}
IPv6 <---> {IPv6_UDP, IPv6_TCP, IPv6_SCTP}For example, when we create an FDIR rule for IPv4, this rule will work on packets including IPv4, IPv4_UDP, IPv4_TCP and IPv4_SCTP. But if we then create an FDIR rule for IPv4_UDP and then destroy it, the first FDIR rule for IPv4 cannot work on pkt IPv4_UDP then.
To prevent this unexpected behavior, we add restriction in software when creating FDIR rules by adding necessary profile conflict check.
--- .../ethernet/intel/ice/ice_virtchnl_fdir.c | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+)
drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c +73 -0
@@ -731,6 +731,72 @@ static void ice_vc_fdir_rem_prof_all(struct ice_vf *vf) } } +/** +* ice_vc_fdir_has_prof_conflict +* @vf: pointer to the VF structure +* @conf: FDIR configuration for each filter +* +* Check if @conf has conflicting profile with existing profiles +* +* Return: true on success, and false on error. +*/ +static bool +ice_vc_fdir_has_prof_conflict (struct ice_vf *vf, +struct virtchnl_fdir_fltr_conf *conf) +{ +struct ice_fdir_fltr *desc; + +list_for_each_entry (desc, &vf->fdir.fdir_rule_list, fltr_node) { +struct virtchnl_fdir_fltr_conf *existing_conf; +enum ice_fltr_ptype flow_type_a, flow_type_b; +struct ice_fdir_fltr *a, *b; + + existing_conf =to_fltr_conf_from_desc (desc); + a = &existing_conf->input; + b = &conf->input; + flow_type_a = a->flow_type; + flow_type_b = b->flow_type; + +/* No need to compare two rules with different tunnel types or +* with the same protocol type. +*/ +if (existing_conf->ttype != conf->ttype || + flow_type_a == flow_type_b) +continue ; + +switch (flow_type_a) { +case ICE_FLTR_PTYPE_NONF_IPV4_UDP : +case ICE_FLTR_PTYPE_NONF_IPV4_TCP : +case ICE_FLTR_PTYPE_NONF_IPV4_SCTP : +if (flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV4_OTHER ) +return true; +break ; +case ICE_FLTR_PTYPE_NONF_IPV4_OTHER : +if (flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV4_UDP || + flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV4_TCP || + flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV4_SCTP ) +return true; +break ; +case ICE_FLTR_PTYPE_NONF_IPV6_UDP : +case ICE_FLTR_PTYPE_NONF_IPV6_TCP : +case ICE_FLTR_PTYPE_NONF_IPV6_SCTP : +if (flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV6_OTHER ) +return true; +break ; +case ICE_FLTR_PTYPE_NONF_IPV6_OTHER : +if (flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV6_UDP || + flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV6_TCP || + flow_type_b ==ICE_FLTR_PTYPE_NONF_IPV6_SCTP ) +return true; +break ; +default : +break ; + } + } + +return false; +} +/** * ice_vc_fdir_write_flow_prof * @vf: pointer to the VF structure
@@ -871,6 +937,13 @@ ice_vc_fdir_config_input_set(struct ice_vf *vf, struct virtchnl_fdir_add *fltr,enum ice_fltr_ptype flow;int ret; + ret =ice_vc_fdir_has_prof_conflict (vf, conf); +if (ret) { +dev_dbg (dev,"Found flow profile conflict for VF %d\n" , + vf->vf_id); +return ret; + } + flow = input->flow_type; ret =ice_vc_fdir_alloc_prof (vf, flow);if (ret) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 53/99 ice: fix invalid check for empty list in ice_sched_assoc_vsi_to_agg()
In reply to Greg Kroah-HartmanFrom: Jakob Koschel <[email protected]>
[ Upstream commit e9a1cc2e4c4ee7c7e60fb26345618c2522a2a10f ]
The code implicitly assumes that the list iterator finds a correct handle. If 'vsi_handle' is not found the 'old_agg_vsi_info' was pointing to an bogus memory location. For safety a separate list iterator variable should be used to make the != NULL check on 'old_agg_vsi_info' correct under any circumstances.
Additionally Linus proposed to avoid any use of the list iterator variable after the loop, in the attempt to move the list iterator variable declaration into the macro to avoid any potential misuse after the loop. Using it in a pointer comparison after the loop is undefined behavior and should be omitted if possible [1].
--- drivers/net/ethernet/intel/ice/ice_sched.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_sched.c +5 -3
@@ -2758,7 +2758,7 @@ static enum ice_status ice_sched_assoc_vsi_to_agg(struct ice_port_info *pi, u32 agg_id, u16 vsi_handle, unsigned long *tc_bitmap) { - struct ice_sched_agg_vsi_info *agg_vsi_info, *old_agg_vsi_info = NULL; + struct ice_sched_agg_vsi_info *agg_vsi_info, *iter, *old_agg_vsi_info = NULL;struct ice_sched_agg_info *agg_info, *old_agg_info;enum ice_status status =0 ;struct ice_hw *hw = pi->hw;
@@ -2776,11 +2776,13 @@ ice_sched_assoc_vsi_to_agg(struct ice_port_info *pi, u32 agg_id,if (old_agg_info && old_agg_info != agg_info) {struct ice_sched_agg_vsi_info *vtmp; -list_for_each_entry_safe (old_agg_vsi_info, vtmp, +list_for_each_entry_safe (iter, vtmp, &old_agg_info->agg_vsi_list, list_entry) -if (old_agg_vsi_info->vsi_handle == vsi_handle) +if (iter->vsi_handle == vsi_handle) { + old_agg_vsi_info = iter;break ; + } }/* check if entry already exist */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 54/99 ALSA: ymfpci: Create card with device-managed snd_devm_card_new()
In reply to Greg Kroah-HartmanFrom: Tasos Sahanidis <[email protected]>
[ Upstream commit f33fc1576757741479452255132d6e3aaf558ffe ]
snd_card_ymfpci_remove() was removed in commit c6e6bb5eab74 ("ALSA:
ymfpci: Allocate resources with device-managed APIs"), but the call to snd_card_new() was not replaced with snd_devm_card_new().
Since there was no longer a call to snd_card_free, unloading the module would eventually result in Oops:
[697561.532887] BUG: unable to handle page fault for address: ffffffffc0924480 [697561.532893] #PF: supervisor read access in kernel mode [697561.532896] #PF: error_code(0x0000) - not-present page [697561.532899] PGD ae1e15067 P4D ae1e15067 PUD ae1e17067 PMD 11a8f5067 PTE 0 [697561.532905] Oops: 0000 [#1] PREEMPT SMP NOPTI [697561.532909] CPU: 21 PID: 5080 Comm: wireplumber Tainted: G W OE 6.2.7 #1 [697561.532914] Hardware name: System manufacturer System Product Name/TUF GAMING X570-PLUS, BIOS 4408 10/28/2022 [697561.532916] RIP: 0010:try_module_get.part.0+0x1a/0xe0 [697561.532924] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 49 89 fc bf 01 00 00 00 e8 56 3c f8 ff <41> 83 3c 24 02 0f 84 96 00 00 00 41 8b 84 24 30 03 00 00 85 c0 0f [697561.532927] RSP: 0018:ffffbe9b858c3bd8 EFLAGS: 00010246 [697561.532930] RAX: ffff9815d14f1900 RBX: ffff9815c14e6000 RCX: 0000000000000000 [697561.532933] RDX: 0000000000000000 RSI: ffffffffc055092c RDI: ffffffffb3778c1a [697561.532935] RBP: ffffbe9b858c3be8 R08: 0000000000000040 R09: ffff981a1a741380 [697561.532937] R10: ffffbe9b858c3c80 R11: 00000009d56533a6 R12: ffffffffc0924480 [697561.532939] R13: ffff9823439d8500 R14: 0000000000000025 R15: ffff9815cd109f80 [697561.532942] FS: 00007f13084f1f80(0000) GS:ffff9824aef40000(0000) knlGS:0000000000000000 [697561.532945] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [697561.532947] CR2: ffffffffc0924480 CR3: 0000000145344000 CR4: 0000000000350ee0 [697561.532949] Call Trace: [697561.532951] <TASK> [697561.532955] try_module_get+0x13/0x30 [697561.532960] snd_ctl_open+0x61/0x1c0 [snd] [697561.532976] snd_open+0xb4/0x1e0 [snd] [697561.532989] chrdev_open+0xc7/0x240 [697561.532995] ? fsnotify_perm.part.0+0x6e/0x160 [697561.533000] ? __pfx_chrdev_open+0x10/0x10 [697561.533005] do_dentry_open+0x169/0x440 [697561.533009] vfs_open+0x2d/0x40 [697561.533012] path_openat+0xa9d/0x10d0 [697561.533017] ? debug_smp_processor_id+0x17/0x20 [697561.533022] ? trigger_load_balance+0x65/0x370 [697561.533026] do_filp_open+0xb2/0x160 [697561.533032] ? _raw_spin_unlock+0x19/0x40 [697561.533036] ? alloc_fd+0xa9/0x190 [697561.533040] do_sys_openat2+0x9f/0x160 [697561.533044] __x64_sys_openat+0x55/0x90 [697561.533048] do_syscall_64+0x3b/0x90 [697561.533052] entry_SYSCALL_64_after_hwframe+0x72/0xdc [697561.533056] RIP: 0033:0x7f1308a40db4 [697561.533059] Code: 24 20 eb 8f 66 90 44 89 54 24 0c e8 46 68 f8 ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 32 44 89 c7 89 44 24 0c e8 78 68 f8 ff 8b 44 [697561.533062] RSP: 002b:00007ffcce664450 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 [697561.533066] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f1308a40db4 [697561.533068] RDX: 0000000000080000 RSI: 00007ffcce664690 RDI: 00000000ffffff9c [697561.533070] RBP: 00007ffcce664690 R08: 0000000000000000 R09: 0000000000000012 [697561.533072] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000080000 [697561.533074] R13: 00007f13054b069b R14: 0000565209f83200 R15: 0000000000000000 [697561.533078] </TASK>
--- sound/pci/ymfpci/ymfpci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ymfpci/ymfpci.c +1 -1
@@ -170,7 +170,7 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,return -ENOENT ; } - err =snd_card_new (&pci->dev, index[dev], id[dev],THIS_MODULE , + err =snd_devm_card_new (&pci->dev, index[dev], id[dev],THIS_MODULE ,sizeof (*chip), &card);if (err <0 )return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 55/99 ALSA: ymfpci: Fix BUG_ON in probe function
In reply to Greg Kroah-HartmanFrom: Tasos Sahanidis <[email protected]>
[ Upstream commit 6be2e7522eb529b41c16d459f33bbdbcddbf5c15 ]
The snd_dma_buffer.bytes field now contains the aligned size, which this snd_BUG_ON() did not account for, resulting in the following:
[ 9.625915] ------------[ cut here ]------------ [ 9.633440] WARNING: CPU: 0 PID: 126 at sound/pci/ymfpci/ymfpci_main.c:2168 snd_ymfpci_create+0x681/0x698 [snd_ymfpci] [ 9.648926] Modules linked in: snd_ymfpci(+) snd_intel_dspcfg kvm(+) snd_intel_sdw_acpi snd_ac97_codec snd_mpu401_uart snd_opl3_lib irqbypass snd_hda_codec gameport snd_rawmidi crct10dif_pclmul crc32_pclmul cfg80211 snd_hda_core polyval_clmulni polyval_generic gf128mul snd_seq_device ghash_clmulni_intel snd_hwdep ac97_bus sha512_ssse3 rfkill snd_pcm aesni_intel tg3 snd_timer crypto_simd snd mxm_wmi libphy cryptd k10temp fam15h_power pcspkr soundcore sp5100_tco wmi acpi_cpufreq mac_hid dm_multipath sg loop fuse dm_mod bpf_preload ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 sr_mod cdrom ata_generic pata_acpi firewire_ohci crc32c_intel firewire_core xhci_pci crc_itu_t pata_via xhci_pci_renesas floppy [ 9.711849] CPU: 0 PID: 126 Comm: kworker/0:2 Not tainted 6.1.21-1-lts #1 08d2e5ece03136efa7c6aeea9a9c40916b1bd8da [ 9.722200] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./990FX Extreme4, BIOS P2.70 06/05/2014 [ 9.732204] Workqueue: events work_for_cpu_fn [ 9.736580] RIP: 0010:snd_ymfpci_create+0x681/0x698 [snd_ymfpci] [ 9.742594] Code: 8c c0 4c 89 e2 48 89 df 48 c7 c6 92 c6 8c c0 e8 15 d0 e9 ff 48 83 c4 08 44 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f e9 d3 7a 33 e3 <0f> 0b e9 cb fd ff ff 41 bd fb ff ff ff eb db 41 bd f4 ff ff ff eb [ 9.761358] RSP: 0018:ffffab64804e7da0 EFLAGS: 00010287 [ 9.766594] RAX: ffff8fa2df06c400 RBX: ffff8fa3073a8000 RCX: ffff8fa303fbc4a8 [ 9.773734] RDX: ffff8fa2df06d000 RSI: 0000000000000010 RDI: 0000000000000020 [ 9.780876] RBP: ffff8fa300b5d0d0 R08: ffff8fa3073a8e50 R09: 00000000df06bf00 [ 9.788018] R10: ffff8fa2df06bf00 R11: 00000000df068200 R12: ffff8fa3073a8918 [ 9.795159] R13: 0000000000000000 R14: 0000000000000080 R15: ffff8fa2df068200 [ 9.802317] FS: 0000000000000000(0000) GS:ffff8fa9fec00000(0000) knlGS:0000000000000000 [ 9.810414] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9.816158] CR2: 000055febaf66500 CR3: 0000000101a2e000 CR4: 00000000000406f0 [ 9.823301] Call Trace: [ 9.825747] <TASK> [ 9.827889] snd_card_ymfpci_probe+0x194/0x950 [snd_ymfpci b78a5fe64b5663a6390a909c67808567e3e73615] [ 9.837030] ? finish_task_switch.isra.0+0x90/0x2d0 [ 9.841918] local_pci_probe+0x45/0x80 [ 9.845680] work_for_cpu_fn+0x1a/0x30 [ 9.849431] process_one_work+0x1c7/0x380 [ 9.853464] worker_thread+0x1af/0x390 [ 9.857225] ? rescuer_thread+0x3b0/0x3b0 [ 9.861254] kthread+0xde/0x110 [ 9.864414] ? kthread_complete_and_exit+0x20/0x20 [ 9.869210] ret_from_fork+0x22/0x30 [ 9.872792] </TASK> [ 9.874985] ---[ end trace 0000000000000000 ]---
--- sound/pci/ymfpci/ymfpci_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ymfpci/ymfpci_main.c +1 -1
@@ -2165,7 +2165,7 @@ static int snd_ymfpci_memalloc(struct snd_ymfpci *chip) chip->work_base = ptr; chip->work_base_addr = ptr_addr; -snd_BUG_ON (ptr + chip->work_size != +snd_BUG_ON (ptr +PAGE_ALIGN (chip->work_size) != chip->work_ptr->area + chip->work_ptr->bytes);snd_ymfpci_writel (chip,YDSXGR_PLAYCTRLBASE , chip->bank_base_playback_addr);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 56/99 net: ipa: compute DMA pool size properly
In reply to Greg Kroah-HartmanFrom: Alex Elder <[email protected]>
[ Upstream commit 6c75dc94f2b27fff57b305af9236eea181a00b6c ]
In gsi_trans_pool_init_dma(), the total size of a pool of memory used for DMA transactions is calculated. However the calculation is done incorrectly.
For 4KB pages, this total size is currently always more than one page, and as a result, the calculation produces a positive (though incorrect) total size. The code still works in this case; we just end up with fewer DMA pool entries than we intended.
Bjorn Andersson tested booting a kernel with 16KB pages, and hit a null pointer derereference in sg_alloc_append_table_from_pages(), descending from gsi_trans_pool_init_dma(). The cause of this was that a 16KB total size was going to be allocated, and with 16KB pages the order of that allocation is 0. The total_size calculation yielded 0, which eventually led to the crash.
Correcting the total_size calculation fixes the problem.
--- drivers/net/ipa/gsi_trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ipa/gsi_trans.c +1 -1
@@ -155,7 +155,7 @@ int gsi_trans_pool_init_dma(struct device *dev, struct gsi_trans_pool *pool,* gsi_trans_pool_exit_dma() can assume the total allocated * size is exactly (count * size). */ - total_size =get_order (total_size) <<PAGE_SHIFT ; + total_size =PAGE_SIZE <<get_order (total_size); virt =dma_alloc_coherent (dev, total_size, &addr,GFP_KERNEL );if (!virt)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 57/99 i40e: fix registers dump after run ethtool adapter self test
In reply to Greg Kroah-HartmanFrom: Radoslaw Tyl <[email protected]>
[ Upstream commit c5cff16f461a4a434a9915a7be7ac9ced861a8a4 ]
Fix invalid registers dump from ethtool -d ethX after adapter self test by ethtool -t ethY. It causes invalid data display.
The problem was caused by overwriting i40e_reg_list[].elements which is common for ethtool self test and dump.
--- drivers/net/ethernet/intel/i40e/i40e_diag.c | 11 ++++++----- drivers/net/ethernet/intel/i40e/i40e_diag.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_diag.c +6 -5
@@ -44,7 +44,7 @@ static i40e_status i40e_diag_reg_pattern_test(struct i40e_hw *hw,return 0 ; } -struct i40e_diag_reg_test_info i40e_reg_list[] = { +const struct i40e_diag_reg_test_info i40e_reg_list[] = {/* offset mask elements stride */ {I40E_QTX_CTL (0 ),0x0000FFBF ,1 ,I40E_QTX_CTL (1 ) -I40E_QTX_CTL (0 )},
@@ -78,27 +78,28 @@ i40e_status i40e_diag_reg_test(struct i40e_hw *hw) {i40e_status ret_code =0 ;u32 reg, mask; +u32 elements;u32 i, j;for (i =0 ; i40e_reg_list[i].offset !=0 && !ret_code; i++) { + elements = i40e_reg_list[i].elements;/* set actual reg range for dynamically allocated resources */ if (i40e_reg_list[i].offset ==I40E_QTX_CTL (0 ) && hw->func_caps.num_tx_qp !=0 ) - i40e_reg_list[i].elements = hw->func_caps.num_tx_qp; + elements = hw->func_caps.num_tx_qp;if ((i40e_reg_list[i].offset ==I40E_PFINT_ITRN (0 ,0 ) || i40e_reg_list[i].offset ==I40E_PFINT_ITRN (1 ,0 ) || i40e_reg_list[i].offset ==I40E_PFINT_ITRN (2 ,0 ) || i40e_reg_list[i].offset ==I40E_QINT_TQCTL (0 ) || i40e_reg_list[i].offset ==I40E_QINT_RQCTL (0 )) && hw->func_caps.num_msix_vectors !=0 ) - i40e_reg_list[i].elements = - hw->func_caps.num_msix_vectors -1 ; + elements = hw->func_caps.num_msix_vectors -1 ;/* test register access */ mask = i40e_reg_list[i].mask; -for (j =0 ; j < i40e_reg_list[i].elements && !ret_code; j++) { +for (j =0 ; j < elements && !ret_code; j++) { reg = i40e_reg_list[i].offset + (j * i40e_reg_list[i].stride); ret_code =i40e_diag_reg_pattern_test (hw, reg, mask);
drivers/net/ethernet/intel/i40e/i40e_diag.h +1 -1
@@ -20,7 +20,7 @@ struct i40e_diag_reg_test_info {u32 stride;/* bytes between each element */ }; -extern struct i40e_diag_reg_test_info i40e_reg_list[]; +extern const struct i40e_diag_reg_test_info i40e_reg_list[];i40e_status i40e_diag_reg_test (struct i40e_hw *hw);i40e_status i40e_diag_eeprom_test (struct i40e_hw *hw);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 58/99 bnxt_en: Fix reporting of test result in ethtool selftest
In reply to Greg Kroah-HartmanFrom: Kalesh AP <[email protected]>
[ Upstream commit 83714dc3db0e4a088673601bc8099b079bc1a077 ]
When the selftest command fails, driver is not reporting the failure by updating the "test->flags" when bnxt_close_nic() fails.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +1 -0
@@ -3504,6 +3504,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,bnxt_ulp_stop (bp); rc =bnxt_close_nic (bp, true, false);if (rc) { + etest->flags |=ETH_TEST_FL_FAILED ;bnxt_ulp_start (bp, rc);return ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 59/99 bnxt_en: Fix typo in PCI id to device description string mapping
In reply to Greg Kroah-HartmanFrom: Kalesh AP <[email protected]>
[ Upstream commit 62aad36ed31abc80f35db11e187e690448a79f7d ]
Fix 57502 and 57508 NPAR description string entries. The typos caused these devices to not match up with lspci output.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +4 -4
@@ -223,12 +223,12 @@ static const struct pci_device_id bnxt_pci_tbl[] = { { PCI_VDEVICE(BROADCOM, 0x1750), .driver_data = BCM57508 }, { PCI_VDEVICE(BROADCOM, 0x1751), .driver_data = BCM57504 }, { PCI_VDEVICE(BROADCOM, 0x1752), .driver_data = BCM57502 }, - { PCI_VDEVICE(BROADCOM, 0x1800), .driver_data = BCM57508_NPAR }, + { PCI_VDEVICE(BROADCOM, 0x1800), .driver_data = BCM57502_NPAR }, { PCI_VDEVICE(BROADCOM, 0x1801), .driver_data = BCM57504_NPAR }, - { PCI_VDEVICE(BROADCOM, 0x1802), .driver_data = BCM57502_NPAR }, - { PCI_VDEVICE(BROADCOM, 0x1803), .driver_data = BCM57508_NPAR }, + { PCI_VDEVICE(BROADCOM, 0x1802), .driver_data = BCM57508_NPAR }, + { PCI_VDEVICE(BROADCOM, 0x1803), .driver_data = BCM57502_NPAR }, { PCI_VDEVICE(BROADCOM, 0x1804), .driver_data = BCM57504_NPAR }, - { PCI_VDEVICE(BROADCOM, 0x1805), .driver_data = BCM57502_NPAR }, + { PCI_VDEVICE(BROADCOM, 0x1805), .driver_data = BCM57508_NPAR }, { PCI_VDEVICE(BROADCOM, 0xd802), .driver_data = BCM58802 }, { PCI_VDEVICE(BROADCOM, 0xd804), .driver_data = BCM58804 }, #ifdef CONFIG_BNXT_SRIOV
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 60/99 bnxt_en: Add missing 200G link speed reporting
In reply to Greg Kroah-HartmanFrom: Michael Chan <[email protected]>
[ Upstream commit 581bce7bcb7e7f100908728e7b292e266c76895b ]
bnxt_fw_to_ethtool_speed() is missing the case statement for 200G link speed reported by firmware. As a result, ethtool will report unknown speed when the firmware reports 200G link speed.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 -0
@@ -1202,6 +1202,7 @@ struct bnxt_link_info {#define BNXT_LINK_SPEED_40GB PORT_PHY_QCFG_RESP_LINK_SPEED_40GB#define BNXT_LINK_SPEED_50GB PORT_PHY_QCFG_RESP_LINK_SPEED_50GB#define BNXT_LINK_SPEED_100GB PORT_PHY_QCFG_RESP_LINK_SPEED_100GB +#define BNXT_LINK_SPEED_200GB PORT_PHY_QCFG_RESP_LINK_SPEED_200GBu16 support_speeds;u16 support_pam4_speeds;u16 auto_link_speeds;/* fw adv setting */
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 -0
@@ -1670,6 +1670,8 @@ u32 bnxt_fw_to_ethtool_speed(u16 fw_link_speed)return SPEED_50000 ;case BNXT_LINK_SPEED_100GB :return SPEED_100000 ; +case BNXT_LINK_SPEED_200GB : +return SPEED_200000 ;default :return SPEED_UNKNOWN ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 61/99 net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
In reply to Greg Kroah-HartmanFrom: Steffen Bätz <[email protected]>
[ Upstream commit 7bcad0f0e6fbc1d613e49e0ee35c8e5f2e685bb0 ]
Do not set the MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP bit on CPU or DSA ports.
This allows the host CPU port to be a regular IGMP listener by sending out IGMP Membership Reports, which would otherwise not be forwarded by the mv88exxx chip, but directly looped back to the CPU port itself.
--- drivers/net/dsa/mv88e6xxx/chip.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +7 -2
@@ -2912,9 +2912,14 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)* If this is the upstream port for this switch, enable * forwarding of unknown unicasts and multicasts. */ - reg =MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP | -MV88E6185_PORT_CTL0_USE_TAG |MV88E6185_PORT_CTL0_USE_IP | + reg =MV88E6185_PORT_CTL0_USE_TAG |MV88E6185_PORT_CTL0_USE_IP |MV88E6XXX_PORT_CTL0_STATE_FORWARDING ; +/* Forward any IPv4 IGMP or IPv6 MLD frames received +* by a USER port to the CPU port to allow snooping. +*/ +if (dsa_is_user_port (ds, port)) + reg |=MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP ; + err =mv88e6xxx_port_write (chip, port,MV88E6XXX_PORT_CTL0 , reg);if (err)return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 62/99 net: ethernet: mtk_eth_soc: fix flow block refcounting logic
In reply to Greg Kroah-HartmanFrom: Felix Fietkau <[email protected]>
[ Upstream commit 8c1cb87c2a5c29da416848451a687473f379611c ]
Since we call flow_block_cb_decref on FLOW_BLOCK_UNBIND, we also need to call flow_block_cb_incref for a newly allocated cb.
Also fix the accidentally inverted refcount check on unbind.
--- drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_ppe_offload.c +2 -1
@@ -462,6 +462,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)if (IS_ERR (block_cb))return PTR_ERR (block_cb); +flow_block_cb_incref (block_cb);flow_block_cb_add (block_cb, f);list_add_tail (&block_cb->driver_list, &block_cb_list);return 0 ;
@@ -470,7 +471,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)if (!block_cb)return -ENOENT ; -if (flow_block_cb_decref (block_cb)) { +if (!flow_block_cb_decref (block_cb)) {flow_block_cb_remove (block_cb, f);list_del (&block_cb->driver_list); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 63/99 pinctrl: ocelot: Fix alt mode for ocelot
In reply to Greg Kroah-HartmanFrom: Horatiu Vultur <[email protected]>
[ Upstream commit 657fd9da2d4b4aa0a384105b236baa22fa0233bf ]
In case the driver was trying to set an alternate mode for gpio 0 or 32 then the mode was not set correctly. The reason is that there is computation error inside the function ocelot_pinmux_set_mux because in this case it was trying to shift to left by -1. Fix this by actually shifting the function bits and not the position.
--- drivers/pinctrl/pinctrl-ocelot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-ocelot.c +1 -1
@@ -739,7 +739,7 @@ static int ocelot_pinmux_set_mux(struct pinctrl_dev *pctldev,regmap_update_bits (info->map,REG_ALT (0 , info, pin->pin),BIT (p), f << p);regmap_update_bits (info->map,REG_ALT (1 , info, pin->pin), -BIT (p), f << (p -1 )); +BIT (p), (f >>1 ) << p);return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 64/99 iommu/vt-d: Allow zero SAGAW if second-stage not supported
In reply to Greg Kroah-HartmanFrom: Lu Baolu <[email protected]>
[ Upstream commit bfd3c6b9fa4a1dc78139dd1621d5bea321ffa69d ]
The VT-d spec states (in section 11.4.2) that hardware implementations reporting second-stage translation support (SSTS) field as Clear also report the SAGAW field as 0. Fix an inappropriate check in alloc_iommu().
--- drivers/iommu/intel/dmar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/intel/dmar.c +2 -1
@@ -1080,7 +1080,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) } err = -EINVAL ; -if (cap_sagaw (iommu->cap) ==0 ) { +if (!cap_sagaw (iommu->cap) && + (!ecap_smts (iommu->ecap) ||ecap_slts (iommu->ecap))) {pr_info ("%s: No supported address widths. Not attempting DMA translation.\n" , iommu->name); drhd->ignored =1 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 65/99 Input: alps - fix compatibility with -funsigned-char
In reply to Greg Kroah-HartmanFrom: msizanoen <[email protected]>
commit 754ff5060daf5a1cf4474eff9b4edeb6c17ef7ab upstream.
The AlpsPS/2 code previously relied on the assumption that char is a signed type, which was true on x86 platforms (the only place where this driver is used) before kernel 6.2. However, on 6.2 and later, this assumption is broken due to the introduction of -funsigned-char as a new global compiler flag.
Fix this by explicitly specifying the signedness of char when sign extending the values received from the device.
--- drivers/input/mouse/alps.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/input/mouse/alps.c +8 -8
@@ -852,8 +852,8 @@ static void alps_process_packet_v6(struc x = y = z =0 ;/* Divide 4 since trackpoint's speed is too fast */ -input_report_rel (dev2,REL_X , (char )x /4 ); -input_report_rel (dev2,REL_Y , -((char )y /4 )); +input_report_rel (dev2,REL_X , (s8 )x /4 ); +input_report_rel (dev2,REL_Y , -((s8 )y /4 ));psmouse_report_standard_buttons (dev2, packet[3 ]);
@@ -1104,8 +1104,8 @@ static void alps_process_trackstick_pack ((packet[3 ] &0x20 ) <<1 ); z = (packet[5 ] &0x3f ) | ((packet[3 ] &0x80 ) >>1 ); -input_report_rel (dev2,REL_X , (char )x); -input_report_rel (dev2,REL_Y , -((char )y)); +input_report_rel (dev2,REL_X , (s8 )x); +input_report_rel (dev2,REL_Y , -((s8 )y));input_report_abs (dev2,ABS_PRESSURE , z);psmouse_report_standard_buttons (dev2, packet[1 ]);
@@ -2294,20 +2294,20 @@ static int alps_get_v3_v7_resolution(strif (reg <0 )return reg; - x_pitch = (char )(reg <<4 ) >>4 ;/* sign extend lower 4 bits */ + x_pitch = (s8)(reg <<4 ) >>4 ;/* sign extend lower 4 bits */ x_pitch =50 +2 * x_pitch;/* In 0.1 mm units */ - y_pitch = (char )reg >>4 ;/* sign extend upper 4 bits */ + y_pitch = (s8 )reg >>4 ;/* sign extend upper 4 bits */ y_pitch =36 +2 * y_pitch;/* In 0.1 mm units */ reg =alps_command_mode_read_reg (psmouse, reg_pitch +1 );if (reg <0 )return reg; - x_electrode = (char )(reg <<4 ) >>4 ;/* sign extend lower 4 bits */ + x_electrode = (s8)(reg <<4 ) >>4 ;/* sign extend lower 4 bits */ x_electrode =17 + x_electrode; - y_electrode = (char )reg >>4 ;/* sign extend upper 4 bits */ + y_electrode = (s8 )reg >>4 ;/* sign extend upper 4 bits */ y_electrode =13 + y_electrode; x_phys = x_pitch * (x_electrode -1 );/* In 0.1 mm units */
Greg Kroah-Hartman
maintainerPATCH 66/99 Input: focaltech - use explicitly signed char type
In reply to Greg Kroah-HartmanFrom: Jason A. Donenfeld <[email protected]>
commit 8980f190947ba29f23110408e712444884b74251 upstream.
The recent change of -funsigned-char causes additions of negative numbers to become additions of large positive numbers, leading to wrong calculations of mouse movement. Change these casts to be explicitly signed, to take into account negative offsets.
--- drivers/input/mouse/focaltech.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/input/mouse/focaltech.c +4 -4
@@ -202,8 +202,8 @@ static void focaltech_process_rel_packet state->pressed = packet[0 ] >>7 ; finger1 = ((packet[0 ] >>4 ) &0x7 ) -1 ;if (finger1 <FOC_MAX_FINGERS ) { - state->fingers[finger1].x += (char )packet[1 ]; - state->fingers[finger1].y += (char )packet[2 ]; + state->fingers[finger1].x += (s8 )packet[1 ]; + state->fingers[finger1].y += (s8 )packet[2 ]; }else {psmouse_err (psmouse,"First finger in rel packet invalid: %d\n" , finger1);
@@ -218,8 +218,8 @@ static void focaltech_process_rel_packet*/ finger2 = ((packet[3 ] >>4 ) &0x7 ) -1 ;if (finger2 <FOC_MAX_FINGERS ) { - state->fingers[finger2].x += (char )packet[4 ]; - state->fingers[finger2].y += (char )packet[5 ]; + state->fingers[finger2].x += (s8 )packet[4 ]; + state->fingers[finger2].y += (s8 )packet[5 ]; } }
Greg Kroah-Hartman
maintainerPATCH 67/99 cifs: prevent infinite recursion in CIFSGetDFSRefer()
In reply to Greg Kroah-HartmanFrom: Paulo Alcantara <[email protected]>
commit 09ba47b44d26b475bbdf9c80db9e0193d2b58956 upstream.
We can't call smb_init() in CIFSGetDFSRefer() as cifs_reconnect_tcon() may end up calling CIFSGetDFSRefer() again to get new DFS referrals and thus causing an infinite recursion.
--- fs/cifs/cifssmb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/cifs/cifssmb.c +7 -2
@@ -4751,8 +4751,13 @@ CIFSGetDFSRefer(const unsigned int xid,return -ENODEV ; getDFSRetry: - rc =smb_init (SMB_COM_TRANSACTION2 ,15 , ses->tcon_ipc, (void **) &pSMB, - (void **) &pSMBr); +/* +* Use smb_init_no_reconnect() instead of smb_init() as +* CIFSGetDFSRefer() may be called from cifs_reconnect_tcon() and thus +* causing an infinite recursion. +*/ + rc =smb_init_no_reconnect (SMB_COM_TRANSACTION2 ,15 , ses->tcon_ipc, + (void **)&pSMB, (void **)&pSMBr);if (rc)return rc;
Greg Kroah-Hartman
maintainerPATCH 68/99 cifs: fix DFS traversal oops without CONFIG_CIFS_DFS_UPCALL
In reply to Greg Kroah-HartmanFrom: David Disseldorp <[email protected]>
commit 179a88a8558bbf42991d361595281f3e45d7edfc upstream.
When compiled with CONFIG_CIFS_DFS_UPCALL disabled, cifs_dfs_d_automount is NULL. cifs.ko logic for mapping CIFS_FATTR_DFS_REFERRAL attributes to S_AUTOMOUNT and corresponding dentry flags is retained regardless of CONFIG_CIFS_DFS_UPCALL, leading to a NULL pointer dereference in VFS follow_automount() when traversing a DFS referral link:
BUG: kernel NULL pointer dereference, address: 0000000000000000 ... Call Trace: <TASK> __traverse_mounts+0xb5/0x220 ? cifs_revalidate_mapping+0x65/0xc0 [cifs] step_into+0x195/0x610 ? lookup_fast+0xe2/0xf0 path_lookupat+0x64/0x140 filename_lookup+0xc2/0x140 ? __create_object+0x299/0x380 ? kmem_cache_alloc+0x119/0x220 ? user_path_at_empty+0x31/0x50 user_path_at_empty+0x31/0x50 __x64_sys_chdir+0x2a/0xd0 ? exit_to_user_mode_prepare+0xca/0x100 do_syscall_64+0x42/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc
This fix adds an inline cifs_dfs_d_automount() {return -EREMOTE} handler when CONFIG_CIFS_DFS_UPCALL is disabled. An alternative would be to avoid flagging S_AUTOMOUNT, etc. without CONFIG_CIFS_DFS_UPCALL. This approach was chosen as it provides more control over the error path.
--- fs/cifs/cifsfs.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/cifs/cifsfs.h +4 -1
@@ -118,7 +118,10 @@ extern const struct dentry_operations ci#ifdef CONFIG_CIFS_DFS_UPCALL extern struct vfsmount *cifs_dfs_d_automount (struct path *path);#else -#define cifs_dfs_d_automount NULL +static inline struct vfsmount *cifs_dfs_d_automount (struct path *path) +{ +return ERR_PTR (-EREMOTE ); +}#endif /* Functions related to symlinks */
Greg Kroah-Hartman
maintainerPATCH 69/99 Input: goodix - add Lenovo Yoga Book X90F to nine_bytes_report DMI table
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 8a0432bab6ea3203d220785da7ab3c7677f70ecb upstream.
The Android Lenovo Yoga Book X90F / X90L uses the same goodix touchscreen with 9 bytes touch reports for its touch keyboard as the already supported Windows Lenovo Yoga Book X91F/L, add a DMI match for this to the nine_bytes_report DMI table.
When the quirk for the X91F/L was initially added it was written to also apply to the X90F/L but this does not work because the Android version of the Yoga Book uses completely different DMI strings. Also adjust the X91F/L quirk to reflect that it only applies to the X91F/L models.
--- drivers/input/touchscreen/goodix.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/input/touchscreen/goodix.c +11 -3
@@ -123,10 +123,18 @@ static const unsigned long goodix_irq_flstatic const struct dmi_system_id nine_bytes_report[] = { #if defined(CONFIG_DMI) && defined(CONFIG_X86) { - .ident ="Lenovo YogaBook" , -/* YB1-X91L/F and YB1-X90L/F */ +/* Lenovo Yoga Book X90F / X90L */ .matches = { -DMI_MATCH (DMI_PRODUCT_NAME ,"Lenovo YB1-X9" ) +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel Corporation" ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"CHERRYVIEW D1 PLATFORM" ), +DMI_EXACT_MATCH (DMI_PRODUCT_VERSION ,"YETI-11" ), + } + }, + { +/* Lenovo Yoga Book X91F / X91L */ + .matches = { +/* Non exact match to match F + L versions */ +DMI_MATCH (DMI_PRODUCT_NAME ,"Lenovo YB1-X91" ), } }, #endif
Greg Kroah-Hartman
maintainerPATCH 70/99 btrfs: fix race between quota disable and quota assign ioctls
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
commit 2f1a6be12ab6c8470d5776e68644726c94257c54 upstream.
The quota assign ioctl can currently run in parallel with a quota disable ioctl call. The assign ioctl uses the quota root, while the disable ioctl frees that root, and therefore we can have a use-after-free triggered in the assign ioctl, leading to a trace like the following when KASAN is enabled:
[672.723][T736] BUG: KASAN: slab-use-after-free in btrfs_search_slot+0x2962/0x2db0 [672.723][T736] Read of size 8 at addr ffff888022ec0208 by task btrfs_search_sl/27736 [672.724][T736] [672.725][T736] CPU: 1 PID: 27736 Comm: btrfs_search_sl Not tainted 6.3.0-rc3 #37 [672.723][T736] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [672.727][T736] Call Trace: [672.728][T736] <TASK> [672.728][T736] dump_stack_lvl+0xd9/0x150 [672.725][T736] print_report+0xc1/0x5e0 [672.720][T736] ? __virt_addr_valid+0x61/0x2e0 [672.727][T736] ? __phys_addr+0xc9/0x150 [672.725][T736] ? btrfs_search_slot+0x2962/0x2db0 [672.722][T736] kasan_report+0xc0/0xf0 [672.729][T736] ? btrfs_search_slot+0x2962/0x2db0 [672.724][T736] btrfs_search_slot+0x2962/0x2db0 [672.723][T736] ? fs_reclaim_acquire+0xba/0x160 [672.722][T736] ? split_leaf+0x13d0/0x13d0 [672.726][T736] ? rcu_is_watching+0x12/0xb0 [672.723][T736] ? kmem_cache_alloc+0x338/0x3c0 [672.722][T736] update_qgroup_status_item+0xf7/0x320 [672.724][T736] ? add_qgroup_rb+0x3d0/0x3d0 [672.739][T736] ? do_raw_spin_lock+0x12d/0x2b0 [672.730][T736] ? spin_bug+0x1d0/0x1d0 [672.737][T736] btrfs_run_qgroups+0x5de/0x840 [672.730][T736] ? btrfs_qgroup_rescan_worker+0xa70/0xa70 [672.738][T736] ? __del_qgroup_relation+0x4ba/0xe00 [672.738][T736] btrfs_ioctl+0x3d58/0x5d80 [672.735][T736] ? tomoyo_path_number_perm+0x16a/0x550 [672.737][T736] ? tomoyo_execute_permission+0x4a0/0x4a0 [672.731][T736] ? btrfs_ioctl_get_supported_features+0x50/0x50 [672.737][T736] ? __sanitizer_cov_trace_switch+0x54/0x90 [672.734][T736] ? do_vfs_ioctl+0x132/0x1660 [672.730][T736] ? vfs_fileattr_set+0xc40/0xc40 [672.730][T736] ? _raw_spin_unlock_irq+0x2e/0x50 [672.732][T736] ? sigprocmask+0xf2/0x340 [672.737][T736] ? __fget_files+0x26a/0x480 [672.732][T736] ? bpf_lsm_file_ioctl+0x9/0x10 [672.738][T736] ? btrfs_ioctl_get_supported_features+0x50/0x50 [672.736][T736] __x64_sys_ioctl+0x198/0x210 [672.736][T736] do_syscall_64+0x39/0xb0 [672.731][T736] entry_SYSCALL_64_after_hwframe+0x63/0xcd [672.739][T736] RIP: 0033:0x4556ad [672.742][T736] </TASK> [672.743][T736] [672.748][T736] Allocated by task 27677: [672.743][T736] kasan_save_stack+0x22/0x40 [672.741][T736] kasan_set_track+0x25/0x30 [672.741][T736] __kasan_kmalloc+0xa4/0xb0 [672.749][T736] btrfs_alloc_root+0x48/0x90 [672.746][T736] btrfs_create_tree+0x146/0xa20 [672.744][T736] btrfs_quota_enable+0x461/0x1d20 [672.743][T736] btrfs_ioctl+0x4a1c/0x5d80 [672.747][T736] __x64_sys_ioctl+0x198/0x210 [672.749][T736] do_syscall_64+0x39/0xb0 [672.744][T736] entry_SYSCALL_64_after_hwframe+0x63/0xcd [672.756][T736] [672.757][T736] Freed by task 27677: [672.759][T736] kasan_save_stack+0x22/0x40 [672.759][T736] kasan_set_track+0x25/0x30 [672.756][T736] kasan_save_free_info+0x2e/0x50 [672.751][T736] ____kasan_slab_free+0x162/0x1c0 [672.758][T736] slab_free_freelist_hook+0x89/0x1c0 [672.752][T736] __kmem_cache_free+0xaf/0x2e0 [672.752][T736] btrfs_put_root+0x1ff/0x2b0 [672.759][T736] btrfs_quota_disable+0x80a/0xbc0 [672.752][T736] btrfs_ioctl+0x3e5f/0x5d80 [672.756][T736] __x64_sys_ioctl+0x198/0x210 [672.753][T736] do_syscall_64+0x39/0xb0 [672.765][T736] entry_SYSCALL_64_after_hwframe+0x63/0xcd [672.769][T736] [672.768][T736] The buggy address belongs to the object at ffff888022ec0000 [672.768][T736] which belongs to the cache kmalloc-4k of size 4096 [672.769][T736] The buggy address is located 520 bytes inside of [672.769][T736] freed 4096-byte region [ffff888022ec0000, ffff888022ec1000) [672.760][T736] [672.764][T736] The buggy address belongs to the physical page: [672.761][T736] page:ffffea00008bb000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22ec0 [672.766][T736] head:ffffea00008bb000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [672.779][T736] flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) [672.770][T736] raw: 00fff00000010200 ffff888012842140 ffffea000054ba00 dead000000000002 [672.770][T736] raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 [672.771][T736] page dumped because: kasan: bad access detected [672.778][T736] page_owner tracks the page as allocated [672.777][T736] page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 88 [672.779][T736] get_page_from_freelist+0x119c/0x2d50 [672.779][T736] __alloc_pages+0x1cb/0x4a0 [672.776][T736] alloc_pages+0x1aa/0x270 [672.773][T736] allocate_slab+0x260/0x390 [672.771][T736] ___slab_alloc+0xa9a/0x13e0 [672.778][T736] __slab_alloc.constprop.0+0x56/0xb0 [672.771][T736] __kmem_cache_alloc_node+0x136/0x320 [672.789][T736] __kmalloc+0x4e/0x1a0 [672.783][T736] tomoyo_realpath_from_path+0xc3/0x600 [672.781][T736] tomoyo_path_perm+0x22f/0x420 [672.782][T736] tomoyo_path_unlink+0x92/0xd0 [672.780][T736] security_path_unlink+0xdb/0x150 [672.788][T736] do_unlinkat+0x377/0x680 [672.788][T736] __x64_sys_unlink+0xca/0x110 [672.789][T736] do_syscall_64+0x39/0xb0 [672.783][T736] entry_SYSCALL_64_after_hwframe+0x63/0xcd [672.784][T736] page last free stack trace: [672.787][T736] free_pcp_prepare+0x4e5/0x920 [672.787][T736] free_unref_page+0x1d/0x4e0 [672.784][T736] __unfreeze_partials+0x17c/0x1a0 [672.797][T736] qlist_free_all+0x6a/0x180 [672.796][T736] kasan_quarantine_reduce+0x189/0x1d0 [672.797][T736] __kasan_slab_alloc+0x64/0x90 [672.793][T736] kmem_cache_alloc+0x17c/0x3c0 [672.799][T736] getname_flags.part.0+0x50/0x4e0 [672.799][T736] getname_flags+0x9e/0xe0 [672.792][T736] vfs_fstatat+0x77/0xb0 [672.791][T736] __do_sys_newlstat+0x84/0x100 [672.798][T736] do_syscall_64+0x39/0xb0 [672.796][T736] entry_SYSCALL_64_after_hwframe+0x63/0xcd [672.790][T736] [672.791][T736] Memory state around the buggy address: [672.799][T736] ffff888022ec0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [672.805][T736] ffff888022ec0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [672.802][T736] >ffff888022ec0200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [672.809][T736] ^ [672.809][T736] ffff888022ec0280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [672.809][T736] ffff888022ec0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Fix this by having the qgroup assign ioctl take the qgroup ioctl mutex before calling btrfs_run_qgroups(), which is what all qgroup ioctls should call.
--- fs/btrfs/ioctl.c | 2 ++ fs/btrfs/qgroup.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-)
fs/btrfs/ioctl.c +2 -0
@@ -4267,7 +4267,9 @@ static long btrfs_ioctl_qgroup_assign(st }/* update qgroup status and info */ +mutex_lock (&fs_info->qgroup_ioctl_lock); err =btrfs_run_qgroups (trans); +mutex_unlock (&fs_info->qgroup_ioctl_lock);if (err <0 )btrfs_handle_fs_error (fs_info, err,"failed to update qgroup status and info" );
fs/btrfs/qgroup.c +10 -1
@@ -2752,13 +2752,22 @@ cleanup: }/* -* called from commit_transaction. Writes all changed qgroups to disk. +* Writes all changed qgroups to disk. +* Called by the transaction commit path and the qgroup assign ioctl. */ int btrfs_run_qgroups (struct btrfs_trans_handle *trans) {struct btrfs_fs_info *fs_info = trans->fs_info;int ret =0 ; +/* +* In case we are called from the qgroup assign ioctl, assert that we +* are holding the qgroup_ioctl_lock, otherwise we can race with a quota +* disable operation (ioctl) and access a freed quota root. +*/ +if (trans->transaction->state !=TRANS_STATE_COMMIT_DOING ) +lockdep_assert_held (&fs_info->qgroup_ioctl_lock); +if (!fs_info->quota_root)return ret;
Greg Kroah-Hartman
maintainerPATCH 71/99 btrfs: scan device in non-exclusive mode
In reply to Greg Kroah-HartmanFrom: Anand Jain <[email protected]>
commit 50d281fc434cb8e2497f5e70a309ccca6b1a09f0 upstream.
This fixes mkfs/mount/check failures due to race with systemd-udevd scan.
During the device scan initiated by systemd-udevd, other user space EXCL operations such as mkfs, mount, or check may get blocked and result in a "Device or resource busy" error. This is because the device scan process opens the device with the EXCL flag in the kernel.
Two reports were received:
- btrfs/179 test case, where the fsck command failed with the -EBUSY error
- LTP pwritev03 test case, where mkfs.vfs failed with
the -EBUSY error, when mkfs.vfs tried to overwrite old btrfs filesystem on the device.
In both cases, fsck and mkfs (respectively) were racing with a systemd-udevd device scan, and systemd-udevd won, resulting in the -EBUSY error for fsck and mkfs.
Reproducing the problem has been difficult because there is a very small window during which these userspace threads can race to acquire the exclusive device open. Even on the system where the problem was observed, the problem occurrences were anywhere between 10 to 400 iterations and chances of reproducing decreases with debug printk()s.
However, an exclusive device open is unnecessary for the scan process, as there are no write operations on the device during scan. Furthermore, during the mount process, the superblock is re-read in the below function call chain:
btrfs_mount_root
btrfs_open_devices
open_fs_devices
btrfs_open_one_device
btrfs_get_bdev_and_sb
So, to fix this issue, removes the FMODE_EXCL flag from the scan operation, and add a comment.
The case where mkfs may still write to the device and a scan is running, the btrfs signature is not written at that time so scan will not recognize such device.
--- fs/btrfs/volumes.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/btrfs/volumes.c +10 -1
@@ -1406,8 +1406,17 @@ struct btrfs_device *btrfs_scan_one_devi* So, we need to add a special mount option to scan for * later supers, using BTRFS_SUPER_MIRROR_MAX instead */ - flags |=FMODE_EXCL ; +/* +* Avoid using flag |= FMODE_EXCL here, as the systemd-udev may +* initiate the device scan which may race with the user's mount +* or mkfs command, resulting in failure. +* Since the device scan is solely for reading purposes, there is +* no need for FMODE_EXCL. Additionally, the devices are read again +* during the mount process. It is ok to get some inconsistent +* values temporarily, as the device paths of the fsid are the only +* required information for assembling the volume. +*/ bdev =blkdev_get_by_path (path, flags, holder);if (IS_ERR (bdev))return ERR_CAST (bdev);
Greg Kroah-Hartman
maintainerPATCH 72/99 zonefs: Always invalidate last cached page on append write
In reply to Greg Kroah-HartmanFrom: Damien Le Moal <[email protected]>
commit c1976bd8f23016d8706973908f2bb0ac0d852a8f upstream.
When a direct append write is executed, the append offset may correspond to the last page of a sequential file inode which might have been cached already by buffered reads, page faults with mmap-read or non-direct readahead. To ensure that the on-disk and cached data is consistant for such last cached page, make sure to always invalidate it in zonefs_file_dio_append(). If the invalidation fails, return -EBUSY to userspace to differentiate from IO errors.
This invalidation will always be a no-op when the FS block size (device zone write granularity) is equal to the page size (e.g. 4K).
--- fs/zonefs/super.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
fs/zonefs/super.c +14 -0
@@ -736,6 +736,7 @@ static ssize_t zonefs_file_dio_append(ststruct zonefs_inode_info *zi =ZONEFS_I (inode);struct block_device *bdev = inode->i_sb->s_bdev;unsigned int max =bdev_max_zone_append_sectors (bdev); +pgoff_t start, end;struct bio *bio;ssize_t size;int nr_pages;
@@ -744,6 +745,19 @@ static ssize_t zonefs_file_dio_append(st max =ALIGN_DOWN (max <<SECTOR_SHIFT , inode->i_sb->s_blocksize);iov_iter_truncate (from, max); +/* +* If the inode block size (zone write granularity) is smaller than the +* page size, we may be appending data belonging to the last page of the +* inode straddling inode->i_size, with that page already cached due to +* a buffered read or readahead. So make sure to invalidate that page. +* This will always be a no-op for the case where the block size is +* equal to the page size. +*/ + start = iocb->ki_pos >>PAGE_SHIFT ; + end = (iocb->ki_pos +iov_iter_count (from) -1 ) >>PAGE_SHIFT ; +if (invalidate_inode_pages2_range (inode->i_mapping, start, end)) +return -EBUSY ; + nr_pages =iov_iter_npages (from,BIO_MAX_VECS );if (!nr_pages)return 0 ;
Greg Kroah-Hartman
maintainerPATCH 73/99 can: j1939: prevent deadlock by moving j1939_sk_errqueue()
In reply to Greg Kroah-HartmanFrom: Oleksij Rempel <[email protected]>
commit d1366b283d94ac4537a4b3a1e8668da4df7ce7e9 upstream.
This commit addresses a deadlock situation that can occur in certain scenarios, such as when running data TP/ETP transfer and subscribing to the error queue while receiving a net down event. The deadlock involves locks in the following order:
3
j1939_session_list_lock -> active_session_list_lock j1939_session_activate
...
j1939_sk_queue_activate_next -> sk_session_queue_lock
...
j1939_xtp_rx_eoma_one
2
j1939_sk_queue_drop_all -> sk_session_queue_lock
...
j1939_sk_netdev_event_netdown -> j1939_socks_lock j1939_netdev_notify
1
j1939_sk_errqueue -> j1939_socks_lock __j1939_session_cancel -> active_session_list_lock j1939_tp_rxtimer
CPU0 CPU1
---- ----
lock(&priv->active_session_list_lock);
lock(&jsk->sk_session_queue_lock);
lock(&priv->active_session_list_lock); lock(&priv->j1939_socks_lock);
The solution implemented in this commit is to move the j1939_sk_errqueue() call out of the active_session_list_lock context, thus preventing the deadlock situation.
--- net/can/j1939/transport.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/can/j1939/transport.c +6 -2
@@ -1124,8 +1124,6 @@ static void __j1939_session_cancel(strucif (session->sk)j1939_sk_send_loop_abort (session->sk, session->err); -else -j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_ABORT ); } static void j1939_session_cancel(struct j1939_session *session,
@@ -1140,6 +1138,9 @@ static void j1939_session_cancel(struct }j1939_session_list_unlock (session->priv); + +if (!session->sk) +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_ABORT ); }static enum hrtimer_restart j1939_tp_txtimer (struct hrtimer *hrtimer)
@@ -1253,6 +1254,9 @@ static enum hrtimer_restart j1939_tp_rxt__j1939_session_cancel (session,J1939_XTP_ABORT_TIMEOUT ); }j1939_session_list_unlock (session->priv); + +if (!session->sk) +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_ABORT ); }j1939_session_put (session);
Greg Kroah-Hartman
maintainerPATCH 74/99 xen/netback: dont do grant copy across page boundary
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
commit 05310f31ca74673a96567fb14637b7d5d6c82ea5 upstream.
Fix xenvif_get_requests() not to do grant copy operations across local page boundaries. This requires to double the maximum number of copy operations per queue, as each copy could now be split into 2.
Make sure that struct xenvif_tx_cb doesn't grow too large.
--- drivers/net/xen-netback/common.h | 2 +- drivers/net/xen-netback/netback.c | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-)
drivers/net/xen-netback/common.h +1 -1
@@ -166,7 +166,7 @@ struct xenvif_queue { /* Per-queue datastruct pending_tx_info pending_tx_info[MAX_PENDING_REQS ];grant_handle_t grant_tx_handle[MAX_PENDING_REQS ]; -struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS ]; +struct gnttab_copy tx_copy_ops[2 *MAX_PENDING_REQS ];struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS ];struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS ];/* passed to gnttab_[un]map_refs with pages under (un)mapping */
drivers/net/xen-netback/netback.c +23 -2
@@ -334,6 +334,7 @@ static int xenvif_count_requests(structstruct xenvif_tx_cb {u16 copy_pending_idx[XEN_NETBK_LEGACY_SLOTS_MAX +1 ];u8 copy_count; +u32 split_mask; };#define XENVIF_TX_CB (skb) ((struct xenvif_tx_cb *)(skb)->cb)
@@ -361,6 +362,8 @@ static inline struct sk_buff *xenvif_allstruct sk_buff *skb =alloc_skb (size +NET_SKB_PAD +NET_IP_ALIGN ,GFP_ATOMIC | __GFP_NOWARN); + +BUILD_BUG_ON (sizeof (*XENVIF_TX_CB (skb)) >sizeof (skb->cb));if (unlikely (skb ==NULL ))return NULL ;
@@ -396,11 +399,13 @@ static void xenvif_get_requests(struct x nr_slots = shinfo->nr_frags +1 ;copy_count (skb) =0 ; +XENVIF_TX_CB (skb)->split_mask =0 ;/* Create copy ops for exactly data_len bytes into the skb head. */ __skb_put (skb, data_len);while (data_len >0 ) {int amount = data_len > txp->size ? txp->size : data_len; +bool split = false; cop->source.u.ref = txp->gref; cop->source.domid = queue->vif->domid;
@@ -413,6 +418,13 @@ static void xenvif_get_requests(struct x cop->dest.u.gmfn =virt_to_gfn (skb->data +skb_headlen (skb) - data_len); +/* Don't cross local page boundary! */ +if (cop->dest.offset + amount >XEN_PAGE_SIZE ) { + amount =XEN_PAGE_SIZE - cop->dest.offset; +XENVIF_TX_CB (skb)->split_mask |=1U <<copy_count (skb); + split = true; + } + cop->len = amount; cop->flags = GNTCOPY_source_gref;
@@ -420,7 +432,8 @@ static void xenvif_get_requests(struct x pending_idx = queue->pending_ring[index];callback_param (queue, pending_idx).ctx =NULL ;copy_pending_idx (skb,copy_count (skb)) = pending_idx; -copy_count (skb)++; +if (!split) +copy_count (skb)++; cop++; data_len -= amount;
@@ -441,7 +454,8 @@ static void xenvif_get_requests(struct x nr_slots--; }else {/* The copy op partially covered the tx_request. -* The remainder will be mapped. +* The remainder will be mapped or copied in the next +* iteration. */ txp->offset += amount; txp->size -= amount;
@@ -539,6 +553,13 @@ static int xenvif_tx_check_gop(struct xe pending_idx =copy_pending_idx (skb, i); newerr = (*gopp_copy)->status; + +/* Split copies need to be handled together. */ +if (XENVIF_TX_CB (skb)->split_mask & (1U << i)) { + (*gopp_copy)++; +if (!newerr) + newerr = (*gopp_copy)->status; + }if (likely (!newerr)) {/* The first frag might still have this slot mapped */ if (i <copy_count (skb) -1 || !sharedslot)
Greg Kroah-Hartman
maintainerPATCH 75/99 net: phy: dp83869: fix default value for tx-/rx-internal-delay
In reply to Greg Kroah-HartmanFrom: Josua Mayer <[email protected]>
commit 82e2c39f9ef78896e9b634dfd82dc042e6956bb7 upstream.
dp83869 internally uses a look-up table for mapping supported delays in nanoseconds to register values.
When specific delays are defined in device-tree, phy_get_internal_delay does the lookup automatically returning an index.
The default case wrongly assigns the nanoseconds value from the lookup table, resulting in numeric value 2000 applied to delay configuration register, rather than the expected index values 0-7 (7 for 2000). Ultimately this issue broke RX for 1Gbps links.
Fix default delay configuration by assigning the intended index value directly.
--- drivers/net/phy/dp83869.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/phy/dp83869.c +2 -4
@@ -587,15 +587,13 @@ static int dp83869_of_init(struct phy_de &dp83869_internal_delay[0 ], delay_size, true);if (dp83869->rx_int_delay <0 ) - dp83869->rx_int_delay = - dp83869_internal_delay[DP83869_CLK_DELAY_DEF ]; + dp83869->rx_int_delay =DP83869_CLK_DELAY_DEF ; dp83869->tx_int_delay =phy_get_internal_delay (phydev, dev, &dp83869_internal_delay[0 ], delay_size, false);if (dp83869->tx_int_delay <0 ) - dp83869->tx_int_delay = - dp83869_internal_delay[DP83869_CLK_DELAY_DEF ]; + dp83869->tx_int_delay =DP83869_CLK_DELAY_DEF ;return ret; }
Greg Kroah-Hartman
maintainerPATCH 76/99 pinctrl: amd: Disable and mask interrupts on resume
In reply to Greg Kroah-HartmanFrom: Kornel Dulęba <[email protected]>
commit b26cd9325be4c1fcd331b77f10acb627c560d4d7 upstream.
This fixes a similar problem to the one observed in:
commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe").
On some systems, during suspend/resume cycle firmware leaves an interrupt enabled on a pin that is not used by the kernel. This confuses the AMD pinctrl driver and causes spurious interrupts.
The driver already has logic to detect if a pin is used by the kernel. Leverage it to re-initialize interrupt fields of a pin only if it's not used by us.
--- drivers/pinctrl/pinctrl-amd.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/pinctrl/pinctrl-amd.c +20 -16
@@ -863,32 +863,34 @@ static const struct pinconf_ops amd_pinc .pin_config_group_set = amd_pinconf_group_set, }; -static void amd_gpio_irq_init (struct amd_gpio *gpio_dev) +static void amd_gpio_irq_init_pin (struct amd_gpio *gpio_dev,int pin) { -struct pinctrl_desc *desc = gpio_dev->pctrl->desc; +const struct pin_desc *pd;unsigned long flags;u32 pin_reg, mask; -int i; mask =BIT (WAKE_CNTRL_OFF_S0I3 ) |BIT (WAKE_CNTRL_OFF_S3 ) |BIT (INTERRUPT_MASK_OFF ) |BIT (INTERRUPT_ENABLE_OFF ) |BIT (WAKE_CNTRL_OFF_S4 ); -for (i =0 ; i < desc->npins; i++) { -int pin = desc->pins[i].number; -const struct pin_desc *pd =pin_desc_get (gpio_dev->pctrl, pin); - -if (!pd) -continue ; + pd =pin_desc_get (gpio_dev->pctrl, pin); +if (!pd) +return ; -raw_spin_lock_irqsave (&gpio_dev->lock, flags); +raw_spin_lock_irqsave (&gpio_dev->lock, flags); + pin_reg =readl (gpio_dev->base + pin *4 ); + pin_reg &= ~mask; +writel (pin_reg, gpio_dev->base + pin *4 ); +raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); +} - pin_reg =readl (gpio_dev->base + i *4 ); - pin_reg &= ~mask; -writel (pin_reg, gpio_dev->base + i *4 ); +static void amd_gpio_irq_init (struct amd_gpio *gpio_dev) +{ +struct pinctrl_desc *desc = gpio_dev->pctrl->desc; +int i; -raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); - } +for (i =0 ; i < desc->npins; i++) +amd_gpio_irq_init_pin (gpio_dev, i); }#ifdef CONFIG_PM_SLEEP
@@ -941,8 +943,10 @@ static int amd_gpio_resume(struct devicefor (i =0 ; i < desc->npins; i++) {int pin = desc->pins[i].number; -if (!amd_gpio_should_save (gpio_dev, pin)) +if (!amd_gpio_should_save (gpio_dev, pin)) { +amd_gpio_irq_init_pin (gpio_dev, pin);continue ; + }raw_spin_lock_irqsave (&gpio_dev->lock, flags); gpio_dev->saved_regs[i] |=readl (gpio_dev->base + pin *4 ) &PIN_IRQ_PENDING ;
Greg Kroah-Hartman
maintainerPATCH 77/99 pinctrl: at91-pio4: fix domain name assignment
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 7bb97e360acdd38b68ad0a1defb89c6e89c85596 upstream.
Since commit d59f6617eef0 ("genirq: Allow fwnode to carry name information only") an IRQ domain is always given a name during allocation (e.g. used for the debugfs entry).
Drop the no longer valid name assignment, which would lead to an attempt to free a string constant when removing the domain on late probe failures (e.g. probe deferral).
--- drivers/pinctrl/pinctrl-at91-pio4.c | 1 - 1 file changed, 1 deletion(-)
drivers/pinctrl/pinctrl-at91-pio4.c +0 -1
@@ -1184,7 +1184,6 @@ static int atmel_pinctrl_probe(struct pldev_err (dev,"can't add the irq domain\n" );return -ENODEV ; } - atmel_pioctrl->irq_domain->name ="atmel gpio" ;for (i =0 ; i < atmel_pioctrl->npins; i++) {int irq =irq_create_mapping (atmel_pioctrl->irq_domain, i);
Greg Kroah-Hartman
maintainerPATCH 78/99 powerpc: Dont try to copy PPR for task with NULL pt_regs
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit fd7276189450110ed835eb0a334e62d2f1c4e3be upstream.
powerpc sets up PF_KTHREAD and PF_IO_WORKER with a NULL pt_regs, which from my (arguably very short) checking is not commonly done for other archs. This is fine, except when PF_IO_WORKER's have been created and the task does something that causes a coredump to be generated. Then we get this crash:
Kernel attempted to read user page (160) - exploit attempt? (uid: 1000)
BUG: Kernel NULL pointer dereference on read at 0x00000160
Faulting instruction address: 0xc0000000000c3a60
Oops: Kernel access of bad area, sig: 11 [#1]
LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=32 NUMA pSeries
Modules linked in: bochs drm_vram_helper drm_kms_helper xts binfmt_misc ecb ctr syscopyarea sysfillrect cbc sysimgblt drm_ttm_helper aes_generic ttm sg libaes evdev joydev virtio_balloon vmx_crypto gf128mul drm dm_mod fuse loop configfs drm_panel_orientation_quirks ip_tables x_tables autofs4 hid_generic usbhid hid xhci_pci xhci_hcd usbcore usb_common sd_mod
CPU: 1 PID: 1982 Comm: ppc-crash Not tainted 6.3.0-rc2+ #88
Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1202 0xf000005 of:SLOF,HEAD hv:linux,kvm pSeries
NIP: c0000000000c3a60 LR: c000000000039944 CTR: c0000000000398e0
REGS: c0000000041833b0 TRAP: 0300 Not tainted (6.3.0-rc2+)
MSR: 800000000280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE> CR: 88082828 XER: 200400f8
...
NIP memcpy_power7+0x200/0x7d0
LR ppr_get+0x64/0xb0
Call Trace:
ppr_get+0x40/0xb0 (unreliable)
__regset_get+0x180/0x1f0
regset_get_alloc+0x64/0x90
elf_core_dump+0xb98/0x1b60
do_coredump+0x1c34/0x24a0
get_signal+0x71c/0x1410
do_notify_resume+0x140/0x6f0
interrupt_exit_user_prepare_main+0x29c/0x320
interrupt_exit_user_prepare+0x6c/0xa0
interrupt_return_srr_user+0x8/0x138Because ppr_get() is trying to copy from a PF_IO_WORKER with a NULL pt_regs.
Check for a valid pt_regs in both ppc_get/ppr_set, and return an error if not set. The actual error value doesn't seem to be important here, so just pick -EINVAL.
--- arch/powerpc/kernel/ptrace/ptrace-view.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/kernel/ptrace/ptrace-view.c +6 -0
@@ -290,6 +290,9 @@ static int gpr_set(struct task_struct *tstatic int ppr_get (struct task_struct *target,const struct user_regset *regset,struct membuf to) { +if (!target->thread.regs) +return -EINVAL ; +return membuf_write (&to, &target->thread.regs->ppr,sizeof (u64)); }
@@ -297,6 +300,9 @@ static int ppr_set(struct task_struct *t unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { + if (!target->thread.regs) + return -EINVAL; + return user_regset_copyin(&pos, &count, &kbuf, &ubuf, &target->thread.regs->ppr, 0, sizeof(u64)); }
Greg Kroah-Hartman
maintainerPATCH 79/99 NFSv4: Fix hangs when recovering open state after a server reboot
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
commit 6165a16a5ad9b237bb3131cff4d3c601ccb8f9a3 upstream.
When we're using a cached open stateid or a delegation in order to avoid sending a CLAIM_PREVIOUS open RPC call to the server, we don't have a new open stateid to present to update_open_stateid(). Instead rely on nfs4_try_open_cached(), just as if we were doing a normal open.
--- fs/nfs/nfs4proc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/nfs/nfs4proc.c +2 -3
@@ -1993,8 +1993,7 @@ _nfs4_opendata_reclaim_to_nfs4_state(strif (!data->rpc_done) {if (data->rpc_status)return ERR_PTR (data->rpc_status); -/* cached opens have already been processed */ - goto update; +return nfs4_try_open_cached (data); } ret =nfs_refresh_inode (inode, &data->f_attr);
@@ -2003,7 +2002,7 @@ _nfs4_opendata_reclaim_to_nfs4_state(strif (data->o_res.delegation_type !=0 )nfs4_opendata_check_deleg (data, state); -update: +if (!update_open_stateid (state, &data->o_res.stateid,NULL , data->o_arg.fmode))return ERR_PTR (-EAGAIN );
Greg Kroah-Hartman
maintainerPATCH 80/99 ALSA: hda/conexant: Partial revert of a quirk for Lenovo
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit b871cb971c683f7f212e7ca3c9a6709a75785116 upstream.
The recent commit f83bb2592482 ("ALSA: hda/conexant: Add quirk for LENOVO 20149 Notebook model") introduced a quirk for the device with 17aa:3977, but this caused a regression on another model (Lenovo Ideadpad U31) with the very same PCI SSID. And, through skimming over the net, it seems that this PCI SSID is used for multiple different models, so it's no good idea to apply the quirk with the SSID.
Although we may take a different ID check (e.g. the codec SSID instead of the PCI SSID), unfortunately, the original patch author couldn't identify the hardware details any longer as the machine was returned, and we can't develop the further proper fix.
In this patch, instead, we partially revert the change so that the quirk won't be applied as default for addressing the regression. Meanwhile, the quirk function itself is kept, and it's now made to be applicable via the explicit model=lenovo-20149 option.
--- sound/pci/hda/patch_conexant.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/pci/hda/patch_conexant.c +5 -1
@@ -980,7 +980,10 @@ static const struct snd_pci_quirk cxt506SND_PCI_QUIRK (0x17aa ,0x3905 ,"Lenovo G50-30" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x17aa ,0x390b ,"Lenovo G50-80" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x17aa ,0x3975 ,"Lenovo U300s" ,CXT_FIXUP_STEREO_DMIC ), -SND_PCI_QUIRK (0x17aa ,0x3977 ,"Lenovo IdeaPad U310" ,CXT_PINCFG_LENOVO_NOTEBOOK ), +/* NOTE: we'd need to extend the quirk for 17aa:3977 as the same +* PCI SSID is used on multiple Lenovo models +*/ +SND_PCI_QUIRK (0x17aa ,0x3977 ,"Lenovo IdeaPad U310" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x17aa ,0x3978 ,"Lenovo G50-70" ,CXT_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x17aa ,0x397b ,"Lenovo S205" ,CXT_FIXUP_STEREO_DMIC ), SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
@@ -1003,6 +1006,7 @@ static const struct hda_model_fixup cxt5 { .id = CXT_FIXUP_MUTE_LED_GPIO, .name = "mute-led-gpio" }, { .id = CXT_FIXUP_HP_ZBOOK_MUTE_LED, .name = "hp-zbook-mute-led" }, { .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" }, + { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" }, {} };
Greg Kroah-Hartman
maintainerPATCH 81/99 ALSA: usb-audio: Fix regression on detection of Roland VS-100
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit fa4e7a6fa12b1132340785e14bd439cbe95b7a5a upstream.
It's been reported that the recent kernel can't probe the PCM devices on Roland VS-100 properly, and it turned out to be a regression by the recent addition of the bit shift range check for the format bits. In the old code, we just did bit-shift and it resulted in zero, which is then corrected to the standard PCM format, while the new code explicitly returns an error in such a case.
For addressing the regression, relax the check and fallback to the standard PCM type (with the info output).
--- sound/usb/format.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/usb/format.c +6 -2
@@ -39,8 +39,12 @@ static u64 parse_audio_format_i_type(strcase UAC_VERSION_1 :default : {struct uac_format_type_i_discrete_descriptor *fmt = _fmt; -if (format >=64 ) -return 0 ;/* invalid format */ +if (format >=64 ) { +usb_audio_info (chip, +"%u:%d: invalid format type 0x%llx is detected, processed as PCM\n" , + fp->iface, fp->altsetting, format); + format =UAC_FORMAT_TYPE_I_PCM ; + } sample_width = fmt->bBitResolution; sample_bytes = fmt->bSubframeSize; format =1ULL << format;
Greg Kroah-Hartman
maintainerPATCH 82/99 ALSA: hda/realtek: Add quirks for some Clevo laptops
In reply to Greg Kroah-HartmanFrom: Tim Crawford <[email protected]>
commit b7a5822810c4398515300d614d988cf638adecad upstream.
Add the audio quirk for some of Clevo's latest RPL laptops:
- NP50RNJS (ALC256)
- NP70SNE (ALC256)
- PD50SNE (ALC1220)
- PE60RNE (ALC1220)
--- sound/pci/hda/patch_realtek.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/pci/hda/patch_realtek.c +4 -0
@@ -2625,6 +2625,7 @@ static const struct snd_pci_quirk alc882SND_PCI_QUIRK (0x1558 ,0x65e5 ,"Clevo PC50D[PRS](?:-D|-G)?" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ),SND_PCI_QUIRK (0x1558 ,0x65f1 ,"Clevo PC50HS" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ),SND_PCI_QUIRK (0x1558 ,0x65f5 ,"Clevo PD50PN[NRT]" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ), +SND_PCI_QUIRK (0x1558 ,0x66a2 ,"Clevo PE60RNE" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ),SND_PCI_QUIRK (0x1558 ,0x67d1 ,"Clevo PB71[ER][CDF]" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ),SND_PCI_QUIRK (0x1558 ,0x67e1 ,"Clevo PB71[DE][CDF]" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ), SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
@@ -2645,6 +2646,7 @@ static const struct snd_pci_quirk alc882SND_PCI_QUIRK (0x1558 ,0x96e1 ,"Clevo P960[ER][CDFN]-K" ,ALC1220_FIXUP_CLEVO_P950 ),SND_PCI_QUIRK (0x1558 ,0x97e1 ,"Clevo P970[ER][CDFN]" ,ALC1220_FIXUP_CLEVO_P950 ),SND_PCI_QUIRK (0x1558 ,0x97e2 ,"Clevo P970RC-M" ,ALC1220_FIXUP_CLEVO_P950 ), +SND_PCI_QUIRK (0x1558 ,0xd502 ,"Clevo PD50SNE" ,ALC1220_FIXUP_CLEVO_PB51ED_PINS ),SND_PCI_QUIRK_VENDOR (0x1558 ,"Clevo laptop" ,ALC882_FIXUP_EAPD ),SND_PCI_QUIRK (0x161f ,0x2054 ,"Medion laptop" ,ALC883_FIXUP_EAPD ), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
@@ -9201,6 +9203,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1558 ,0x5101 ,"Clevo S510WU" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0x5157 ,"Clevo W517GU1" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0x51a1 ,"Clevo NS50MU" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1558 ,0x5630 ,"Clevo NP50RNJS" ,ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0x70a1 ,"Clevo NB70T[HJK]" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0x70b3 ,"Clevo NK70SB" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -9235,6 +9238,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1558 ,0x971d ,"Clevo N970T[CDF]" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0xa500 ,"Clevo NL5[03]RU" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0xa600 ,"Clevo NL50NU" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1558 ,0xa671 ,"Clevo NP70SN[CDE]" ,ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0xb018 ,"Clevo NP50D[BE]" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1558 ,0xb019 ,"Clevo NH77D[BE]Q" ,ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
Greg Kroah-Hartman
maintainerPATCH 83/99 ALSA: hda/realtek: Add quirk for Lenovo ZhaoYang CF4620Z
In reply to Greg Kroah-HartmanFrom: huangwenhui <[email protected]>
commit 52aad39385e1bfdb34a1b405f699a8ef302c58b0 upstream.
Fix headset microphone detection on Lenovo ZhaoYang CF4620Z.
[ adjusted to be applicable to the latest tree -- tiwai ]
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9332,6 +9332,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x511e ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x511f ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x9e54 ,"LENOVO NB" ,ALC269_FIXUP_LENOVO_EAPD ), +SND_PCI_QUIRK (0x17aa ,0x9e56 ,"Lenovo ZhaoYang CF4620Z" ,ALC286_FIXUP_SONY_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1849 ,0x1233 ,"ASRock NUC Box 1100" ,ALC233_FIXUP_NO_AUDIO_JACK ),SND_PCI_QUIRK (0x1849 ,0xa233 ,"Positivo Master C6300" ,ALC269_FIXUP_HEADSET_MIC ), SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
Greg Kroah-Hartman
maintainerPATCH 84/99 xtensa: fix KASAN report for show_stack
In reply to Greg Kroah-HartmanFrom: Max Filippov <[email protected]>
commit 1d3b7a788ca7435156809a6bd5b20c95b2370d45 upstream.
show_stack dumps raw stack contents which may trigger an unnecessary KASAN report. Fix it by copying stack contents to a temporary buffer with __memcpy and then printing that buffer instead of passing stack pointer directly to the print_hex_dump.
--- arch/xtensa/kernel/traps.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
arch/xtensa/kernel/traps.c +12 -4
@@ -510,7 +510,7 @@ static size_t kstack_depth_to_print = COvoid show_stack (struct task_struct *task,unsigned long *sp,const char *loglvl) { -size_t len; +size_t len, off =0 ;if (!sp) sp =stack_pointer (task);
@@ -519,9 +519,17 @@ void show_stack(struct task_struct *task kstack_depth_to_print * STACK_DUMP_ENTRY_SIZE);printk ("%sStack:\n" , loglvl); -print_hex_dump (loglvl," " ,DUMP_PREFIX_NONE , -STACK_DUMP_LINE_SIZE ,STACK_DUMP_ENTRY_SIZE , - sp, len, false); +while (off < len) { +u8 line[STACK_DUMP_LINE_SIZE ]; +size_t line_len = len - off >STACK_DUMP_LINE_SIZE ? +STACK_DUMP_LINE_SIZE : len - off; + +__memcpy (line, (u8 *)sp + off, line_len); +print_hex_dump (loglvl," " ,DUMP_PREFIX_NONE , +STACK_DUMP_LINE_SIZE ,STACK_DUMP_ENTRY_SIZE , + line, line_len, false); + off +=STACK_DUMP_LINE_SIZE ; + }show_trace (task, sp, loglvl); }
Greg Kroah-Hartman
maintainerPATCH 85/99 rcu: Fix rcu_torture_read ftrace event
In reply to Greg Kroah-HartmanFrom: Douglas Raillard <[email protected]>
commit d18a04157fc171fd48075e3dc96471bd3b87f0dd upstream.
Fix the rcutorturename field so that its size is correctly reported in the text format embedded in trace.dat files. As it stands, it is reported as being of size 1:
field:char rcutorturename[8]; offset:8; size:1; signed:0;
--- include/trace/events/rcu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/trace/events/rcu.h +1 -1
@@ -768,7 +768,7 @@ TRACE_EVENT_RCU(rcu_torture_read,TP_ARGS (rcutorturename, rhp, secs, c_old, c),TP_STRUCT__entry ( - __field(char, rcutorturename[RCUTORTURENAME_LEN]) + __array(char, rcutorturename, RCUTORTURENAME_LEN) __field(struct rcu_head *, rhp) __field(unsigned long, secs) __field(unsigned long, c_old)
Greg Kroah-Hartman
maintainerPATCH 86/99 drm/etnaviv: fix reference leak when mmaping imported buffer
In reply to Greg Kroah-HartmanFrom: Lucas Stach <[email protected]>
commit 963b2e8c428f79489ceeb058e8314554ec9cbe6f upstream.
drm_gem_prime_mmap() takes a reference on the GEM object, but before that drm_gem_mmap_obj() already takes a reference, which will be leaked as only one reference is dropped when the mapping is closed. Drop the extra reference when dma_buf_mmap() succeeds.
--- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +9 -1
@@ -88,7 +88,15 @@ static void *etnaviv_gem_prime_vmap_implstatic int etnaviv_gem_prime_mmap_obj (struct etnaviv_gem_object *etnaviv_obj,struct vm_area_struct *vma) { -return dma_buf_mmap (etnaviv_obj->base.dma_buf, vma,0 ); +int ret; + + ret =dma_buf_mmap (etnaviv_obj->base.dma_buf, vma,0 ); +if (!ret) { +/* Drop the reference acquired by drm_gem_mmap_obj(). */ +drm_gem_object_put (&etnaviv_obj->base); + } + +return ret; }static const struct etnaviv_gem_ops etnaviv_gem_prime_ops = {
Greg Kroah-Hartman
maintainerPATCH 87/99 drm/amd/display: Add DSC Support for Synaptics Cascaded MST Hub
In reply to Greg Kroah-HartmanFrom: Fangzhi Zuo <[email protected]>
commit f4f3b7dedbe849e780c779ba67365bb1db0d8637 upstream.
Traditional synaptics hub has one MST branch device without virtual dpcd. Synaptics cascaded hub has two chained MST branch devices. DSC decoding is performed via root MST branch device, instead of the second MST branch device.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 19 ++++++++++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h | 12 +++++++ 2 files changed, 31 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +19 -0
@@ -184,6 +184,21 @@ static bool needs_dsc_aux_workaround(strreturn false; } +bool is_synaptics_cascaded_panamera (struct dc_link *link,struct drm_dp_mst_port *port) +{ +u8 branch_vendor_data[4 ] = {0 };// Vendor data 0x50C ~ 0x50F + +if (drm_dp_dpcd_read (port->mgr->aux,DP_BRANCH_VENDOR_SPECIFIC_START , &branch_vendor_data,4 ) ==4 ) { +if (link->dpcd_caps.branch_dev_id ==DP_BRANCH_DEVICE_ID_90CC24 && +IS_SYNAPTICS_CASCADED_PANAMERA (link->dpcd_caps.branch_dev_name, branch_vendor_data)) { +DRM_INFO ("Synaptics Cascaded MST hub\n" ); +return true; + } + } + +return false; +} +static bool validate_dsc_caps_on_connector (struct amdgpu_dm_connector *aconnector) {struct dc_sink *dc_sink = aconnector->dc_sink;
@@ -207,6 +222,10 @@ static bool validate_dsc_caps_on_connect needs_dsc_aux_workaround(aconnector->dc_link)) aconnector->dsc_aux = &aconnector->mst_port->dm_dp_aux.aux; +/* synaptics cascaded MST hub case */ +if (!aconnector->dsc_aux &&is_synaptics_cascaded_panamera (aconnector->dc_link, port)) + aconnector->dsc_aux = port->mgr->aux; +if (!aconnector->dsc_aux)return false;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +12 -0
@@ -26,6 +26,18 @@#ifndef __DAL_AMDGPU_DM_MST_TYPES_H__#define __DAL_AMDGPU_DM_MST_TYPES_H__ +#define DP_BRANCH_VENDOR_SPECIFIC_START 0x50C + +/** +* Panamera MST Hub detection +* Offset DPCD 050Eh == 0x5A indicates cascaded MST hub case +* Check from beginning of branch device vendor specific field (050Ch) +*/ +#define IS_SYNAPTICS_PANAMERA (branchDevName) (((int)branchDevName[4] & 0xF0) == 0x50 ? 1 : 0) +#define BRANCH_HW_REVISION_PANAMERA_A2 0x10 +#define SYNAPTICS_CASCADED_HUB_ID 0x5A +#define IS_SYNAPTICS_CASCADED_PANAMERA (devName, data) ((IS_SYNAPTICS_PANAMERA(devName) && ((int)data[2] == SYNAPTICS_CASCADED_HUB_ID)) ? 1 : 0) +struct amdgpu_display_manager ;struct amdgpu_dm_connector ;
Greg Kroah-Hartman
maintainerPATCH 88/99 KVM: arm64: Disable interrupts while walking userspace PTs
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit e86fc1a3a3e9b4850fe74d738e3cfcf4297d8bba upstream.
We walk the userspace PTs to discover what mapping size was used there. However, this can race against the userspace tables being freed, and we end-up in the weeds.
Thankfully, the mm code is being generous and will IPI us when doing so. So let's implement our part of the bargain and disable interrupts around the walk. This ensures that nothing terrible happens during that time.
We still need to handle the removal of the page tables before the walk. For that, allow get_user_mapping_size() to return an error, and make sure this error can be propagated all the way to the the exit handler.
--- arch/arm64/kvm/mmu.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-)
arch/arm64/kvm/mmu.c +38 -7
@@ -468,14 +468,33 @@ static int get_user_mapping_size(struct CONFIG_PGTABLE_LEVELS), .mm_ops = &kvm_user_mm_ops, }; +unsigned long flags;kvm_pte_t pte =0 ;/* Keep GCC quiet... */ u32 level = ~0 ;int ret; +/* +* Disable IRQs so that we hazard against a concurrent +* teardown of the userspace page tables (which relies on +* IPI-ing threads). +*/ +local_irq_save (flags); ret =kvm_pgtable_get_leaf (&pgt, addr, &pte, &level); -VM_BUG_ON (ret); -VM_BUG_ON (level >=KVM_PGTABLE_MAX_LEVELS ); -VM_BUG_ON (!(pte &PTE_VALID )); +local_irq_restore (flags); + +if (ret) +return ret; + +/* +* Not seeing an error, but not updating level? Something went +* deeply wrong... +*/ +if (WARN_ON (level >=KVM_PGTABLE_MAX_LEVELS )) +return -EFAULT ; + +/* Oops, the userspace PTs are gone... Replay the fault */ +if (!kvm_pte_valid (pte)) +return -EAGAIN ;return BIT (ARM64_HW_PGTABLE_LEVEL_SHIFT (level)); }
@@ -826,7 +845,7 @@ static bool fault_supports_stage2_huge_m* * Returns the size of the mapping. */ -static unsigned long +static long transparent_hugepage_adjust (struct kvm *kvm,struct kvm_memory_slot *memslot,unsigned long hva,kvm_pfn_t *pfnp,phys_addr_t *ipap)
@@ -838,8 +857,15 @@ transparent_hugepage_adjust(struct kvm ** sure that the HVA and IPA are sufficiently aligned and that the * block map is contained within the memslot. */ -if (fault_supports_stage2_huge_mapping (memslot, hva,PMD_SIZE ) && -get_user_mapping_size (kvm, hva) >=PMD_SIZE ) { +if (fault_supports_stage2_huge_mapping (memslot, hva,PMD_SIZE )) { +int sz =get_user_mapping_size (kvm, hva); + +if (sz <0 ) +return sz; + +if (sz <PMD_SIZE ) +return PAGE_SIZE ; +/* * The address we faulted on is backed by a transparent huge * page. However, because we map the compound huge page and
@@ -957,7 +983,7 @@ static int user_mem_abort(struct kvm_vcpkvm_pfn_t pfn;bool logging_active =memslot_is_logging (memslot);unsigned long fault_level =kvm_vcpu_trap_get_fault_level (vcpu); -unsigned long vma_pagesize, fault_granule; +long vma_pagesize, fault_granule;enum kvm_pgtable_prot prot =KVM_PGTABLE_PROT_R ;struct kvm_pgtable *pgt;
@@ -1104,6 +1130,11 @@ static int user_mem_abort(struct kvm_vcp vma_pagesize =transparent_hugepage_adjust (kvm, memslot, hva, &pfn, &fault_ipa); + +if (vma_pagesize <0 ) { + ret = vma_pagesize; + goto out_unlock; + } }if (fault_status !=FSC_PERM && !device &&kvm_has_mte (kvm)) {
Greg Kroah-Hartman
maintainerPATCH 89/99 s390/uaccess: add missing earlyclobber annotations to __clear_user()
In reply to Greg Kroah-HartmanFrom: Heiko Carstens <[email protected]>
commit 89aba4c26fae4e459f755a18912845c348ee48f3 upstream.
Add missing earlyclobber annotation to size, to, and tmp2 operands of the __clear_user() inline assembly since they are modified or written to before the last usage of all input operands. This can lead to incorrect register allocation for the inline assembly.
--- arch/s390/lib/uaccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/lib/uaccess.c +1 -1
@@ -227,7 +227,7 @@ static inline unsigned long clear_user_m"4: slgr %0,%0\n" "5:\n" EX_TABLE(0b,2b) EX_TABLE(6b,2b) EX_TABLE(3b,5b) EX_TABLE(7b,5b) - : "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2) + : "+&a" (size), "+&a" (to), "+a" (tmp1), "=&a" (tmp2) : "a" (empty_zero_page), [spec] "K" (0x81UL) : "cc", "memory", "0");return size;
Greg Kroah-Hartman
maintainerPATCH 90/99 KVM: VMX: Move preemption timer <=> hrtimer dance to common x86
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit 98c25ead5eda5e9d41abe57839ad3e8caf19500c upstream.
Handle the switch to/from the hypervisor/software timer when a vCPU is blocking in common x86 instead of in VMX. Even though VMX is the only user of a hypervisor timer, the logic and all functions involved are generic x86 (unless future CPUs do something completely different and implement a hypervisor timer that runs regardless of mode).
Handling the switch in common x86 will allow for the elimination of the pre/post_blocks hooks, and also lets KVM switch back to the hypervisor timer if and only if it was in use (without additional params). Add a comment explaining why the switch cannot be deferred to kvm_sched_out() or kvm_vcpu_block().
Message-Id: <[email protected]>
[ta: Fix conflicts in vmx_pre_block and vmx_post_block as per Paolo's suggestion. Add Reported-by and Link tags.]
--- arch/x86/kvm/vmx/vmx.c | 6 ------ arch/x86/kvm/x86.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-)
arch/x86/kvm/vmx/vmx.c +0 -6
@@ -7597,17 +7597,11 @@ static int vmx_pre_block(struct kvm_vcpuif (pi_pre_block (vcpu))return 1 ; -if (kvm_lapic_hv_timer_in_use (vcpu)) -kvm_lapic_switch_to_sw_timer (vcpu); -return 0 ; }static void vmx_post_block (struct kvm_vcpu *vcpu) { -if (kvm_x86_ops.set_hv_timer) -kvm_lapic_switch_to_hv_timer (vcpu); -pi_post_block (vcpu); }
arch/x86/kvm/x86.c +21 -0
@@ -10043,12 +10043,28 @@ out:static inline int vcpu_block (struct kvm *kvm,struct kvm_vcpu *vcpu) { +bool hv_timer; +if (!kvm_arch_vcpu_runnable (vcpu) && (!kvm_x86_ops.pre_block ||static_call (kvm_x86_pre_block)(vcpu) ==0 )) { +/* +* Switch to the software timer before halt-polling/blocking as +* the guest's timer may be a break event for the vCPU, and the +* hypervisor timer runs only when the CPU is in guest mode. +* Switch before halt-polling so that KVM recognizes an expired +* timer before blocking. +*/ + hv_timer =kvm_lapic_hv_timer_in_use (vcpu); +if (hv_timer) +kvm_lapic_switch_to_sw_timer (vcpu); +srcu_read_unlock (&kvm->srcu, vcpu->srcu_idx);kvm_vcpu_block (vcpu); vcpu->srcu_idx =srcu_read_lock (&kvm->srcu); +if (hv_timer) +kvm_lapic_switch_to_hv_timer (vcpu); +if (kvm_x86_ops.post_block)static_call (kvm_x86_post_block)(vcpu);
@@ -10287,6 +10303,11 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v r = -EINTR ; goto out; } +/* +* It should be impossible for the hypervisor timer to be in +* use before KVM has ever run the vCPU. +*/ +WARN_ON_ONCE (kvm_lapic_hv_timer_in_use (vcpu));kvm_vcpu_block (vcpu);if (kvm_apic_accept_events (vcpu) <0 ) { r =0 ;
Greg Kroah-Hartman
maintainerPATCH 91/99 KVM: x86: Inject #GP on x2APIC WRMSR that sets reserved bits 63:32
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit ab52be1b310bcb39e6745d34a8f0e8475d67381a upstream.
Reject attempts to set bits 63:32 for 32-bit x2APIC registers, i.e. all x2APIC registers except ICR. Per Intel's SDM:
Non-zero writes (by WRMSR instruction) to reserved bits to these registers will raise a general protection fault exception
Opportunistically fix a typo in a nearby comment.
--- arch/x86/kvm/lapic.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/x86/kvm/lapic.c +8 -0
@@ -2802,6 +2802,10 @@ int kvm_x2apic_msr_write(struct kvm_vcpu/* if this is ICR write vector before command */ if (reg ==APIC_ICR )kvm_lapic_reg_write (apic,APIC_ICR2 , (u32)(data >>32 )); +else if (data >>32 ) +/* Bits 63:32 are reserved in all other registers. */ +return 1 ; +return kvm_lapic_reg_write (apic, reg, (u32 )data); }
@@ -2836,6 +2840,10 @@ int kvm_hv_vapic_msr_write(struct kvm_vc/* if this is ICR write vector before command */ if (reg ==APIC_ICR )kvm_lapic_reg_write (apic,APIC_ICR2 , (u32)(data >>32 )); +else if (data >>32 ) +/* Bits 63:32 are reserved in all other registers. */ +return 1 ; +return kvm_lapic_reg_write (apic, reg, (u32 )data); }
Greg Kroah-Hartman
maintainerPATCH 92/99 KVM: x86: Purge "highest ISR" cache when updating APICv state
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit 97a71c444a147ae41c7d0ab5b3d855d7f762f3ed upstream.
Purge the "highest ISR" cache when updating APICv state on a vCPU. The cache must not be used when APICv is active as hardware may emulate EOIs (and other operations) without exiting to KVM.
This fixes a bug where KVM will effectively block IRQs in perpetuity due to the "highest ISR" never getting reset if APICv is activated on a vCPU while an IRQ is in-service. Hardware emulates the EOI and KVM never gets a chance to update its cache.
Message-Id: <[email protected]>
--- arch/x86/kvm/lapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/lapic.c +1 -2
@@ -2316,6 +2316,7 @@ void kvm_apic_update_apicv(struct kvm_vc apic->irr_pending = (apic_search_irr (apic) !=-1 ); apic->isr_count =count_vectors (apic->regs +APIC_ISR ); } + apic->highest_isr_cache =-1 ; }EXPORT_SYMBOL_GPL (kvm_apic_update_apicv);
@@ -2368,7 +2369,6 @@ void kvm_lapic_reset(struct kvm_vcpu *vckvm_lapic_set_reg (apic,APIC_TMR +0x10 * i,0 ); }kvm_apic_update_apicv (vcpu); - apic->highest_isr_cache =-1 ;update_divide_count (apic);atomic_set (&apic->lapic_timer.pending,0 );
@@ -2638,7 +2638,6 @@ int kvm_apic_set_state(struct kvm_vcpu *__start_apic_timer (apic,APIC_TMCCT );kvm_lapic_set_reg (apic,APIC_TMCCT ,0 );kvm_apic_update_apicv (vcpu); - apic->highest_isr_cache =-1 ;if (vcpu->arch.apicv_active) {static_call (kvm_x86_apicv_post_state_restore)(vcpu); static_call(kvm_x86_hwapic_irr_update)(vcpu,
Greg Kroah-Hartman
maintainerPATCH 93/99 zonefs: Fix error message in zonefs_file_dio_append()
In reply to Greg Kroah-HartmanFrom: Damien Le Moal <[email protected]>
commit 88b170088ad2c3e27086fe35769aa49f8a512564 upstream.
Since the expected write location in a sequential file is always at the end of the file (append write), when an invalid write append location is detected in zonefs_file_dio_append(), print the invalid written location instead of the expected write location.
--- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/zonefs/super.c +1 -1
@@ -796,7 +796,7 @@ static ssize_t zonefs_file_dio_append(stif (bio->bi_iter.bi_sector != wpsector) {zonefs_warn (inode->i_sb,"Corrupted write pointer %llu for zone at %llu\n" , - wpsector, zi->i_zsector); + bio->bi_iter.bi_sector, zi->i_zsector); ret = -EIO ; } }
Greg Kroah-Hartman
maintainerPATCH 94/99 selftests/bpf: Test btf dump for struct with padding only fields
In reply to Greg Kroah-HartmanFrom: Eduard Zingerman <[email protected]>
[ Upstream commit d503f1176b14f722a40ea5110312614982f9a80b ]
Structures with zero regular fields but some padding constitute a special case in btf_dump.c:btf_dump_emit_struct_def with regards to newline before closing '}'.
Stable-dep-of: ea2ce1ba99aa ("libbpf: Fix BTF-to-C converter's padding logic")
--- .../selftests/bpf/progs/btf_dump_test_case_padding.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c +9 -0
@@ -102,12 +102,21 @@ struct zone {struct zone_padding __pad__; }; +/* ----- START-EXPECTED-OUTPUT ----- */ +struct padding_wo_named_members { + long: 64; + long: 64; +}; + +/* ------ END-EXPECTED-OUTPUT ------ */ +int f (struct {struct padded_implicitly _1;struct padded_explicitly _2;struct padded_a_lot _3;struct padded_cache_line _4;struct zone _5; +struct padding_wo_named_members _6; } *_) {return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 95/99 libbpf: Fix BTF-to-C converters padding logic
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit ea2ce1ba99aa6a60c8d8a706e3abadf3de372163 ]
Turns out that btf_dump API doesn't handle a bunch of tricky corner cases, as reported by Per, and further discovered using his testing Python script ([0]).
This patch revamps btf_dump's padding logic significantly, making it more correct and also avoiding unnecessary explicit padding, where compiler would pad naturally. This overall topic turned out to be very tricky and subtle, there are lots of subtle corner cases. The comments in the code tries to give some clues, but comments themselves are supposed to be paired with good understanding of C alignment and padding rules. Plus some experimentation to figure out subtle things like whether long :0; means that struct is now forced to be long-aligned (no, it's not, turns out).
Anyways, Per's script, while not completely correct in some known situations, doesn't show any obvious cases where this logic breaks, so this is a nice improvement over the previous state of this logic.
Some selftests had to be adjusted to accommodate better use of natural alignment rules, eliminating some unnecessary padding, or changing it to type: 0; alignment markers.
Note also that for when we are in between bitfields, we emit explicit bit size, while otherwise we use : 0, this feels much more natural in practice.
Next patch will add few more test cases, found through randomized Per's script.
[0] https://lore.kernel.org/bpf/[email protected]/
--- tools/lib/bpf/btf_dump.c | 169 +++++++++++++----- .../bpf/progs/btf_dump_test_case_bitfields.c | 2 +- .../bpf/progs/btf_dump_test_case_padding.c | 58 ++++-- 3 files changed, 164 insertions(+), 65 deletions(-)
tools/lib/bpf/btf_dump.c +123 -46
@@ -817,6 +817,25 @@ static void btf_dump_emit_type(struct btf_dump *d, __u32 id, __u32 cont_id) } } +static int btf_natural_align_of (const struct btf *btf,__u32 id) +{ +const struct btf_type *t =btf__type_by_id (btf, id); +int i, align, vlen; +const struct btf_member *m; + +if (!btf_is_composite (t)) +return btf__align_of (btf, id); + + align =1 ; + m =btf_members (t); + vlen =btf_vlen (t); +for (i =0 ; i < vlen; i++, m++) { + align =max (align,btf__align_of (btf, m->type)); + } + +return align; +} +static bool btf_is_struct_packed (const struct btf *btf,__u32 id,const struct btf_type *t) {
@@ -824,16 +843,16 @@ static bool btf_is_struct_packed(const struct btf *btf, __u32 id,int align, i, bit_sz;__u16 vlen; - align =btf__align_of (btf, id); -/* size of a non-packed struct has to be a multiple of its alignment*/ -if (align && t->size % align) + align =btf_natural_align_of (btf, id); +/* size of a non-packed struct has to be a multiple of its alignment */ +if (align && (t->size % align) !=0 )return true; m =btf_members (t); vlen =btf_vlen (t);/* all non-bitfield fields have to be naturally aligned */ for (i =0 ; i < vlen; i++, m++) { - align =btf__align_of (btf, m->type); + align =btf_natural_align_of (btf, m->type); bit_sz =btf_member_bitfield_size (t, i);if (align && bit_sz ==0 && m->offset % (8 * align) !=0 )return true;
@@ -846,44 +865,97 @@ static bool btf_is_struct_packed(const struct btf *btf, __u32 id,return false; } -static int chip_away_bits (int total,int at_most) -{ -return total % at_most ? : at_most; -} -static void btf_dump_emit_bit_padding (const struct btf_dump *d, -int cur_off,int m_off,int m_bit_sz, -int align,int lvl) +int cur_off,int next_off,int next_align, +bool in_bitfield,int lvl) { -int off_diff = m_off - cur_off; -int ptr_bits = d->ptr_sz *8 ; +const struct { +const char *name; +int bits; + } pads[] = { + {"long" , d->ptr_sz *8 }, {"int" ,32 }, {"short" ,16 }, {"char" ,8 } + }; +int new_off, pad_bits, bits, i; +const char *pad_type; + +if (cur_off >= next_off) +return ;/* no gap */ + +/* For filling out padding we want to take advantage of +* natural alignment rules to minimize unnecessary explicit +* padding. First, we find the largest type (among long, int, +* short, or char) that can be used to force naturally aligned +* boundary. Once determined, we'll use such type to fill in +* the remaining padding gap. In some cases we can rely on +* compiler filling some gaps, but sometimes we need to force +* alignment to close natural alignment with markers like +* `long: 0` (this is always the case for bitfields). Note +* that even if struct itself has, let's say 4-byte alignment +* (i.e., it only uses up to int-aligned types), using `long: +* X;` explicit padding doesn't actually change struct's +* overall alignment requirements, but compiler does take into +* account that type's (long, in this example) natural +* alignment requirements when adding implicit padding. We use +* this fact heavily and don't worry about ruining correct +* struct alignment requirement. +*/ +for (i =0 ; i <ARRAY_SIZE (pads); i++) { + pad_bits = pads[i].bits; + pad_type = pads[i].name; -if (off_diff <=0 ) -/* no gap */ -return ; -if (m_bit_sz ==0 && off_diff < align *8 ) -/* natural padding will take care of a gap */ -return ; + new_off =roundup (cur_off, pad_bits); +if (new_off <= next_off) +break ; + } -while (off_diff >0 ) { -const char *pad_type; -int pad_bits; - -if (ptr_bits >32 && off_diff >32 ) { - pad_type ="long" ; - pad_bits =chip_away_bits (off_diff, ptr_bits); - }else if (off_diff >16 ) { - pad_type ="int" ; - pad_bits =chip_away_bits (off_diff,32 ); - }else if (off_diff >8 ) { - pad_type ="short" ; - pad_bits =chip_away_bits (off_diff,16 ); - }else { - pad_type ="char" ; - pad_bits =chip_away_bits (off_diff,8 ); +if (new_off > cur_off && new_off <= next_off) { +/* We need explicit `<type>: 0` aligning mark if next +* field is right on alignment offset and its +* alignment requirement is less strict than <type>'s +* alignment (so compiler won't naturally align to the +* offset we expect), or if subsequent `<type>: X`, +* will actually completely fit in the remaining hole, +* making compiler basically ignore `<type>: X` +* completely. +*/ +if (in_bitfield || + (new_off == next_off &&roundup (cur_off, next_align *8 ) != new_off) || + (new_off != next_off && next_off - new_off <= new_off - cur_off)) +/* but for bitfields we'll emit explicit bit count */ +btf_dump_printf (d,"\n%s%s: %d;" ,pfx (lvl), pad_type, + in_bitfield ? new_off - cur_off :0 ); + cur_off = new_off; + } + +/* Now we know we start at naturally aligned offset for a chosen +* padding type (long, int, short, or char), and so the rest is just +* a straightforward filling of remaining padding gap with full +* `<type>: sizeof(<type>);` markers, except for the last one, which +* might need smaller than sizeof(<type>) padding. +*/ +while (cur_off != next_off) { + bits =min (next_off - cur_off, pad_bits); +if (bits == pad_bits) { +btf_dump_printf (d,"\n%s%s: %d;" ,pfx (lvl), pad_type, pad_bits); + cur_off += bits; +continue ; + } +/* For the remainder padding that doesn't cover entire +* pad_type bit length, we pick the smallest necessary type. +* This is pure aesthetics, we could have just used `long`, +* but having smallest necessary one communicates better the +* scale of the padding gap. +*/ +for (i =ARRAY_SIZE (pads) -1 ; i >=0 ; i--) { + pad_type = pads[i].name; + pad_bits = pads[i].bits; +if (pad_bits < bits) +continue ; + +btf_dump_printf (d,"\n%s%s: %d;" ,pfx (lvl), pad_type, bits); + cur_off += bits; +break ; } -btf_dump_printf (d,"\n%s%s: %d;" ,pfx (lvl), pad_type, pad_bits); - off_diff -= pad_bits; } }
@@ -903,9 +975,11 @@ static void btf_dump_emit_struct_def(struct btf_dump *d, {const struct btf_member *m =btf_members (t);bool is_struct =btf_is_struct (t); -int align, i, packed, off =0 ; +bool packed, prev_bitfield = false; +int align, i, off =0 ;__u16 vlen =btf_vlen (t); + align =btf__align_of (d->btf, id); packed = is_struct ?btf_is_struct_packed (d->btf, id, t) :0 ; btf_dump_printf(d, "%s%s%s {",
@@ -915,33 +989,36 @@ static void btf_dump_emit_struct_def(struct btf_dump *d,for (i =0 ; i < vlen; i++, m++) {const char *fname; -int m_off, m_sz; +int m_off, m_sz, m_align; +bool in_bitfield; fname =btf_name_of (d, m->name_off); m_sz =btf_member_bitfield_size (t, i); m_off =btf_member_bit_offset (t, i); - align = packed ?1 :btf__align_of (d->btf, m->type); + m_align = packed ?1 :btf__align_of (d->btf, m->type); -btf_dump_emit_bit_padding (d, off, m_off, m_sz, align, lvl +1 ); + in_bitfield = prev_bitfield && m_sz !=0 ; + +btf_dump_emit_bit_padding (d, off, m_off, m_align, in_bitfield, lvl +1 );btf_dump_printf (d,"\n%s" ,pfx (lvl +1 ));btf_dump_emit_type_decl (d, m->type, fname, lvl +1 );if (m_sz) {btf_dump_printf (d,": %d" , m_sz); off = m_off + m_sz; + prev_bitfield = true; }else { m_sz =max ((__s64 )0 ,btf__resolve_size (d->btf, m->type)); off = m_off + m_sz *8 ; + prev_bitfield = false; } +btf_dump_printf (d,";" ); }/* pad at the end, if necessary */ -if (is_struct) { - align = packed ?1 :btf__align_of (d->btf, id); -btf_dump_emit_bit_padding (d, off, t->size *8 ,0 , align, - lvl +1 ); - } +if (is_struct) +btf_dump_emit_bit_padding (d, off, t->size *8 , align, false, lvl +1 );if (vlen)btf_dump_printf (d,"\n" );
tools/testing/selftests/bpf/progs/btf_dump_test_case_bitfields.c +1 -1
@@ -53,7 +53,7 @@ struct bitfields_only_mixed_types {*/ /* ------ END-EXPECTED-OUTPUT ------ */ struct bitfield_mixed_with_others { - long: 4; /* char is enough as a backing field */ + char: 4; /* char is enough as a backing field */int a:4 ;/* 8-bit implicit padding */ short b;/* combined with previous bitfield */
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c +40 -18
107 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 96/99 selftests/bpf: Add few corner cases to test padding handling of btf_dump
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit b148c8b9b926e257a59c8eb2cd6fa3adfd443254 ]
Add few hand-crafted cases and few randomized cases found using script from [0] that tests btf_dump's padding logic.
[0] https://lore.kernel.org/bpf/[email protected]/
Stable-dep-of: 4fb877aaa179 ("libbpf: Fix btf_dump's packed struct determination")
--- .../bpf/progs/btf_dump_test_case_packing.c | 61 +++++++++- .../bpf/progs/btf_dump_test_case_padding.c | 104 ++++++++++++++++++ 2 files changed, 164 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/progs/btf_dump_test_case_packing.c +60 -1
@@ -58,7 +58,64 @@ union jump_code_union { } __attribute__((packed)); }; -/*------ END-EXPECTED-OUTPUT ------ */ +/* ----- START-EXPECTED-OUTPUT ----- */ +/* +*struct nested_packed_but_aligned_struct { +* int x1; +* int x2; +*}; +* +*struct outer_implicitly_packed_struct { +* char y1; +* struct nested_packed_but_aligned_struct y2; +*} __attribute__((packed)); +* +*/ +/* ------ END-EXPECTED-OUTPUT ------ */ + +struct nested_packed_but_aligned_struct { +int x1; +int x2; +} __attribute__((packed)); + +struct outer_implicitly_packed_struct { +char y1; +struct nested_packed_but_aligned_struct y2; +}; +/* ----- START-EXPECTED-OUTPUT ----- */ +/* +*struct usb_ss_ep_comp_descriptor { +* char: 8; +* char bDescriptorType; +* char bMaxBurst; +* short wBytesPerInterval; +*}; +* +*struct usb_host_endpoint { +* long: 64; +* char: 8; +* struct usb_ss_ep_comp_descriptor ss_ep_comp; +* long: 0; +*} __attribute__((packed)); +* +*/ +/* ------ END-EXPECTED-OUTPUT ------ */ + +struct usb_ss_ep_comp_descriptor { + char: 8; +char bDescriptorType; +char bMaxBurst; + int: 0; +short wBytesPerInterval; +} __attribute__((packed)); + +struct usb_host_endpoint { + long: 64; + char: 8; +struct usb_ss_ep_comp_descriptor ss_ep_comp; + long: 0; +}; + int f(struct { struct packed_trailing_space _1;
@@ -69,6 +126,8 @@ int f(struct {union union_is_never_packed _6;union union_does_not_need_packing _7;union jump_code_union _8; +struct outer_implicitly_packed_struct _9; +struct usb_host_endpoint _10; } *_) {return 0 ;
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c +104 -0
116 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 97/99 libbpf: Fix btf_dumps packed struct determination
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 4fb877aaa179dcdb1676d55216482febaada457e ]
Fix bug in btf_dump's logic of determining if a given struct type is packed or not. The notion of "natural alignment" is not needed and is even harmful in this case, so drop it altogether. The biggest difference in btf_is_struct_packed() compared to its original implementation is that we don't really use btf__align_of() to determine overall alignment of a struct type (because it could be 1 for both packed and non-packed struct, depending on specifci field definitions), and just use field's actual alignment to calculate whether any field is requiring packing or struct's size overall necessitates packing.
Add two simple test cases that demonstrate the difference this change would make.
--- tools/lib/bpf/btf_dump.c | 33 ++++--------------- .../bpf/progs/btf_dump_test_case_packing.c | 19 +++++++++++ 2 files changed, 25 insertions(+), 27 deletions(-)
tools/lib/bpf/btf_dump.c +6 -27
@@ -817,47 +817,26 @@ static void btf_dump_emit_type(struct btf_dump *d, __u32 id, __u32 cont_id) } } -static int btf_natural_align_of (const struct btf *btf,__u32 id) -{ -const struct btf_type *t =btf__type_by_id (btf, id); -int i, align, vlen; -const struct btf_member *m; - -if (!btf_is_composite (t)) -return btf__align_of (btf, id); - - align =1 ; - m =btf_members (t); - vlen =btf_vlen (t); -for (i =0 ; i < vlen; i++, m++) { - align =max (align,btf__align_of (btf, m->type)); - } - -return align; -} -static bool btf_is_struct_packed (const struct btf *btf,__u32 id,const struct btf_type *t) {const struct btf_member *m; -int align, i, bit_sz; +int max_align =1 , align, i, bit_sz;__u16 vlen; - align =btf_natural_align_of (btf, id); -/* size of a non-packed struct has to be a multiple of its alignment */ -if (align && (t->size % align) !=0 ) -return true; - m =btf_members (t); vlen =btf_vlen (t);/* all non-bitfield fields have to be naturally aligned */ for (i =0 ; i < vlen; i++, m++) { - align =btf_natural_align_of (btf, m->type); + align =btf__align_of (btf, m->type); bit_sz =btf_member_bitfield_size (t, i);if (align && bit_sz ==0 && m->offset % (8 * align) !=0 )return true; + max_align =max (align, max_align); } - +/* size of a non-packed struct has to be a multiple of its alignment */ +if (t->size % max_align !=0 ) +return true;/* * if original struct was marked as packed, but its layout is * naturally aligned, we'll detect that it's not packed
tools/testing/selftests/bpf/progs/btf_dump_test_case_packing.c +19 -0
@@ -116,6 +116,23 @@ struct usb_host_endpoint { long: 0; }; +/* ----- START-EXPECTED-OUTPUT ----- */ +struct nested_packed_struct { +int a; +char b; +} __attribute__((packed)); + +struct outer_nonpacked_struct { +short a; +struct nested_packed_struct b; +}; + +struct outer_packed_struct { +short a; +struct nested_packed_struct b; +} __attribute__((packed)); + +/* ------ END-EXPECTED-OUTPUT ------ */ int f(struct { struct packed_trailing_space _1;
@@ -128,6 +145,8 @@ int f(struct {union jump_code_union _8;struct outer_implicitly_packed_struct _9;struct usb_host_endpoint _10; +struct outer_nonpacked_struct _11; +struct outer_packed_struct _12; } *_) {return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 98/99 hsr: ratelimit only when errors are printed
In reply to Greg Kroah-HartmanFrom: Matthieu Baerts <[email protected]>
commit 1b0120e4db0bf2838d1ce741195ce4b7cc100b91 upstream.
Recently, when automatically merging -net and net-next in MPTCP devel tree, our CI reported [1] a conflict in hsr, the same as the one reported by Stephen in netdev [2].
When looking at the conflict, I noticed it is in fact the v1 [3] that has been applied in -net and the v2 [4] in net-next. Maybe the v1 was applied by accident.
As mentioned by Jakub Kicinski [5], the new condition makes more sense before the net_ratelimit(), not to update net_ratelimit's state which is unnecessary if we're not going to print either way.
Here, this modification applies the v2 but in -net.
--- net/hsr/hsr_framereg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/hsr/hsr_framereg.c +1 -1
@@ -385,7 +385,7 @@ void hsr_addr_subst_dest(struct hsr_node node_dst =find_node_by_addr_A (&port->hsr->node_db,eth_hdr (skb)->h_dest);if (!node_dst) { -if (net_ratelimit () && port->hsr->prot_version !=PRP_V1 ) +if (port->hsr->prot_version !=PRP_V1 &&net_ratelimit ())netdev_err (skb->dev,"%s: Unknown node\n" , __func__);return ; }
Greg Kroah-Hartman
maintainerPATCH 99/99 x86/PVH: avoid 32-bit build warning when obtaining VGA console info
In reply to Greg Kroah-HartmanFrom: Jan Beulich <[email protected]>
commit aadbd07ff8a75ed342388846da78dfaddb8b106a upstream.
In the commit referenced below I failed to pay attention to this code also being buildable as 32-bit. Adjust the type of "ret" - there's no real need for it to be wider than 32 bits.
--- arch/x86/xen/enlighten_pvh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/enlighten_pvh.c +1 -1
@@ -48,7 +48,7 @@ void __init xen_pvh_init(struct boot_parstruct xen_platform_op op = { .cmd = XENPF_get_dom0_console, }; -long ret =HYPERVISOR_platform_op (&op); +int ret =HYPERVISOR_platform_op (&op);if (ret >0 ) xen_init_vga(&op.u.dom0_console,
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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.
Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0) and powerpc (ps3_defconfig, GCC 12.2.0).
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.15.106-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.15.y
* git commit: aacd621499911fb2f9643a302eb98e3670b89539
* git describe: v5.15.105-100-gaacd62149991
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.15.y/build/v5.15.105-100-gaacd62149991
## Test Regressions (compared to v5.15.105)
## Metric Regressions (compared to v5.15.105)
## Test Fixes (compared to v5.15.105)
## Metric Fixes (compared to v5.15.105)
## Test result summary
total: 138014, pass: 115097, fail: 4115, skip: 18551, xfail: 251
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 115 total, 114 passed, 1 failed
* arm64: 43 total, 43 passed, 0 failed
* i386: 33 total, 31 passed, 2 failed
* mips: 27 total, 26 passed, 1 failed
* parisc: 8 total, 8 passed, 0 failed
* powerpc: 27 total, 26 passed, 1 failed
* riscv: 11 total, 11 passed, 0 failed
* s390: 12 total, 11 passed, 1 failed
* sh: 14 total, 12 passed, 2 failed
* sparc: 8 total, 8 passed, 0 failed
* x86_64: 36 total, 36 passed, 0 failed
## Test suites summary
* boot
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-open-posix-tests
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* perf
* rcutorture
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.15:
11 builds: 11 pass, 0 fail
28 boots: 28 pass, 0 fail
114 tests: 114 pass, 0 failLinux version: 5.15.106-rc1-gaacd62149991
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Hello Greg,
Quoted 10 lines
From: Greg Kroah-Hartman <[email protected]>
Sent: Monday, April 3, 2023 3:08 PMThis is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
CIP configurations built and booted with Linux 5.15.106-rc1 (aacd62149991):
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/826399791
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/commits/linux-5.15.y
Kind regards, Chris
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
Build results:
total: 160 pass: 160 fail: 0 Qemu test results: total: 499 pass: 499 fail: 0
Guenter
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64.
Thanks,
Harshit
Quoted 9 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.106 release. There are 99 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 Wed, 05 Apr 2023 14:03:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.106-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.15:
11 builds: 11 pass, 0 fail
28 boots: 28 pass, 0 fail
114 tests: 114 pass, 0 failLinux version: 5.15.106-rc1-gaacd62149991
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon