* [PATCH 5.19 000/365] 5.19.4-rc1 review
@ 2022-08-23 7:58 Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 001/365] ALSA: info: Fix llseek return value when using callback Greg Kroah-Hartman
` (369 more replies)
0 siblings, 370 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, slade
This is the start of the stable review cycle for the 5.19.4 release.
There are 365 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu, 25 Aug 2022 08:00:15 +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.19.4-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.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 5.19.4-rc1
Takashi Iwai <tiwai@suse.de>
Revert "ALSA: hda: Fix page fault in snd_hda_codec_shutdown()"
Ren Zhijie <renzhijie2@huawei.com>
scsi: ufs: ufs-mediatek: Fix build error and type mismatch
Ye Bin <yebin10@huawei.com>
f2fs: fix null-ptr-deref in f2fs_get_dnode_of_data
Daeho Jeong <daehojeong@google.com>
f2fs: revive F2FS_IOC_ABORT_VOLATILE_WRITE
Nathan Chancellor <nathan@kernel.org>
MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0
Zheyu Ma <zheyuma97@gmail.com>
video: fbdev: i740fb: Check the argument of i740_calc_vclk()
Stanimir Varbanov <stanimir.varbanov@linaro.org>
venus: pm_helpers: Fix warning in OPP during probe
Zhouyi Zhou <zhouzhouyi@gmail.com>
powerpc/64: Init jump labels before parse_early_param()
Steve French <stfrench@microsoft.com>
smb3: check xattr value length earlier
Chao Yu <chao.yu@oppo.com>
f2fs: fix to do sanity check on segment type in build_sit_entries()
Chao Yu <chao.yu@oppo.com>
f2fs: fix to avoid use f2fs_bug_on() in f2fs_new_node_page()
Takashi Iwai <tiwai@suse.de>
ALSA: control: Use deferred fasync helper
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Use deferred fasync helper
Takashi Iwai <tiwai@suse.de>
ALSA: timer: Use deferred fasync helper
Takashi Iwai <tiwai@suse.de>
ALSA: core: Add async signal helpers
Alexey Kardashevskiy <aik@ozlabs.ru>
powerpc/ioda/iommu/debugfs: Generate unique debugfs entries
Miklos Szeredi <mszeredi@redhat.com>
ovl: warn if trusted xattr creation fails
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
ASoC: codecs: va-macro: use fsgen as clock
Christophe Leroy <christophe.leroy@csgroup.eu>
powerpc/32: Don't always pass -mcpu=powerpc to the compiler
Christophe Leroy <christophe.leroy@csgroup.eu>
powerpc/32: Set an IBAT covering up to _einittext during init
Laurent Dufour <ldufour@linux.ibm.com>
powerpc/pseries/mobility: set NMI watchdog factor during an LPM
Laurent Dufour <ldufour@linux.ibm.com>
powerpc/watchdog: introduce a NMI watchdog's factor
Laurent Dufour <ldufour@linux.ibm.com>
watchdog: export lockup_detector_reconfigure
Yong Zhi <yong.zhi@intel.com>
ASoC: Intel: sof_nau8825: Move quirk check to the front in late probe
Andrey Turkin <andrey.turkin@gmail.com>
ASoC: Intel: sof_es8336: ignore GpioInt when looking for speaker/headset GPIO lines
Andrey Turkin <andrey.turkin@gmail.com>
ASoC: Intel: sof_es8336: Fix GPIO quirks set via module option
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
ASoC: SOF: Intel: hda: add sanity check on SSP index reported by NHLT
Kai-Heng Feng <kai.heng.feng@canonical.com>
ALSA: hda/realtek: Enable speaker and mute LEDs for HP laptops
Xianting Tian <xianting.tian@linux.alibaba.com>
RISC-V: Add fast call path of crash_kexec()
Celeste Liu <coelacanthus@outlook.com>
riscv: mmap with PROT_WRITE but no PROT_READ is invalid
Mark Brown <broonie@kernel.org>
ASoC: nau8821: Don't unconditionally free interrupt
Conor Dooley <conor.dooley@microchip.com>
riscv: dts: canaan: Add k210 topology information
Conor Dooley <conor.dooley@microchip.com>
riscv: dts: sifive: Add fu740 topology information
Conor Dooley <conor.dooley@microchip.com>
riscv: dts: sifive: Add fu540 topology information
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
ASoC: rsnd: care default case on rsnd_ssiu_busif_err_irq_ctrl()
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: sof-client-probes: Only load the driver if IPC3 is used
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: Intel: hda-ipc: Do not process IPC reply before firmware boot
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: Intel: cnl: Do not process IPC reply before firmware boot
Helge Deller <deller@gmx.de>
modules: Ensure natural alignment for .altinstructions and __bug_table sections
Cezary Rojewski <cezary.rojewski@intel.com>
ALSA: hda: Fix page fault in snd_hda_codec_shutdown()
Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
ASoC: Intel: avs: Set max DMA segment size
Yunfei Wang <yf.wang@mediatek.com>
iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit
Liang He <windhl@126.com>
mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start
Schspa Shi <schspa@gmail.com>
vfio: Clear the caps->buf to NULL after free
Fabiano Rosas <farosas@linux.ibm.com>
KVM: PPC: Book3S HV: Fix "rm_exit" entry in debugfs timings
Liang He <windhl@126.com>
tty: serial: Fix refcount leak bug in ucc_uart.c
Dongli Zhang <dongli.zhang@oracle.com>
swiotlb: panic if nslabs is too small
Guenter Roeck <linux@roeck-us.net>
lib/list_debug.c: Detect uninitialized lists
Kiselev, Oleg <okiselev@amazon.com>
ext4: avoid resizing to a partial cluster size
Lukas Czerner <lczerner@redhat.com>
ext4: block range must be validated before use in ext4_mb_clear_bb()
Ye Bin <yebin10@huawei.com>
ext4: avoid remove directory when directory is corrupted
Wentao_Liang <Wentao_Liang_g@163.com>
drivers:md:fix a potential use-after-free bug
Sagi Grimberg <sagi@grimberg.me>
nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown
Logan Gunthorpe <logang@deltatee.com>
md/raid5: Make logic blocking check consistent with logic that blocks
Logan Gunthorpe <logang@deltatee.com>
md: Notify sysfs sync_completed in md_reap_sync_thread()
Marek Szyprowski <m.szyprowski@samsung.com>
phy: samsung: phy-exynos-pcie: sanitize init/power_on callbacks
Stafford Horne <shorne@gmail.com>
openrisc: io: Define iounmap argument as volatile
Li Zhijian <lizhijian@fujitsu.com>
Revert "RDMA/rxe: Create duplicate mapping tables for FMRs"
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
dmaengine: sprd: Cleanup in .remove() after pm_runtime_get_sync() failed
Akhil R <akhilrajeev@nvidia.com>
dmaengine: tegra: Add terminate() for Tegra234
Steven Rostedt (Google) <rostedt@goodmis.org>
selftests/kprobe: Do not test for GRP/ without event failures
Liao Chang <liaochang1@huawei.com>
csky/kprobe: reclaim insn_slot on kprobe unregistration
Bob Pearson <rpearsonhpe@gmail.com>
RDMA/rxe: Limit the number of calls to each tasklet
Sudeep Holla <sudeep.holla@arm.com>
ACPI: PPTT: Leave the table mapped for the runtime usage
Takeshi Saito <takeshi.saito.xv@renesas.com>
mmc: renesas_sdhi: newer SoCs don't need manual tap correction
Ben Dooks <ben.dooks@sifive.com>
dmaengine: dw-axi-dmac: ignore interrupt if no descriptor
Ben Dooks <ben.dooks@sifive.com>
dmaengine: dw-axi-dmac: do not print NULL LLI during error
Geert Uytterhoeven <geert+renesas@glider.be>
of: overlay: Move devicetree_corrupt() check up
Jason A. Donenfeld <Jason@zx2c4.com>
um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups
Huacai Chen <chenhuacai@kernel.org>
PCI/ACPI: Guard ARM64-specific mcfg_quirks
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
cxl: Fix a memory leak in an error handling path
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
pinctrl: intel: Check against matching data instead of ACPI companion
Chanho Park <chanho61.park@samsung.com>
scsi: ufs: ufs-exynos: Change ufs phy control sequence
Wolfram Sang <wsa+renesas@sang-engineering.com>
mmc: tmio: avoid glitches when resetting
Oded Gabbay <ogabbay@kernel.org>
habanalabs/gaudi: mask constant value before cast
Ofir Bitton <obitton@habana.ai>
habanalabs/gaudi: fix shift out of bounds
Tal Cohen <talcohen@habana.ai>
habanalabs/gaudi: invoke device reset from one code block
Dafna Hirschfeld <dhirschfeld@habana.ai>
habanalabs: add terminating NULL to attrs arrays
Nick Desaulniers <ndesaulniers@google.com>
coresight: etm4x: avoid build failure with unrolled loops
Jozef Martiniak <jomajm@gmail.com>
gadgetfs: ep_io - wait until IRQ finishes
James Smart <jsmart2021@gmail.com>
scsi: lpfc: Fix possible memory leak when failing to issue CMF WQE
James Smart <jsmart2021@gmail.com>
scsi: lpfc: Prevent buffer overflow crashes in debugfs with malformed user input
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
clk: qcom: clk-alpha-pll: fix clk_trion_pll_configure description
Sergey Senozhatsky <senozhatsky@chromium.org>
zram: do not lookup algorithm in backends table
Jean-Philippe Brucker <jean-philippe@linaro.org>
uacce: Handle parent device removal or parent driver module rmmod
Robert Marko <robimarko@gmail.com>
clk: qcom: ipq8074: dont disable gcc_sleep_clk_src
Pascal Terjan <pterjan@google.com>
vboxguest: Do not use devm for irq
Amelie Delaunay <amelie.delaunay@foss.st.com>
usb: dwc2: gadget: remove D+ pull-up while no vbus with usb-role-switch
Mike Christie <michael.christie@oracle.com>
scsi: iscsi: Fix HW conn removal use after free
Liang He <windhl@126.com>
usb: renesas: Fix refcount leak bug
Liang He <windhl@126.com>
usb: host: ohci-ppc-of: Fix refcount leak bug
Prashant Malani <pmalani@chromium.org>
usb: typec: mux: Add CONFIG guards for functions
Po-Wen Kao <powen.kao@mediatek.com>
scsi: ufs: ufs-mediatek: Fix the timing of configuring device regulators
Tony Lindgren <tony@atomide.com>
clk: ti: Stop using legacy clkctrl names for omap4 and 5
Sai Prakash Ranjan <quic_saipraka@quicinc.com>
drm/meson: Fix overflow implicit truncation warnings
Sai Prakash Ranjan <quic_saipraka@quicinc.com>
irqchip/tegra: Fix overflow implicit truncation warnings
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
Pali Rohár <pali@kernel.org>
PCI: aardvark: Fix reporting Slot capabilities on emulated bridge
Michael Grzeschik <m.grzeschik@pengutronix.de>
usb: gadget: uvc: call uvc uvcg_warn on completed status instead of uvcg_info
Michael Grzeschik <m.grzeschik@pengutronix.de>
usb: gadget: uvc: calculate the number of request depending on framesize
Frank Li <Frank.Li@nxp.com>
usb: cdns3 fix use-after-free at workaround 2
Pavel Skripkin <paskripkin@gmail.com>
staging: r8188eu: add error handling of rtw_read32
Pavel Skripkin <paskripkin@gmail.com>
staging: r8188eu: add error handling of rtw_read16
Pavel Skripkin <paskripkin@gmail.com>
staging: r8188eu: add error handling of rtw_read8
Tzung-Bi Shih <tzungbi@kernel.org>
platform/chrome: cros_ec_proto: don't show MKBP version if unsupported
Pavan Chebbi <pavan.chebbi@broadcom.com>
PCI: Add ACS quirk for Broadcom BCM5750x NICs
Tao Jin <tao-j@outlook.com>
HID: multitouch: new device class fix Lenovo X12 trackpad sticky
Gil Fine <gil.fine@intel.com>
thunderbolt: Change downstream router's TMU rate in both TMU uni/bidir mode
Josh Poimboeuf <jpoimboe@kernel.org>
x86/kvm: Fix "missing ENDBR" BUG for fastop functions
Josh Poimboeuf <jpoimboe@kernel.org>
x86/ibt, objtool: Add IBT_NOSEAL()
Vladimir Oltean <vladimir.oltean@nxp.com>
net: mscc: ocelot: report ndo_get_stats64 from the wraparound-resistant ocelot->stats
Vladimir Oltean <vladimir.oltean@nxp.com>
net: mscc: ocelot: make struct ocelot_stat_layout array indexable
Vladimir Oltean <vladimir.oltean@nxp.com>
net: mscc: ocelot: fix race between ndo_get_stats64 and ocelot_check_stats_work
Vladimir Oltean <vladimir.oltean@nxp.com>
net: mscc: ocelot: turn stats_lock into a spinlock
Oliver Upton <oliver.upton@linux.dev>
KVM: arm64: Reject 32bit user PSTATE on asymmetric systems
Oliver Upton <oliver.upton@linux.dev>
KVM: arm64: Treat PMCR_EL1.LC as RES1 on asymmetric systems
Maíra Canal <mairacanal@riseup.net>
drm/amdgpu: Fix use-after-free on amdgpu_bo_list mutex
Samuel Holland <samuel@sholland.org>
drm/sun4i: dsi: Prevent underflow when computing packet sizes
Marek Vasut <marex@denx.de>
drm/bridge: lvds-codec: Fix error checking of drm_of_lvds_get_data_mapping()
Lijo Lazar <lijo.lazar@amd.com>
drm/amdgpu: Avoid another list of reset devices
Matthew Auld <matthew.auld@intel.com>
drm/i915/ttm: don't leak the ccs state
Liang He <windhl@126.com>
drm/meson: Fix refcount bugs in meson_vpu_has_available_connectors()
Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
drm/imx/dcss: get rid of HPD warning message
Fedor Pchelkin <pchelkin@ispras.ru>
can: j1939: j1939_sk_queue_activate_next_locked(): replace WARN_ON_ONCE with netdev_warn_once()
Andrew Donnellan <ajd@linux.ibm.com>
gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file
Masahiro Yamada <masahiroy@kernel.org>
kbuild: fix the modules order between drivers and libs
Lin Ma <linma@zju.edu.cn>
igb: Add lock to avoid data race
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
stmmac: intel: Add a missing clk_disable_unprepare() call in intel_eth_pci_remove()
Samuel Holland <samuel@sholland.org>
dt-bindings: display: sun4i: Add D1 TCONs to conditionals
Csókás Bence <csokas.bence@prolan.hu>
fec: Fix timer capture timing in `fec_ptp_enable_pps()`
Ben Hutchings <benh@debian.org>
tools/rtla: Fix command symlinks
Yufen Yu <yuyufen@huawei.com>
blk-mq: run queue no matter whether the request is the last request
Alan Brady <alan.brady@intel.com>
i40e: Fix to stop tx_timeout recovery if GLOBR fails
Frieder Schrempf <frieder.schrempf@kontron.de>
regulator: pca9450: Remove restrictions for regulator-name
Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
i40e: Fix tunnel checksum offload with fragmented traffic
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
i2c: imx: Make sure to unregister adapter on remove()
Masahiro Yamada <masahiroy@kernel.org>
modpost: fix module versioning when a symbol lacks valid CRC
Benjamin Mikailenko <benjamin.mikailenko@intel.com>
ice: Ignore error message when setting same promiscuous mode
Grzegorz Siwik <grzegorz.siwik@intel.com>
ice: Fix clearing of promisc mode with bridge over bond
Grzegorz Siwik <grzegorz.siwik@intel.com>
ice: Ignore EEXIST when setting promisc mode
Grzegorz Siwik <grzegorz.siwik@intel.com>
ice: Fix double VLAN error when entering promisc mode
Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
ice: Fix VF not able to send tagged traffic with no VLAN filters
Michal Jaron <michalx.jaron@intel.com>
ice: Fix call trace with null VSI during VF reset
Benjamin Mikailenko <benjamin.mikailenko@intel.com>
ice: Fix VSI rebuild WARN_ON check for VF
Rustam Subkhankulov <subkhankulov@ispras.ru>
net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions()
Vladimir Oltean <vladimir.oltean@nxp.com>
net: dsa: don't warn in dsa_port_set_state_now() when driver doesn't support it
Jakub Kicinski <kuba@kernel.org>
net: genl: fix error path memory leak in policy dumping
Vladimir Oltean <vladimir.oltean@nxp.com>
net: mscc: ocelot: fix address of SYS_COUNT_TX_AGING counter
Vladimir Oltean <vladimir.oltean@nxp.com>
net: mscc: ocelot: fix incorrect ndo_get_stats64 packet counters
Vladimir Oltean <vladimir.oltean@nxp.com>
net: dsa: felix: fix ethtool 256-511 and 512-1023 TX packet counters
Arun Ramadoss <arun.ramadoss@microchip.com>
net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry
Zhengchao Shao <shaozhengchao@huawei.com>
net: sched: fix misuse of qcpu->backlog in gnet_stats_add_queue_cpu
Zhengchao Shao <shaozhengchao@huawei.com>
net: rtnetlink: fix module reference count leak issue in rtnetlink_rcv_msg
Xin Xiong <xiongx18@fudan.edu.cn>
net: fix potential refcount leak in ndisc_router_discovery()
Sergei Antonov <saproj@gmail.com>
net: moxa: pass pdev instead of ndev to DMA functions
Amit Cohen <amcohen@nvidia.com>
mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice
Michael S. Tsirkin <mst@redhat.com>
virtio_net: fix endian-ness for RSS
Maxim Kochetkov <fido_max@inbox.ru>
net: qrtr: start MHI channel after endpoit creation
Sergei Antonov <saproj@gmail.com>
net: dsa: mv88e6060: prevent crash on an unused port
Xin Xiong <xiongx18@fudan.edu.cn>
net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()
Neil Armstrong <narmstrong@baylibre.com>
spi: meson-spicc: add local pow2 clock ops to preserve rate between messages
Michael Ellerman <mpe@ellerman.id.au>
powerpc/pci: Fix get_phb_number() locking
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: disallow NFT_SET_ELEM_CATCHALL and NFT_SET_ELEM_INTERVAL_END
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag
Florian Westphal <fw@strlen.de>
netfilter: nf_tables: fix scheduling-while-atomic splat
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: really skip inactive sets when allocating name
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: possible module reference underflow in error path
Florian Westphal <fw@strlen.de>
netfilter: nf_ct_irc: cap packet search space to 4k
Florian Westphal <fw@strlen.de>
netfilter: nf_ct_ftp: prefer skb_linearize
Florian Westphal <fw@strlen.de>
netfilter: nf_ct_h323: cap packet size at 64k
Florian Westphal <fw@strlen.de>
netfilter: nf_ct_sane: remove pseudo skb linearization
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: disallow NFTA_SET_ELEM_KEY_END with NFT_SET_ELEM_INTERVAL_END flag
Dan Carpenter <dan.carpenter@oracle.com>
fs/ntfs3: uninitialized variable in ntfs_set_acl_ex()
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: use READ_ONCE and WRITE_ONCE for shared generation id access
Florian Westphal <fw@strlen.de>
netfilter: nfnetlink: re-enable conntrack expectation events
Potnuri Bharat Teja <bharat@chelsio.com>
RDMA/cxgb4: fix accept failure due to increased cpl_t5_pass_accept_rpl size
Mark Bloch <mbloch@nvidia.com>
RDMA/mlx5: Use the proper number of ports
Sergey Gorenko <sergeygo@nvidia.com>
IB/iser: Fix login with authentication
Philipp Zabel <p.zabel@pengutronix.de>
ASoC: codec: tlv320aic32x4: fix mono playback via I2S
Martin Povišer <povik+lin@cutebit.org>
ASoC: tas2770: Fix handling of mute/unmute
Martin Povišer <povik+lin@cutebit.org>
ASoC: tas2770: Drop conflicting set_bias_level power setting
Martin Povišer <povik+lin@cutebit.org>
ASoC: tas2770: Allow mono streams
Martin Povišer <povik+lin@cutebit.org>
ASoC: tas2770: Set correct FSYNC polarity
Takashi Iwai <tiwai@suse.de>
ASoC: DPCM: Don't pick up BE without substream
Takashi Iwai <tiwai@suse.de>
ASoC: SOF: Intel: hda: Fix potential buffer overflow by snprintf()
Takashi Iwai <tiwai@suse.de>
ASoC: SOF: debug: Fix potential buffer overflow by snprintf()
Takashi Iwai <tiwai@suse.de>
ASoC: Intel: avs: Fix potential buffer overflow by snprintf()
Ivan Vecera <ivecera@redhat.com>
iavf: Fix deadlock in initialization
Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
iavf: Fix reset error handling
Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
iavf: Fix NULL pointer dereference in iavf_get_link_ksettings
Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
iavf: Fix adminq error handling
Al Viro <viro@zeniv.linux.org.uk>
nios2: add force_successful_syscall_return()
Al Viro <viro@zeniv.linux.org.uk>
nios2: restarts apply only to the first sigframe we build...
Al Viro <viro@zeniv.linux.org.uk>
nios2: fix syscall restart checks
Al Viro <viro@zeniv.linux.org.uk>
nios2: traced syscall does need to check the syscall number
Al Viro <viro@zeniv.linux.org.uk>
nios2: don't leave NULLs in sys_call_table[]
Al Viro <viro@zeniv.linux.org.uk>
nios2: page fault et.al. are *not* restartable syscalls...
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3: Fix missing i_op in ntfs_read_mft
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3: Do not change mode if ntfs_set_ea failed
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3: Fix double free on remount
Dan Carpenter <dan.carpenter@oracle.com>
fs/ntfs3: Don't clear upper bits accidentally in log_replay()
Pavel Skripkin <paskripkin@gmail.com>
fs/ntfs3: Fix NULL deref in ntfs_update_mftmirr
Yan Lei <chinayanlei2002@163.com>
fs/ntfs3: Fix using uninitialized value n when calling indx_read
Chen Lin <chen45464546@163.com>
dpaa2-eth: trace the allocated address instead of page struct
Adrian Hunter <adrian.hunter@intel.com>
perf tests: Fix Track with sched_switch test for hybrid case
Adrian Hunter <adrian.hunter@intel.com>
perf parse-events: Fix segfault when event parser gets an error
Robin Reckmann <robin.reckmann@googlemail.com>
i2c: qcom-geni: Fix GPI DMA buffer sync-back
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
perf probe: Fix an error handling path in 'parse_perf_probe_command()'
Christoph Hellwig <hch@lst.de>
nvme-fc: fix the fc_appid_store return value
Matthias May <matthias.may@westermo.com>
geneve: fix TOS inheriting for ipv4
Jeff Layton <jlayton@kernel.org>
fscache: don't leak cookie access refs if invalidation is in progress or failed
Duoming Zhou <duoming@zju.edu.cn>
atm: idt77252: fix use-after-free bugs caused by tst_timer
Gerhard Engleder <gerhard@engleder-embedded.com>
tsnep: Fix tsnep_tx_unmap() error path usage
Dan Carpenter <dan.carpenter@oracle.com>
xen/xenbus: fix return type in xenbus_file_read()
Yu Xiao <yu.xiao@corigine.com>
nfp: ethtool: fix the display error of `ethtool -m DEVNAME`
Dan Carpenter <dan.carpenter@oracle.com>
NTB: ntb_tool: uninitialized heap data in tool_fn_write()
Roberto Sassu <roberto.sassu@huawei.com>
tools build: Switch to new openssl API for test-libcrypto
Ondrej Mosnacek <omosnace@redhat.com>
kbuild: dummy-tools: avoid tmpdir leak in dummy gcc
Dan Williams <dan.j.williams@intel.com>
tools/testing/cxl: Fix cxl_hdm_decode_init() calling convention
Stefano Garzarella <sgarzare@redhat.com>
vdpa_sim_blk: set number of address spaces and virtqueue groups
Stefano Garzarella <sgarzare@redhat.com>
vdpa_sim: use max_iotlb_entries as a limit in vhost_iotlb_init
Jacky Bai <ping.bai@nxp.com>
clk: imx93: Correct the edma1's parent clock
Jeff Layton <jlayton@kernel.org>
ceph: don't leak snap_rwsem in handle_cap_grant
Yuanzheng Song <songyuanzheng@huawei.com>
tools/vm/slabinfo: use alphabetic order when two values are equal
Dan Williams <dan.j.williams@intel.com>
tools/testing/cxl: Fix decoder default state
Luís Henriques <lhenriques@suse.de>
ceph: use correct index when encoding client supported features
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
spi: dt-bindings: qcom,spi-geni-qcom: allow three interconnects
Bryan O'Donoghue <bryan.odonoghue@linaro.org>
dt-bindings: opp: opp-v2-kryo-cpu: Fix example binding checks
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
spi: dt-bindings: zynqmp-qspi: add missing 'required'
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
spi: dt-bindings: cadence: add missing 'required'
Johan Hovold <johan+linaro@kernel.org>
dt-bindings: PCI: qcom: Fix reset conditional
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
dt-bindings: clock: qcom,gcc-msm8996: add more GCC clock sources
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
dt-bindings: arm: qcom: fix MSM8994 boards compatibles
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
dt-bindings: arm: qcom: fix MSM8916 MTP compatibles
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
dt-bindings: arm: qcom: fix Longcheer L8150 compatibles
Michal Simek <michal.simek@xilinx.com>
dt-bindings: gpio: zynq: Add missing compatible strings
Peilin Ye <peilin.ye@bytedance.com>
vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout()
Peilin Ye <peilin.ye@bytedance.com>
vsock: Fix memory leak in vsock_connect()
Florian Westphal <fw@strlen.de>
plip: avoid rcu debug splat
Matthias May <matthias.may@westermo.com>
ipv6: do not use RT_TOS for IPv6 flowlabel
Matthias May <matthias.may@westermo.com>
mlx5: do not use RT_TOS for IPv6 flowlabel
Matthias May <matthias.may@westermo.com>
vxlan: do not use RT_TOS for IPv6 flowlabel
Matthias May <matthias.may@westermo.com>
geneve: do not use RT_TOS for IPv6 flowlabel
Sakari Ailus <sakari.ailus@linux.intel.com>
ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool
Subbaraya Sundeep <sbhatta@marvell.com>
octeontx2-af: Fix key checking for source mac
Subbaraya Sundeep <sbhatta@marvell.com>
octeontx2-af: Fix mcam entry resource leak
Harman Kalra <hkalra@marvell.com>
octeontx2-af: suppress external profile loading warning
Stanislaw Kardach <skardach@marvell.com>
octeontx2-af: Apply tx nibble fixup always
Naveen Mamindlapalli <naveenm@marvell.com>
octeontx2-pf: Fix NIX_AF_TL3_TL2X_LINKX_CFG register configuration
Peter Zijlstra <peterz@infradead.org>
um: Add missing apply_returns()
Jeff LaBundy <jeff@labundy.com>
dt-bindings: input: iqs7222: Extend slider-mapped GPIO to IQS7222C
Jeff LaBundy <jeff@labundy.com>
dt-bindings: input: iqs7222: Correct bottom speed step size
Jeff LaBundy <jeff@labundy.com>
dt-bindings: input: iqs7222: Remove support for RF filter
Jeff LaBundy <jeff@labundy.com>
Input: iqs7222 - remove support for RF filter
Jeff LaBundy <jeff@labundy.com>
Input: iqs7222 - handle reset during ATI
Jeff LaBundy <jeff@labundy.com>
Input: iqs7222 - acknowledge reset before writing registers
Jeff LaBundy <jeff@labundy.com>
Input: iqs7222 - protect volatile registers
Jeff LaBundy <jeff@labundy.com>
Input: iqs7222 - fortify slider event reporting
Jeff LaBundy <jeff@labundy.com>
Input: iqs7222 - correct slider event disable logic
Mattijs Korpershoek <mkorpershoek@baylibre.com>
Input: mt6779-keypad - match hardware matrix organization
Miaoqian Lin <linmq006@gmail.com>
Input: exc3000 - fix return value check of wait_for_completion_timeout
Zeng Jingxiang <linuszeng@tencent.com>
rtc: spear: set range max
Jianhua Lu <lujianhua000@gmail.com>
pinctrl: qcom: sm8250: Fix PDC map
Allen-KH Cheng <allen-kh.cheng@mediatek.com>
dt-bindings: pinctrl: mt8186: Add and use drive-strength-microamp
Samuel Holland <samuel@sholland.org>
pinctrl: sunxi: Add I/O bias setting for H6 R-PIO
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
dt-bindings: pinctrl: mt8195: Add and use drive-strength-microamp
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
dt-bindings: pinctrl: mt8195: Fix name for mediatek,rsel-resistance-in-si-unit
Basavaraj Natikar <Basavaraj.Natikar@amd.com>
pinctrl: amd: Don't save/restore interrupt status and wake status bits
Nikita Travkin <nikita@trvn.ru>
pinctrl: qcom: msm8916: Allow CAMSS GP clocks to be muxed
Miaoqian Lin <linmq006@gmail.com>
pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map
Nícolas F. R. A. Prado <nfraprado@collabora.com>
dt-bindings: pinctrl: mt8192: Use generic bias instead of pull-*-adv
Nícolas F. R. A. Prado <nfraprado@collabora.com>
dt-bindings: pinctrl: mt8192: Add drive-strength-microamp
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
pinctrl: renesas: rzg2l: Return -EINVAL for pins which have input disabled
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
dt-bindings: arm: qcom: fix Alcatel OneTouch Idol 3 compatibles
Ido Schimmel <idosch@nvidia.com>
selftests: forwarding: Fix failing tests with old libnet
Jakub Kicinski <kuba@kernel.org>
net: atm: bring back zatm uAPI
Sandor Bodo-Merle <sbodomerle@gmail.com>
net: bgmac: Fix a BUG triggered by wrong bytes_compl
Vladimir Oltean <vladimir.oltean@nxp.com>
net: dsa: felix: suppress non-changes to the tagging protocol
Oleksij Rempel <linux@rempel-privat.de>
net: phy: c45 baset1: do not skip aneg configuration if clock role is not specified
Florian Fainelli <f.fainelli@gmail.com>
net: bcmgenet: Indicate MAC is in charge of PHY PM
Florian Fainelli <f.fainelli@gmail.com>
net: phy: Warn about incorrect mdio_bus_phy_resume() state
Ido Schimmel <idosch@nvidia.com>
devlink: Fix use-after-free after a failed reload
Shigeru Yoshida <syoshida@redhat.com>
virtio-blk: Avoid use-after-free on suspend/resume
Xuan Zhuo <xuanzhuo@linux.alibaba.com>
virtio_net: fix memory leak inside XPD_TX with mergeable
Michael S. Tsirkin <mst@redhat.com>
virtio: VIRTIO_HARDEN_NOTIFICATION is broken
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared
Trond Myklebust <trond.myklebust@hammerspace.com>
SUNRPC: Don't reuse bvec on retransmission of the request
Trond Myklebust <trond.myklebust@hammerspace.com>
SUNRPC: Reinitialise the backchannel request buffers before reuse
Chuck Lever <chuck.lever@oracle.com>
SUNRPC: Fix xdr_encode_bool()
Dan Aloni <dan.aloni@vastdata.com>
sunrpc: fix expiry of auth creds
Randy Dunlap <rdunlap@infradead.org>
m68k: coldfire/device.c: protect FLEXCAN blocks
Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
net: atlantic: fix aq_vec index out of range error
Fedor Pchelkin <pchelkin@ispras.ru>
can: j1939: j1939_session_destroy(): fix memory leak of skbs
Sebastian Würl <sebastian.wuerl@ororatech.com>
can: mcp251x: Fix race condition on receive interrupt
Hou Tao <houtao1@huawei.com>
bpf: Check the validity of max_rdwr_access for sock local storage map iterator
Hou Tao <houtao1@huawei.com>
bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator
Hou Tao <houtao1@huawei.com>
bpf: Acquire map uref in .init_seq_private for sock local storage map iterator
Hou Tao <houtao1@huawei.com>
bpf: Acquire map uref in .init_seq_private for hash map iterator
Hou Tao <houtao1@huawei.com>
bpf: Acquire map uref in .init_seq_private for array map iterator
Kumar Kartikeya Dwivedi <memxor@gmail.com>
bpf: Don't reinit map value in prealloc_lru_pop
Alexei Starovoitov <ast@kernel.org>
bpf: Disallow bpf programs call prog_run command.
Jinghao Jia <jinghao@linux.ibm.com>
BPF: Fix potential bad pointer dereference in bpf_sys_bpf()
Florian Westphal <fw@strlen.de>
selftests: mptcp: make sendfile selftest work
Paolo Abeni <pabeni@redhat.com>
mptcp: do not queue data on closed subflows
Paolo Abeni <pabeni@redhat.com>
mptcp: move subflow cleanup in mptcp_destroy_common()
Jiri Olsa <jolsa@kernel.org>
mptcp, btf: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled
Trond Myklebust <trond.myklebust@hammerspace.com>
NFSv4/pnfs: Fix a use-after-free bug in open
Zhang Xianwei <zhang.xianwei8@zte.com.cn>
NFSv4.1: RECLAIM_COMPLETE must handle EACCES
Trond Myklebust <trond.myklebust@hammerspace.com>
NFSv4: Fix races in the legacy idmapper upcall
Trond Myklebust <trond.myklebust@hammerspace.com>
NFSv4.1: Handle NFS4ERR_DELAY replies to OP_SEQUENCE correctly
Trond Myklebust <trond.myklebust@hammerspace.com>
NFSv4.1: Don't decrease the value of seq_nr_highest_sent
Cezar Bulinaru <cbulinaru@gmail.com>
net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null
Florian Westphal <fw@strlen.de>
netfilter: nf_tables: fix crash when nf_trace is enabled
Qifu Zhang <zhangqifu@bytedance.com>
Documentation: ACPI: EINJ: Fix obsolete example
Xiu Jianfeng <xiujianfeng@huawei.com>
apparmor: Fix memleak in aa_simple_write_to_buffer()
Xin Xiong <xiongx18@fudan.edu.cn>
apparmor: fix reference count leak in aa_pivotroot()
John Johansen <john.johansen@canonical.com>
apparmor: fix overlapping attachment computation
John Johansen <john.johansen@canonical.com>
apparmor: fix setting unconfined mode on a loaded profile
Tom Rix <trix@redhat.com>
apparmor: fix aa_label_asxprint return check
John Johansen <john.johansen@canonical.com>
apparmor: Fix failed mount permission check error message
John Johansen <john.johansen@canonical.com>
apparmor: fix absroot causing audited secids to begin with =
John Johansen <john.johansen@canonical.com>
apparmor: fix quiet_denied for file rules
Marc Kleine-Budde <mkl@pengutronix.de>
can: ems_usb: fix clang's -Wunaligned-access warning
Nícolas F. R. A. Prado <nfraprado@collabora.com>
dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional
Mohan Kumar <mkumard@nvidia.com>
ALSA: hda: Fix crash due to jack poll in suspend
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: More comprehensive mixer map for ASUS ROG Zenith II
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing: Have filter accept "common_cpu" to be consistent
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/probes: Have kprobes and uprobes use $COMM too
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/eprobes: Have event probes be consistent with kprobes and uprobes
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/eprobes: Fix reading of string fields
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/eprobes: Do not hardcode $comm as a string
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/eprobes: Do not allow eprobes to use $stack, or % for regs
Steven Rostedt (Google) <rostedt@goodmis.org>
tracing/perf: Fix double put of trace event when init fails
Nadav Amit <namit@vmware.com>
x86/kprobes: Fix JNG/JNLE emulation
Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
cifs: Fix memory leak on the deferred close
Mauro Carvalho Chehab <mchehab@kernel.org>
drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb()
Chris Wilson <chris.p.wilson@intel.com>
drm/i915/gt: Batch TLB invalidations
Chris Wilson <chris.p.wilson@intel.com>
drm/i915/gt: Skip TLB invalidations once wedged
Chris Wilson <chris.p.wilson@intel.com>
drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations
Chris Wilson <chris.p.wilson@intel.com>
drm/i915/gt: Ignore TLB invalidations on idle engines
Likun Gao <Likun.Gao@amd.com>
drm/amdgpu: change vram width algorithm for vram_info v3_0
Filipe Manana <fdmanana@suse.com>
btrfs: fix warning during log replay when bumping inode link count
Filipe Manana <fdmanana@suse.com>
btrfs: fix lost error handling when looking up extended ref on log replay
Josef Bacik <josef@toxicpanda.com>
btrfs: reset RO counter on block group if we fail to relocate
Zixuan Fu <r33s3n6@gmail.com>
btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
mmc: meson-gx: Fix an error handling path in meson_mmc_probe()
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
mmc: pxamci: Fix an error handling path in pxamci_probe()
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
mmc: pxamci: Fix another error handling path in pxamci_probe()
Damien Le Moal <damien.lemoal@opensource.wdc.com>
ata: libata-eh: Add missing command name
Harald Freudenberger <freude@linux.ibm.com>
s390/ap: fix crash on older machines based on QCI info missing
Aurabindo Pillai <aurabindo.pillai@amd.com>
drm/amd/display: Check correct bounds for stream encoder instances for DCN303
Alex Deucher <alexander.deucher@amd.com>
drm/amdgpu: Only disable prefer_shadow on hawaii
Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
drm/ttm: Fix dummy res NULL ptr deref bug
Karol Herbst <kherbst@redhat.com>
drm/nouveau: recognise GA103
Hector Martin <marcan@marcan.st>
locking/atomic: Make test_and_*_bit() ordered on failure
Chris Wilson <chris@chris-wilson.co.uk>
drm/i915/gem: Remove shared locking on freeing objects
Mikulas Patocka <mpatocka@redhat.com>
rds: add missing barrier to release_refill
Aaron Lu <aaron.lu@intel.com>
x86/mm: Use proper mask when setting PUD mapping
Sean Christopherson <seanjc@google.com>
KVM: Unconditionally get a ref to /dev/kvm module when creating a VM
Jason Gunthorpe <jgg@ziepe.ca>
RDMA: Handle the return code from dma_resv_wait_timeout() properly
Christoffer Sandberg <cs@tuxedo.de>
ALSA: hda/realtek: Add quirk for Clevo NS50PU, NS70PU
Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
ALSA: info: Fix llseek return value when using callback
-------------
Diffstat:
Documentation/admin-guide/sysctl/kernel.rst | 12 +
Documentation/atomic_bitops.txt | 2 +-
Documentation/devicetree/bindings/arm/qcom.yaml | 18 +-
.../bindings/clock/qcom,gcc-msm8996.yaml | 16 +
.../bindings/display/allwinner,sun4i-a10-tcon.yaml | 4 +
.../devicetree/bindings/gpio/gpio-zynq.yaml | 6 +-
.../devicetree/bindings/input/azoteq,iqs7222.yaml | 28 +-
.../devicetree/bindings/opp/opp-v2-kryo-cpu.yaml | 15 +
.../devicetree/bindings/pci/qcom,pcie.yaml | 2 +-
.../bindings/pinctrl/pinctrl-mt8186.yaml | 29 +-
.../bindings/pinctrl/pinctrl-mt8192.yaml | 58 +--
.../bindings/pinctrl/pinctrl-mt8195.yaml | 37 +-
.../bindings/regulator/nxp,pca9450-regulator.yaml | 11 -
.../bindings/spi/qcom,spi-geni-qcom.yaml | 5 +-
.../devicetree/bindings/spi/spi-cadence.yaml | 7 +
.../devicetree/bindings/spi/spi-zynqmp-qspi.yaml | 7 +
.../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 1 +
Documentation/firmware-guide/acpi/apei/einj.rst | 2 +-
Makefile | 10 +-
arch/arm64/include/asm/kvm_host.h | 4 +
arch/arm64/kvm/arm.c | 3 +-
arch/arm64/kvm/guest.c | 2 +-
arch/arm64/kvm/sys_regs.c | 4 +-
arch/csky/kernel/probes/kprobes.c | 4 +
arch/m68k/coldfire/device.c | 6 +-
arch/mips/cavium-octeon/octeon-platform.c | 3 +-
arch/mips/mm/tlbex.c | 4 +-
arch/nios2/include/asm/entry.h | 3 +-
arch/nios2/include/asm/ptrace.h | 2 +
arch/nios2/kernel/entry.S | 22 +-
arch/nios2/kernel/signal.c | 3 +-
arch/nios2/kernel/syscall_table.c | 1 +
arch/openrisc/include/asm/io.h | 2 +-
arch/openrisc/mm/ioremap.c | 2 +-
arch/powerpc/Makefile | 26 +-
arch/powerpc/include/asm/nmi.h | 2 +
arch/powerpc/kernel/head_book3s_32.S | 4 +-
arch/powerpc/kernel/pci-common.c | 16 +-
arch/powerpc/kernel/prom.c | 7 +
arch/powerpc/kernel/watchdog.c | 21 +-
arch/powerpc/kvm/book3s_hv_p9_entry.c | 13 +-
arch/powerpc/mm/book3s32/mmu.c | 10 +-
arch/powerpc/platforms/Kconfig.cputype | 21 +-
arch/powerpc/platforms/powernv/pci-ioda.c | 2 +
arch/powerpc/platforms/pseries/mobility.c | 43 ++
arch/riscv/boot/dts/canaan/k210.dtsi | 12 +
arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 24 +
arch/riscv/boot/dts/sifive/fu740-c000.dtsi | 24 +
arch/riscv/kernel/sys_riscv.c | 5 +-
arch/riscv/kernel/traps.c | 4 +
arch/um/kernel/um_arch.c | 4 +
arch/um/os-Linux/skas/process.c | 17 +-
arch/x86/include/asm/ibt.h | 11 +
arch/x86/kernel/kprobes/core.c | 2 +-
arch/x86/kvm/emulate.c | 3 +-
arch/x86/mm/init_64.c | 2 +-
block/blk-mq.c | 2 +-
drivers/acpi/pci_mcfg.c | 3 +
drivers/acpi/pptt.c | 102 ++---
drivers/acpi/property.c | 8 +-
drivers/ata/libata-eh.c | 1 +
drivers/atm/idt77252.c | 1 +
drivers/block/virtio_blk.c | 24 +-
drivers/block/zram/zcomp.c | 11 +-
drivers/clk/imx/clk-imx93.c | 2 +-
drivers/clk/qcom/clk-alpha-pll.c | 2 +-
drivers/clk/qcom/gcc-ipq8074.c | 1 +
drivers/clk/ti/clk-44xx.c | 210 ++++-----
drivers/clk/ti/clk-54xx.c | 160 +++----
drivers/clk/ti/clkctrl.c | 4 -
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 11 +
drivers/dma/sprd-dma.c | 5 +-
drivers/dma/tegra186-gpc-dma.c | 26 +-
drivers/gpu/drm/amd/amdgpu/aldebaran.c | 45 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 +-
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +-
.../drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +-
drivers/gpu/drm/bridge/lvds-codec.c | 2 +-
drivers/gpu/drm/i915/gem/i915_gem_object.c | 16 +-
drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 3 +-
drivers/gpu/drm/i915/gem/i915_gem_pages.c | 25 +-
drivers/gpu/drm/i915/gt/intel_gt.c | 77 +++-
drivers/gpu/drm/i915/gt/intel_gt.h | 12 +-
drivers/gpu/drm/i915/gt/intel_gt_pm.h | 3 +
drivers/gpu/drm/i915/gt/intel_gt_types.h | 18 +-
drivers/gpu/drm/i915/gt/intel_migrate.c | 23 +-
drivers/gpu/drm/i915/gt/intel_ppgtt.c | 8 +-
drivers/gpu/drm/i915/i915_drv.h | 4 +-
drivers/gpu/drm/i915/i915_vma.c | 33 +-
drivers/gpu/drm/i915/i915_vma.h | 1 +
drivers/gpu/drm/i915/i915_vma_resource.c | 5 +-
drivers/gpu/drm/i915/i915_vma_resource.h | 6 +-
drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 -
drivers/gpu/drm/meson/meson_drv.c | 5 +-
drivers/gpu/drm/meson/meson_viu.c | 22 +-
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 22 +
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +-
drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
drivers/hid/hid-multitouch.c | 13 +-
drivers/hwtracing/coresight/coresight-etm4x.h | 3 +-
drivers/i2c/busses/i2c-imx.c | 20 +-
drivers/i2c/busses/i2c-qcom-geni.c | 5 +-
drivers/infiniband/core/umem_dmabuf.c | 8 +-
drivers/infiniband/hw/cxgb4/cm.c | 25 +-
drivers/infiniband/hw/mlx5/main.c | 34 +-
drivers/infiniband/sw/rxe/rxe_loc.h | 1 -
drivers/infiniband/sw/rxe/rxe_mr.c | 199 +++------
drivers/infiniband/sw/rxe/rxe_mw.c | 6 +-
drivers/infiniband/sw/rxe/rxe_param.h | 6 +
drivers/infiniband/sw/rxe/rxe_task.c | 16 +-
drivers/infiniband/sw/rxe/rxe_verbs.c | 39 +-
drivers/infiniband/sw/rxe/rxe_verbs.h | 21 +-
drivers/infiniband/ulp/iser/iser_initiator.c | 7 +-
drivers/input/keyboard/mt6779-keypad.c | 8 +-
drivers/input/misc/iqs7222.c | 178 +++++---
drivers/input/touchscreen/exc3000.c | 7 +-
drivers/iommu/io-pgtable-arm-v7s.c | 75 +++-
drivers/irqchip/irq-tegra.c | 10 +-
drivers/md/md.c | 1 +
drivers/md/raid5.c | 4 +-
drivers/media/platform/qcom/venus/pm_helpers.c | 10 +-
drivers/misc/cxl/irq.c | 1 +
drivers/misc/habanalabs/common/sysfs.c | 2 +
drivers/misc/habanalabs/gaudi/gaudi.c | 50 ++-
drivers/misc/habanalabs/goya/goya_hwmgr.c | 2 +
drivers/misc/uacce/uacce.c | 133 ++++--
drivers/mmc/host/meson-gx-mmc.c | 6 +-
drivers/mmc/host/pxamci.c | 4 +-
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_core.c | 34 +-
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 6 +
drivers/mmc/host/tmio_mmc.c | 2 +-
drivers/mmc/host/tmio_mmc.h | 6 +-
drivers/mmc/host/tmio_mmc_core.c | 28 +-
drivers/net/can/spi/mcp251x.c | 18 +-
drivers/net/can/usb/ems_usb.c | 2 +-
drivers/net/dsa/microchip/ksz9477.c | 3 +
drivers/net/dsa/mv88e6060.c | 3 +
drivers/net/dsa/ocelot/felix.c | 3 +
drivers/net/dsa/ocelot/felix_vsc9959.c | 491 ++++++++++++++++-----
drivers/net/dsa/ocelot/seville_vsc9953.c | 484 +++++++++++++++-----
drivers/net/dsa/sja1105/sja1105_devlink.c | 2 +-
drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 21 +-
drivers/net/ethernet/broadcom/bgmac.c | 2 +-
drivers/net/ethernet/broadcom/genet/bcmmii.c | 3 +
drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | 2 +-
drivers/net/ethernet/engleder/tsnep_main.c | 8 +-
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +-
drivers/net/ethernet/freescale/fec_ptp.c | 6 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 +-
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 15 +-
drivers/net/ethernet/intel/iavf/iavf_main.c | 22 +-
drivers/net/ethernet/intel/ice/ice_fltr.c | 8 +-
drivers/net/ethernet/intel/ice/ice_lib.c | 8 +-
drivers/net/ethernet/intel/ice/ice_main.c | 12 +-
drivers/net/ethernet/intel/ice/ice_switch.c | 9 +-
drivers/net/ethernet/intel/ice/ice_vf_lib.c | 15 +-
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 57 ++-
drivers/net/ethernet/intel/igb/igb.h | 2 +
drivers/net/ethernet/intel/igb/igb_main.c | 12 +-
drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 6 +
.../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 15 +-
.../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 3 +-
.../ethernet/marvell/octeontx2/nic/otx2_common.c | 19 +-
.../ethernet/marvell/octeontx2/nic/otx2_common.h | 1 +
.../net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 4 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
drivers/net/ethernet/moxa/moxart_ether.c | 20 +-
drivers/net/ethernet/mscc/ocelot.c | 51 ++-
drivers/net/ethernet/mscc/ocelot_net.c | 55 +--
drivers/net/ethernet/mscc/ocelot_vsc7514.c | 468 ++++++++++++++++----
drivers/net/ethernet/mscc/vsc7514_regs.c | 26 +-
.../net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 +
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 +
drivers/net/geneve.c | 15 +-
drivers/net/phy/phy-c45.c | 34 +-
drivers/net/phy/phy_device.c | 6 +
drivers/net/plip/plip.c | 2 +-
drivers/net/tap.c | 20 +-
drivers/net/virtio_net.c | 9 +-
drivers/net/vxlan/vxlan_core.c | 2 +-
drivers/ntb/test/ntb_tool.c | 8 +-
drivers/nvme/host/fc.c | 3 +-
drivers/nvme/target/tcp.c | 3 +-
drivers/of/overlay.c | 11 +-
drivers/pci/controller/pci-aardvark.c | 33 +-
drivers/pci/quirks.c | 3 +
drivers/phy/samsung/phy-exynos-pcie.c | 25 +-
drivers/pinctrl/intel/pinctrl-intel.c | 14 +-
drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +-
drivers/pinctrl/pinctrl-amd.c | 11 +-
drivers/pinctrl/qcom/pinctrl-msm8916.c | 4 +-
drivers/pinctrl/qcom/pinctrl-sm8250.c | 2 +-
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +
drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c | 1 +
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 7 +-
drivers/platform/chrome/cros_ec_proto.c | 8 +-
drivers/rtc/rtc-spear.c | 2 +-
drivers/s390/crypto/ap_bus.c | 3 +
drivers/s390/crypto/ap_bus.h | 4 +
drivers/scsi/lpfc/lpfc_debugfs.c | 20 +-
drivers/scsi/lpfc/lpfc_sli.c | 4 +-
drivers/scsi/scsi_transport_iscsi.c | 2 -
drivers/spi/spi-meson-spicc.c | 129 ++++--
drivers/staging/r8188eu/core/rtw_cmd.c | 15 +-
drivers/staging/r8188eu/core/rtw_efuse.c | 33 +-
drivers/staging/r8188eu/core/rtw_fw.c | 72 ++-
drivers/staging/r8188eu/core/rtw_led.c | 16 +-
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 62 ++-
drivers/staging/r8188eu/core/rtw_pwrctrl.c | 9 +-
drivers/staging/r8188eu/core/rtw_wlan_util.c | 20 +-
drivers/staging/r8188eu/hal/Hal8188ERateAdaptive.c | 21 +-
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 21 +-
drivers/staging/r8188eu/hal/HalPwrSeqCmd.c | 9 +-
drivers/staging/r8188eu/hal/hal_com.c | 27 +-
drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 37 +-
drivers/staging/r8188eu/hal/rtl8188e_dm.c | 6 +-
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 136 ++++--
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 30 +-
drivers/staging/r8188eu/hal/usb_halinit.c | 251 +++++++++--
drivers/staging/r8188eu/hal/usb_ops_linux.c | 33 +-
drivers/staging/r8188eu/include/rtw_io.h | 6 +-
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 47 +-
drivers/staging/r8188eu/os_dep/os_intfs.c | 19 +-
drivers/thunderbolt/tmu.c | 13 +-
drivers/tty/serial/ucc_uart.c | 2 +
drivers/ufs/core/ufshcd.c | 11 +-
drivers/ufs/host/ufs-exynos.c | 17 +-
drivers/ufs/host/ufs-mediatek.c | 60 ++-
drivers/usb/cdns3/cdns3-gadget.c | 2 +-
drivers/usb/dwc2/gadget.c | 3 +-
drivers/usb/gadget/function/uvc_queue.c | 17 +-
drivers/usb/gadget/function/uvc_video.c | 2 +-
drivers/usb/gadget/legacy/inode.c | 1 +
drivers/usb/host/ohci-ppc-of.c | 1 +
drivers/usb/renesas_usbhs/rza.c | 4 +
drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 +-
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 6 +
drivers/vfio/vfio.c | 1 +
drivers/video/fbdev/i740fb.c | 9 +-
drivers/virt/vboxguest/vboxguest_linux.c | 9 +-
drivers/virtio/Kconfig | 3 +-
drivers/xen/xenbus/xenbus_dev_frontend.c | 4 +-
fs/btrfs/block-group.c | 4 +-
fs/btrfs/relocation.c | 7 +-
fs/btrfs/tree-log.c | 8 +-
fs/ceph/caps.c | 27 +-
fs/ceph/mds_client.c | 7 +-
fs/ceph/mds_client.h | 6 -
fs/cifs/misc.c | 6 +
fs/cifs/smb2ops.c | 5 +-
fs/ext4/mballoc.c | 21 +-
fs/ext4/namei.c | 7 +-
fs/ext4/resize.c | 10 +
fs/f2fs/f2fs.h | 6 +
fs/f2fs/file.c | 32 +-
fs/f2fs/node.c | 6 +-
fs/f2fs/segment.c | 17 +-
fs/fscache/cookie.c | 7 +-
fs/nfs/nfs4idmap.c | 46 +-
fs/nfs/nfs4proc.c | 20 +-
fs/ntfs3/fslog.c | 2 +-
fs/ntfs3/fsntfs.c | 7 +-
fs/ntfs3/index.c | 2 +-
fs/ntfs3/inode.c | 1 +
fs/ntfs3/super.c | 8 +-
fs/ntfs3/xattr.c | 22 +-
fs/overlayfs/super.c | 7 +-
include/asm-generic/bitops/atomic.h | 6 -
include/linux/bpfptr.h | 8 +-
include/linux/io-pgtable.h | 15 +-
include/linux/nmi.h | 2 +
include/linux/sunrpc/xdr.h | 4 +-
include/linux/sunrpc/xprt.h | 3 +-
include/linux/uacce.h | 6 +-
include/linux/usb/typec_mux.h | 44 +-
include/net/mptcp.h | 4 +
include/net/netns/conntrack.h | 2 +-
include/soc/mscc/ocelot.h | 113 ++++-
include/sound/control.h | 2 +-
include/sound/core.h | 8 +
include/sound/pcm.h | 2 +-
include/uapi/linux/atm_zatm.h | 47 ++
include/uapi/linux/f2fs.h | 2 +-
include/ufs/ufshcd.h | 12 +
kernel/bpf/arraymap.c | 6 +
kernel/bpf/hashtab.c | 8 +-
kernel/bpf/syscall.c | 20 +-
kernel/dma/swiotlb.c | 6 +-
kernel/trace/trace_eprobe.c | 91 +++-
kernel/trace/trace_event_perf.c | 7 +-
kernel/trace/trace_events.c | 1 +
kernel/trace/trace_probe.c | 29 +-
kernel/watchdog.c | 21 +-
lib/list_debug.c | 12 +-
net/can/j1939/socket.c | 5 +-
net/can/j1939/transport.c | 8 +-
net/core/bpf_sk_storage.c | 12 +-
net/core/devlink.c | 4 +-
net/core/gen_stats.c | 2 +-
net/core/rtnetlink.c | 1 +
net/core/sock_map.c | 20 +-
net/dsa/port.c | 7 +-
net/ipv6/ip6_output.c | 3 +-
net/ipv6/ndisc.c | 3 +
net/mptcp/protocol.c | 47 +-
net/mptcp/protocol.h | 13 +-
net/mptcp/subflow.c | 3 +-
net/netfilter/nf_conntrack_ftp.c | 24 +-
net/netfilter/nf_conntrack_h323_main.c | 10 +-
net/netfilter/nf_conntrack_irc.c | 12 +-
net/netfilter/nf_conntrack_sane.c | 68 ++-
net/netfilter/nf_tables_api.c | 74 +++-
net/netfilter/nf_tables_core.c | 21 +-
net/netfilter/nfnetlink.c | 83 +++-
net/netlink/genetlink.c | 6 +-
net/netlink/policy.c | 14 +-
net/qrtr/mhi.c | 12 +-
net/rds/ib_recv.c | 1 +
net/sunrpc/auth.c | 2 +-
net/sunrpc/backchannel_rqst.c | 14 +
net/sunrpc/clnt.c | 1 -
net/sunrpc/sysfs.c | 6 +-
net/sunrpc/xprt.c | 27 +-
net/sunrpc/xprtsock.c | 12 +-
net/vmw_vsock/af_vsock.c | 10 +-
scripts/Makefile.gcc-plugins | 2 +-
scripts/dummy-tools/gcc | 8 +-
scripts/mod/modpost.c | 4 +-
scripts/module.lds.S | 2 +
security/apparmor/apparmorfs.c | 2 +-
security/apparmor/audit.c | 2 +-
security/apparmor/domain.c | 2 +-
security/apparmor/include/lib.h | 5 +
security/apparmor/include/policy.h | 2 +-
security/apparmor/label.c | 13 +-
security/apparmor/mount.c | 8 +-
security/apparmor/policy_unpack.c | 12 +-
sound/core/control.c | 7 +-
sound/core/info.c | 6 +-
sound/core/misc.c | 94 ++++
sound/core/pcm.c | 1 +
sound/core/pcm_lib.c | 2 +-
sound/core/pcm_native.c | 2 +-
sound/core/timer.c | 11 +-
sound/pci/hda/hda_codec.c | 14 +-
sound/pci/hda/patch_realtek.c | 3 +
sound/soc/codecs/lpass-va-macro.c | 11 +-
sound/soc/codecs/nau8821.c | 10 -
sound/soc/codecs/tas2770.c | 98 ++--
sound/soc/codecs/tas2770.h | 5 +
sound/soc/codecs/tlv320aic32x4.c | 9 +
sound/soc/intel/avs/core.c | 1 +
sound/soc/intel/avs/pcm.c | 4 +-
sound/soc/intel/boards/sof_es8336.c | 35 +-
sound/soc/intel/boards/sof_nau8825.c | 10 +-
sound/soc/qcom/qdsp6/q6apm-dai.c | 6 +
sound/soc/sh/rcar/ssiu.c | 2 +
sound/soc/soc-pcm.c | 3 +
sound/soc/sof/debug.c | 6 +-
sound/soc/sof/intel/cnl.c | 37 +-
sound/soc/sof/intel/hda-ipc.c | 39 +-
sound/soc/sof/intel/hda.c | 9 +-
sound/soc/sof/sof-client-probes.c | 4 +
sound/usb/card.c | 8 +
sound/usb/mixer_maps.c | 34 +-
tools/build/feature/test-libcrypto.c | 15 +-
tools/lib/bpf/skel_internal.h | 4 +-
tools/objtool/check.c | 3 +-
tools/perf/tests/switch-tracking.c | 18 +-
tools/perf/util/parse-events.c | 14 +-
tools/perf/util/probe-event.c | 6 +-
tools/testing/cxl/test/cxl.c | 1 -
tools/testing/cxl/test/mock.c | 8 +-
.../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 -
.../net/forwarding/custom_multipath_hash.sh | 24 +-
.../net/forwarding/gre_custom_multipath_hash.sh | 24 +-
.../net/forwarding/ip6gre_custom_multipath_hash.sh | 24 +-
tools/testing/selftests/net/mptcp/mptcp_connect.c | 26 +-
tools/tracing/rtla/Makefile | 4 +-
tools/vm/slabinfo.c | 32 +-
virt/kvm/kvm_main.c | 14 +-
391 files changed, 5480 insertions(+), 2432 deletions(-)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 001/365] ALSA: info: Fix llseek return value when using callback
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 002/365] ALSA: hda/realtek: Add quirk for Clevo NS50PU, NS70PU Greg Kroah-Hartman
` (368 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Amadeusz Sławiński, Takashi Iwai
From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
commit 9be080edcca330be4af06b19916c35227891e8bc upstream.
When using callback there was a flow of
ret = -EINVAL
if (callback) {
offset = callback();
goto out;
}
...
offset = some other value in case of no callback;
ret = offset;
out:
return ret;
which causes the snd_info_entry_llseek() to return -EINVAL when there is
callback handler. Fix this by setting "ret" directly to callback return
value before jumping to "out".
Fixes: 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220817124924.3974577-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/core/info.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -111,9 +111,9 @@ static loff_t snd_info_entry_llseek(stru
entry = data->entry;
mutex_lock(&entry->access);
if (entry->c.ops->llseek) {
- offset = entry->c.ops->llseek(entry,
- data->file_private_data,
- file, offset, orig);
+ ret = entry->c.ops->llseek(entry,
+ data->file_private_data,
+ file, offset, orig);
goto out;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 002/365] ALSA: hda/realtek: Add quirk for Clevo NS50PU, NS70PU
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 001/365] ALSA: info: Fix llseek return value when using callback Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 003/365] RDMA: Handle the return code from dma_resv_wait_timeout() properly Greg Kroah-Hartman
` (367 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Christoffer Sandberg, Werner Sembach,
Takashi Iwai
From: Christoffer Sandberg <cs@tuxedo.de>
commit 90d74fdbd8059bf041ac797092c9b1d461555280 upstream.
Fixes headset microphone detection on Clevo NS50PU and NS70PU.
Signed-off-by: Christoffer Sandberg <cs@tuxedo.de>
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220817135144.34103-1-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9352,6 +9352,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 003/365] RDMA: Handle the return code from dma_resv_wait_timeout() properly
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 001/365] ALSA: info: Fix llseek return value when using callback Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 002/365] ALSA: hda/realtek: Add quirk for Clevo NS50PU, NS70PU Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 004/365] KVM: Unconditionally get a ref to /dev/kvm module when creating a VM Greg Kroah-Hartman
` (366 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, stable, Maor Gottlieb,
Jason Gunthorpe, Leon Romanovsky
From: Jason Gunthorpe <jgg@nvidia.com>
commit b16de8b9e7d1aae169d059c3a0dd9a881a3c0d1d upstream.
ib_umem_dmabuf_map_pages() returns 0 on success and -ERRNO on failure.
dma_resv_wait_timeout() uses a different scheme:
* Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or
* greater than zero on success.
This results in ib_umem_dmabuf_map_pages() being non-functional as a
positive return will be understood to be an error by drivers.
Fixes: f30bceab16d1 ("RDMA: use dma_resv_wait() instead of extracting the fence")
Cc: stable@kernel.org
Link: https://lore.kernel.org/r/0-v1-d8f4e1fa84c8+17-rdma_dmabuf_fix_jgg@nvidia.com
Tested-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/core/umem_dmabuf.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c
index fce80a4a5147..04c04e6d24c3 100644
--- a/drivers/infiniband/core/umem_dmabuf.c
+++ b/drivers/infiniband/core/umem_dmabuf.c
@@ -18,6 +18,7 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
struct scatterlist *sg;
unsigned long start, end, cur = 0;
unsigned int nmap = 0;
+ long ret;
int i;
dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv);
@@ -67,9 +68,14 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
* may be not up-to-date. Wait for the exporter to finish
* the migration.
*/
- return dma_resv_wait_timeout(umem_dmabuf->attach->dmabuf->resv,
+ ret = dma_resv_wait_timeout(umem_dmabuf->attach->dmabuf->resv,
DMA_RESV_USAGE_KERNEL,
false, MAX_SCHEDULE_TIMEOUT);
+ if (ret < 0)
+ return ret;
+ if (ret == 0)
+ return -ETIMEDOUT;
+ return 0;
}
EXPORT_SYMBOL(ib_umem_dmabuf_map_pages);
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 004/365] KVM: Unconditionally get a ref to /dev/kvm module when creating a VM
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 003/365] RDMA: Handle the return code from dma_resv_wait_timeout() properly Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 005/365] x86/mm: Use proper mask when setting PUD mapping Greg Kroah-Hartman
` (365 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, David Matlack, Sean Christopherson,
Paolo Bonzini
From: Sean Christopherson <seanjc@google.com>
commit 405294f29faee5de8c10cb9d4a90e229c2835279 upstream.
Unconditionally get a reference to the /dev/kvm module when creating a VM
instead of using try_get_module(), which will fail if the module is in
the process of being forcefully unloaded. The error handling when
try_get_module() fails doesn't properly unwind all that has been done,
e.g. doesn't call kvm_arch_pre_destroy_vm() and doesn't remove the VM
from the global list. Not removing VMs from the global list tends to be
fatal, e.g. leads to use-after-free explosions.
The obvious alternative would be to add proper unwinding, but the
justification for using try_get_module(), "rmmod --wait", is completely
bogus as support for "rmmod --wait", i.e. delete_module() without
O_NONBLOCK, was removed by commit 3f2b9c9cdf38 ("module: remove rmmod
--wait option.") nearly a decade ago.
It's still possible for try_get_module() to fail due to the module dying
(more like being killed), as the module will be tagged MODULE_STATE_GOING
by "rmmod --force", i.e. delete_module(..., O_TRUNC), but playing nice
with forced unloading is an exercise in futility and gives a falsea sense
of security. Using try_get_module() only prevents acquiring _new_
references, it doesn't magically put the references held by other VMs,
and forced unloading doesn't wait, i.e. "rmmod --force" on KVM is all but
guaranteed to cause spectacular fireworks; the window where KVM will fail
try_get_module() is tiny compared to the window where KVM is building and
running the VM with an elevated module refcount.
Addressing KVM's inability to play nice with "rmmod --force" is firmly
out-of-scope. Forcefully unloading any module taints kernel (for obvious
reasons) _and_ requires the kernel to be built with
CONFIG_MODULE_FORCE_UNLOAD=y, which is off by default and comes with the
amusing disclaimer that it's "mainly for kernel developers and desperate
users". In other words, KVM is free to scoff at bug reports due to using
"rmmod --force" while VMs may be running.
Fixes: 5f6de5cbebee ("KVM: Prevent module exit until all VMs are freed")
Cc: stable@vger.kernel.org
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220816053937.2477106-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
virt/kvm/kvm_main.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1085,6 +1085,9 @@ static struct kvm *kvm_create_vm(unsigne
if (!kvm)
return ERR_PTR(-ENOMEM);
+ /* KVM is pinned via open("/dev/kvm"), the fd passed to this ioctl(). */
+ __module_get(kvm_chardev_ops.owner);
+
KVM_MMU_LOCK_INIT(kvm);
mmgrab(current->mm);
kvm->mm = current->mm;
@@ -1170,16 +1173,6 @@ static struct kvm *kvm_create_vm(unsigne
preempt_notifier_inc();
kvm_init_pm_notifier(kvm);
- /*
- * When the fd passed to this ioctl() is opened it pins the module,
- * but try_module_get() also prevents getting a reference if the module
- * is in MODULE_STATE_GOING (e.g. if someone ran "rmmod --wait").
- */
- if (!try_module_get(kvm_chardev_ops.owner)) {
- r = -ENODEV;
- goto out_err;
- }
-
return kvm;
out_err:
@@ -1201,6 +1194,7 @@ out_err_no_irq_srcu:
out_err_no_srcu:
kvm_arch_free_vm(kvm);
mmdrop(current->mm);
+ module_put(kvm_chardev_ops.owner);
return ERR_PTR(r);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 005/365] x86/mm: Use proper mask when setting PUD mapping
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 004/365] KVM: Unconditionally get a ref to /dev/kvm module when creating a VM Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 006/365] rds: add missing barrier to release_refill Greg Kroah-Hartman
` (364 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Aaron Lu, stable, Linus Torvalds
From: Aaron Lu <aaron.lu@intel.com>
commit 88e0a74902f894fbbc55ad3ad2cb23b4bfba555c upstream.
Commit c164fbb40c43f("x86/mm: thread pgprot_t through
init_memory_mapping()") mistakenly used __pgprot() which doesn't respect
__default_kernel_pte_mask when setting PUD mapping.
Fix it by only setting the one bit we actually need (PSE) and leaving
the other bits (that have been properly masked) alone.
Fixes: c164fbb40c43 ("x86/mm: thread pgprot_t through init_memory_mapping()")
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/mm/init_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -645,7 +645,7 @@ phys_pud_init(pud_t *pud_page, unsigned
pages++;
spin_lock(&init_mm.page_table_lock);
- prot = __pgprot(pgprot_val(prot) | __PAGE_KERNEL_LARGE);
+ prot = __pgprot(pgprot_val(prot) | _PAGE_PSE);
set_pte_init((pte_t *)pud,
pfn_pte((paddr & PUD_MASK) >> PAGE_SHIFT,
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 006/365] rds: add missing barrier to release_refill
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 005/365] x86/mm: Use proper mask when setting PUD mapping Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 007/365] drm/i915/gem: Remove shared locking on freeing objects Greg Kroah-Hartman
` (363 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Mikulas Patocka, David S. Miller
From: Mikulas Patocka <mpatocka@redhat.com>
commit 9f414eb409daf4f778f011cf8266d36896bb930b upstream.
The functions clear_bit and set_bit do not imply a memory barrier, thus it
may be possible that the waitqueue_active function (which does not take
any locks) is moved before clear_bit and it could miss a wakeup event.
Fix this bug by adding a memory barrier after clear_bit.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/rds/ib_recv.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -363,6 +363,7 @@ static int acquire_refill(struct rds_con
static void release_refill(struct rds_connection *conn)
{
clear_bit(RDS_RECV_REFILL, &conn->c_flags);
+ smp_mb__after_atomic();
/* We don't use wait_on_bit()/wake_up_bit() because our waking is in a
* hot path and finding waiters is very rare. We don't want to walk
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 007/365] drm/i915/gem: Remove shared locking on freeing objects
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 006/365] rds: add missing barrier to release_refill Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 008/365] locking/atomic: Make test_and_*_bit() ordered on failure Greg Kroah-Hartman
` (362 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chris Wilson, Nirmoy Das,
Matthew Auld, Rodrigo Vivi
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 2826d447fbd60e6a05e53d5f918bceb8c04e315c upstream.
The obj->base.resv may be shared across many objects, some of which may
still be live and locked, preventing objects from being freed
indefintely. We could individualise the lock during the free, or rely on
a freed object having no contention and being able to immediately free
the pages it owns.
Fixes: be7612fd6665 ("drm/i915: Require object lock when freeing pages during destruction")
Fixes: 6cb12fbda1c2 ("drm/i915: Use trylock instead of blocking lock for __i915_gem_free_objects.")
Cc: <stable@vger.kernel.org> # v5.17+
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Nirmoy Das <nirmoy.das@intel.com>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220726144844.18429-1-nirmoy.das@intel.com
(cherry picked from commit 7dd5c56531eb03696acdb17774721de5ef481c0b)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/gem/i915_gem_object.c | 16 ++++------------
drivers/gpu/drm/i915/i915_drv.h | 4 ++--
2 files changed, 6 insertions(+), 14 deletions(-)
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -268,7 +268,7 @@ static void __i915_gem_object_free_mmaps
*/
void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
{
- assert_object_held(obj);
+ assert_object_held_shared(obj);
if (!list_empty(&obj->vma.list)) {
struct i915_vma *vma;
@@ -331,15 +331,7 @@ static void __i915_gem_free_objects(stru
continue;
}
- if (!i915_gem_object_trylock(obj, NULL)) {
- /* busy, toss it back to the pile */
- if (llist_add(&obj->freed, &i915->mm.free_list))
- queue_delayed_work(i915->wq, &i915->mm.free_work, msecs_to_jiffies(10));
- continue;
- }
-
__i915_gem_object_pages_fini(obj);
- i915_gem_object_unlock(obj);
__i915_gem_free_object(obj);
/* But keep the pointer alive for RCU-protected lookups */
@@ -359,7 +351,7 @@ void i915_gem_flush_free_objects(struct
static void __i915_gem_free_work(struct work_struct *work)
{
struct drm_i915_private *i915 =
- container_of(work, struct drm_i915_private, mm.free_work.work);
+ container_of(work, struct drm_i915_private, mm.free_work);
i915_gem_flush_free_objects(i915);
}
@@ -391,7 +383,7 @@ static void i915_gem_free_object(struct
*/
if (llist_add(&obj->freed, &i915->mm.free_list))
- queue_delayed_work(i915->wq, &i915->mm.free_work, 0);
+ queue_work(i915->wq, &i915->mm.free_work);
}
void __i915_gem_object_flush_frontbuffer(struct drm_i915_gem_object *obj,
@@ -719,7 +711,7 @@ bool i915_gem_object_placement_possible(
void i915_gem_init__objects(struct drm_i915_private *i915)
{
- INIT_DELAYED_WORK(&i915->mm.free_work, __i915_gem_free_work);
+ INIT_WORK(&i915->mm.free_work, __i915_gem_free_work);
}
void i915_objects_module_exit(void)
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -254,7 +254,7 @@ struct i915_gem_mm {
* List of objects which are pending destruction.
*/
struct llist_head free_list;
- struct delayed_work free_work;
+ struct work_struct free_work;
/**
* Count of objects pending destructions. Used to skip needlessly
* waiting on an RCU barrier if no objects are waiting to be freed.
@@ -1415,7 +1415,7 @@ static inline void i915_gem_drain_freed_
* armed the work again.
*/
while (atomic_read(&i915->mm.free_count)) {
- flush_delayed_work(&i915->mm.free_work);
+ flush_work(&i915->mm.free_work);
flush_delayed_work(&i915->bdev.wq);
rcu_barrier();
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 008/365] locking/atomic: Make test_and_*_bit() ordered on failure
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 007/365] drm/i915/gem: Remove shared locking on freeing objects Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 009/365] drm/nouveau: recognise GA103 Greg Kroah-Hartman
` (361 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Linus Torvalds, Hector Martin,
Will Deacon, Arnd Bergmann
From: Hector Martin <marcan@marcan.st>
commit 415d832497098030241605c52ea83d4e2cfa7879 upstream.
These operations are documented as always ordered in
include/asm-generic/bitops/instrumented-atomic.h, and producer-consumer
type use cases where one side needs to ensure a flag is left pending
after some shared data was updated rely on this ordering, even in the
failure case.
This is the case with the workqueue code, which currently suffers from a
reproducible ordering violation on Apple M1 platforms (which are
notoriously out-of-order) that ends up causing the TTY layer to fail to
deliver data to userspace properly under the right conditions. This
change fixes that bug.
Change the documentation to restrict the "no order on failure" story to
the _lock() variant (for which it makes sense), and remove the
early-exit from the generic implementation, which is what causes the
missing barrier semantics in that case. Without this, the remaining
atomic op is fully ordered (including on ARM64 LSE, as of recent
versions of the architecture spec).
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@vger.kernel.org
Fixes: e986a0d6cb36 ("locking/atomics, asm-generic/bitops/atomic.h: Rewrite using atomic_*() APIs")
Fixes: 61e02392d3c7 ("locking/atomic/bitops: Document and clarify ordering semantics for failed test_and_{}_bit()")
Signed-off-by: Hector Martin <marcan@marcan.st>
Acked-by: Will Deacon <will@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/atomic_bitops.txt | 2 +-
include/asm-generic/bitops/atomic.h | 6 ------
2 files changed, 1 insertion(+), 7 deletions(-)
--- a/Documentation/atomic_bitops.txt
+++ b/Documentation/atomic_bitops.txt
@@ -59,7 +59,7 @@ Like with atomic_t, the rule of thumb is
- RMW operations that have a return value are fully ordered.
- RMW operations that are conditional are unordered on FAILURE,
- otherwise the above rules apply. In the case of test_and_{}_bit() operations,
+ otherwise the above rules apply. In the case of test_and_set_bit_lock(),
if the bit in memory is unchanged by the operation then it is deemed to have
failed.
--- a/include/asm-generic/bitops/atomic.h
+++ b/include/asm-generic/bitops/atomic.h
@@ -39,9 +39,6 @@ arch_test_and_set_bit(unsigned int nr, v
unsigned long mask = BIT_MASK(nr);
p += BIT_WORD(nr);
- if (READ_ONCE(*p) & mask)
- return 1;
-
old = arch_atomic_long_fetch_or(mask, (atomic_long_t *)p);
return !!(old & mask);
}
@@ -53,9 +50,6 @@ arch_test_and_clear_bit(unsigned int nr,
unsigned long mask = BIT_MASK(nr);
p += BIT_WORD(nr);
- if (!(READ_ONCE(*p) & mask))
- return 0;
-
old = arch_atomic_long_fetch_andnot(mask, (atomic_long_t *)p);
return !!(old & mask);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 009/365] drm/nouveau: recognise GA103
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 008/365] locking/atomic: Make test_and_*_bit() ordered on failure Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 010/365] drm/ttm: Fix dummy res NULL ptr deref bug Greg Kroah-Hartman
` (360 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Karol Herbst, Lyude Paul
From: Karol Herbst <kherbst@redhat.com>
commit c20ee5749a3f688d9bab83a3b09b75587153ff13 upstream.
Appears to be ok with general GA10x code.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Cc: <stable@vger.kernel.org> # v5.15+
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220803142745.2679510-1-kherbst@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -2606,6 +2606,27 @@ nv172_chipset = {
};
static const struct nvkm_device_chip
+nv173_chipset = {
+ .name = "GA103",
+ .bar = { 0x00000001, tu102_bar_new },
+ .bios = { 0x00000001, nvkm_bios_new },
+ .devinit = { 0x00000001, ga100_devinit_new },
+ .fb = { 0x00000001, ga102_fb_new },
+ .gpio = { 0x00000001, ga102_gpio_new },
+ .i2c = { 0x00000001, gm200_i2c_new },
+ .imem = { 0x00000001, nv50_instmem_new },
+ .mc = { 0x00000001, ga100_mc_new },
+ .mmu = { 0x00000001, tu102_mmu_new },
+ .pci = { 0x00000001, gp100_pci_new },
+ .privring = { 0x00000001, gm200_privring_new },
+ .timer = { 0x00000001, gk20a_timer_new },
+ .top = { 0x00000001, ga100_top_new },
+ .disp = { 0x00000001, ga102_disp_new },
+ .dma = { 0x00000001, gv100_dma_new },
+ .fifo = { 0x00000001, ga102_fifo_new },
+};
+
+static const struct nvkm_device_chip
nv174_chipset = {
.name = "GA104",
.bar = { 0x00000001, tu102_bar_new },
@@ -3092,6 +3113,7 @@ nvkm_device_ctor(const struct nvkm_devic
case 0x167: device->chip = &nv167_chipset; break;
case 0x168: device->chip = &nv168_chipset; break;
case 0x172: device->chip = &nv172_chipset; break;
+ case 0x173: device->chip = &nv173_chipset; break;
case 0x174: device->chip = &nv174_chipset; break;
case 0x176: device->chip = &nv176_chipset; break;
case 0x177: device->chip = &nv177_chipset; break;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 010/365] drm/ttm: Fix dummy res NULL ptr deref bug
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 009/365] drm/nouveau: recognise GA103 Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 011/365] drm/amdgpu: Only disable prefer_shadow on hawaii Greg Kroah-Hartman
` (359 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Arunpravin Paneer Selvam,
kernel test robot, Christian König
From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
commit cf4b7387c0a842d64bdd7c353e6d3298174a7740 upstream.
Check the bo->resource value before accessing the resource
mem_type.
v2: Fix commit description unwrapped warning
<log snip>
[ 40.191227][ T184] general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] SMP KASAN PTI
[ 40.192995][ T184] KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
[ 40.194411][ T184] CPU: 1 PID: 184 Comm: systemd-udevd Not tainted 5.19.0-rc4-00721-gb297c22b7070 #1
[ 40.196063][ T184] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014
[ 40.199605][ T184] RIP: 0010:ttm_bo_validate+0x1b3/0x240 [ttm]
[ 40.200754][ T184] Code: e8 72 c5 ff ff 83 f8 b8 74 d4 85 c0 75 54 49 8b 9e 58 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 10 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 44 8b 53 10 31 c0 85 d2 0f 85 58
[ 40.203685][ T184] RSP: 0018:ffffc900006df0c8 EFLAGS: 00010202
[ 40.204630][ T184] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff1102f4bb71b
[ 40.205864][ T184] RDX: 0000000000000002 RSI: ffffc900006df208 RDI: 0000000000000010
[ 40.207102][ T184] RBP: 1ffff920000dbe1a R08: ffffc900006df208 R09: 0000000000000000
[ 40.208394][ T184] R10: ffff88817a5f0000 R11: 0000000000000001 R12: ffffc900006df110
[ 40.209692][ T184] R13: ffffc900006df0f0 R14: ffff88817a5db800 R15: ffffc900006df208
[ 40.210862][ T184] FS: 00007f6b1d16e8c0(0000) GS:ffff88839d700000(0000) knlGS:0000000000000000
[ 40.212250][ T184] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 40.213275][ T184] CR2: 000055a1001d4ff0 CR3: 00000001700f4000 CR4: 00000000000006e0
[ 40.214469][ T184] Call Trace:
[ 40.214974][ T184] <TASK>
[ 40.215438][ T184] ? ttm_bo_bounce_temp_buffer+0x140/0x140 [ttm]
[ 40.216572][ T184] ? mutex_spin_on_owner+0x240/0x240
[ 40.217456][ T184] ? drm_vma_offset_add+0xaa/0x100 [drm]
[ 40.218457][ T184] ttm_bo_init_reserved+0x3d6/0x540 [ttm]
[ 40.219410][ T184] ? shmem_get_inode+0x744/0x980
[ 40.220231][ T184] ttm_bo_init_validate+0xb1/0x200 [ttm]
[ 40.221172][ T184] ? bo_driver_evict_flags+0x340/0x340 [drm_vram_helper]
[ 40.222530][ T184] ? ttm_bo_init_reserved+0x540/0x540 [ttm]
[ 40.223643][ T184] ? __do_sys_finit_module+0x11a/0x1c0
[ 40.224654][ T184] ? __shmem_file_setup+0x102/0x280
[ 40.234764][ T184] drm_gem_vram_create+0x305/0x480 [drm_vram_helper]
[ 40.235766][ T184] ? bo_driver_evict_flags+0x340/0x340 [drm_vram_helper]
[ 40.236846][ T184] ? __kasan_slab_free+0x108/0x180
[ 40.237650][ T184] drm_gem_vram_fill_create_dumb+0x134/0x340 [drm_vram_helper]
[ 40.238864][ T184] ? local_pci_probe+0xdf/0x180
[ 40.239674][ T184] ? drmm_vram_helper_init+0x400/0x400 [drm_vram_helper]
[ 40.240826][ T184] drm_client_framebuffer_create+0x19c/0x400 [drm]
[ 40.241955][ T184] ? drm_client_buffer_delete+0x200/0x200 [drm]
[ 40.243001][ T184] ? drm_client_pick_crtcs+0x554/0xb80 [drm]
[ 40.244030][ T184] drm_fb_helper_generic_probe+0x23f/0x940 [drm_kms_helper]
[ 40.245226][ T184] ? __cond_resched+0x1c/0xc0
[ 40.245987][ T184] ? drm_fb_helper_memory_range_to_clip+0x180/0x180 [drm_kms_helper]
[ 40.247316][ T184] ? mutex_unlock+0x80/0x100
[ 40.248005][ T184] ? __mutex_unlock_slowpath+0x2c0/0x2c0
[ 40.249083][ T184] drm_fb_helper_single_fb_probe+0x907/0xf00 [drm_kms_helper]
[ 40.250314][ T184] ? drm_fb_helper_check_var+0x1180/0x1180 [drm_kms_helper]
[ 40.251540][ T184] ? __cond_resched+0x1c/0xc0
[ 40.252321][ T184] ? mutex_lock+0x9f/0x100
[ 40.253062][ T184] __drm_fb_helper_initial_config_and_unlock+0xb9/0x2c0 [drm_kms_helper]
[ 40.254394][ T184] drm_fbdev_client_hotplug+0x56f/0x840 [drm_kms_helper]
[ 40.255477][ T184] drm_fbdev_generic_setup+0x165/0x3c0 [drm_kms_helper]
[ 40.256607][ T184] bochs_pci_probe+0x6b7/0x900 [bochs]
[ 40.257515][ T184] ? _raw_spin_lock_irqsave+0x87/0x100
[ 40.258312][ T184] ? bochs_hw_init+0x480/0x480 [bochs]
[ 40.259244][ T184] ? bochs_hw_init+0x480/0x480 [bochs]
[ 40.260186][ T184] local_pci_probe+0xdf/0x180
[ 40.260928][ T184] pci_call_probe+0x15f/0x500
[ 40.265798][ T184] ? _raw_spin_lock+0x81/0x100
[ 40.266508][ T184] ? pci_pm_suspend_noirq+0x980/0x980
[ 40.267322][ T184] ? pci_assign_irq+0x81/0x280
[ 40.268096][ T184] ? pci_match_device+0x351/0x6c0
[ 40.268883][ T184] ? kernfs_put+0x18/0x40
[ 40.269611][ T184] pci_device_probe+0xee/0x240
[ 40.270352][ T184] really_probe+0x435/0xa80
[ 40.271021][ T184] __driver_probe_device+0x2ab/0x480
[ 40.271828][ T184] driver_probe_device+0x49/0x140
[ 40.272627][ T184] __driver_attach+0x1bd/0x4c0
[ 40.273372][ T184] ? __device_attach_driver+0x240/0x240
[ 40.274273][ T184] bus_for_each_dev+0x11e/0x1c0
[ 40.275080][ T184] ? subsys_dev_iter_exit+0x40/0x40
[ 40.275951][ T184] ? klist_add_tail+0x132/0x280
[ 40.276767][ T184] bus_add_driver+0x39b/0x580
[ 40.277574][ T184] driver_register+0x20f/0x3c0
[ 40.278281][ T184] ? 0xffffffffc04a2000
[ 40.278894][ T184] do_one_initcall+0x8a/0x300
[ 40.279642][ T184] ? trace_event_raw_event_initcall_level+0x1c0/0x1c0
[ 40.280707][ T184] ? kasan_unpoison+0x23/0x80
[ 40.281479][ T184] ? kasan_unpoison+0x23/0x80
[ 40.282197][ T184] do_init_module+0x190/0x640
[ 40.282926][ T184] load_module+0x221b/0x2780
[ 40.283611][ T184] ? layout_and_allocate+0x5c0/0x5c0
[ 40.284401][ T184] ? kernel_read_file+0x286/0x6c0
[ 40.285216][ T184] ? __x64_sys_fspick+0x2c0/0x2c0
[ 40.286043][ T184] ? mmap_region+0x4e7/0x1300
[ 40.286832][ T184] ? __do_sys_finit_module+0x11a/0x1c0
[ 40.287743][ T184] __do_sys_finit_module+0x11a/0x1c0
[ 40.288636][ T184] ? __ia32_sys_init_module+0xc0/0xc0
[ 40.289557][ T184] ? __seccomp_filter+0x15e/0xc80
[ 40.290341][ T184] ? vm_mmap_pgoff+0x185/0x240
[ 40.291060][ T184] do_syscall_64+0x3b/0xc0
[ 40.291763][ T184] entry_SYSCALL_64_after_hwframe+0x46/0xb0
[ 40.292678][ T184] RIP: 0033:0x7f6b1d6279b9
[ 40.293438][ T184] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a7 54 0c 00 f7 d8 64 89 01 48
[ 40.296302][ T184] RSP: 002b:00007ffe7f51b798 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 40.297633][ T184] RAX: ffffffffffffffda RBX: 00005642dcca2880 RCX: 00007f6b1d6279b9
[ 40.298890][ T184] RDX: 0000000000000000 RSI: 00007f6b1d7b2e2d RDI: 0000000000000016
[ 40.300199][ T184] RBP: 0000000000020000 R08: 0000000000000000 R09: 00005642dccd5530
[ 40.301547][ T184] R10: 0000000000000016 R11: 0000000000000246 R12: 00007f6b1d7b2e2d
[ 40.302698][ T184] R13: 0000000000000000 R14: 00005642dcca4230 R15: 00005642dcca2880
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reported-by: kernel test robot <oliver.sang@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220726162205.2778-1-Arunpravin.PaneerSelvam@amd.com
Link: https://patchwork.freedesktop.org/patch/msgid/20220809095623.3569-1-Arunpravin.PaneerSelvam@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -918,7 +918,7 @@ int ttm_bo_validate(struct ttm_buffer_ob
/*
* We might need to add a TTM.
*/
- if (bo->resource->mem_type == TTM_PL_SYSTEM) {
+ if (!bo->resource || bo->resource->mem_type == TTM_PL_SYSTEM) {
ret = ttm_tt_create(bo, true);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 011/365] drm/amdgpu: Only disable prefer_shadow on hawaii
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 010/365] drm/ttm: Fix dummy res NULL ptr deref bug Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 012/365] drm/amd/display: Check correct bounds for stream encoder instances for DCN303 Greg Kroah-Hartman
` (358 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Alex Deucher, Mario Limonciello
From: Alex Deucher <alexander.deucher@amd.com>
commit a6250bdb6c4677ee77d699b338e077b900f94c0c upstream.
We changed it for all asics due to a hibernation regression
on hawaii, but the workaround breaks suspend on a polaris12.
Just disable it for hawaii.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216119
Fixes: 3a4b1cc28fbd ("drm/amdgpu/display: disable prefer_shadow for generic fb helpers")
Reviewed-and-tested-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 +--
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 +--
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 +--
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 +--
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 +++++--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
6 files changed, 14 insertions(+), 12 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -496,8 +496,7 @@ static int amdgpu_vkms_sw_init(void *han
adev_to_drm(adev)->mode_config.max_height = YRES_MAX;
adev_to_drm(adev)->mode_config.preferred_depth = 24;
- /* disable prefer shadow for now due to hibernation issues */
- adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ adev_to_drm(adev)->mode_config.prefer_shadow = 1;
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -2796,8 +2796,7 @@ static int dce_v10_0_sw_init(void *handl
adev_to_drm(adev)->mode_config.max_height = 16384;
adev_to_drm(adev)->mode_config.preferred_depth = 24;
- /* disable prefer shadow for now due to hibernation issues */
- adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ adev_to_drm(adev)->mode_config.prefer_shadow = 1;
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -2914,8 +2914,7 @@ static int dce_v11_0_sw_init(void *handl
adev_to_drm(adev)->mode_config.max_height = 16384;
adev_to_drm(adev)->mode_config.preferred_depth = 24;
- /* disable prefer shadow for now due to hibernation issues */
- adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ adev_to_drm(adev)->mode_config.prefer_shadow = 1;
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -2673,8 +2673,7 @@ static int dce_v6_0_sw_init(void *handle
adev_to_drm(adev)->mode_config.max_width = 16384;
adev_to_drm(adev)->mode_config.max_height = 16384;
adev_to_drm(adev)->mode_config.preferred_depth = 24;
- /* disable prefer shadow for now due to hibernation issues */
- adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ adev_to_drm(adev)->mode_config.prefer_shadow = 1;
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -2693,8 +2693,11 @@ static int dce_v8_0_sw_init(void *handle
adev_to_drm(adev)->mode_config.max_height = 16384;
adev_to_drm(adev)->mode_config.preferred_depth = 24;
- /* disable prefer shadow for now due to hibernation issues */
- adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ if (adev->asic_type == CHIP_HAWAII)
+ /* disable prefer shadow for now due to hibernation issues */
+ adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ else
+ adev_to_drm(adev)->mode_config.prefer_shadow = 1;
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3894,8 +3894,11 @@ static int amdgpu_dm_mode_config_init(st
adev_to_drm(adev)->mode_config.max_height = 16384;
adev_to_drm(adev)->mode_config.preferred_depth = 24;
- /* disable prefer shadow for now due to hibernation issues */
- adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ if (adev->asic_type == CHIP_HAWAII)
+ /* disable prefer shadow for now due to hibernation issues */
+ adev_to_drm(adev)->mode_config.prefer_shadow = 0;
+ else
+ adev_to_drm(adev)->mode_config.prefer_shadow = 1;
/* indicates support for immediate flip */
adev_to_drm(adev)->mode_config.async_page_flip = true;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 012/365] drm/amd/display: Check correct bounds for stream encoder instances for DCN303
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 011/365] drm/amdgpu: Only disable prefer_shadow on hawaii Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 013/365] s390/ap: fix crash on older machines based on QCI info missing Greg Kroah-Hartman
` (357 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Chris Park,
Rodrigo Siqueira, Tom Chung, Aurabindo Pillai, Daniel Wheeler,
Alex Deucher
From: Aurabindo Pillai <aurabindo.pillai@amd.com>
commit 89b008222c2bf21e50219725caed31590edfd9d1 upstream.
[Why & How]
eng_id for DCN303 cannot be more than 1, since we have only two
instances of stream encoders.
Check the correct boundary condition for engine ID for DCN303 prevent
the potential out of bounds access.
Fixes: cd6d421e3d1a ("drm/amd/display: Initial DC support for Beige Goby")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@vger.kernel.org
Reviewed-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
@@ -372,7 +372,7 @@ static struct stream_encoder *dcn303_str
int afmt_inst;
/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
- if (eng_id <= ENGINE_ID_DIGE) {
+ if (eng_id <= ENGINE_ID_DIGB) {
vpg_inst = eng_id;
afmt_inst = eng_id;
} else
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 013/365] s390/ap: fix crash on older machines based on QCI info missing
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 012/365] drm/amd/display: Check correct bounds for stream encoder instances for DCN303 Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 014/365] ata: libata-eh: Add missing command name Greg Kroah-Hartman
` (356 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Harald Freudenberger, Tony Krowiak,
Alexander Gordeev
From: Harald Freudenberger <freude@linux.ibm.com>
commit 0fef40be5d1f8e7af3d61e8827a63c5862cd99f7 upstream.
On older z series machines (z12 and older) there is no QCI info
available. The AP code took care of this and the AP bus scan then
switched to simple probing via TAPQ.
With commit
283915850a44 ("s390/ap: notify drivers on config changed and scan complete callbacks")
some code was introduced which silently assumed that the QCI info is
always available. However, with KVM simulating an older machine (z12)
the result was a kernel crash. Funnily the same crash does not happen
on LPAR - maybe because NULL is a valid pointer and reading some data
from address 0 also works fine.
This fix now improves the code to be aware that the QCI instruction
may not be available on older machines and thus the two pointers to
QCI info structs may simple be NULL.
However, on a machine not providing the QCI info the two callbacks to
the zcrypt device drivers on_config_changed() and on_scan_complete()
provide parameters which are pointers to a QCI info struct.
These both callbacks are NOT served if there is no QCI info available.
The only consumer of these callbacks is the vfio device driver. This
driver only supports CEX4 and higher. All physical machines which are
able to provide CEX4 cards have QCI support available. So there is
no sense in for example fill the QCI info struct by hand with looping
over cards and queues and TAPQ each APQN.
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Cc: stable@vger.kernel.org
Fixes: 283915850a44 ("s390/ap: notify drivers on config changed and scan complete callbacks")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/crypto/ap_bus.c | 3 +++
drivers/s390/crypto/ap_bus.h | 4 ++++
2 files changed, 7 insertions(+)
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -2068,6 +2068,9 @@ static inline void ap_scan_adapter(int a
*/
static bool ap_get_configuration(void)
{
+ if (!ap_qci_info) /* QCI not supported */
+ return false;
+
memcpy(ap_qci_info_old, ap_qci_info, sizeof(*ap_qci_info));
ap_fetch_qci_info(ap_qci_info);
--- a/drivers/s390/crypto/ap_bus.h
+++ b/drivers/s390/crypto/ap_bus.h
@@ -148,12 +148,16 @@ struct ap_driver {
/*
* Called at the start of the ap bus scan function when
* the crypto config information (qci) has changed.
+ * This callback is not invoked if there is no AP
+ * QCI support available.
*/
void (*on_config_changed)(struct ap_config_info *new_config_info,
struct ap_config_info *old_config_info);
/*
* Called at the end of the ap bus scan function when
* the crypto config information (qci) has changed.
+ * This callback is not invoked if there is no AP
+ * QCI support available.
*/
void (*on_scan_complete)(struct ap_config_info *new_config_info,
struct ap_config_info *old_config_info);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 014/365] ata: libata-eh: Add missing command name
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 013/365] s390/ap: fix crash on older machines based on QCI info missing Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 015/365] mmc: pxamci: Fix another error handling path in pxamci_probe() Greg Kroah-Hartman
` (355 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Damien Le Moal, Hannes Reinecke
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
commit d3122bf9aa4c974f5e2c0112f799757b3a2779da upstream.
Add the missing command name for ATA_CMD_NCQ_NON_DATA to
ata_get_cmd_name().
Fixes: 661ce1f0c4a6 ("libata/libsas: Define ATA_CMD_NCQ_NON_DATA")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/ata/libata-eh.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2122,6 +2122,7 @@ const char *ata_get_cmd_name(u8 command)
{ ATA_CMD_WRITE_QUEUED_FUA_EXT, "WRITE DMA QUEUED FUA EXT" },
{ ATA_CMD_FPDMA_READ, "READ FPDMA QUEUED" },
{ ATA_CMD_FPDMA_WRITE, "WRITE FPDMA QUEUED" },
+ { ATA_CMD_NCQ_NON_DATA, "NCQ NON-DATA" },
{ ATA_CMD_FPDMA_SEND, "SEND FPDMA QUEUED" },
{ ATA_CMD_FPDMA_RECV, "RECEIVE FPDMA QUEUED" },
{ ATA_CMD_PIO_READ, "READ SECTOR(S)" },
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 015/365] mmc: pxamci: Fix another error handling path in pxamci_probe()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 014/365] ata: libata-eh: Add missing command name Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 016/365] mmc: pxamci: Fix an " Greg Kroah-Hartman
` (354 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Christophe JAILLET, Ulf Hansson
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
commit b886f54c300d31c109d2e4336b22922b64e7ba7d upstream.
The commit in Fixes: has introduced an new error handling without branching
to the existing error handling path.
Update it now and release some resources if pxamci_init_ocr() fails.
Fixes: 61951fd6cb49 ("mmc: pxamci: let mmc core handle regulators")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/07a2dcebf8ede69b484103de8f9df043f158cffd.1658862932.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/pxamci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -672,7 +672,7 @@ static int pxamci_probe(struct platform_
ret = pxamci_init_ocr(host);
if (ret < 0)
- return ret;
+ goto out;
mmc->caps = 0;
host->cmdat = 0;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 016/365] mmc: pxamci: Fix an error handling path in pxamci_probe()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 015/365] mmc: pxamci: Fix another error handling path in pxamci_probe() Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 017/365] mmc: meson-gx: Fix an error handling path in meson_mmc_probe() Greg Kroah-Hartman
` (353 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Christophe JAILLET, Ulf Hansson
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
commit 98d7c5e5792b8ce3e1352196dac7f404bb1b46ec upstream.
The commit in Fixes: has moved some code around without updating gotos to
the error handling path.
Update it now and release some resources if pxamci_of_init() fails.
Fixes: fa3a5115469c ("mmc: pxamci: call mmc_of_parse()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/6d75855ad4e2470e9ed99e0df21bc30f0c925a29.1658862932.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/pxamci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -648,7 +648,7 @@ static int pxamci_probe(struct platform_
ret = pxamci_of_init(pdev, mmc);
if (ret)
- return ret;
+ goto out;
host = mmc_priv(mmc);
host->mmc = mmc;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 017/365] mmc: meson-gx: Fix an error handling path in meson_mmc_probe()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 016/365] mmc: pxamci: Fix an " Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 018/365] btrfs: unset reloc control if transaction commit fails in prepare_to_relocate() Greg Kroah-Hartman
` (352 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Christophe JAILLET, Ulf Hansson
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
commit b3e1cf31154136da855f3cb6117c17eb0b6bcfb4 upstream.
The commit in Fixes has introduced a new error handling which should goto
the existing error handling path.
Otherwise some resources leak.
Fixes: 19c6beaa064c ("mmc: meson-gx: add device reset")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/be4b863bacf323521ba3a02efdc4fca9cdedd1a6.1659855351.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1172,8 +1172,10 @@ static int meson_mmc_probe(struct platfo
}
ret = device_reset_optional(&pdev->dev);
- if (ret)
- return dev_err_probe(&pdev->dev, ret, "device reset failed\n");
+ if (ret) {
+ dev_err_probe(&pdev->dev, ret, "device reset failed\n");
+ goto free_host;
+ }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->regs = devm_ioremap_resource(&pdev->dev, res);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 018/365] btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 017/365] mmc: meson-gx: Fix an error handling path in meson_mmc_probe() Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 019/365] btrfs: reset RO counter on block group if we fail to relocate Greg Kroah-Hartman
` (351 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, TOTE Robot, Sweet Tea Dorminy,
Nikolay Borisov, Zixuan Fu, David Sterba
From: Zixuan Fu <r33s3n6@gmail.com>
commit 85f02d6c856b9f3a0acf5219de6e32f58b9778eb upstream.
In btrfs_relocate_block_group(), the rc is allocated. Then
btrfs_relocate_block_group() calls
relocate_block_group()
prepare_to_relocate()
set_reloc_control()
that assigns rc to the variable fs_info->reloc_ctl. When
prepare_to_relocate() returns, it calls
btrfs_commit_transaction()
btrfs_start_dirty_block_groups()
btrfs_alloc_path()
kmem_cache_zalloc()
which may fail for example (or other errors could happen). When the
failure occurs, btrfs_relocate_block_group() detects the error and frees
rc and doesn't set fs_info->reloc_ctl to NULL. After that, in
btrfs_init_reloc_root(), rc is retrieved from fs_info->reloc_ctl and
then used, which may cause a use-after-free bug.
This possible bug can be triggered by calling btrfs_ioctl_balance()
before calling btrfs_ioctl_defrag().
To fix this possible bug, in prepare_to_relocate(), check if
btrfs_commit_transaction() fails. If the failure occurs,
unset_reloc_control() is called to set fs_info->reloc_ctl to NULL.
The error log in our fault-injection testing is shown as follows:
[ 58.751070] BUG: KASAN: use-after-free in btrfs_init_reloc_root+0x7ca/0x920 [btrfs]
...
[ 58.753577] Call Trace:
...
[ 58.755800] kasan_report+0x45/0x60
[ 58.756066] btrfs_init_reloc_root+0x7ca/0x920 [btrfs]
[ 58.757304] record_root_in_trans+0x792/0xa10 [btrfs]
[ 58.757748] btrfs_record_root_in_trans+0x463/0x4f0 [btrfs]
[ 58.758231] start_transaction+0x896/0x2950 [btrfs]
[ 58.758661] btrfs_defrag_root+0x250/0xc00 [btrfs]
[ 58.759083] btrfs_ioctl_defrag+0x467/0xa00 [btrfs]
[ 58.759513] btrfs_ioctl+0x3c95/0x114e0 [btrfs]
...
[ 58.768510] Allocated by task 23683:
[ 58.768777] ____kasan_kmalloc+0xb5/0xf0
[ 58.769069] __kmalloc+0x227/0x3d0
[ 58.769325] alloc_reloc_control+0x10a/0x3d0 [btrfs]
[ 58.769755] btrfs_relocate_block_group+0x7aa/0x1e20 [btrfs]
[ 58.770228] btrfs_relocate_chunk+0xf1/0x760 [btrfs]
[ 58.770655] __btrfs_balance+0x1326/0x1f10 [btrfs]
[ 58.771071] btrfs_balance+0x3150/0x3d30 [btrfs]
[ 58.771472] btrfs_ioctl_balance+0xd84/0x1410 [btrfs]
[ 58.771902] btrfs_ioctl+0x4caa/0x114e0 [btrfs]
...
[ 58.773337] Freed by task 23683:
...
[ 58.774815] kfree+0xda/0x2b0
[ 58.775038] free_reloc_control+0x1d6/0x220 [btrfs]
[ 58.775465] btrfs_relocate_block_group+0x115c/0x1e20 [btrfs]
[ 58.775944] btrfs_relocate_chunk+0xf1/0x760 [btrfs]
[ 58.776369] __btrfs_balance+0x1326/0x1f10 [btrfs]
[ 58.776784] btrfs_balance+0x3150/0x3d30 [btrfs]
[ 58.777185] btrfs_ioctl_balance+0xd84/0x1410 [btrfs]
[ 58.777621] btrfs_ioctl+0x4caa/0x114e0 [btrfs]
...
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
CC: stable@vger.kernel.org # 5.15+
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Zixuan Fu <r33s3n6@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/relocation.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3573,7 +3573,12 @@ int prepare_to_relocate(struct reloc_con
*/
return PTR_ERR(trans);
}
- return btrfs_commit_transaction(trans);
+
+ ret = btrfs_commit_transaction(trans);
+ if (ret)
+ unset_reloc_control(rc);
+
+ return ret;
}
static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 019/365] btrfs: reset RO counter on block group if we fail to relocate
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 018/365] btrfs: unset reloc control if transaction commit fails in prepare_to_relocate() Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 020/365] btrfs: fix lost error handling when looking up extended ref on log replay Greg Kroah-Hartman
` (350 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Boris Burkov, Josef Bacik, David Sterba
From: Josef Bacik <josef@toxicpanda.com>
commit 74944c873602a3ed8d16ff7af3f64af80c0f9dac upstream.
With the automatic block group reclaim code we will preemptively try to
mark the block group RO before we start the relocation. We do this to
make sure we should actually try to relocate the block group.
However if we hit an error during the actual relocation we won't clean
up our RO counter and the block group will remain RO. This was observed
internally with file systems reporting less space available from df when
we had failed background relocations.
Fix this by doing the dec_ro in the error case.
Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones")
CC: stable@vger.kernel.org # 5.15+
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/block-group.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1640,9 +1640,11 @@ void btrfs_reclaim_bgs_work(struct work_
div64_u64(zone_unusable * 100, bg->length));
trace_btrfs_reclaim_block_group(bg);
ret = btrfs_relocate_chunk(fs_info, bg->start);
- if (ret)
+ if (ret) {
+ btrfs_dec_block_group_ro(bg);
btrfs_err(fs_info, "error relocating chunk %llu",
bg->start);
+ }
next:
btrfs_put_block_group(bg);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 020/365] btrfs: fix lost error handling when looking up extended ref on log replay
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 019/365] btrfs: reset RO counter on block group if we fail to relocate Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 021/365] btrfs: fix warning during log replay when bumping inode link count Greg Kroah-Hartman
` (349 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Filipe Manana, David Sterba
From: Filipe Manana <fdmanana@suse.com>
commit 7a6b75b79902e47f46328b57733f2604774fa2d9 upstream.
During log replay, when processing inode references, if we get an error
when looking up for an extended reference at __add_inode_ref(), we ignore
it and proceed, returning success (0) if no other error happens after the
lookup. This is obviously wrong because in case an extended reference
exists and it encodes some name not in the log, we need to unlink it,
otherwise the filesystem state will not match the state it had after the
last fsync.
So just make __add_inode_ref() return an error it gets from the extended
reference lookup.
Fixes: f186373fef005c ("btrfs: extended inode refs")
CC: stable@vger.kernel.org # 4.9+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/tree-log.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1146,7 +1146,9 @@ again:
extref = btrfs_lookup_inode_extref(NULL, root, path, name, namelen,
inode_objectid, parent_objectid, 0,
0);
- if (!IS_ERR_OR_NULL(extref)) {
+ if (IS_ERR(extref)) {
+ return PTR_ERR(extref);
+ } else if (extref) {
u32 item_size;
u32 cur_offset = 0;
unsigned long base;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 021/365] btrfs: fix warning during log replay when bumping inode link count
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 020/365] btrfs: fix lost error handling when looking up extended ref on log replay Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 022/365] drm/amdgpu: change vram width algorithm for vram_info v3_0 Greg Kroah-Hartman
` (348 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Filipe Manana, David Sterba
From: Filipe Manana <fdmanana@suse.com>
commit 769030e11847c5412270c0726ff21d3a1f0a3131 upstream.
During log replay, at add_link(), we may increment the link count of
another inode that has a reference that conflicts with a new reference
for the inode currently being processed.
During log replay, at add_link(), we may drop (unlink) a reference from
some inode in the subvolume tree if that reference conflicts with a new
reference found in the log for the inode we are currently processing.
After the unlink, If the link count has decreased from 1 to 0, then we
increment the link count to prevent the inode from being deleted if it's
evicted by an iput() call, because we may have references to add to that
inode later on (and we will fixup its link count later during log replay).
However incrementing the link count from 0 to 1 triggers a warning:
$ cat fs/inode.c
(...)
void inc_nlink(struct inode *inode)
{
if (unlikely(inode->i_nlink == 0)) {
WARN_ON(!(inode->i_state & I_LINKABLE));
atomic_long_dec(&inode->i_sb->s_remove_count);
}
(...)
The I_LINKABLE flag is only set when creating an O_TMPFILE file, so it's
never set during log replay.
Most of the time, the warning isn't triggered even if we dropped the last
reference of the conflicting inode, and this is because:
1) The conflicting inode was previously marked for fixup, through a call
to link_to_fixup_dir(), which increments the inode's link count;
2) And the last iput() on the inode has not triggered eviction of the
inode, nor was eviction triggered after the iput(). So at add_link(),
even if we unlink the last reference of the inode, its link count ends
up being 1 and not 0.
So this means that if eviction is triggered after link_to_fixup_dir() is
called, at add_link() we will read the inode back from the subvolume tree
and have it with a correct link count, matching the number of references
it has on the subvolume tree. So if when we are at add_link() the inode
has exactly one reference only, its link count is 1, and after the unlink
its link count becomes 0.
So fix this by using set_nlink() instead of inc_nlink(), as the former
accepts a transition from 0 to 1 and it's what we use in other similar
contexts (like at link_to_fixup_dir().
Also make add_inode_ref() use set_nlink() instead of inc_nlink() to
bump the link count from 0 to 1.
The warning is actually harmless, but it may scare users. Josef also ran
into it recently.
CC: stable@vger.kernel.org # 5.1+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/tree-log.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1459,7 +1459,7 @@ static int add_link(struct btrfs_trans_h
* on the inode will not free it. We will fixup the link count later.
*/
if (other_inode->i_nlink == 0)
- inc_nlink(other_inode);
+ set_nlink(other_inode, 1);
add_link:
ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode),
name, namelen, 0, ref_index);
@@ -1602,7 +1602,7 @@ static noinline int add_inode_ref(struct
* free it. We will fixup the link count later.
*/
if (!ret && inode->i_nlink == 0)
- inc_nlink(inode);
+ set_nlink(inode, 1);
}
if (ret < 0)
goto out;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 022/365] drm/amdgpu: change vram width algorithm for vram_info v3_0
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 021/365] btrfs: fix warning during log replay when bumping inode link count Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 023/365] drm/i915/gt: Ignore TLB invalidations on idle engines Greg Kroah-Hartman
` (347 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Likun Gao, Hawking Zhang, Alex Deucher
From: Likun Gao <Likun.Gao@amd.com>
commit 4a0a2cf4c03ba49a4c2596c49c7daa719917d509 upstream.
Update the vram width algorithm for vram_info v3_0 to align with the
changes of latest IFWI.
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 5.19.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
index fd8f3731758e..b81b77a9efa6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
@@ -314,7 +314,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
mem_channel_number = vram_info->v30.channel_num;
mem_channel_width = vram_info->v30.channel_width;
if (vram_width)
- *vram_width = mem_channel_number * mem_channel_width;
+ *vram_width = mem_channel_number * (1 << mem_channel_width);
break;
default:
return -EINVAL;
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 023/365] drm/i915/gt: Ignore TLB invalidations on idle engines
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 022/365] drm/amdgpu: change vram width algorithm for vram_info v3_0 Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 024/365] drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations Greg Kroah-Hartman
` (346 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chris Wilson, Fei Yang, Andi Shyti,
Thomas Hellström, Tvrtko Ursulin, Mauro Carvalho Chehab,
Rodrigo Vivi
From: Chris Wilson <chris.p.wilson@intel.com>
commit db100e28fdf026a1fc10657c5170bb1e65663805 upstream.
Check if the device is powered down prior to any engine activity,
as, on such cases, all the TLBs were already invalidated, so an
explicit TLB invalidation is not needed, thus reducing the
performance regression impact due to it.
This becomes more significant with GuC, as it can only do so when
the connection to the GuC is awake.
Cc: stable@vger.kernel.org
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Cc: Fei Yang <fei.yang@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/278a57a672edac75683f0818b292e95da583a5fe.1658924372.git.mchehab@kernel.org
(cherry picked from commit 4bedceaed1ae1172cfe72d3ff752b3a1d32fe4d9)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/gem/i915_gem_pages.c | 10 ++++++----
drivers/gpu/drm/i915/gt/intel_gt.c | 17 ++++++++++-------
drivers/gpu/drm/i915/gt/intel_gt_pm.h | 3 +++
3 files changed, 19 insertions(+), 11 deletions(-)
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -6,14 +6,15 @@
#include <drm/drm_cache.h>
+#include "gt/intel_gt.h"
+#include "gt/intel_gt_pm.h"
+
#include "i915_drv.h"
#include "i915_gem_object.h"
#include "i915_scatterlist.h"
#include "i915_gem_lmem.h"
#include "i915_gem_mman.h"
-#include "gt/intel_gt.h"
-
void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
struct sg_table *pages,
unsigned int sg_page_sizes)
@@ -217,10 +218,11 @@ __i915_gem_object_unset_pages(struct drm
if (test_and_clear_bit(I915_BO_WAS_BOUND_BIT, &obj->flags)) {
struct drm_i915_private *i915 = to_i915(obj->base.dev);
+ struct intel_gt *gt = to_gt(i915);
intel_wakeref_t wakeref;
- with_intel_runtime_pm_if_active(&i915->runtime_pm, wakeref)
- intel_gt_invalidate_tlbs(to_gt(i915));
+ with_intel_gt_pm_if_awake(gt, wakeref)
+ intel_gt_invalidate_tlbs(gt);
}
return pages;
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -11,6 +11,7 @@
#include "i915_drv.h"
#include "intel_context.h"
+#include "intel_engine_pm.h"
#include "intel_engine_regs.h"
#include "intel_gt.h"
#include "intel_gt_buffer_pool.h"
@@ -1181,6 +1182,7 @@ void intel_gt_invalidate_tlbs(struct int
struct drm_i915_private *i915 = gt->i915;
struct intel_uncore *uncore = gt->uncore;
struct intel_engine_cs *engine;
+ intel_engine_mask_t awake, tmp;
enum intel_engine_id id;
const i915_reg_t *regs;
unsigned int num = 0;
@@ -1204,26 +1206,31 @@ void intel_gt_invalidate_tlbs(struct int
GEM_TRACE("\n");
- assert_rpm_wakelock_held(&i915->runtime_pm);
-
mutex_lock(>->tlb_invalidate_lock);
intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
spin_lock_irq(&uncore->lock); /* serialise invalidate with GT reset */
+ awake = 0;
for_each_engine(engine, gt, id) {
struct reg_and_bit rb;
+ if (!intel_engine_pm_is_awake(engine))
+ continue;
+
rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
if (!i915_mmio_reg_offset(rb.reg))
continue;
intel_uncore_write_fw(uncore, rb.reg, rb.bit);
+ awake |= engine->mask;
}
spin_unlock_irq(&uncore->lock);
- for_each_engine(engine, gt, id) {
+ for_each_engine_masked(engine, gt, awake, tmp) {
+ struct reg_and_bit rb;
+
/*
* HW architecture suggest typical invalidation time at 40us,
* with pessimistic cases up to 100us and a recommendation to
@@ -1231,12 +1238,8 @@ void intel_gt_invalidate_tlbs(struct int
*/
const unsigned int timeout_us = 100;
const unsigned int timeout_ms = 4;
- struct reg_and_bit rb;
rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
- if (!i915_mmio_reg_offset(rb.reg))
- continue;
-
if (__intel_wait_for_register_fw(uncore,
rb.reg, rb.bit, 0,
timeout_us, timeout_ms,
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.h
@@ -55,6 +55,9 @@ static inline void intel_gt_pm_might_put
for (tmp = 1, intel_gt_pm_get(gt); tmp; \
intel_gt_pm_put(gt), tmp = 0)
+#define with_intel_gt_pm_if_awake(gt, wf) \
+ for (wf = intel_gt_pm_get_if_awake(gt); wf; intel_gt_pm_put_async(gt), wf = 0)
+
static inline int intel_gt_pm_wait_for_idle(struct intel_gt *gt)
{
return intel_wakeref_wait_for_idle(>->wakeref);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 024/365] drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 023/365] drm/i915/gt: Ignore TLB invalidations on idle engines Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 025/365] drm/i915/gt: Skip TLB invalidations once wedged Greg Kroah-Hartman
` (345 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chris Wilson, Fei Yang, Andi Shyti,
Tvrtko Ursulin, Thomas Hellström, Mauro Carvalho Chehab,
Rodrigo Vivi
From: Chris Wilson <chris.p.wilson@intel.com>
commit 180abeb2c5032704787151135b6a38c6b71295a6 upstream.
Ensure that the TLB of the OA unit is also invalidated
on gen12 HW, as just invalidating the TLB of an engine is not
enough.
Cc: stable@vger.kernel.org
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Cc: Fei Yang <fei.yang@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/59724d9f5cf1e93b1620d01b8332ac991555283d.1658924372.git.mchehab@kernel.org
(cherry picked from commit dfc83de118ff7930acc9a4c8dfdba7c153aa44d6)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/gt/intel_gt.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -10,6 +10,7 @@
#include "pxp/intel_pxp.h"
#include "i915_drv.h"
+#include "i915_perf_oa_regs.h"
#include "intel_context.h"
#include "intel_engine_pm.h"
#include "intel_engine_regs.h"
@@ -1226,6 +1227,15 @@ void intel_gt_invalidate_tlbs(struct int
awake |= engine->mask;
}
+ /* Wa_2207587034:tgl,dg1,rkl,adl-s,adl-p */
+ if (awake &&
+ (IS_TIGERLAKE(i915) ||
+ IS_DG1(i915) ||
+ IS_ROCKETLAKE(i915) ||
+ IS_ALDERLAKE_S(i915) ||
+ IS_ALDERLAKE_P(i915)))
+ intel_uncore_write_fw(uncore, GEN12_OA_TLB_INV_CR, 1);
+
spin_unlock_irq(&uncore->lock);
for_each_engine_masked(engine, gt, awake, tmp) {
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 025/365] drm/i915/gt: Skip TLB invalidations once wedged
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 024/365] drm/i915/gt: Invalidate TLB of the OA unit at TLB invalidations Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 026/365] drm/i915/gt: Batch TLB invalidations Greg Kroah-Hartman
` (344 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chris Wilson, Fei Yang,
Tvrtko Ursulin, Andi Shyti, Thomas Hellström,
Mauro Carvalho Chehab, Rodrigo Vivi
From: Chris Wilson <chris.p.wilson@intel.com>
commit e5a95c83ed1492c0f442b448b20c90c8faaf702b upstream.
Skip all further TLB invalidations once the device is wedged and
had been reset, as, on such cases, it can no longer process instructions
on the GPU and the user no longer has access to the TLB's in each engine.
So, an attempt to do a TLB cache invalidation will produce a timeout.
That helps to reduce the performance regression introduced by TLB
invalidate logic.
Cc: stable@vger.kernel.org
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Cc: Fei Yang <fei.yang@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5aa86564b9ec5fe7fe605c1dd7de76855401ed73.1658924372.git.mchehab@kernel.org
(cherry picked from commit be0366f168033374a93e4c43fdaa1a90ab905184)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/gt/intel_gt.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -1191,6 +1191,9 @@ void intel_gt_invalidate_tlbs(struct int
if (I915_SELFTEST_ONLY(gt->awake == -ENODEV))
return;
+ if (intel_gt_is_wedged(gt))
+ return;
+
if (GRAPHICS_VER(i915) == 12) {
regs = gen12_regs;
num = ARRAY_SIZE(gen12_regs);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 026/365] drm/i915/gt: Batch TLB invalidations
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 025/365] drm/i915/gt: Skip TLB invalidations once wedged Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 027/365] drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb() Greg Kroah-Hartman
` (343 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Tvrtko Ursulin, Chris Wilson,
Fei Yang, Mauro Carvalho Chehab, Andi Shyti, Rodrigo Vivi
From: Chris Wilson <chris.p.wilson@intel.com>
commit 59eda6ce824e95b98c45628fe6c0adb9130c6df2 upstream.
Invalidate TLB in batches, in order to reduce performance regressions.
Currently, every caller performs a full barrier around a TLB
invalidation, ignoring all other invalidations that may have already
removed their PTEs from the cache. As this is a synchronous operation
and can be quite slow, we cause multiple threads to contend on the TLB
invalidate mutex blocking userspace.
We only need to invalidate the TLB once after replacing our PTE to
ensure that there is no possible continued access to the physical
address before releasing our pages. By tracking a seqno for each full
TLB invalidate we can quickly determine if one has been performed since
rewriting the PTE, and only if necessary trigger one for ourselves.
That helps to reduce the performance regression introduced by TLB
invalidate logic.
[mchehab: rebased to not require moving the code to a separate file]
Cc: stable@vger.kernel.org
Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Cc: Fei Yang <fei.yang@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/4e97ef5deb6739cadaaf40aa45620547e9c4ec06.1658924372.git.mchehab@kernel.org
(cherry picked from commit 5d36acb7198b0e5eb88e6b701f9ad7b9448f8df9)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 3 -
drivers/gpu/drm/i915/gem/i915_gem_pages.c | 21 +++++----
drivers/gpu/drm/i915/gt/intel_gt.c | 53 +++++++++++++++++------
drivers/gpu/drm/i915/gt/intel_gt.h | 12 ++++-
drivers/gpu/drm/i915/gt/intel_gt_types.h | 18 +++++++
drivers/gpu/drm/i915/gt/intel_ppgtt.c | 8 ++-
drivers/gpu/drm/i915/i915_vma.c | 33 +++++++++++---
drivers/gpu/drm/i915/i915_vma.h | 1
drivers/gpu/drm/i915/i915_vma_resource.c | 5 +-
drivers/gpu/drm/i915/i915_vma_resource.h | 6 ++
10 files changed, 125 insertions(+), 35 deletions(-)
--- a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
@@ -335,7 +335,6 @@ struct drm_i915_gem_object {
#define I915_BO_READONLY BIT(7)
#define I915_TILING_QUIRK_BIT 8 /* unknown swizzling; do not release! */
#define I915_BO_PROTECTED BIT(9)
-#define I915_BO_WAS_BOUND_BIT 10
/**
* @mem_flags - Mutable placement-related flags
*
@@ -598,6 +597,8 @@ struct drm_i915_gem_object {
* pages were last acquired.
*/
bool dirty:1;
+
+ u32 tlb;
} mm;
struct {
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -191,6 +191,18 @@ static void unmap_object(struct drm_i915
vunmap(ptr);
}
+static void flush_tlb_invalidate(struct drm_i915_gem_object *obj)
+{
+ struct drm_i915_private *i915 = to_i915(obj->base.dev);
+ struct intel_gt *gt = to_gt(i915);
+
+ if (!obj->mm.tlb)
+ return;
+
+ intel_gt_invalidate_tlb(gt, obj->mm.tlb);
+ obj->mm.tlb = 0;
+}
+
struct sg_table *
__i915_gem_object_unset_pages(struct drm_i915_gem_object *obj)
{
@@ -216,14 +228,7 @@ __i915_gem_object_unset_pages(struct drm
__i915_gem_object_reset_page_iter(obj);
obj->mm.page_sizes.phys = obj->mm.page_sizes.sg = 0;
- if (test_and_clear_bit(I915_BO_WAS_BOUND_BIT, &obj->flags)) {
- struct drm_i915_private *i915 = to_i915(obj->base.dev);
- struct intel_gt *gt = to_gt(i915);
- intel_wakeref_t wakeref;
-
- with_intel_gt_pm_if_awake(gt, wakeref)
- intel_gt_invalidate_tlbs(gt);
- }
+ flush_tlb_invalidate(obj);
return pages;
}
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -36,8 +36,6 @@ static void __intel_gt_init_early(struct
{
spin_lock_init(>->irq_lock);
- mutex_init(>->tlb_invalidate_lock);
-
INIT_LIST_HEAD(>->closed_vma);
spin_lock_init(>->closed_lock);
@@ -48,6 +46,8 @@ static void __intel_gt_init_early(struct
intel_gt_init_reset(gt);
intel_gt_init_requests(gt);
intel_gt_init_timelines(gt);
+ mutex_init(>->tlb.invalidate_lock);
+ seqcount_mutex_init(>->tlb.seqno, >->tlb.invalidate_lock);
intel_gt_pm_init_early(gt);
intel_uc_init_early(>->uc);
@@ -833,6 +833,7 @@ void intel_gt_driver_late_release_all(st
intel_gt_fini_requests(gt);
intel_gt_fini_reset(gt);
intel_gt_fini_timelines(gt);
+ mutex_destroy(>->tlb.invalidate_lock);
intel_engines_free(gt);
}
}
@@ -1165,7 +1166,7 @@ get_reg_and_bit(const struct intel_engin
return rb;
}
-void intel_gt_invalidate_tlbs(struct intel_gt *gt)
+static void mmio_invalidate_full(struct intel_gt *gt)
{
static const i915_reg_t gen8_regs[] = {
[RENDER_CLASS] = GEN8_RTCR,
@@ -1188,12 +1189,6 @@ void intel_gt_invalidate_tlbs(struct int
const i915_reg_t *regs;
unsigned int num = 0;
- if (I915_SELFTEST_ONLY(gt->awake == -ENODEV))
- return;
-
- if (intel_gt_is_wedged(gt))
- return;
-
if (GRAPHICS_VER(i915) == 12) {
regs = gen12_regs;
num = ARRAY_SIZE(gen12_regs);
@@ -1208,9 +1203,6 @@ void intel_gt_invalidate_tlbs(struct int
"Platform does not implement TLB invalidation!"))
return;
- GEM_TRACE("\n");
-
- mutex_lock(>->tlb_invalidate_lock);
intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
spin_lock_irq(&uncore->lock); /* serialise invalidate with GT reset */
@@ -1230,6 +1222,8 @@ void intel_gt_invalidate_tlbs(struct int
awake |= engine->mask;
}
+ GT_TRACE(gt, "invalidated engines %08x\n", awake);
+
/* Wa_2207587034:tgl,dg1,rkl,adl-s,adl-p */
if (awake &&
(IS_TIGERLAKE(i915) ||
@@ -1269,5 +1263,38 @@ void intel_gt_invalidate_tlbs(struct int
* transitions.
*/
intel_uncore_forcewake_put_delayed(uncore, FORCEWAKE_ALL);
- mutex_unlock(>->tlb_invalidate_lock);
+}
+
+static bool tlb_seqno_passed(const struct intel_gt *gt, u32 seqno)
+{
+ u32 cur = intel_gt_tlb_seqno(gt);
+
+ /* Only skip if a *full* TLB invalidate barrier has passed */
+ return (s32)(cur - ALIGN(seqno, 2)) > 0;
+}
+
+void intel_gt_invalidate_tlb(struct intel_gt *gt, u32 seqno)
+{
+ intel_wakeref_t wakeref;
+
+ if (I915_SELFTEST_ONLY(gt->awake == -ENODEV))
+ return;
+
+ if (intel_gt_is_wedged(gt))
+ return;
+
+ if (tlb_seqno_passed(gt, seqno))
+ return;
+
+ with_intel_gt_pm_if_awake(gt, wakeref) {
+ mutex_lock(>->tlb.invalidate_lock);
+ if (tlb_seqno_passed(gt, seqno))
+ goto unlock;
+
+ mmio_invalidate_full(gt);
+
+ write_seqcount_invalidate(>->tlb.seqno);
+unlock:
+ mutex_unlock(>->tlb.invalidate_lock);
+ }
}
--- a/drivers/gpu/drm/i915/gt/intel_gt.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt.h
@@ -123,7 +123,17 @@ void intel_gt_info_print(const struct in
void intel_gt_watchdog_work(struct work_struct *work);
-void intel_gt_invalidate_tlbs(struct intel_gt *gt);
+static inline u32 intel_gt_tlb_seqno(const struct intel_gt *gt)
+{
+ return seqprop_sequence(>->tlb.seqno);
+}
+
+static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)
+{
+ return intel_gt_tlb_seqno(gt) | 1;
+}
+
+void intel_gt_invalidate_tlb(struct intel_gt *gt, u32 seqno);
struct resource intel_pci_resource(struct pci_dev *pdev, int bar);
--- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
@@ -11,6 +11,7 @@
#include <linux/llist.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
+#include <linux/seqlock.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/workqueue.h>
@@ -76,7 +77,22 @@ struct intel_gt {
struct intel_uc uc;
struct intel_gsc gsc;
- struct mutex tlb_invalidate_lock;
+ struct {
+ /* Serialize global tlb invalidations */
+ struct mutex invalidate_lock;
+
+ /*
+ * Batch TLB invalidations
+ *
+ * After unbinding the PTE, we need to ensure the TLB
+ * are invalidated prior to releasing the physical pages.
+ * But we only need one such invalidation for all unbinds,
+ * so we track how many TLB invalidations have been
+ * performed since unbind the PTE and only emit an extra
+ * invalidate if no full barrier has been passed.
+ */
+ seqcount_mutex_t seqno;
+ } tlb;
struct i915_wa_list wa_list;
--- a/drivers/gpu/drm/i915/gt/intel_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ppgtt.c
@@ -206,8 +206,12 @@ void ppgtt_bind_vma(struct i915_address_
void ppgtt_unbind_vma(struct i915_address_space *vm,
struct i915_vma_resource *vma_res)
{
- if (vma_res->allocated)
- vm->clear_range(vm, vma_res->start, vma_res->vma_size);
+ if (!vma_res->allocated)
+ return;
+
+ vm->clear_range(vm, vma_res->start, vma_res->vma_size);
+ if (vma_res->tlb)
+ vma_invalidate_tlb(vm, *vma_res->tlb);
}
static unsigned long pd_count(u64 size, int shift)
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -537,8 +537,6 @@ int i915_vma_bind(struct i915_vma *vma,
bind_flags);
}
- set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
-
atomic_or(bind_flags, &vma->flags);
return 0;
}
@@ -1301,6 +1299,19 @@ err_unpin:
return err;
}
+void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb)
+{
+ /*
+ * Before we release the pages that were bound by this vma, we
+ * must invalidate all the TLBs that may still have a reference
+ * back to our physical address. It only needs to be done once,
+ * so after updating the PTE to point away from the pages, record
+ * the most recent TLB invalidation seqno, and if we have not yet
+ * flushed the TLBs upon release, perform a full invalidation.
+ */
+ WRITE_ONCE(tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
+}
+
static void __vma_put_pages(struct i915_vma *vma, unsigned int count)
{
/* We allocate under vma_get_pages, so beware the shrinker */
@@ -1927,7 +1938,12 @@ struct dma_fence *__i915_vma_evict(struc
vma->vm->skip_pte_rewrite;
trace_i915_vma_unbind(vma);
- unbind_fence = i915_vma_resource_unbind(vma_res);
+ if (async)
+ unbind_fence = i915_vma_resource_unbind(vma_res,
+ &vma->obj->mm.tlb);
+ else
+ unbind_fence = i915_vma_resource_unbind(vma_res, NULL);
+
vma->resource = NULL;
atomic_and(~(I915_VMA_BIND_MASK | I915_VMA_ERROR | I915_VMA_GGTT_WRITE),
@@ -1935,10 +1951,13 @@ struct dma_fence *__i915_vma_evict(struc
i915_vma_detach(vma);
- if (!async && unbind_fence) {
- dma_fence_wait(unbind_fence, false);
- dma_fence_put(unbind_fence);
- unbind_fence = NULL;
+ if (!async) {
+ if (unbind_fence) {
+ dma_fence_wait(unbind_fence, false);
+ dma_fence_put(unbind_fence);
+ unbind_fence = NULL;
+ }
+ vma_invalidate_tlb(vma->vm, vma->obj->mm.tlb);
}
/*
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -213,6 +213,7 @@ bool i915_vma_misplaced(const struct i91
u64 size, u64 alignment, u64 flags);
void __i915_vma_set_map_and_fenceable(struct i915_vma *vma);
void i915_vma_revoke_mmap(struct i915_vma *vma);
+void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb);
struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async);
int __i915_vma_unbind(struct i915_vma *vma);
int __must_check i915_vma_unbind(struct i915_vma *vma);
--- a/drivers/gpu/drm/i915/i915_vma_resource.c
+++ b/drivers/gpu/drm/i915/i915_vma_resource.c
@@ -223,10 +223,13 @@ i915_vma_resource_fence_notify(struct i9
* Return: A refcounted pointer to a dma-fence that signals when unbinding is
* complete.
*/
-struct dma_fence *i915_vma_resource_unbind(struct i915_vma_resource *vma_res)
+struct dma_fence *i915_vma_resource_unbind(struct i915_vma_resource *vma_res,
+ u32 *tlb)
{
struct i915_address_space *vm = vma_res->vm;
+ vma_res->tlb = tlb;
+
/* Reference for the sw fence */
i915_vma_resource_get(vma_res);
--- a/drivers/gpu/drm/i915/i915_vma_resource.h
+++ b/drivers/gpu/drm/i915/i915_vma_resource.h
@@ -67,6 +67,7 @@ struct i915_page_sizes {
* taken when the unbind is scheduled.
* @skip_pte_rewrite: During ggtt suspend and vm takedown pte rewriting
* needs to be skipped for unbind.
+ * @tlb: pointer for obj->mm.tlb, if async unbind. Otherwise, NULL
*
* The lifetime of a struct i915_vma_resource is from a binding request to
* the actual possible asynchronous unbind has completed.
@@ -119,6 +120,8 @@ struct i915_vma_resource {
bool immediate_unbind:1;
bool needs_wakeref:1;
bool skip_pte_rewrite:1;
+
+ u32 *tlb;
};
bool i915_vma_resource_hold(struct i915_vma_resource *vma_res,
@@ -131,7 +134,8 @@ struct i915_vma_resource *i915_vma_resou
void i915_vma_resource_free(struct i915_vma_resource *vma_res);
-struct dma_fence *i915_vma_resource_unbind(struct i915_vma_resource *vma_res);
+struct dma_fence *i915_vma_resource_unbind(struct i915_vma_resource *vma_res,
+ u32 *tlb);
void __i915_vma_resource_init(struct i915_vma_resource *vma_res);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 027/365] drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 026/365] drm/i915/gt: Batch TLB invalidations Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 028/365] cifs: Fix memory leak on the deferred close Greg Kroah-Hartman
` (342 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mauro Carvalho Chehab, Andi Shyti,
Rodrigo Vivi
From: Mauro Carvalho Chehab <mchehab@kernel.org>
commit 9d50bff40e3e366886ec37299fc317edf84be0c9 upstream.
WRITE_ONCE() should happen at the original var, not on a local
copy of it.
Cc: stable@vger.kernel.org
Fixes: 59eda6ce824e ("drm/i915/gt: Batch TLB invalidations")
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
[added cc-stable while merging it]
Link: https://patchwork.freedesktop.org/patch/msgid/f9550e6bacea10131ff40dd8981b69eb9251cdcd.1659598090.git.mchehab@kernel.org
(cherry picked from commit 3d037d99e61a1e7a3ae3d214146d88db349dd19f)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/gt/intel_ppgtt.c | 2 +-
drivers/gpu/drm/i915/i915_vma.c | 6 +++---
drivers/gpu/drm/i915/i915_vma.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/i915/gt/intel_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ppgtt.c
@@ -211,7 +211,7 @@ void ppgtt_unbind_vma(struct i915_addres
vm->clear_range(vm, vma_res->start, vma_res->vma_size);
if (vma_res->tlb)
- vma_invalidate_tlb(vm, *vma_res->tlb);
+ vma_invalidate_tlb(vm, vma_res->tlb);
}
static unsigned long pd_count(u64 size, int shift)
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1299,7 +1299,7 @@ err_unpin:
return err;
}
-void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb)
+void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb)
{
/*
* Before we release the pages that were bound by this vma, we
@@ -1309,7 +1309,7 @@ void vma_invalidate_tlb(struct i915_addr
* the most recent TLB invalidation seqno, and if we have not yet
* flushed the TLBs upon release, perform a full invalidation.
*/
- WRITE_ONCE(tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
+ WRITE_ONCE(*tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
}
static void __vma_put_pages(struct i915_vma *vma, unsigned int count)
@@ -1957,7 +1957,7 @@ struct dma_fence *__i915_vma_evict(struc
dma_fence_put(unbind_fence);
unbind_fence = NULL;
}
- vma_invalidate_tlb(vma->vm, vma->obj->mm.tlb);
+ vma_invalidate_tlb(vma->vm, &vma->obj->mm.tlb);
}
/*
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -213,7 +213,7 @@ bool i915_vma_misplaced(const struct i91
u64 size, u64 alignment, u64 flags);
void __i915_vma_set_map_and_fenceable(struct i915_vma *vma);
void i915_vma_revoke_mmap(struct i915_vma *vma);
-void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb);
+void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb);
struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async);
int __i915_vma_unbind(struct i915_vma *vma);
int __must_check i915_vma_unbind(struct i915_vma *vma);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 028/365] cifs: Fix memory leak on the deferred close
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 027/365] drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb() Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 029/365] x86/kprobes: Fix JNG/JNLE emulation Greg Kroah-Hartman
` (341 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Shyam Prasad N, Zhang Xiaoxu, Steve French
From: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
commit ca08d0eac020d48a3141dbec0a3cf64fbdb17cde upstream.
xfstests on smb21 report kmemleak as below:
unreferenced object 0xffff8881767d6200 (size 64):
comm "xfs_io", pid 1284, jiffies 4294777434 (age 20.789s)
hex dump (first 32 bytes):
80 5a d0 11 81 88 ff ff 78 8a aa 63 81 88 ff ff .Z......x..c....
00 71 99 76 81 88 ff ff 00 00 00 00 00 00 00 00 .q.v............
backtrace:
[<00000000ad04e6ea>] cifs_close+0x92/0x2c0
[<0000000028b93c82>] __fput+0xff/0x3f0
[<00000000d8116851>] task_work_run+0x85/0xc0
[<0000000027e14f9e>] do_exit+0x5e5/0x1240
[<00000000fb492b95>] do_group_exit+0x58/0xe0
[<00000000129a32d9>] __x64_sys_exit_group+0x28/0x30
[<00000000e3f7d8e9>] do_syscall_64+0x35/0x80
[<00000000102e8a0b>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
When cancel the deferred close work, we should also cleanup the struct
cifs_deferred_close.
Fixes: 9e992755be8f2 ("cifs: Call close synchronously during unlink/rename/lease break.")
Fixes: e3fc065682ebb ("cifs: Deferred close performance improvements")
Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/misc.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -742,6 +742,8 @@ cifs_close_deferred_file(struct cifsInod
list_for_each_entry(cfile, &cifs_inode->openFileList, flist) {
if (delayed_work_pending(&cfile->deferred)) {
if (cancel_delayed_work(&cfile->deferred)) {
+ cifs_del_deferred_close(cfile);
+
tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);
if (tmp_list == NULL)
break;
@@ -773,6 +775,8 @@ cifs_close_all_deferred_files(struct cif
cfile = list_entry(tmp, struct cifsFileInfo, tlist);
if (delayed_work_pending(&cfile->deferred)) {
if (cancel_delayed_work(&cfile->deferred)) {
+ cifs_del_deferred_close(cfile);
+
tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);
if (tmp_list == NULL)
break;
@@ -808,6 +812,8 @@ cifs_close_deferred_file_under_dentry(st
if (strstr(full_path, path)) {
if (delayed_work_pending(&cfile->deferred)) {
if (cancel_delayed_work(&cfile->deferred)) {
+ cifs_del_deferred_close(cfile);
+
tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);
if (tmp_list == NULL)
break;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 029/365] x86/kprobes: Fix JNG/JNLE emulation
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 028/365] cifs: Fix memory leak on the deferred close Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 030/365] tracing/perf: Fix double put of trace event when init fails Greg Kroah-Hartman
` (340 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Nadav Amit, Ingo Molnar
From: Nadav Amit <namit@vmware.com>
commit 8924779df820c53875abaeb10c648e9cb75b46d4 upstream.
When kprobes emulates JNG/JNLE instructions on x86 it uses the wrong
condition. For JNG (opcode: 0F 8E), according to Intel SDM, the jump is
performed if (ZF == 1 or SF != OF). However the kernel emulation
currently uses 'and' instead of 'or'.
As a result, setting a kprobe on JNG/JNLE might cause the kernel to
behave incorrectly whenever the kprobe is hit.
Fix by changing the 'and' to 'or'.
Fixes: 6256e668b7af ("x86/kprobes: Use int3 instead of debug trap for single-step")
Signed-off-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220813225943.143767-1-namit@vmware.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/kprobes/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -505,7 +505,7 @@ static void kprobe_emulate_jcc(struct kp
match = ((regs->flags & X86_EFLAGS_SF) >> X86_EFLAGS_SF_BIT) ^
((regs->flags & X86_EFLAGS_OF) >> X86_EFLAGS_OF_BIT);
if (p->ainsn.jcc.type >= 0xe)
- match = match && (regs->flags & X86_EFLAGS_ZF);
+ match = match || (regs->flags & X86_EFLAGS_ZF);
}
__kprobe_emulate_jmp(p, regs, (match && !invert) || (!match && invert));
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 030/365] tracing/perf: Fix double put of trace event when init fails
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 029/365] x86/kprobes: Fix JNG/JNLE emulation Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 031/365] tracing/eprobes: Do not allow eprobes to use $stack, or % for regs Greg Kroah-Hartman
` (339 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krister Johansen, Jiri Olsa,
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit 7249921d94ff64f67b733eca0b68853a62032b3d upstream.
If in perf_trace_event_init(), the perf_trace_event_open() fails, then it
will call perf_trace_event_unreg() which will not only unregister the perf
trace event, but will also call the put() function of the tp_event.
The problem here is that the trace_event_try_get_ref() is called by the
caller of perf_trace_event_init() and if perf_trace_event_init() returns a
failure, it will then call trace_event_put(). But since the
perf_trace_event_unreg() already called the trace_event_put() function, it
triggers a WARN_ON().
WARNING: CPU: 1 PID: 30309 at kernel/trace/trace_dynevent.c:46 trace_event_dyn_put_ref+0x15/0x20
If perf_trace_event_reg() does not call the trace_event_try_get_ref() then
the perf_trace_event_unreg() should not be calling trace_event_put(). This
breaks symmetry and causes bugs like these.
Pull out the trace_event_put() from perf_trace_event_unreg() and call it
in the locations that perf_trace_event_unreg() is called. This not only
fixes this bug, but also brings back the proper symmetry of the reg/unreg
vs get/put logic.
Link: https://lore.kernel.org/all/cover.1660347763.git.kjlx@templeofstupid.com/
Link: https://lkml.kernel.org/r/20220816192817.43d5e17f@gandalf.local.home
Cc: stable@vger.kernel.org
Fixes: 1d18538e6a092 ("tracing: Have dynamic events have a ref counter")
Reported-by: Krister Johansen <kjlx@templeofstupid.com>
Reviewed-by: Krister Johansen <kjlx@templeofstupid.com>
Tested-by: Krister Johansen <kjlx@templeofstupid.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_event_perf.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -157,7 +157,7 @@ static void perf_trace_event_unreg(struc
int i;
if (--tp_event->perf_refcount > 0)
- goto out;
+ return;
tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER, NULL);
@@ -176,8 +176,6 @@ static void perf_trace_event_unreg(struc
perf_trace_buf[i] = NULL;
}
}
-out:
- trace_event_put_ref(tp_event);
}
static int perf_trace_event_open(struct perf_event *p_event)
@@ -241,6 +239,7 @@ void perf_trace_destroy(struct perf_even
mutex_lock(&event_mutex);
perf_trace_event_close(p_event);
perf_trace_event_unreg(p_event);
+ trace_event_put_ref(p_event->tp_event);
mutex_unlock(&event_mutex);
}
@@ -292,6 +291,7 @@ void perf_kprobe_destroy(struct perf_eve
mutex_lock(&event_mutex);
perf_trace_event_close(p_event);
perf_trace_event_unreg(p_event);
+ trace_event_put_ref(p_event->tp_event);
mutex_unlock(&event_mutex);
destroy_local_trace_kprobe(p_event->tp_event);
@@ -347,6 +347,7 @@ void perf_uprobe_destroy(struct perf_eve
mutex_lock(&event_mutex);
perf_trace_event_close(p_event);
perf_trace_event_unreg(p_event);
+ trace_event_put_ref(p_event->tp_event);
mutex_unlock(&event_mutex);
destroy_local_trace_uprobe(p_event->tp_event);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 031/365] tracing/eprobes: Do not allow eprobes to use $stack, or % for regs
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 030/365] tracing/perf: Fix double put of trace event when init fails Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 032/365] tracing/eprobes: Do not hardcode $comm as a string Greg Kroah-Hartman
` (338 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ingo Molnar, Andrew Morton,
Tzvetomir Stoyanov, Tom Zanussi, Masami Hiramatsu (Google),
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit 2673c60ee67e71f2ebe34386e62d348f71edee47 upstream.
While playing with event probes (eprobes), I tried to see what would
happen if I attempted to retrieve the instruction pointer (%rip) knowing
that event probes do not use pt_regs. The result was:
BUG: kernel NULL pointer dereference, address: 0000000000000024
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 1 PID: 1847 Comm: trace-cmd Not tainted 5.19.0-rc5-test+ #309
Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01
v03.03 07/14/2016
RIP: 0010:get_event_field.isra.0+0x0/0x50
Code: ff 48 c7 c7 c0 8f 74 a1 e8 3d 8b f5 ff e8 88 09 f6 ff 4c 89 e7 e8
50 6a 13 00 48 89 ef 5b 5d 41 5c 41 5d e9 42 6a 13 00 66 90 <48> 63 47 24
8b 57 2c 48 01 c6 8b 47 28 83 f8 02 74 0e 83 f8 04 74
RSP: 0018:ffff916c394bbaf0 EFLAGS: 00010086
RAX: ffff916c854041d8 RBX: ffff916c8d9fbf50 RCX: ffff916c255d2000
RDX: 0000000000000000 RSI: ffff916c255d2008 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffff916c3a2a0c08 R09: ffff916c394bbda8
R10: 0000000000000000 R11: 0000000000000000 R12: ffff916c854041d8
R13: ffff916c854041b0 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff916c9ea40000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000024 CR3: 000000011b60a002 CR4: 00000000001706e0
Call Trace:
<TASK>
get_eprobe_size+0xb4/0x640
? __mod_node_page_state+0x72/0xc0
__eprobe_trace_func+0x59/0x1a0
? __mod_lruvec_page_state+0xaa/0x1b0
? page_remove_file_rmap+0x14/0x230
? page_remove_rmap+0xda/0x170
event_triggers_call+0x52/0xe0
trace_event_buffer_commit+0x18f/0x240
trace_event_raw_event_sched_wakeup_template+0x7a/0xb0
try_to_wake_up+0x260/0x4c0
__wake_up_common+0x80/0x180
__wake_up_common_lock+0x7c/0xc0
do_notify_parent+0x1c9/0x2a0
exit_notify+0x1a9/0x220
do_exit+0x2ba/0x450
do_group_exit+0x2d/0x90
__x64_sys_exit_group+0x14/0x20
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x46/0xb0
Obviously this is not the desired result.
Move the testing for TPARG_FL_TPOINT which is only used for event probes
to the top of the "$" variable check, as all the other variables are not
used for event probes. Also add a check in the register parsing "%" to
fail if an event probe is used.
Link: https://lkml.kernel.org/r/20220820134400.564426983@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -279,7 +279,14 @@ static int parse_probe_vars(char *arg, c
int ret = 0;
int len;
- if (strcmp(arg, "retval") == 0) {
+ if (flags & TPARG_FL_TPOINT) {
+ if (code->data)
+ return -EFAULT;
+ code->data = kstrdup(arg, GFP_KERNEL);
+ if (!code->data)
+ return -ENOMEM;
+ code->op = FETCH_OP_TP_ARG;
+ } else if (strcmp(arg, "retval") == 0) {
if (flags & TPARG_FL_RETURN) {
code->op = FETCH_OP_RETVAL;
} else {
@@ -319,13 +326,6 @@ static int parse_probe_vars(char *arg, c
code->op = FETCH_OP_ARG;
code->param = (unsigned int)param - 1;
#endif
- } else if (flags & TPARG_FL_TPOINT) {
- if (code->data)
- return -EFAULT;
- code->data = kstrdup(arg, GFP_KERNEL);
- if (!code->data)
- return -ENOMEM;
- code->op = FETCH_OP_TP_ARG;
} else
goto inval_var;
@@ -380,6 +380,11 @@ parse_probe_arg(char *arg, const struct
break;
case '%': /* named register */
+ if (flags & TPARG_FL_TPOINT) {
+ /* eprobes do not handle registers */
+ trace_probe_log_err(offs, BAD_VAR);
+ break;
+ }
ret = regs_query_register_offset(arg + 1);
if (ret >= 0) {
code->op = FETCH_OP_REG;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 032/365] tracing/eprobes: Do not hardcode $comm as a string
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 031/365] tracing/eprobes: Do not allow eprobes to use $stack, or % for regs Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 033/365] tracing/eprobes: Fix reading of string fields Greg Kroah-Hartman
` (337 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ingo Molnar, Andrew Morton,
Masami Hiramatsu, Tzvetomir Stoyanov, Tom Zanussi,
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit 02333de90e5945e2fe7fc75b15b4eb9aee187f0a upstream.
The variable $comm is hard coded as a string, which is true for both
kprobes and uprobes, but for event probes (eprobes) it is a field name. In
most cases the "comm" field would be a string, but there's no guarantee of
that fact.
Do not assume that comm is a string. Not to mention, it currently forces
comm fields to fault, as string processing for event probes is currently
broken.
Link: https://lkml.kernel.org/r/20220820134400.756152112@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -618,9 +618,10 @@ static int traceprobe_parse_probe_arg_bo
/*
* Since $comm and immediate string can not be dereferenced,
- * we can find those by strcmp.
+ * we can find those by strcmp. But ignore for eprobes.
*/
- if (strcmp(arg, "$comm") == 0 || strncmp(arg, "\\\"", 2) == 0) {
+ if (!(flags & TPARG_FL_TPOINT) &&
+ (strcmp(arg, "$comm") == 0 || strncmp(arg, "\\\"", 2) == 0)) {
/* The type of $comm must be "string", and not an array. */
if (parg->count || (t && strcmp(t, "string")))
goto out;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 033/365] tracing/eprobes: Fix reading of string fields
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 032/365] tracing/eprobes: Do not hardcode $comm as a string Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 034/365] tracing/eprobes: Have event probes be consistent with kprobes and uprobes Greg Kroah-Hartman
` (336 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ingo Molnar, Andrew Morton,
Tzvetomir Stoyanov, Tom Zanussi, Masami Hiramatsu (Google),
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit f04dec93466a0481763f3b56cdadf8076e28bfbf upstream.
Currently when an event probe (eprobe) hooks to a string field, it does
not display it as a string, but instead as a number. This makes the field
rather useless. Handle the different kinds of strings, dynamic, static,
relational/dynamic etc.
Now when a string field is used, the ":string" type can be used to display
it:
echo "e:sw sched/sched_switch comm=$next_comm:string" > dynamic_events
Link: https://lkml.kernel.org/r/20220820134400.959640191@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -310,6 +310,27 @@ static unsigned long get_event_field(str
addr = rec + field->offset;
+ if (is_string_field(field)) {
+ switch (field->filter_type) {
+ case FILTER_DYN_STRING:
+ val = (unsigned long)(rec + (*(unsigned int *)addr & 0xffff));
+ break;
+ case FILTER_RDYN_STRING:
+ val = (unsigned long)(addr + (*(unsigned int *)addr & 0xffff));
+ break;
+ case FILTER_STATIC_STRING:
+ val = (unsigned long)addr;
+ break;
+ case FILTER_PTR_STRING:
+ val = (unsigned long)(*(char *)addr);
+ break;
+ default:
+ WARN_ON_ONCE(1);
+ return 0;
+ }
+ return val;
+ }
+
switch (field->size) {
case 1:
if (field->is_signed)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 034/365] tracing/eprobes: Have event probes be consistent with kprobes and uprobes
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 033/365] tracing/eprobes: Fix reading of string fields Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 035/365] tracing/probes: Have kprobes and uprobes use $COMM too Greg Kroah-Hartman
` (335 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ingo Molnar, Andrew Morton,
Masami Hiramatsu, Tzvetomir Stoyanov, Tom Zanussi,
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit 6a832ec3d680b3a4f4fad5752672827d71bae501 upstream.
Currently, if a symbol "@" is attempted to be used with an event probe
(eprobes), it will cause a NULL pointer dereference crash.
Both kprobes and uprobes can reference data other than the main registers.
Such as immediate address, symbols and the current task name. Have eprobes
do the same thing.
For "comm", if "comm" is used and the event being attached to does not
have the "comm" field, then make it the "$comm" that kprobes has. This is
consistent to the way histograms and filters work.
Link: https://lkml.kernel.org/r/20220820134401.136924220@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 70 ++++++++++++++++++++++++++++++++++++++++----
1 file changed, 64 insertions(+), 6 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -226,6 +226,7 @@ static int trace_eprobe_tp_arg_update(st
struct probe_arg *parg = &ep->tp.args[i];
struct ftrace_event_field *field;
struct list_head *head;
+ int ret = -ENOENT;
head = trace_get_fields(ep->event);
list_for_each_entry(field, head, link) {
@@ -235,9 +236,20 @@ static int trace_eprobe_tp_arg_update(st
return 0;
}
}
+
+ /*
+ * Argument not found on event. But allow for comm and COMM
+ * to be used to get the current->comm.
+ */
+ if (strcmp(parg->code->data, "COMM") == 0 ||
+ strcmp(parg->code->data, "comm") == 0) {
+ parg->code->op = FETCH_OP_COMM;
+ ret = 0;
+ }
+
kfree(parg->code->data);
parg->code->data = NULL;
- return -ENOENT;
+ return ret;
}
static int eprobe_event_define_fields(struct trace_event_call *event_call)
@@ -362,16 +374,38 @@ static unsigned long get_event_field(str
static int get_eprobe_size(struct trace_probe *tp, void *rec)
{
+ struct fetch_insn *code;
struct probe_arg *arg;
int i, len, ret = 0;
for (i = 0; i < tp->nr_args; i++) {
arg = tp->args + i;
- if (unlikely(arg->dynamic)) {
+ if (arg->dynamic) {
unsigned long val;
- val = get_event_field(arg->code, rec);
- len = process_fetch_insn_bottom(arg->code + 1, val, NULL, NULL);
+ code = arg->code;
+ retry:
+ switch (code->op) {
+ case FETCH_OP_TP_ARG:
+ val = get_event_field(code, rec);
+ break;
+ case FETCH_OP_IMM:
+ val = code->immediate;
+ break;
+ case FETCH_OP_COMM:
+ val = (unsigned long)current->comm;
+ break;
+ case FETCH_OP_DATA:
+ val = (unsigned long)code->data;
+ break;
+ case FETCH_NOP_SYMBOL: /* Ignore a place holder */
+ code++;
+ goto retry;
+ default:
+ continue;
+ }
+ code++;
+ len = process_fetch_insn_bottom(code, val, NULL, NULL);
if (len > 0)
ret += len;
}
@@ -389,8 +423,28 @@ process_fetch_insn(struct fetch_insn *co
{
unsigned long val;
- val = get_event_field(code, rec);
- return process_fetch_insn_bottom(code + 1, val, dest, base);
+ retry:
+ switch (code->op) {
+ case FETCH_OP_TP_ARG:
+ val = get_event_field(code, rec);
+ break;
+ case FETCH_OP_IMM:
+ val = code->immediate;
+ break;
+ case FETCH_OP_COMM:
+ val = (unsigned long)current->comm;
+ break;
+ case FETCH_OP_DATA:
+ val = (unsigned long)code->data;
+ break;
+ case FETCH_NOP_SYMBOL: /* Ignore a place holder */
+ code++;
+ goto retry;
+ default:
+ return -EILSEQ;
+ }
+ code++;
+ return process_fetch_insn_bottom(code, val, dest, base);
}
NOKPROBE_SYMBOL(process_fetch_insn)
@@ -862,6 +916,10 @@ static int trace_eprobe_tp_update_arg(st
if (ep->tp.args[i].code->op == FETCH_OP_TP_ARG)
ret = trace_eprobe_tp_arg_update(ep, i);
+ /* Handle symbols "@" */
+ if (!ret)
+ ret = traceprobe_update_arg(&ep->tp.args[i]);
+
return ret;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 035/365] tracing/probes: Have kprobes and uprobes use $COMM too
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 034/365] tracing/eprobes: Have event probes be consistent with kprobes and uprobes Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 036/365] tracing: Have filter accept "common_cpu" to be consistent Greg Kroah-Hartman
` (334 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ingo Molnar, Andrew Morton,
Tzvetomir Stoyanov, Tom Zanussi, Masami Hiramatsu (Google),
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit ab8384442ee512fc0fc72deeb036110843d0e7ff upstream.
Both $comm and $COMM can be used to get current->comm in eprobes and the
filtering and histogram logic. Make kprobes and uprobes consistent in this
regard and allow both $comm and $COMM as well. Currently kprobes and
uprobes only handle $comm, which is inconsistent with the other utilities,
and can be confusing to users.
Link: https://lkml.kernel.org/r/20220820134401.317014913@goodmis.org
Link: https://lore.kernel.org/all/20220820220442.776e1ddaf8836e82edb34d01@kernel.org/
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 533059281ee5 ("tracing: probeevent: Introduce new argument fetching code")
Suggested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -310,7 +310,7 @@ static int parse_probe_vars(char *arg, c
}
} else
goto inval_var;
- } else if (strcmp(arg, "comm") == 0) {
+ } else if (strcmp(arg, "comm") == 0 || strcmp(arg, "COMM") == 0) {
code->op = FETCH_OP_COMM;
#ifdef CONFIG_HAVE_FUNCTION_ARG_ACCESS_API
} else if (((flags & TPARG_FL_MASK) ==
@@ -621,7 +621,8 @@ static int traceprobe_parse_probe_arg_bo
* we can find those by strcmp. But ignore for eprobes.
*/
if (!(flags & TPARG_FL_TPOINT) &&
- (strcmp(arg, "$comm") == 0 || strncmp(arg, "\\\"", 2) == 0)) {
+ (strcmp(arg, "$comm") == 0 || strcmp(arg, "$COMM") == 0 ||
+ strncmp(arg, "\\\"", 2) == 0)) {
/* The type of $comm must be "string", and not an array. */
if (parg->count || (t && strcmp(t, "string")))
goto out;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 036/365] tracing: Have filter accept "common_cpu" to be consistent
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 035/365] tracing/probes: Have kprobes and uprobes use $COMM too Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 037/365] ALSA: usb-audio: More comprehensive mixer map for ASUS ROG Zenith II Greg Kroah-Hartman
` (333 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ingo Molnar, Andrew Morton,
Tzvetomir Stoyanov, Tom Zanussi, Masami Hiramatsu (Google),
Steven Rostedt (Google)
From: Steven Rostedt (Google) <rostedt@goodmis.org>
commit b2380577d4fe1c0ef3fa50417f1e441c016e4cbe upstream.
Make filtering consistent with histograms. As "cpu" can be a field of an
event, allow for "common_cpu" to keep it from being confused with the
"cpu" field of the event.
Link: https://lkml.kernel.org/r/20220820134401.513062765@goodmis.org
Link: https://lore.kernel.org/all/20220820220920.e42fa32b70505b1904f0a0ad@kernel.org/
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 1e3bac71c5053 ("tracing/histogram: Rename "cpu" to "common_cpu"")
Suggested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -176,6 +176,7 @@ static int trace_define_generic_fields(v
__generic_field(int, CPU, FILTER_CPU);
__generic_field(int, cpu, FILTER_CPU);
+ __generic_field(int, common_cpu, FILTER_CPU);
__generic_field(char *, COMM, FILTER_COMM);
__generic_field(char *, comm, FILTER_COMM);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 037/365] ALSA: usb-audio: More comprehensive mixer map for ASUS ROG Zenith II
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 036/365] tracing: Have filter accept "common_cpu" to be consistent Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:58 ` [PATCH 5.19 038/365] ALSA: hda: Fix crash due to jack poll in suspend Greg Kroah-Hartman
` (332 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai
From: Takashi Iwai <tiwai@suse.de>
commit 6bc2906253e723d1ab1acc652b55b83e286bfec2 upstream.
ASUS ROG Zenith II has two USB interfaces, one for the front headphone
and another for the rest I/O. Currently we provided the mixer mapping
for the latter but with an incomplete form.
This patch corrects and provides more comprehensive mixer mapping, as
well as providing the proper device names for both the front headphone
and main audio.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211005
Fixes: 2a48218f8e23 ("ALSA: usb-audio: Add mixer workaround for TRX40 and co")
Link: https://lore.kernel.org/r/20220809073259.18849-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/card.c | 8 ++++++++
sound/usb/mixer_maps.c | 34 +++++++++++++++++++++++++---------
2 files changed, 33 insertions(+), 9 deletions(-)
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -387,6 +387,14 @@ static const struct usb_audio_device_nam
DEVICE_NAME(0x05e1, 0x0408, "Syntek", "STK1160"),
DEVICE_NAME(0x05e1, 0x0480, "Hauppauge", "Woodbury"),
+ /* ASUS ROG Zenith II: this machine has also two devices, one for
+ * the front headphone and another for the rest
+ */
+ PROFILE_NAME(0x0b05, 0x1915, "ASUS", "Zenith II Front Headphone",
+ "Zenith-II-Front-Headphone"),
+ PROFILE_NAME(0x0b05, 0x1916, "ASUS", "Zenith II Main Audio",
+ "Zenith-II-Main-Audio"),
+
/* ASUS ROG Strix */
PROFILE_NAME(0x0b05, 0x1917,
"Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -374,13 +374,28 @@ static const struct usbmix_name_map cors
{ 0 }
};
-/* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX
- * response for Input Gain Pad (id=19, control=12) and the connector status
- * for SPDIF terminal (id=18). Skip them.
- */
-static const struct usbmix_name_map asus_rog_map[] = {
- { 18, NULL }, /* OT, connector control */
- { 19, NULL, 12 }, /* FU, Input Gain Pad */
+/* ASUS ROG Zenith II with Realtek ALC1220-VB */
+static const struct usbmix_name_map asus_zenith_ii_map[] = {
+ { 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */
+ { 16, "Speaker" }, /* OT */
+ { 22, "Speaker Playback" }, /* FU */
+ { 7, "Line" }, /* IT */
+ { 19, "Line Capture" }, /* FU */
+ { 8, "Mic" }, /* IT */
+ { 20, "Mic Capture" }, /* FU */
+ { 9, "Front Mic" }, /* IT */
+ { 21, "Front Mic Capture" }, /* FU */
+ { 17, "IEC958" }, /* OT */
+ { 23, "IEC958 Playback" }, /* FU */
+ {}
+};
+
+static const struct usbmix_connector_map asus_zenith_ii_connector_map[] = {
+ { 10, 16 }, /* (Back) Speaker */
+ { 11, 17 }, /* SPDIF */
+ { 13, 7 }, /* Line */
+ { 14, 8 }, /* Mic */
+ { 15, 9 }, /* Front Mic */
{}
};
@@ -611,9 +626,10 @@ static const struct usbmix_ctl_map usbmi
.map = gigabyte_b450_map,
.connector_map = gigabyte_b450_connector_map,
},
- { /* ASUS ROG Zenith II */
+ { /* ASUS ROG Zenith II (main audio) */
.id = USB_ID(0x0b05, 0x1916),
- .map = asus_rog_map,
+ .map = asus_zenith_ii_map,
+ .connector_map = asus_zenith_ii_connector_map,
},
{ /* ASUS ROG Strix */
.id = USB_ID(0x0b05, 0x1917),
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 038/365] ALSA: hda: Fix crash due to jack poll in suspend
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 037/365] ALSA: usb-audio: More comprehensive mixer map for ASUS ROG Zenith II Greg Kroah-Hartman
@ 2022-08-23 7:58 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 039/365] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Greg Kroah-Hartman
` (331 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Mohan Kumar, Takashi Iwai
From: Mohan Kumar <mkumard@nvidia.com>
commit 636aa8807b5780b76609b40cd3d3e1b5a225471c upstream.
With jackpoll_in_suspend flag set, there is a possibility that
jack poll worker thread will run even after system suspend was
completed. Any register access after system pm callback flow
will result in kernel crash as still jack poll worker thread
tries to access registers.
To fix the crash issue during system flow, cancel the jack poll
worker thread during system pm prepare callback and cancel the
worker thread at start of runtime suspend callback and re-schedule
at last to avoid any unwarranted access of register by worker thread
during suspend flow.
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Fixes: b33115bd05af ("ALSA: hda: Jack detection poll in suspend state")
Link: https://lore.kernel.org/r/20220811052704.2944-1-mkumard@nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/hda_codec.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2935,8 +2935,7 @@ static int hda_codec_runtime_suspend(str
if (!codec->card)
return 0;
- if (!codec->bus->jackpoll_in_suspend)
- cancel_delayed_work_sync(&codec->jackpoll_work);
+ cancel_delayed_work_sync(&codec->jackpoll_work);
state = hda_call_codec_suspend(codec);
if (codec->link_down_at_suspend ||
@@ -2944,6 +2943,11 @@ static int hda_codec_runtime_suspend(str
(state & AC_PWRST_CLK_STOP_OK)))
snd_hdac_codec_link_down(&codec->core);
snd_hda_codec_display_power(codec, false);
+
+ if (codec->bus->jackpoll_in_suspend &&
+ (dev->power.power_state.event != PM_EVENT_SUSPEND))
+ schedule_delayed_work(&codec->jackpoll_work,
+ codec->jackpoll_interval);
return 0;
}
@@ -2967,6 +2971,9 @@ static int hda_codec_runtime_resume(stru
#ifdef CONFIG_PM_SLEEP
static int hda_codec_pm_prepare(struct device *dev)
{
+ struct hda_codec *codec = dev_to_hda_codec(dev);
+
+ cancel_delayed_work_sync(&codec->jackpoll_work);
dev->power.power_state = PMSG_SUSPEND;
return pm_runtime_suspended(dev);
}
@@ -2986,9 +2993,6 @@ static void hda_codec_pm_complete(struct
static int hda_codec_pm_suspend(struct device *dev)
{
- struct hda_codec *codec = dev_to_hda_codec(dev);
-
- cancel_delayed_work_sync(&codec->jackpoll_work);
dev->power.power_state = PMSG_SUSPEND;
return pm_runtime_force_suspend(dev);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 039/365] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2022-08-23 7:58 ` [PATCH 5.19 038/365] ALSA: hda: Fix crash due to jack poll in suspend Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 040/365] can: ems_usb: fix clangs -Wunaligned-access warning Greg Kroah-Hartman
` (330 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Nícolas F . R . A . Prado,
Krzysztof Kozlowski, Chunfeng Yun
From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
commit b2c510ffe29f20a5f6ff31ae28d32ffa494b8cfb upstream.
Add missing "minItems: 1" to the interrupt-names property to allow the
second interrupt-names, "wakeup", to be optional.
Fixes: fe8e488058c4 ("dt-bindings: usb: mtk-xhci: add wakeup interrupt")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220623193702.817996-2-nfraprado@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 1 +
1 file changed, 1 insertion(+)
--- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
@@ -57,6 +57,7 @@ properties:
- description: optional, wakeup interrupt used to support runtime PM
interrupt-names:
+ minItems: 1
items:
- const: host
- const: wakeup
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 040/365] can: ems_usb: fix clangs -Wunaligned-access warning
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 039/365] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 041/365] apparmor: fix quiet_denied for file rules Greg Kroah-Hartman
` (329 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Gerhard Uttenthaler, Sebastian Haas,
Marc Kleine-Budde
From: Marc Kleine-Budde <mkl@pengutronix.de>
commit a4cb6e62ea4d36e53fb3c0f18ea4503d7b76674f upstream.
clang emits a -Wunaligned-access warning on struct __packed
ems_cpc_msg.
The reason is that the anonymous union msg (not declared as packed) is
being packed right after some non naturally aligned variables (3*8
bits + 2*32) inside a packed struct:
| struct __packed ems_cpc_msg {
| u8 type; /* type of message */
| u8 length; /* length of data within union 'msg' */
| u8 msgid; /* confirmation handle */
| __le32 ts_sec; /* timestamp in seconds */
| __le32 ts_nsec; /* timestamp in nano seconds */
| /* ^ not naturally aligned */
|
| union {
| /* ^ not declared as packed */
| u8 generic[64];
| struct cpc_can_msg can_msg;
| struct cpc_can_params can_params;
| struct cpc_confirm confirmation;
| struct cpc_overrun overrun;
| struct cpc_can_error error;
| struct cpc_can_err_counter err_counter;
| u8 can_state;
| } msg;
| };
Starting from LLVM 14, having an unpacked struct nested in a packed
struct triggers a warning. c.f. [1].
Fix the warning by marking the anonymous union as packed.
[1] https://github.com/llvm/llvm-project/issues/55520
Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Link: https://lore.kernel.org/all/20220802094021.959858-1-mkl@pengutronix.de
Cc: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/ems_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -194,7 +194,7 @@ struct __packed ems_cpc_msg {
__le32 ts_sec; /* timestamp in seconds */
__le32 ts_nsec; /* timestamp in nano seconds */
- union {
+ union __packed {
u8 generic[64];
struct cpc_can_msg can_msg;
struct cpc_can_params can_params;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 041/365] apparmor: fix quiet_denied for file rules
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 040/365] can: ems_usb: fix clangs -Wunaligned-access warning Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 042/365] apparmor: fix absroot causing audited secids to begin with = Greg Kroah-Hartman
` (328 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, John Johansen
From: John Johansen <john.johansen@canonical.com>
commit 68ff8540cc9e4ab557065b3f635c1ff4c96e1f1c upstream.
Global quieting of denied AppArmor generated file events is not
handled correctly. Unfortunately the is checking if quieting of all
audit events is set instead of just denied events.
Fixes: 67012e8209df ("AppArmor: basic auditing infrastructure.")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/audit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/apparmor/audit.c
+++ b/security/apparmor/audit.c
@@ -137,7 +137,7 @@ int aa_audit(int type, struct aa_profile
}
if (AUDIT_MODE(profile) == AUDIT_QUIET ||
(type == AUDIT_APPARMOR_DENIED &&
- AUDIT_MODE(profile) == AUDIT_QUIET))
+ AUDIT_MODE(profile) == AUDIT_QUIET_DENIED))
return aad(sa)->error;
if (KILL_MODE(profile) && type == AUDIT_APPARMOR_DENIED)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 042/365] apparmor: fix absroot causing audited secids to begin with =
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 041/365] apparmor: fix quiet_denied for file rules Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 043/365] apparmor: Fix failed mount permission check error message Greg Kroah-Hartman
` (327 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Casey Schaufler, John Johansen
From: John Johansen <john.johansen@canonical.com>
commit 511f7b5b835726e844a5fc7444c18e4b8672edfd upstream.
AppArmor is prefixing secids that are converted to secctx with the =
to indicate the secctx should only be parsed from an absolute root
POV. This allows catching errors where secctx are reparsed back into
internal labels.
Unfortunately because audit is using secid to secctx conversion this
means that subject and object labels can result in a very unfortunate
== that can break audit parsing.
eg. the subj==unconfined term in the below audit message
type=USER_LOGIN msg=audit(1639443365.233:160): pid=1633 uid=0 auid=1000
ses=3 subj==unconfined msg='op=login id=1000 exe="/usr/sbin/sshd"
hostname=192.168.122.1 addr=192.168.122.1 terminal=/dev/pts/1 res=success'
Fix this by switch the prepending of = to a _. This still works as a
special character to flag this case without breaking audit. Also move
this check behind debug as it should not be needed during normal
operqation.
Fixes: 26b7899510ae ("apparmor: add support for absolute root view based labels")
Reported-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/include/lib.h | 5 +++++
security/apparmor/label.c | 7 ++++---
2 files changed, 9 insertions(+), 3 deletions(-)
--- a/security/apparmor/include/lib.h
+++ b/security/apparmor/include/lib.h
@@ -22,6 +22,11 @@
*/
#define DEBUG_ON (aa_g_debug)
+/*
+ * split individual debug cases out in preparation for finer grained
+ * debug controls in the future.
+ */
+#define AA_DEBUG_LABEL DEBUG_ON
#define dbg_printk(__fmt, __args...) pr_debug(__fmt, ##__args)
#define AA_DEBUG(fmt, args...) \
do { \
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -1631,9 +1631,9 @@ int aa_label_snxprint(char *str, size_t
AA_BUG(!str && size != 0);
AA_BUG(!label);
- if (flags & FLAG_ABS_ROOT) {
+ if (AA_DEBUG_LABEL && (flags & FLAG_ABS_ROOT)) {
ns = root_ns;
- len = snprintf(str, size, "=");
+ len = snprintf(str, size, "_");
update_for_len(total, len, size, str);
} else if (!ns) {
ns = labels_ns(label);
@@ -1895,7 +1895,8 @@ struct aa_label *aa_label_strn_parse(str
AA_BUG(!str);
str = skipn_spaces(str, n);
- if (str == NULL || (*str == '=' && base != &root_ns->unconfined->label))
+ if (str == NULL || (AA_DEBUG_LABEL && *str == '_' &&
+ base != &root_ns->unconfined->label))
return ERR_PTR(-EINVAL);
len = label_count_strn_entries(str, end - str);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 043/365] apparmor: Fix failed mount permission check error message
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 042/365] apparmor: fix absroot causing audited secids to begin with = Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 044/365] apparmor: fix aa_label_asxprint return check Greg Kroah-Hartman
` (326 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, John Johansen
From: John Johansen <john.johansen@canonical.com>
commit ec240b5905bbb09a03dccffee03062cf39e38dc2 upstream.
When the mount check fails due to a permission check failure instead
of explicitly at one of the subcomponent checks, AppArmor is reporting
a failure in the flags match. However this is not true and AppArmor
can not attribute the error at this point to any particular component,
and should only indicate the mount failed due to missing permissions.
Fixes: 2ea3ffb7782a ("apparmor: add mount mediation")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/mount.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/security/apparmor/mount.c
+++ b/security/apparmor/mount.c
@@ -229,7 +229,8 @@ static const char * const mnt_info_table
"failed srcname match",
"failed type match",
"failed flags match",
- "failed data match"
+ "failed data match",
+ "failed perms check"
};
/*
@@ -284,8 +285,8 @@ static int do_match_mnt(struct aa_dfa *d
return 0;
}
- /* failed at end of flags match */
- return 4;
+ /* failed at perms check, don't confuse with flags match */
+ return 6;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 044/365] apparmor: fix aa_label_asxprint return check
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 043/365] apparmor: Fix failed mount permission check error message Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 045/365] apparmor: fix setting unconfined mode on a loaded profile Greg Kroah-Hartman
` (325 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Tom Rix, John Johansen
From: Tom Rix <trix@redhat.com>
commit 3e2a3a0830a2090e766d0d887d52c67de2a6f323 upstream.
Clang static analysis reports this issue
label.c:1802:3: warning: 2nd function call argument
is an uninitialized value
pr_info("%s", str);
^~~~~~~~~~~~~~~~~~
str is set from a successful call to aa_label_asxprint(&str, ...)
On failure a negative value is returned, not a -1. So change
the check.
Fixes: f1bd904175e8 ("apparmor: add the base fns() for domain labels")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/label.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -1744,7 +1744,7 @@ void aa_label_xaudit(struct audit_buffer
if (!use_label_hname(ns, label, flags) ||
display_mode(ns, label, flags)) {
len = aa_label_asxprint(&name, ns, label, flags, gfp);
- if (len == -1) {
+ if (len < 0) {
AA_DEBUG("label print error");
return;
}
@@ -1772,7 +1772,7 @@ void aa_label_seq_xprint(struct seq_file
int len;
len = aa_label_asxprint(&str, ns, label, flags, gfp);
- if (len == -1) {
+ if (len < 0) {
AA_DEBUG("label print error");
return;
}
@@ -1795,7 +1795,7 @@ void aa_label_xprintk(struct aa_ns *ns,
int len;
len = aa_label_asxprint(&str, ns, label, flags, gfp);
- if (len == -1) {
+ if (len < 0) {
AA_DEBUG("label print error");
return;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 045/365] apparmor: fix setting unconfined mode on a loaded profile
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 044/365] apparmor: fix aa_label_asxprint return check Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 046/365] apparmor: fix overlapping attachment computation Greg Kroah-Hartman
` (324 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, John Johansen
From: John Johansen <john.johansen@canonical.com>
commit 3bbb7b2e9bbcd22e539e23034da753898fe3b4dc upstream.
When loading a profile that is set to unconfined mode, that label
flag is not set when it should be. Ensure it is set so that when
used in a label the unconfined check will be applied correctly.
Fixes: 038165070aa5 ("apparmor: allow setting any profile into the unconfined state")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/policy_unpack.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -746,16 +746,18 @@ static struct aa_profile *unpack_profile
profile->label.flags |= FLAG_HAT;
if (!unpack_u32(e, &tmp, NULL))
goto fail;
- if (tmp == PACKED_MODE_COMPLAIN || (e->version & FORCE_COMPLAIN_FLAG))
+ if (tmp == PACKED_MODE_COMPLAIN || (e->version & FORCE_COMPLAIN_FLAG)) {
profile->mode = APPARMOR_COMPLAIN;
- else if (tmp == PACKED_MODE_ENFORCE)
+ } else if (tmp == PACKED_MODE_ENFORCE) {
profile->mode = APPARMOR_ENFORCE;
- else if (tmp == PACKED_MODE_KILL)
+ } else if (tmp == PACKED_MODE_KILL) {
profile->mode = APPARMOR_KILL;
- else if (tmp == PACKED_MODE_UNCONFINED)
+ } else if (tmp == PACKED_MODE_UNCONFINED) {
profile->mode = APPARMOR_UNCONFINED;
- else
+ profile->label.flags |= FLAG_UNCONFINED;
+ } else {
goto fail;
+ }
if (!unpack_u32(e, &tmp, NULL))
goto fail;
if (tmp)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 046/365] apparmor: fix overlapping attachment computation
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 045/365] apparmor: fix setting unconfined mode on a loaded profile Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 047/365] apparmor: fix reference count leak in aa_pivotroot() Greg Kroah-Hartman
` (323 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, John Johansen
From: John Johansen <john.johansen@canonical.com>
commit 2504db207146543736e877241f3b3de005cbe056 upstream.
When finding the profile via patterned attachments, the longest left
match is being set to the static compile time value and not using the
runtime computed value.
Fix this by setting the candidate value to the greater of the
precomputed value or runtime computed value.
Fixes: 21f606610502 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/domain.c | 2 +-
security/apparmor/include/policy.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -466,7 +466,7 @@ restart:
* xattrs, or a longer match
*/
candidate = profile;
- candidate_len = profile->xmatch_len;
+ candidate_len = max(count, profile->xmatch_len);
candidate_xattrs = ret;
conflict = false;
}
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -135,7 +135,7 @@ struct aa_profile {
const char *attach;
struct aa_dfa *xmatch;
- int xmatch_len;
+ unsigned int xmatch_len;
enum audit_mode audit;
long mode;
u32 path_flags;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 047/365] apparmor: fix reference count leak in aa_pivotroot()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 046/365] apparmor: fix overlapping attachment computation Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 048/365] apparmor: Fix memleak in aa_simple_write_to_buffer() Greg Kroah-Hartman
` (322 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Xiyu Yang, Xin Tan, Xin Xiong, John Johansen
From: Xin Xiong <xiongx18@fudan.edu.cn>
commit 11c3627ec6b56c1525013f336f41b79a983b4d46 upstream.
The aa_pivotroot() function has a reference counting bug in a specific
path. When aa_replace_current_label() returns on success, the function
forgets to decrement the reference count of “target”, which is
increased earlier by build_pivotroot(), causing a reference leak.
Fix it by decreasing the refcount of “target” in that path.
Fixes: 2ea3ffb7782a ("apparmor: add mount mediation")
Co-developed-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Co-developed-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/mount.c | 1 +
1 file changed, 1 insertion(+)
--- a/security/apparmor/mount.c
+++ b/security/apparmor/mount.c
@@ -719,6 +719,7 @@ int aa_pivotroot(struct aa_label *label,
aa_put_label(target);
goto out;
}
+ aa_put_label(target);
} else
/* already audited error */
error = PTR_ERR(target);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 048/365] apparmor: Fix memleak in aa_simple_write_to_buffer()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 047/365] apparmor: fix reference count leak in aa_pivotroot() Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 049/365] Documentation: ACPI: EINJ: Fix obsolete example Greg Kroah-Hartman
` (321 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Xiu Jianfeng, John Johansen
From: Xiu Jianfeng <xiujianfeng@huawei.com>
commit 417ea9fe972d2654a268ad66e89c8fcae67017c3 upstream.
When copy_from_user failed, the memory is freed by kvfree. however the
management struct and data blob are allocated independently, so only
kvfree(data) cause a memleak issue here. Use aa_put_loaddata(data) to
fix this issue.
Fixes: a6a52579e52b5 ("apparmor: split load data into management struct and data blob")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/apparmor/apparmorfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -401,7 +401,7 @@ static struct aa_loaddata *aa_simple_wri
data->size = copy_size;
if (copy_from_user(data->data, userbuf, copy_size)) {
- kvfree(data);
+ aa_put_loaddata(data);
return ERR_PTR(-EFAULT);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 049/365] Documentation: ACPI: EINJ: Fix obsolete example
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 048/365] apparmor: Fix memleak in aa_simple_write_to_buffer() Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 050/365] netfilter: nf_tables: fix crash when nf_trace is enabled Greg Kroah-Hartman
` (320 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Qifu Zhang, Tony Luck, Rafael J. Wysocki
From: Qifu Zhang <zhangqifu@bytedance.com>
commit 9066e151c37950af92c3be6a7270daa8e8063db9 upstream.
Since commit 488dac0c9237 ("libfs: fix error cast of negative value in
simple_attr_write()"), the EINJ debugfs interface no longer accepts
negative values as input. Attempt to do so will result in EINVAL.
Fixes: 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()")
Signed-off-by: Qifu Zhang <zhangqifu@bytedance.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/firmware-guide/acpi/apei/einj.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Documentation/firmware-guide/acpi/apei/einj.rst
+++ b/Documentation/firmware-guide/acpi/apei/einj.rst
@@ -168,7 +168,7 @@ An error injection example::
0x00000008 Memory Correctable
0x00000010 Memory Uncorrectable non-fatal
# echo 0x12345000 > param1 # Set memory address for injection
- # echo $((-1 << 12)) > param2 # Mask 0xfffffffffffff000 - anywhere in this page
+ # echo 0xfffffffffffff000 > param2 # Mask - anywhere in this page
# echo 0x8 > error_type # Choose correctable memory error
# echo 1 > error_inject # Inject now
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 050/365] netfilter: nf_tables: fix crash when nf_trace is enabled
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 049/365] Documentation: ACPI: EINJ: Fix obsolete example Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 051/365] net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null Greg Kroah-Hartman
` (319 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hangbin Liu, Florian Westphal,
Jakub Kicinski
From: Florian Westphal <fw@strlen.de>
commit 399a14ec7993d605740de7b2cd5c0ce8407d12ed upstream.
do not access info->pkt when info->trace is not 1.
nft_traceinfo is not initialized, except when tracing is enabled.
The 'nft_trace_enabled' static key cannot be used for this, we must
always check info->trace first.
Pass nft_pktinfo directly to avoid this.
Fixes: e34b9ed96ce3 ("netfilter: nf_tables: avoid skb access on nf_stolen")
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_core.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c
index 3ddce24ac76d..cee3e4e905ec 100644
--- a/net/netfilter/nf_tables_core.c
+++ b/net/netfilter/nf_tables_core.c
@@ -34,25 +34,23 @@ static noinline void __nft_trace_packet(struct nft_traceinfo *info,
nft_trace_notify(info);
}
-static inline void nft_trace_packet(struct nft_traceinfo *info,
+static inline void nft_trace_packet(const struct nft_pktinfo *pkt,
+ struct nft_traceinfo *info,
const struct nft_chain *chain,
const struct nft_rule_dp *rule,
enum nft_trace_types type)
{
if (static_branch_unlikely(&nft_trace_enabled)) {
- const struct nft_pktinfo *pkt = info->pkt;
-
info->nf_trace = pkt->skb->nf_trace;
info->rule = rule;
__nft_trace_packet(info, chain, type);
}
}
-static inline void nft_trace_copy_nftrace(struct nft_traceinfo *info)
+static inline void nft_trace_copy_nftrace(const struct nft_pktinfo *pkt,
+ struct nft_traceinfo *info)
{
if (static_branch_unlikely(&nft_trace_enabled)) {
- const struct nft_pktinfo *pkt = info->pkt;
-
if (info->trace)
info->nf_trace = pkt->skb->nf_trace;
}
@@ -96,7 +94,6 @@ static noinline void __nft_trace_verdict(struct nft_traceinfo *info,
const struct nft_chain *chain,
const struct nft_regs *regs)
{
- const struct nft_pktinfo *pkt = info->pkt;
enum nft_trace_types type;
switch (regs->verdict.code) {
@@ -110,7 +107,9 @@ static noinline void __nft_trace_verdict(struct nft_traceinfo *info,
break;
default:
type = NFT_TRACETYPE_RULE;
- info->nf_trace = pkt->skb->nf_trace;
+
+ if (info->trace)
+ info->nf_trace = info->pkt->skb->nf_trace;
break;
}
@@ -271,10 +270,10 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
switch (regs.verdict.code) {
case NFT_BREAK:
regs.verdict.code = NFT_CONTINUE;
- nft_trace_copy_nftrace(&info);
+ nft_trace_copy_nftrace(pkt, &info);
continue;
case NFT_CONTINUE:
- nft_trace_packet(&info, chain, rule,
+ nft_trace_packet(pkt, &info, chain, rule,
NFT_TRACETYPE_RULE);
continue;
}
@@ -318,7 +317,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
goto next_rule;
}
- nft_trace_packet(&info, basechain, NULL, NFT_TRACETYPE_POLICY);
+ nft_trace_packet(pkt, &info, basechain, NULL, NFT_TRACETYPE_POLICY);
if (static_branch_unlikely(&nft_counters_enabled))
nft_update_chain_stats(basechain, pkt);
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 051/365] net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 050/365] netfilter: nf_tables: fix crash when nf_trace is enabled Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 052/365] NFSv4.1: Dont decrease the value of seq_nr_highest_sent Greg Kroah-Hartman
` (318 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Cezar Bulinaru, Willem de Bruijn,
David S. Miller
From: Cezar Bulinaru <cbulinaru@gmail.com>
commit 4f61f133f354853bc394ec7d6028adb9b02dd701 upstream.
Fixes a NULL pointer derefence bug triggered from tap driver.
When tap_get_user calls virtio_net_hdr_to_skb the skb->dev is null
(in tap.c skb->dev is set after the call to virtio_net_hdr_to_skb)
virtio_net_hdr_to_skb calls dev_parse_header_protocol which
needs skb->dev field to be valid.
The line that trigers the bug is in dev_parse_header_protocol
(dev is at offset 0x10 from skb and is stored in RAX register)
if (!dev->header_ops || !dev->header_ops->parse_protocol)
22e1: mov 0x10(%rbx),%rax
22e5: mov 0x230(%rax),%rax
Setting skb->dev before the call in tap.c fixes the issue.
BUG: kernel NULL pointer dereference, address: 0000000000000230
RIP: 0010:virtio_net_hdr_to_skb.constprop.0+0x335/0x410 [tap]
Code: c0 0f 85 b7 fd ff ff eb d4 41 39 c6 77 cf 29 c6 48 89 df 44 01 f6 e8 7a 79 83 c1 48 85 c0 0f 85 d9 fd ff ff eb b7 48 8b 43 10 <48> 8b 80 30 02 00 00 48 85 c0 74 55 48 8b 40 28 48 85 c0 74 4c 48
RSP: 0018:ffffc90005c27c38 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff888298f25300 RCX: 0000000000000010
RDX: 0000000000000005 RSI: ffffc90005c27cb6 RDI: ffff888298f25300
RBP: ffffc90005c27c80 R08: 00000000ffffffea R09: 00000000000007e8
R10: ffff88858ec77458 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000014 R14: ffffc90005c27e08 R15: ffffc90005c27cb6
FS: 0000000000000000(0000) GS:ffff88858ec40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000230 CR3: 0000000281408006 CR4: 00000000003706e0
Call Trace:
tap_get_user+0x3f1/0x540 [tap]
tap_sendmsg+0x56/0x362 [tap]
? get_tx_bufs+0xc2/0x1e0 [vhost_net]
handle_tx_copy+0x114/0x670 [vhost_net]
handle_tx+0xb0/0xe0 [vhost_net]
handle_tx_kick+0x15/0x20 [vhost_net]
vhost_worker+0x7b/0xc0 [vhost]
? vhost_vring_call_reset+0x40/0x40 [vhost]
kthread+0xfa/0x120
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x1f/0x30
Fixes: 924a9bc362a5 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct")
Signed-off-by: Cezar Bulinaru <cbulinaru@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/tap.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -716,10 +716,20 @@ static ssize_t tap_get_user(struct tap_q
skb_reset_mac_header(skb);
skb->protocol = eth_hdr(skb)->h_proto;
+ rcu_read_lock();
+ tap = rcu_dereference(q->tap);
+ if (!tap) {
+ kfree_skb(skb);
+ rcu_read_unlock();
+ return total_len;
+ }
+ skb->dev = tap->dev;
+
if (vnet_hdr_len) {
err = virtio_net_hdr_to_skb(skb, &vnet_hdr,
tap_is_little_endian(q));
if (err) {
+ rcu_read_unlock();
drop_reason = SKB_DROP_REASON_DEV_HDR;
goto err_kfree;
}
@@ -732,8 +742,6 @@ static ssize_t tap_get_user(struct tap_q
__vlan_get_protocol(skb, skb->protocol, &depth) != 0)
skb_set_network_header(skb, depth);
- rcu_read_lock();
- tap = rcu_dereference(q->tap);
/* copy skb_ubuf_info for callback when skb has no error */
if (zerocopy) {
skb_zcopy_init(skb, msg_control);
@@ -742,14 +750,8 @@ static ssize_t tap_get_user(struct tap_q
uarg->callback(NULL, uarg, false);
}
- if (tap) {
- skb->dev = tap->dev;
- dev_queue_xmit(skb);
- } else {
- kfree_skb(skb);
- }
+ dev_queue_xmit(skb);
rcu_read_unlock();
-
return total_len;
err_kfree:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 052/365] NFSv4.1: Dont decrease the value of seq_nr_highest_sent
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 051/365] net: tap: NULL pointer derefence in dev_parse_header_protocol when skb->dev is null Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 053/365] NFSv4.1: Handle NFS4ERR_DELAY replies to OP_SEQUENCE correctly Greg Kroah-Hartman
` (317 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Trond Myklebust
From: Trond Myklebust <trond.myklebust@hammerspace.com>
commit f07a5d2427fc113dc50c5c818eba8929bc27b8ca upstream.
When we're trying to figure out what the server may or may not have seen
in terms of request numbers, do not assume that requests with a larger
number were missed, just because we saw a reply to a request with a
smaller number.
Fixes: 3453d5708b33 ("NFSv4.1: Avoid false retries when RPC calls are interrupted")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -784,10 +784,9 @@ static void nfs4_slot_sequence_record_se
if ((s32)(seqnr - slot->seq_nr_highest_sent) > 0)
slot->seq_nr_highest_sent = seqnr;
}
-static void nfs4_slot_sequence_acked(struct nfs4_slot *slot,
- u32 seqnr)
+static void nfs4_slot_sequence_acked(struct nfs4_slot *slot, u32 seqnr)
{
- slot->seq_nr_highest_sent = seqnr;
+ nfs4_slot_sequence_record_sent(slot, seqnr);
slot->seq_nr_last_acked = seqnr;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 053/365] NFSv4.1: Handle NFS4ERR_DELAY replies to OP_SEQUENCE correctly
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 052/365] NFSv4.1: Dont decrease the value of seq_nr_highest_sent Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 054/365] NFSv4: Fix races in the legacy idmapper upcall Greg Kroah-Hartman
` (316 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Trond Myklebust
From: Trond Myklebust <trond.myklebust@hammerspace.com>
commit 7ccafd4b2b9f34e6d8185f796f151c47424e273e upstream.
Don't assume that the NFS4ERR_DELAY means that the server is processing
this slot id.
Fixes: 3453d5708b33 ("NFSv4.1: Avoid false retries when RPC calls are interrupted")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 1 -
1 file changed, 1 deletion(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -853,7 +853,6 @@ static int nfs41_sequence_process(struct
__func__,
slot->slot_nr,
slot->seq_nr);
- nfs4_slot_sequence_acked(slot, slot->seq_nr);
goto out_retry;
case -NFS4ERR_RETRY_UNCACHED_REP:
case -NFS4ERR_SEQ_FALSE_RETRY:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 054/365] NFSv4: Fix races in the legacy idmapper upcall
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 053/365] NFSv4.1: Handle NFS4ERR_DELAY replies to OP_SEQUENCE correctly Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 055/365] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Greg Kroah-Hartman
` (315 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Trond Myklebust
From: Trond Myklebust <trond.myklebust@hammerspace.com>
commit 51fd2eb52c0ca8275a906eed81878ef50ae94eb0 upstream.
nfs_idmap_instantiate() will cause the process that is waiting in
request_key_with_auxdata() to wake up and exit. If there is a second
process waiting for the idmap->idmap_mutex, then it may wake up and
start a new call to request_key_with_auxdata(). If the call to
idmap_pipe_downcall() from the first process has not yet finished
calling nfs_idmap_complete_pipe_upcall_locked(), then we may end up
triggering the WARN_ON_ONCE() in nfs_idmap_prepare_pipe_upcall().
The fix is to ensure that we clear idmap->idmap_upcall_data before
calling nfs_idmap_instantiate().
Fixes: e9ab41b620e4 ("NFSv4: Clean up the legacy idmapper upcall")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4idmap.c | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
--- a/fs/nfs/nfs4idmap.c
+++ b/fs/nfs/nfs4idmap.c
@@ -561,22 +561,20 @@ nfs_idmap_prepare_pipe_upcall(struct idm
return true;
}
-static void
-nfs_idmap_complete_pipe_upcall_locked(struct idmap *idmap, int ret)
+static void nfs_idmap_complete_pipe_upcall(struct idmap_legacy_upcalldata *data,
+ int ret)
{
- struct key *authkey = idmap->idmap_upcall_data->authkey;
-
- kfree(idmap->idmap_upcall_data);
- idmap->idmap_upcall_data = NULL;
- complete_request_key(authkey, ret);
- key_put(authkey);
+ complete_request_key(data->authkey, ret);
+ key_put(data->authkey);
+ kfree(data);
}
-static void
-nfs_idmap_abort_pipe_upcall(struct idmap *idmap, int ret)
+static void nfs_idmap_abort_pipe_upcall(struct idmap *idmap,
+ struct idmap_legacy_upcalldata *data,
+ int ret)
{
- if (idmap->idmap_upcall_data != NULL)
- nfs_idmap_complete_pipe_upcall_locked(idmap, ret);
+ if (cmpxchg(&idmap->idmap_upcall_data, data, NULL) == data)
+ nfs_idmap_complete_pipe_upcall(data, ret);
}
static int nfs_idmap_legacy_upcall(struct key *authkey, void *aux)
@@ -613,7 +611,7 @@ static int nfs_idmap_legacy_upcall(struc
ret = rpc_queue_upcall(idmap->idmap_pipe, msg);
if (ret < 0)
- nfs_idmap_abort_pipe_upcall(idmap, ret);
+ nfs_idmap_abort_pipe_upcall(idmap, data, ret);
return ret;
out2:
@@ -669,6 +667,7 @@ idmap_pipe_downcall(struct file *filp, c
struct request_key_auth *rka;
struct rpc_inode *rpci = RPC_I(file_inode(filp));
struct idmap *idmap = (struct idmap *)rpci->private;
+ struct idmap_legacy_upcalldata *data;
struct key *authkey;
struct idmap_msg im;
size_t namelen_in;
@@ -678,10 +677,11 @@ idmap_pipe_downcall(struct file *filp, c
* will have been woken up and someone else may now have used
* idmap_key_cons - so after this point we may no longer touch it.
*/
- if (idmap->idmap_upcall_data == NULL)
+ data = xchg(&idmap->idmap_upcall_data, NULL);
+ if (data == NULL)
goto out_noupcall;
- authkey = idmap->idmap_upcall_data->authkey;
+ authkey = data->authkey;
rka = get_request_key_auth(authkey);
if (mlen != sizeof(im)) {
@@ -703,18 +703,17 @@ idmap_pipe_downcall(struct file *filp, c
if (namelen_in == 0 || namelen_in == IDMAP_NAMESZ) {
ret = -EINVAL;
goto out;
-}
+ }
- ret = nfs_idmap_read_and_verify_message(&im,
- &idmap->idmap_upcall_data->idmap_msg,
- rka->target_key, authkey);
+ ret = nfs_idmap_read_and_verify_message(&im, &data->idmap_msg,
+ rka->target_key, authkey);
if (ret >= 0) {
key_set_timeout(rka->target_key, nfs_idmap_cache_timeout);
ret = mlen;
}
out:
- nfs_idmap_complete_pipe_upcall_locked(idmap, ret);
+ nfs_idmap_complete_pipe_upcall(data, ret);
out_noupcall:
return ret;
}
@@ -728,7 +727,7 @@ idmap_pipe_destroy_msg(struct rpc_pipe_m
struct idmap *idmap = data->idmap;
if (msg->errno)
- nfs_idmap_abort_pipe_upcall(idmap, msg->errno);
+ nfs_idmap_abort_pipe_upcall(idmap, data, msg->errno);
}
static void
@@ -736,8 +735,11 @@ idmap_release_pipe(struct inode *inode)
{
struct rpc_inode *rpci = RPC_I(inode);
struct idmap *idmap = (struct idmap *)rpci->private;
+ struct idmap_legacy_upcalldata *data;
- nfs_idmap_abort_pipe_upcall(idmap, -EPIPE);
+ data = xchg(&idmap->idmap_upcall_data, NULL);
+ if (data)
+ nfs_idmap_complete_pipe_upcall(data, -EPIPE);
}
int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, kuid_t *uid)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 055/365] NFSv4.1: RECLAIM_COMPLETE must handle EACCES
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 054/365] NFSv4: Fix races in the legacy idmapper upcall Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 056/365] NFSv4/pnfs: Fix a use-after-free bug in open Greg Kroah-Hartman
` (314 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Zhang Xianwei, Yi Wang, Trond Myklebust
From: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
commit e35a5e782f67ed76a65ad0f23a484444a95f000f upstream.
A client should be able to handle getting an EACCES error while doing
a mount operation to reclaim state due to NFS4CLNT_RECLAIM_REBOOT
being set. If the server returns RPC_AUTH_BADCRED because authentication
failed when we execute "exportfs -au", then RECLAIM_COMPLETE will go a
wrong way. After mount succeeds, all OPEN call will fail due to an
NFS4ERR_GRACE error being returned. This patch is to fix it by resending
a RPC request.
Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Fixes: aa5190d0ed7d ("NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 3 +++
1 file changed, 3 insertions(+)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -9475,6 +9475,9 @@ static int nfs41_reclaim_complete_handle
rpc_delay(task, NFS4_POLL_RETRY_MAX);
fallthrough;
case -NFS4ERR_RETRY_UNCACHED_REP:
+ case -EACCES:
+ dprintk("%s: failed to reclaim complete error %d for server %s, retrying\n",
+ __func__, task->tk_status, clp->cl_hostname);
return -EAGAIN;
case -NFS4ERR_BADSESSION:
case -NFS4ERR_DEADSESSION:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 056/365] NFSv4/pnfs: Fix a use-after-free bug in open
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 055/365] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 057/365] mptcp, btf: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Greg Kroah-Hartman
` (313 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Trond Myklebust
From: Trond Myklebust <trond.myklebust@hammerspace.com>
commit 2135e5d56278ffdb1c2e6d325dc6b87f669b9dac upstream.
If someone cancels the open RPC call, then we must not try to free
either the open slot or the layoutget operation arguments, since they
are likely still in use by the hung RPC call.
Fixes: 6949493884fe ("NFSv4: Don't hold the layoutget locks across multiple RPC calls")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3096,12 +3096,13 @@ static int _nfs4_open_and_get_state(stru
}
out:
- if (opendata->lgp) {
- nfs4_lgopen_release(opendata->lgp);
- opendata->lgp = NULL;
- }
- if (!opendata->cancelled)
+ if (!opendata->cancelled) {
+ if (opendata->lgp) {
+ nfs4_lgopen_release(opendata->lgp);
+ opendata->lgp = NULL;
+ }
nfs4_sequence_free_slot(&opendata->o_res.seq_res);
+ }
return ret;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 057/365] mptcp, btf: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 056/365] NFSv4/pnfs: Fix a use-after-free bug in open Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 058/365] mptcp: move subflow cleanup in mptcp_destroy_common() Greg Kroah-Hartman
` (312 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jiri Olsa, Daniel Borkmann,
Mat Martineau, Martin KaFai Lau
From: Jiri Olsa <jolsa@kernel.org>
commit f1d41f7720c89705c20e4335a807b1c518c2e7be upstream.
The btf_sock_ids array needs struct mptcp_sock BTF ID for the
bpf_skc_to_mptcp_sock helper.
When CONFIG_MPTCP is disabled, the 'struct mptcp_sock' is not
defined and resolve_btfids will complain with:
[...]
BTFIDS vmlinux
WARN: resolve_btfids: unresolved symbol mptcp_sock
[...]
Add an empty definition for struct mptcp_sock when CONFIG_MPTCP
is disabled.
Fixes: 3bc253c2e652 ("bpf: Add bpf_skc_to_mptcp_sock_proto")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20220802163324.1873044-1-jolsa@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/mptcp.h | 4 ++++
1 file changed, 4 insertions(+)
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -290,4 +290,8 @@ struct mptcp_sock *bpf_mptcp_sock_from_s
static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; }
#endif
+#if !IS_ENABLED(CONFIG_MPTCP)
+struct mptcp_sock { };
+#endif
+
#endif /* __NET_MPTCP_H */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 058/365] mptcp: move subflow cleanup in mptcp_destroy_common()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 057/365] mptcp, btf: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 059/365] mptcp: do not queue data on closed subflows Greg Kroah-Hartman
` (311 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Nguyen Dinh Phi, Mat Martineau,
Paolo Abeni, David S. Miller
From: Paolo Abeni <pabeni@redhat.com>
commit c0bf3c6aa444a5ef44acc57ef6cfa53fd4fc1c9b upstream.
If the mptcp socket creation fails due to a CGROUP_INET_SOCK_CREATE
eBPF program, the MPTCP protocol ends-up leaking all the subflows:
the related cleanup happens in __mptcp_destroy_sock() that is not
invoked in such code path.
Address the issue moving the subflow sockets cleanup in the
mptcp_destroy_common() helper, which is invoked in every msk cleanup
path.
Additionally get rid of the intermediate list_splice_init step, which
is an unneeded relic from the past.
The issue is present since before the reported root cause commit, but
any attempt to backport the fix before that hash will require a complete
rewrite.
Fixes: e16163b6e2 ("mptcp: refactor shutdown and close")
Reported-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Co-developed-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/protocol.c | 39 +++++++++++++++------------------------
net/mptcp/protocol.h | 2 +-
net/mptcp/subflow.c | 3 ++-
3 files changed, 18 insertions(+), 26 deletions(-)
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2805,30 +2805,16 @@ static void __mptcp_wr_shutdown(struct s
static void __mptcp_destroy_sock(struct sock *sk)
{
- struct mptcp_subflow_context *subflow, *tmp;
struct mptcp_sock *msk = mptcp_sk(sk);
- LIST_HEAD(conn_list);
pr_debug("msk=%p", msk);
might_sleep();
- /* join list will be eventually flushed (with rst) at sock lock release time*/
- list_splice_init(&msk->conn_list, &conn_list);
-
mptcp_stop_timer(sk);
sk_stop_timer(sk, &sk->sk_timer);
msk->pm.status = 0;
- /* clears msk->subflow, allowing the following loop to close
- * even the initial subflow
- */
- mptcp_dispose_initial_subflow(msk);
- list_for_each_entry_safe(subflow, tmp, &conn_list, node) {
- struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
- __mptcp_close_ssk(sk, ssk, subflow, 0);
- }
-
sk->sk_prot->destroy(sk);
WARN_ON_ONCE(msk->rmem_fwd_alloc);
@@ -2920,24 +2906,20 @@ static void mptcp_copy_inaddrs(struct so
static int mptcp_disconnect(struct sock *sk, int flags)
{
- struct mptcp_subflow_context *subflow, *tmp;
struct mptcp_sock *msk = mptcp_sk(sk);
inet_sk_state_store(sk, TCP_CLOSE);
- list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) {
- struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
-
- __mptcp_close_ssk(sk, ssk, subflow, MPTCP_CF_FASTCLOSE);
- }
-
mptcp_stop_timer(sk);
sk_stop_timer(sk, &sk->sk_timer);
if (mptcp_sk(sk)->token)
mptcp_event(MPTCP_EVENT_CLOSED, mptcp_sk(sk), NULL, GFP_KERNEL);
- mptcp_destroy_common(msk);
+ /* msk->subflow is still intact, the following will not free the first
+ * subflow
+ */
+ mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE);
msk->last_snd = NULL;
WRITE_ONCE(msk->flags, 0);
msk->cb_flags = 0;
@@ -3087,12 +3069,17 @@ out:
return newsk;
}
-void mptcp_destroy_common(struct mptcp_sock *msk)
+void mptcp_destroy_common(struct mptcp_sock *msk, unsigned int flags)
{
+ struct mptcp_subflow_context *subflow, *tmp;
struct sock *sk = (struct sock *)msk;
__mptcp_clear_xmit(sk);
+ /* join list will be eventually flushed (with rst) at sock lock release time */
+ list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node)
+ __mptcp_close_ssk(sk, mptcp_subflow_tcp_sock(subflow), subflow, flags);
+
/* move to sk_receive_queue, sk_stream_kill_queues will purge it */
mptcp_data_lock(sk);
skb_queue_splice_tail_init(&msk->receive_queue, &sk->sk_receive_queue);
@@ -3114,7 +3101,11 @@ static void mptcp_destroy(struct sock *s
{
struct mptcp_sock *msk = mptcp_sk(sk);
- mptcp_destroy_common(msk);
+ /* clears msk->subflow, allowing the following to close
+ * even the initial subflow
+ */
+ mptcp_dispose_initial_subflow(msk);
+ mptcp_destroy_common(msk, 0);
sk_sockets_allocated_dec(sk);
}
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -718,7 +718,7 @@ static inline void mptcp_write_space(str
}
}
-void mptcp_destroy_common(struct mptcp_sock *msk);
+void mptcp_destroy_common(struct mptcp_sock *msk, unsigned int flags);
#define MPTCP_TOKEN_MAX_RETRIES 4
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -621,7 +621,8 @@ static void mptcp_sock_destruct(struct s
sock_orphan(sk);
}
- mptcp_destroy_common(mptcp_sk(sk));
+ /* We don't need to clear msk->subflow, as it's still NULL at this point */
+ mptcp_destroy_common(mptcp_sk(sk), 0);
inet_sock_destruct(sk);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 059/365] mptcp: do not queue data on closed subflows
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 058/365] mptcp: move subflow cleanup in mptcp_destroy_common() Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 060/365] selftests: mptcp: make sendfile selftest work Greg Kroah-Hartman
` (310 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dipanjan Das, Mat Martineau,
Paolo Abeni, David S. Miller
From: Paolo Abeni <pabeni@redhat.com>
commit c886d70286bf3ad411eb3d689328a67f7102c6ae upstream.
Dipanjan reported a syzbot splat at close time:
WARNING: CPU: 1 PID: 10818 at net/ipv4/af_inet.c:153
inet_sock_destruct+0x6d0/0x8e0 net/ipv4/af_inet.c:153
Modules linked in: uio_ivshmem(OE) uio(E)
CPU: 1 PID: 10818 Comm: kworker/1:16 Tainted: G OE
5.19.0-rc6-g2eae0556bb9d #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
Workqueue: events mptcp_worker
RIP: 0010:inet_sock_destruct+0x6d0/0x8e0 net/ipv4/af_inet.c:153
Code: 21 02 00 00 41 8b 9c 24 28 02 00 00 e9 07 ff ff ff e8 34 4d 91
f9 89 ee 4c 89 e7 e8 4a 47 60 ff e9 a6 fc ff ff e8 20 4d 91 f9 <0f> 0b
e9 84 fe ff ff e8 14 4d 91 f9 0f 0b e9 d4 fd ff ff e8 08 4d
RSP: 0018:ffffc9001b35fa78 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00000000002879d0 RCX: ffff8881326f3b00
RDX: 0000000000000000 RSI: ffff8881326f3b00 RDI: 0000000000000002
RBP: ffff888179662674 R08: ffffffff87e983a0 R09: 0000000000000000
R10: 0000000000000005 R11: 00000000000004ea R12: ffff888179662400
R13: ffff888179662428 R14: 0000000000000001 R15: ffff88817e38e258
FS: 0000000000000000(0000) GS:ffff8881f5f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020007bc0 CR3: 0000000179592000 CR4: 0000000000150ee0
Call Trace:
<TASK>
__sk_destruct+0x4f/0x8e0 net/core/sock.c:2067
sk_destruct+0xbd/0xe0 net/core/sock.c:2112
__sk_free+0xef/0x3d0 net/core/sock.c:2123
sk_free+0x78/0xa0 net/core/sock.c:2134
sock_put include/net/sock.h:1927 [inline]
__mptcp_close_ssk+0x50f/0x780 net/mptcp/protocol.c:2351
__mptcp_destroy_sock+0x332/0x760 net/mptcp/protocol.c:2828
mptcp_worker+0x5d2/0xc90 net/mptcp/protocol.c:2586
process_one_work+0x9cc/0x1650 kernel/workqueue.c:2289
worker_thread+0x623/0x1070 kernel/workqueue.c:2436
kthread+0x2e9/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
</TASK>
The root cause of the problem is that an mptcp-level (re)transmit can
race with mptcp_close() and the packet scheduler checks the subflow
state before acquiring the socket lock: we can try to (re)transmit on
an already closed ssk.
Fix the issue checking again the subflow socket status under the
subflow socket lock protection. Additionally add the missing check
for the fallback-to-tcp case.
Fixes: d5f49190def6 ("mptcp: allow picking different xmit subflows")
Reported-by: Dipanjan Das <mail.dipanjan.das@gmail.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/protocol.c | 8 +++++++-
net/mptcp/protocol.h | 11 +++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1276,6 +1276,9 @@ static int mptcp_sendmsg_frag(struct soc
info->limit > dfrag->data_len))
return 0;
+ if (unlikely(!__tcp_can_send(ssk)))
+ return -EAGAIN;
+
/* compute send limit */
info->mss_now = tcp_send_mss(ssk, &info->size_goal, info->flags);
copy = info->size_goal;
@@ -1449,7 +1452,8 @@ static struct sock *mptcp_subflow_get_se
if (__mptcp_check_fallback(msk)) {
if (!msk->first)
return NULL;
- return sk_stream_memory_free(msk->first) ? msk->first : NULL;
+ return __tcp_can_send(msk->first) &&
+ sk_stream_memory_free(msk->first) ? msk->first : NULL;
}
/* re-use last subflow, if the burst allow that */
@@ -1600,6 +1604,8 @@ void __mptcp_push_pending(struct sock *s
ret = mptcp_sendmsg_frag(sk, ssk, dfrag, &info);
if (ret <= 0) {
+ if (ret == -EAGAIN)
+ continue;
mptcp_push_release(ssk, &info);
goto out;
}
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -625,16 +625,19 @@ void mptcp_info2sockaddr(const struct mp
struct sockaddr_storage *addr,
unsigned short family);
-static inline bool __mptcp_subflow_active(struct mptcp_subflow_context *subflow)
+static inline bool __tcp_can_send(const struct sock *ssk)
{
- struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
+ /* only send if our side has not closed yet */
+ return ((1 << inet_sk_state_load(ssk)) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT));
+}
+static inline bool __mptcp_subflow_active(struct mptcp_subflow_context *subflow)
+{
/* can't send if JOIN hasn't completed yet (i.e. is usable for mptcp) */
if (subflow->request_join && !subflow->fully_established)
return false;
- /* only send if our side has not closed yet */
- return ((1 << ssk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT));
+ return __tcp_can_send(mptcp_subflow_tcp_sock(subflow));
}
void mptcp_subflow_set_active(struct mptcp_subflow_context *subflow);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 060/365] selftests: mptcp: make sendfile selftest work
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 059/365] mptcp: do not queue data on closed subflows Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 061/365] BPF: Fix potential bad pointer dereference in bpf_sys_bpf() Greg Kroah-Hartman
` (309 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Xiumei Mu, Mat Martineau,
Florian Westphal, David S. Miller
From: Florian Westphal <fw@strlen.de>
commit df9e03aec3b14970df05b72d54f8ac9da3ab29e1 upstream.
When the selftest got added, sendfile() on mptcp sockets returned
-EOPNOTSUPP, so running 'mptcp_connect.sh -m sendfile' failed
immediately.
This is no longer the case, but the script fails anyway due to timeout.
Let the receiver know once the sender has sent all data, just like
with '-m mmap' mode.
v2: need to respect cfg_wait too, as pm_userspace.sh relied
on -m sendfile to keep the connection open (Mat Martineau)
Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp")
Reported-by: Xiumei Mu <xmu@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/net/mptcp/mptcp_connect.c | 26 ++++++++++++++--------
1 file changed, 17 insertions(+), 9 deletions(-)
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -553,6 +553,18 @@ static void set_nonblock(int fd, bool no
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
}
+static void shut_wr(int fd)
+{
+ /* Close our write side, ev. give some time
+ * for address notification and/or checking
+ * the current status
+ */
+ if (cfg_wait)
+ usleep(cfg_wait);
+
+ shutdown(fd, SHUT_WR);
+}
+
static int copyfd_io_poll(int infd, int peerfd, int outfd, bool *in_closed_after_out)
{
struct pollfd fds = {
@@ -630,14 +642,7 @@ static int copyfd_io_poll(int infd, int
/* ... and peer also closed already */
break;
- /* ... but we still receive.
- * Close our write side, ev. give some time
- * for address notification and/or checking
- * the current status
- */
- if (cfg_wait)
- usleep(cfg_wait);
- shutdown(peerfd, SHUT_WR);
+ shut_wr(peerfd);
} else {
if (errno == EINTR)
continue;
@@ -767,7 +772,7 @@ static int copyfd_io_mmap(int infd, int
if (err)
return err;
- shutdown(peerfd, SHUT_WR);
+ shut_wr(peerfd);
err = do_recvfile(peerfd, outfd);
*in_closed_after_out = true;
@@ -791,6 +796,9 @@ static int copyfd_io_sendfile(int infd,
err = do_sendfile(infd, peerfd, size);
if (err)
return err;
+
+ shut_wr(peerfd);
+
err = do_recvfile(peerfd, outfd);
*in_closed_after_out = true;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 061/365] BPF: Fix potential bad pointer dereference in bpf_sys_bpf()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 060/365] selftests: mptcp: make sendfile selftest work Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 062/365] bpf: Disallow bpf programs call prog_run command Greg Kroah-Hartman
` (308 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jinghao Jia, Yonghong Song,
Alexei Starovoitov
From: Jinghao Jia <jinghao@linux.ibm.com>
commit e2dcac2f58f5a95ab092d1da237ffdc0da1832cf upstream.
The bpf_sys_bpf() helper function allows an eBPF program to load another
eBPF program from within the kernel. In this case the argument union
bpf_attr pointer (as well as the insns and license pointers inside) is a
kernel address instead of a userspace address (which is the case of a
usual bpf() syscall). To make the memory copying process in the syscall
work in both cases, bpfptr_t was introduced to wrap around the pointer
and distinguish its origin. Specifically, when copying memory contents
from a bpfptr_t, a copy_from_user() is performed in case of a userspace
address and a memcpy() is performed for a kernel address.
This can lead to problems because the in-kernel pointer is never checked
for validity. The problem happens when an eBPF syscall program tries to
call bpf_sys_bpf() to load a program but provides a bad insns pointer --
say 0xdeadbeef -- in the bpf_attr union. The helper calls __sys_bpf()
which would then call bpf_prog_load() to load the program.
bpf_prog_load() is responsible for copying the eBPF instructions to the
newly allocated memory for the program; it creates a kernel bpfptr_t for
insns and invokes copy_from_bpfptr(). Internally, all bpfptr_t
operations are backed by the corresponding sockptr_t operations, which
performs direct memcpy() on kernel pointers for copy_from/strncpy_from
operations. Therefore, the code is always happy to dereference the bad
pointer to trigger a un-handle-able page fault and in turn an oops.
However, this is not supposed to happen because at that point the eBPF
program is already verified and should not cause a memory error.
Sample KASAN trace:
[ 25.685056][ T228] ==================================================================
[ 25.685680][ T228] BUG: KASAN: user-memory-access in copy_from_bpfptr+0x21/0x30
[ 25.686210][ T228] Read of size 80 at addr 00000000deadbeef by task poc/228
[ 25.686732][ T228]
[ 25.686893][ T228] CPU: 3 PID: 228 Comm: poc Not tainted 5.19.0-rc7 #7
[ 25.687375][ T228] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014
[ 25.687991][ T228] Call Trace:
[ 25.688223][ T228] <TASK>
[ 25.688429][ T228] dump_stack_lvl+0x73/0x9e
[ 25.688747][ T228] print_report+0xea/0x200
[ 25.689061][ T228] ? copy_from_bpfptr+0x21/0x30
[ 25.689401][ T228] ? _printk+0x54/0x6e
[ 25.689693][ T228] ? _raw_spin_lock_irqsave+0x70/0xd0
[ 25.690071][ T228] ? copy_from_bpfptr+0x21/0x30
[ 25.690412][ T228] kasan_report+0xb5/0xe0
[ 25.690716][ T228] ? copy_from_bpfptr+0x21/0x30
[ 25.691059][ T228] kasan_check_range+0x2bd/0x2e0
[ 25.691405][ T228] ? copy_from_bpfptr+0x21/0x30
[ 25.691734][ T228] memcpy+0x25/0x60
[ 25.692000][ T228] copy_from_bpfptr+0x21/0x30
[ 25.692328][ T228] bpf_prog_load+0x604/0x9e0
[ 25.692653][ T228] ? cap_capable+0xb4/0xe0
[ 25.692956][ T228] ? security_capable+0x4f/0x70
[ 25.693324][ T228] __sys_bpf+0x3af/0x580
[ 25.693635][ T228] bpf_sys_bpf+0x45/0x240
[ 25.693937][ T228] bpf_prog_f0ec79a5a3caca46_bpf_func1+0xa2/0xbd
[ 25.694394][ T228] bpf_prog_run_pin_on_cpu+0x2f/0xb0
[ 25.694756][ T228] bpf_prog_test_run_syscall+0x146/0x1c0
[ 25.695144][ T228] bpf_prog_test_run+0x172/0x190
[ 25.695487][ T228] __sys_bpf+0x2c5/0x580
[ 25.695776][ T228] __x64_sys_bpf+0x3a/0x50
[ 25.696084][ T228] do_syscall_64+0x60/0x90
[ 25.696393][ T228] ? fpregs_assert_state_consistent+0x50/0x60
[ 25.696815][ T228] ? exit_to_user_mode_prepare+0x36/0xa0
[ 25.697202][ T228] ? syscall_exit_to_user_mode+0x20/0x40
[ 25.697586][ T228] ? do_syscall_64+0x6e/0x90
[ 25.697899][ T228] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 25.698312][ T228] RIP: 0033:0x7f6d543fb759
[ 25.698624][ T228] Code: 08 5b 89 e8 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 97 a6 0e 00 f7 d8 64 89 01 48
[ 25.699946][ T228] RSP: 002b:00007ffc3df78468 EFLAGS: 00000287 ORIG_RAX: 0000000000000141
[ 25.700526][ T228] RAX: ffffffffffffffda RBX: 00007ffc3df78628 RCX: 00007f6d543fb759
[ 25.701071][ T228] RDX: 0000000000000090 RSI: 00007ffc3df78478 RDI: 000000000000000a
[ 25.701636][ T228] RBP: 00007ffc3df78510 R08: 0000000000000000 R09: 0000000000300000
[ 25.702191][ T228] R10: 0000000000000005 R11: 0000000000000287 R12: 0000000000000000
[ 25.702736][ T228] R13: 00007ffc3df78638 R14: 000055a1584aca68 R15: 00007f6d5456a000
[ 25.703282][ T228] </TASK>
[ 25.703490][ T228] ==================================================================
[ 25.704050][ T228] Disabling lock debugging due to kernel taint
Update copy_from_bpfptr() and strncpy_from_bpfptr() so that:
- for a kernel pointer, it uses the safe copy_from_kernel_nofault() and
strncpy_from_kernel_nofault() functions.
- for a userspace pointer, it performs copy_from_user() and
strncpy_from_user().
Fixes: af2ac3e13e45 ("bpf: Prepare bpf syscall to be used from kernel and user space.")
Link: https://lore.kernel.org/bpf/20220727132905.45166-1-jinghao@linux.ibm.com/
Signed-off-by: Jinghao Jia <jinghao@linux.ibm.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220729201713.88688-1-jinghao@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/bpfptr.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/include/linux/bpfptr.h
+++ b/include/linux/bpfptr.h
@@ -49,7 +49,9 @@ static inline void bpfptr_add(bpfptr_t *
static inline int copy_from_bpfptr_offset(void *dst, bpfptr_t src,
size_t offset, size_t size)
{
- return copy_from_sockptr_offset(dst, (sockptr_t) src, offset, size);
+ if (!bpfptr_is_kernel(src))
+ return copy_from_user(dst, src.user + offset, size);
+ return copy_from_kernel_nofault(dst, src.kernel + offset, size);
}
static inline int copy_from_bpfptr(void *dst, bpfptr_t src, size_t size)
@@ -78,7 +80,9 @@ static inline void *kvmemdup_bpfptr(bpfp
static inline long strncpy_from_bpfptr(char *dst, bpfptr_t src, size_t count)
{
- return strncpy_from_sockptr(dst, (sockptr_t) src, count);
+ if (bpfptr_is_kernel(src))
+ return strncpy_from_kernel_nofault(dst, src.kernel, count);
+ return strncpy_from_user(dst, src.user, count);
}
#endif /* _LINUX_BPFPTR_H */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 062/365] bpf: Disallow bpf programs call prog_run command.
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 061/365] BPF: Fix potential bad pointer dereference in bpf_sys_bpf() Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 063/365] bpf: Dont reinit map value in prealloc_lru_pop Greg Kroah-Hartman
` (307 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, YiFei Zhu, Alexei Starovoitov
From: Alexei Starovoitov <ast@kernel.org>
commit 86f44fcec22ce2979507742bc53db8400e454f46 upstream.
The verifier cannot perform sufficient validation of bpf_attr->test.ctx_in
pointer, therefore bpf programs should not be allowed to call BPF_PROG_RUN
command from within the program.
To fix this issue split bpf_sys_bpf() bpf helper into normal kern_sys_bpf()
kernel function that can only be used by the kernel light skeleton directly.
Reported-by: YiFei Zhu <zhuyifei@google.com>
Fixes: b1d18a7574d0 ("bpf: Extend sys_bpf commands for bpf_syscall programs.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/bpf/syscall.c | 20 ++++++++++++++------
tools/lib/bpf/skel_internal.h | 4 ++--
2 files changed, 16 insertions(+), 8 deletions(-)
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -5035,9 +5035,6 @@ static bool syscall_prog_is_valid_access
BPF_CALL_3(bpf_sys_bpf, int, cmd, union bpf_attr *, attr, u32, attr_size)
{
- struct bpf_prog * __maybe_unused prog;
- struct bpf_tramp_run_ctx __maybe_unused run_ctx;
-
switch (cmd) {
case BPF_MAP_CREATE:
case BPF_MAP_UPDATE_ELEM:
@@ -5047,6 +5044,18 @@ BPF_CALL_3(bpf_sys_bpf, int, cmd, union
case BPF_LINK_CREATE:
case BPF_RAW_TRACEPOINT_OPEN:
break;
+ default:
+ return -EINVAL;
+ }
+ return __sys_bpf(cmd, KERNEL_BPFPTR(attr), attr_size);
+}
+
+int kern_sys_bpf(int cmd, union bpf_attr *attr, unsigned int size)
+{
+ struct bpf_prog * __maybe_unused prog;
+ struct bpf_tramp_run_ctx __maybe_unused run_ctx;
+
+ switch (cmd) {
#ifdef CONFIG_BPF_JIT /* __bpf_prog_enter_sleepable used by trampoline and JIT */
case BPF_PROG_TEST_RUN:
if (attr->test.data_in || attr->test.data_out ||
@@ -5077,11 +5086,10 @@ BPF_CALL_3(bpf_sys_bpf, int, cmd, union
return 0;
#endif
default:
- return -EINVAL;
+ return ____bpf_sys_bpf(cmd, attr, size);
}
- return __sys_bpf(cmd, KERNEL_BPFPTR(attr), attr_size);
}
-EXPORT_SYMBOL(bpf_sys_bpf);
+EXPORT_SYMBOL(kern_sys_bpf);
static const struct bpf_func_proto bpf_sys_bpf_proto = {
.func = bpf_sys_bpf,
--- a/tools/lib/bpf/skel_internal.h
+++ b/tools/lib/bpf/skel_internal.h
@@ -66,13 +66,13 @@ struct bpf_load_and_run_opts {
const char *errstr;
};
-long bpf_sys_bpf(__u32 cmd, void *attr, __u32 attr_size);
+long kern_sys_bpf(__u32 cmd, void *attr, __u32 attr_size);
static inline int skel_sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
unsigned int size)
{
#ifdef __KERNEL__
- return bpf_sys_bpf(cmd, attr, size);
+ return kern_sys_bpf(cmd, attr, size);
#else
return syscall(__NR_bpf, cmd, attr, size);
#endif
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 063/365] bpf: Dont reinit map value in prealloc_lru_pop
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 062/365] bpf: Disallow bpf programs call prog_run command Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 064/365] bpf: Acquire map uref in .init_seq_private for array map iterator Greg Kroah-Hartman
` (306 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Yonghong Song,
Kumar Kartikeya Dwivedi, Martin KaFai Lau, Alexei Starovoitov
From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
commit 275c30bcee66a27d1aa97a215d607ad6d49804cb upstream.
The LRU map that is preallocated may have its elements reused while
another program holds a pointer to it from bpf_map_lookup_elem. Hence,
only check_and_free_fields is appropriate when the element is being
deleted, as it ensures proper synchronization against concurrent access
of the map value. After that, we cannot call check_and_init_map_value
again as it may rewrite bpf_spin_lock, bpf_timer, and kptr fields while
they can be concurrently accessed from a BPF program.
This is safe to do as when the map entry is deleted, concurrent access
is protected against by check_and_free_fields, i.e. an existing timer
would be freed, and any existing kptr will be released by it. The
program can create further timers and kptrs after check_and_free_fields,
but they will eventually be released once the preallocated items are
freed on map destruction, even if the item is never reused again. Hence,
the deleted item sitting in the free list can still have resources
attached to it, and they would never leak.
With spin_lock, we never touch the field at all on delete or update, as
we may end up modifying the state of the lock. Since the verifier
ensures that a bpf_spin_lock call is always paired with bpf_spin_unlock
call, the program will eventually release the lock so that on reuse the
new user of the value can take the lock.
Essentially, for the preallocated case, we must assume that the map
value may always be in use by the program, even when it is sitting in
the freelist, and handle things accordingly, i.e. use proper
synchronization inside check_and_free_fields, and never reinitialize the
special fields when it is reused on update.
Fixes: 68134668c17f ("bpf: Add map side support for bpf timers.")
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/20220809213033.24147-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/bpf/hashtab.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -311,12 +311,8 @@ static struct htab_elem *prealloc_lru_po
struct htab_elem *l;
if (node) {
- u32 key_size = htab->map.key_size;
-
l = container_of(node, struct htab_elem, lru_node);
- memcpy(l->key, key, key_size);
- check_and_init_map_value(&htab->map,
- l->key + round_up(key_size, 8));
+ memcpy(l->key, key, htab->map.key_size);
return l;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 064/365] bpf: Acquire map uref in .init_seq_private for array map iterator
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 063/365] bpf: Dont reinit map value in prealloc_lru_pop Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 065/365] bpf: Acquire map uref in .init_seq_private for hash " Greg Kroah-Hartman
` (305 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hou Tao, Yonghong Song, Alexei Starovoitov
From: Hou Tao <houtao1@huawei.com>
commit f76fa6b338055054f80c72b29c97fb95c1becadc upstream.
bpf_iter_attach_map() acquires a map uref, and the uref may be released
before or in the middle of iterating map elements. For example, the uref
could be released in bpf_iter_detach_map() as part of
bpf_link_release(), or could be released in bpf_map_put_with_uref() as
part of bpf_map_release().
Alternative fix is acquiring an extra bpf_link reference just like
a pinned map iterator does, but it introduces unnecessary dependency
on bpf_link instead of bpf_map.
So choose another fix: acquiring an extra map uref in .init_seq_private
for array map iterator.
Fixes: d3cc2ab546ad ("bpf: Implement bpf iterator for array maps")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220810080538.1845898-2-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/bpf/arraymap.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -649,6 +649,11 @@ static int bpf_iter_init_array_map(void
seq_info->percpu_value_buf = value_buf;
}
+ /* bpf_iter_attach_map() acquires a map uref, and the uref may be
+ * released before or in the middle of iterating map elements, so
+ * acquire an extra map uref for iterator.
+ */
+ bpf_map_inc_with_uref(map);
seq_info->map = map;
return 0;
}
@@ -657,6 +662,7 @@ static void bpf_iter_fini_array_map(void
{
struct bpf_iter_seq_array_map_info *seq_info = priv_data;
+ bpf_map_put_with_uref(seq_info->map);
kfree(seq_info->percpu_value_buf);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 065/365] bpf: Acquire map uref in .init_seq_private for hash map iterator
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 064/365] bpf: Acquire map uref in .init_seq_private for array map iterator Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 066/365] bpf: Acquire map uref in .init_seq_private for sock local storage " Greg Kroah-Hartman
` (304 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hou Tao, Yonghong Song, Alexei Starovoitov
From: Hou Tao <houtao1@huawei.com>
commit ef1e93d2eeb58a1f08c37b22a2314b94bc045f15 upstream.
bpf_iter_attach_map() acquires a map uref, and the uref may be released
before or in the middle of iterating map elements. For example, the uref
could be released in bpf_iter_detach_map() as part of
bpf_link_release(), or could be released in bpf_map_put_with_uref() as
part of bpf_map_release().
So acquiring an extra map uref in bpf_iter_init_hash_map() and
releasing it in bpf_iter_fini_hash_map().
Fixes: d6c4503cc296 ("bpf: Implement bpf iterator for hash maps")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220810080538.1845898-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/bpf/hashtab.c | 2 ++
1 file changed, 2 insertions(+)
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -2060,6 +2060,7 @@ static int bpf_iter_init_hash_map(void *
seq_info->percpu_value_buf = value_buf;
}
+ bpf_map_inc_with_uref(map);
seq_info->map = map;
seq_info->htab = container_of(map, struct bpf_htab, map);
return 0;
@@ -2069,6 +2070,7 @@ static void bpf_iter_fini_hash_map(void
{
struct bpf_iter_seq_hash_map_info *seq_info = priv_data;
+ bpf_map_put_with_uref(seq_info->map);
kfree(seq_info->percpu_value_buf);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 066/365] bpf: Acquire map uref in .init_seq_private for sock local storage map iterator
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 065/365] bpf: Acquire map uref in .init_seq_private for hash " Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 067/365] bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator Greg Kroah-Hartman
` (303 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hou Tao, Yonghong Song,
Martin KaFai Lau, Alexei Starovoitov
From: Hou Tao <houtao1@huawei.com>
commit 3c5f6e698b5c538bbb23cd453b22e1e4922cffd8 upstream.
bpf_iter_attach_map() acquires a map uref, and the uref may be released
before or in the middle of iterating map elements. For example, the uref
could be released in bpf_iter_detach_map() as part of
bpf_link_release(), or could be released in bpf_map_put_with_uref() as
part of bpf_map_release().
So acquiring an extra map uref in bpf_iter_init_sk_storage_map() and
releasing it in bpf_iter_fini_sk_storage_map().
Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/20220810080538.1845898-4-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/bpf_sk_storage.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/net/core/bpf_sk_storage.c
+++ b/net/core/bpf_sk_storage.c
@@ -875,10 +875,18 @@ static int bpf_iter_init_sk_storage_map(
{
struct bpf_iter_seq_sk_storage_map_info *seq_info = priv_data;
+ bpf_map_inc_with_uref(aux->map);
seq_info->map = aux->map;
return 0;
}
+static void bpf_iter_fini_sk_storage_map(void *priv_data)
+{
+ struct bpf_iter_seq_sk_storage_map_info *seq_info = priv_data;
+
+ bpf_map_put_with_uref(seq_info->map);
+}
+
static int bpf_iter_attach_map(struct bpf_prog *prog,
union bpf_iter_link_info *linfo,
struct bpf_iter_aux_info *aux)
@@ -924,7 +932,7 @@ static const struct seq_operations bpf_s
static const struct bpf_iter_seq_info iter_seq_info = {
.seq_ops = &bpf_sk_storage_map_seq_ops,
.init_seq_private = bpf_iter_init_sk_storage_map,
- .fini_seq_private = NULL,
+ .fini_seq_private = bpf_iter_fini_sk_storage_map,
.seq_priv_size = sizeof(struct bpf_iter_seq_sk_storage_map_info),
};
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 067/365] bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 066/365] bpf: Acquire map uref in .init_seq_private for sock local storage " Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 068/365] bpf: Check the validity of max_rdwr_access for sock local storage map iterator Greg Kroah-Hartman
` (302 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hou Tao, Yonghong Song, Alexei Starovoitov
From: Hou Tao <houtao1@huawei.com>
commit f0d2b2716d71778d0b0c8eaa433c073287d69d93 upstream.
sock_map_iter_attach_target() acquires a map uref, and the uref may be
released before or in the middle of iterating map elements. For example,
the uref could be released in sock_map_iter_detach_target() as part of
bpf_link_release(), or could be released in bpf_map_put_with_uref() as
part of bpf_map_release().
Fixing it by acquiring an extra map uref in .init_seq_private and
releasing it in .fini_seq_private.
Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220810080538.1845898-5-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/sock_map.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
--- a/net/core/sock_map.c
+++ b/net/core/sock_map.c
@@ -783,13 +783,22 @@ static int sock_map_init_seq_private(voi
{
struct sock_map_seq_info *info = priv_data;
+ bpf_map_inc_with_uref(aux->map);
info->map = aux->map;
return 0;
}
+static void sock_map_fini_seq_private(void *priv_data)
+{
+ struct sock_map_seq_info *info = priv_data;
+
+ bpf_map_put_with_uref(info->map);
+}
+
static const struct bpf_iter_seq_info sock_map_iter_seq_info = {
.seq_ops = &sock_map_seq_ops,
.init_seq_private = sock_map_init_seq_private,
+ .fini_seq_private = sock_map_fini_seq_private,
.seq_priv_size = sizeof(struct sock_map_seq_info),
};
@@ -1369,18 +1378,27 @@ static const struct seq_operations sock_
};
static int sock_hash_init_seq_private(void *priv_data,
- struct bpf_iter_aux_info *aux)
+ struct bpf_iter_aux_info *aux)
{
struct sock_hash_seq_info *info = priv_data;
+ bpf_map_inc_with_uref(aux->map);
info->map = aux->map;
info->htab = container_of(aux->map, struct bpf_shtab, map);
return 0;
}
+static void sock_hash_fini_seq_private(void *priv_data)
+{
+ struct sock_hash_seq_info *info = priv_data;
+
+ bpf_map_put_with_uref(info->map);
+}
+
static const struct bpf_iter_seq_info sock_hash_iter_seq_info = {
.seq_ops = &sock_hash_seq_ops,
.init_seq_private = sock_hash_init_seq_private,
+ .fini_seq_private = sock_hash_fini_seq_private,
.seq_priv_size = sizeof(struct sock_hash_seq_info),
};
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 068/365] bpf: Check the validity of max_rdwr_access for sock local storage map iterator
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 067/365] bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 069/365] can: mcp251x: Fix race condition on receive interrupt Greg Kroah-Hartman
` (301 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Hou Tao, Yonghong Song,
Martin KaFai Lau, Alexei Starovoitov
From: Hou Tao <houtao1@huawei.com>
commit 52bd05eb7c88e1ad8541a48873188ccebca9da26 upstream.
The value of sock local storage map is writable in map iterator, so check
max_rdwr_access instead of max_rdonly_access.
Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/20220810080538.1845898-6-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/bpf_sk_storage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/core/bpf_sk_storage.c
+++ b/net/core/bpf_sk_storage.c
@@ -904,7 +904,7 @@ static int bpf_iter_attach_map(struct bp
if (map->map_type != BPF_MAP_TYPE_SK_STORAGE)
goto put_map;
- if (prog->aux->max_rdonly_access > map->value_size) {
+ if (prog->aux->max_rdwr_access > map->value_size) {
err = -EACCES;
goto put_map;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 069/365] can: mcp251x: Fix race condition on receive interrupt
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 068/365] bpf: Check the validity of max_rdwr_access for sock local storage map iterator Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 070/365] can: j1939: j1939_session_destroy(): fix memory leak of skbs Greg Kroah-Hartman
` (300 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sebastian Würl, Marc Kleine-Budde
From: Sebastian Würl <sebastian.wuerl@ororatech.com>
commit d80d60b0db6ff3dd2e29247cc2a5166d7e9ae37e upstream.
The mcp251x driver uses both receiving mailboxes of the CAN controller
chips. For retrieving the CAN frames from the controller via SPI, it checks
once per interrupt which mailboxes have been filled and will retrieve the
messages accordingly.
This introduces a race condition, as another CAN frame can enter mailbox 1
while mailbox 0 is emptied. If now another CAN frame enters mailbox 0 until
the interrupt handler is called next, mailbox 0 is emptied before
mailbox 1, leading to out-of-order CAN frames in the network device.
This is fixed by checking the interrupt flags once again after freeing
mailbox 0, to correctly also empty mailbox 1 before leaving the handler.
For reproducing the bug I created the following setup:
- Two CAN devices, one Raspberry Pi with MCP2515, the other can be any.
- Setup CAN to 1 MHz
- Spam bursts of 5 CAN-messages with increasing CAN-ids
- Continue sending the bursts while sleeping a second between the bursts
- Check on the RPi whether the received messages have increasing CAN-ids
- Without this patch, every burst of messages will contain a flipped pair
v3: https://lore.kernel.org/all/20220804075914.67569-1-sebastian.wuerl@ororatech.com
v2: https://lore.kernel.org/all/20220804064803.63157-1-sebastian.wuerl@ororatech.com
v1: https://lore.kernel.org/all/20220803153300.58732-1-sebastian.wuerl@ororatech.com
Fixes: bf66f3736a94 ("can: mcp251x: Move to threaded interrupts instead of workqueues.")
Signed-off-by: Sebastian Würl <sebastian.wuerl@ororatech.com>
Link: https://lore.kernel.org/all/20220804081411.68567-1-sebastian.wuerl@ororatech.com
[mkl: reduce scope of intf1, eflag1]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/spi/mcp251x.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -1069,9 +1069,6 @@ static irqreturn_t mcp251x_can_ist(int i
mcp251x_read_2regs(spi, CANINTF, &intf, &eflag);
- /* mask out flags we don't care about */
- intf &= CANINTF_RX | CANINTF_TX | CANINTF_ERR;
-
/* receive buffer 0 */
if (intf & CANINTF_RX0IF) {
mcp251x_hw_rx(spi, 0);
@@ -1081,6 +1078,18 @@ static irqreturn_t mcp251x_can_ist(int i
if (mcp251x_is_2510(spi))
mcp251x_write_bits(spi, CANINTF,
CANINTF_RX0IF, 0x00);
+
+ /* check if buffer 1 is already known to be full, no need to re-read */
+ if (!(intf & CANINTF_RX1IF)) {
+ u8 intf1, eflag1;
+
+ /* intf needs to be read again to avoid a race condition */
+ mcp251x_read_2regs(spi, CANINTF, &intf1, &eflag1);
+
+ /* combine flags from both operations for error handling */
+ intf |= intf1;
+ eflag |= eflag1;
+ }
}
/* receive buffer 1 */
@@ -1091,6 +1100,9 @@ static irqreturn_t mcp251x_can_ist(int i
clear_intf |= CANINTF_RX1IF;
}
+ /* mask out flags we don't care about */
+ intf &= CANINTF_RX | CANINTF_TX | CANINTF_ERR;
+
/* any error or tx interrupt we need to clear? */
if (intf & (CANINTF_ERR | CANINTF_TX))
clear_intf |= intf & (CANINTF_ERR | CANINTF_TX);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 070/365] can: j1939: j1939_session_destroy(): fix memory leak of skbs
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 069/365] can: mcp251x: Fix race condition on receive interrupt Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 071/365] net: atlantic: fix aq_vec index out of range error Greg Kroah-Hartman
` (299 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Oleksij Rempel, Fedor Pchelkin,
Alexey Khoroshilov, Marc Kleine-Budde
From: Fedor Pchelkin <pchelkin@ispras.ru>
commit 8c21c54a53ab21842f5050fa090f26b03c0313d6 upstream.
We need to drop skb references taken in j1939_session_skb_queue() when
destroying a session in j1939_session_destroy(). Otherwise those skbs
would be lost.
Link to Syzkaller info and repro: https://forge.ispras.ru/issues/11743.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
V1: https://lore.kernel.org/all/20220708175949.539064-1-pchelkin@ispras.ru
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Suggested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/all/20220805150216.66313-1-pchelkin@ispras.ru
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/can/j1939/transport.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -260,6 +260,8 @@ static void __j1939_session_drop(struct
static void j1939_session_destroy(struct j1939_session *session)
{
+ struct sk_buff *skb;
+
if (session->transmission) {
if (session->err)
j1939_sk_errqueue(session, J1939_ERRQUEUE_TX_ABORT);
@@ -274,7 +276,11 @@ static void j1939_session_destroy(struct
WARN_ON_ONCE(!list_empty(&session->sk_session_queue_entry));
WARN_ON_ONCE(!list_empty(&session->active_session_list_entry));
- skb_queue_purge(&session->skb_queue);
+ while ((skb = skb_dequeue(&session->skb_queue)) != NULL) {
+ /* drop ref taken in j1939_session_skb_queue() */
+ skb_unref(skb);
+ kfree_skb(skb);
+ }
__j1939_session_drop(session);
j1939_priv_put(session->priv);
kfree(session);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 071/365] net: atlantic: fix aq_vec index out of range error
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 070/365] can: j1939: j1939_session_destroy(): fix memory leak of skbs Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 072/365] m68k: coldfire/device.c: protect FLEXCAN blocks Greg Kroah-Hartman
` (298 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chia-Lin Kao (AceLan),
Sudarsana Reddy Kalluru, Jakub Kicinski
From: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
commit 2ba5e47fb75fbb8fab45f5c1bc8d5c33d8834bd3 upstream.
The final update statement of the for loop exceeds the array range, the
dereference of self->aq_vec[i] is not checked and then leads to the
index out of range error.
Also fixed this kind of coding style in other for loop.
[ 97.937604] UBSAN: array-index-out-of-bounds in drivers/net/ethernet/aquantia/atlantic/aq_nic.c:1404:48
[ 97.937607] index 8 is out of range for type 'aq_vec_s *[8]'
[ 97.937608] CPU: 38 PID: 3767 Comm: kworker/u256:18 Not tainted 5.19.0+ #2
[ 97.937610] Hardware name: Dell Inc. Precision 7865 Tower/, BIOS 1.0.0 06/12/2022
[ 97.937611] Workqueue: events_unbound async_run_entry_fn
[ 97.937616] Call Trace:
[ 97.937617] <TASK>
[ 97.937619] dump_stack_lvl+0x49/0x63
[ 97.937624] dump_stack+0x10/0x16
[ 97.937626] ubsan_epilogue+0x9/0x3f
[ 97.937627] __ubsan_handle_out_of_bounds.cold+0x44/0x49
[ 97.937629] ? __scm_send+0x348/0x440
[ 97.937632] ? aq_vec_stop+0x72/0x80 [atlantic]
[ 97.937639] aq_nic_stop+0x1b6/0x1c0 [atlantic]
[ 97.937644] aq_suspend_common+0x88/0x90 [atlantic]
[ 97.937648] aq_pm_suspend_poweroff+0xe/0x20 [atlantic]
[ 97.937653] pci_pm_suspend+0x7e/0x1a0
[ 97.937655] ? pci_pm_suspend_noirq+0x2b0/0x2b0
[ 97.937657] dpm_run_callback+0x54/0x190
[ 97.937660] __device_suspend+0x14c/0x4d0
[ 97.937661] async_suspend+0x23/0x70
[ 97.937663] async_run_entry_fn+0x33/0x120
[ 97.937664] process_one_work+0x21f/0x3f0
[ 97.937666] worker_thread+0x4a/0x3c0
[ 97.937668] ? process_one_work+0x3f0/0x3f0
[ 97.937669] kthread+0xf0/0x120
[ 97.937671] ? kthread_complete_and_exit+0x20/0x20
[ 97.937672] ret_from_fork+0x22/0x30
[ 97.937676] </TASK>
v2. fixed "warning: variable 'aq_vec' set but not used"
v3. simplified a for loop
Fixes: 97bde5c4f909 ("net: ethernet: aquantia: Support for NIC-specific code")
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Link: https://lore.kernel.org/r/20220808081845.42005-1-acelan.kao@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -265,12 +265,10 @@ static void aq_nic_service_timer_cb(stru
static void aq_nic_polling_timer_cb(struct timer_list *t)
{
struct aq_nic_s *self = from_timer(self, t, polling_timer);
- struct aq_vec_s *aq_vec = NULL;
unsigned int i = 0U;
- for (i = 0U, aq_vec = self->aq_vec[0];
- self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
- aq_vec_isr(i, (void *)aq_vec);
+ for (i = 0U; self->aq_vecs > i; ++i)
+ aq_vec_isr(i, (void *)self->aq_vec[i]);
mod_timer(&self->polling_timer, jiffies +
AQ_CFG_POLLING_TIMER_INTERVAL);
@@ -1014,7 +1012,6 @@ int aq_nic_get_regs_count(struct aq_nic_
u64 *aq_nic_get_stats(struct aq_nic_s *self, u64 *data)
{
- struct aq_vec_s *aq_vec = NULL;
struct aq_stats_s *stats;
unsigned int count = 0U;
unsigned int i = 0U;
@@ -1064,11 +1061,11 @@ u64 *aq_nic_get_stats(struct aq_nic_s *s
data += i;
for (tc = 0U; tc < self->aq_nic_cfg.tcs; tc++) {
- for (i = 0U, aq_vec = self->aq_vec[0];
- aq_vec && self->aq_vecs > i;
- ++i, aq_vec = self->aq_vec[i]) {
+ for (i = 0U; self->aq_vecs > i; ++i) {
+ if (!self->aq_vec[i])
+ break;
data += count;
- count = aq_vec_get_sw_stats(aq_vec, tc, data);
+ count = aq_vec_get_sw_stats(self->aq_vec[i], tc, data);
}
}
@@ -1382,7 +1379,6 @@ int aq_nic_set_loopback(struct aq_nic_s
int aq_nic_stop(struct aq_nic_s *self)
{
- struct aq_vec_s *aq_vec = NULL;
unsigned int i = 0U;
netif_tx_disable(self->ndev);
@@ -1400,9 +1396,8 @@ int aq_nic_stop(struct aq_nic_s *self)
aq_ptp_irq_free(self);
- for (i = 0U, aq_vec = self->aq_vec[0];
- self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
- aq_vec_stop(aq_vec);
+ for (i = 0U; self->aq_vecs > i; ++i)
+ aq_vec_stop(self->aq_vec[i]);
aq_ptp_ring_stop(self);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 072/365] m68k: coldfire/device.c: protect FLEXCAN blocks
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 071/365] net: atlantic: fix aq_vec index out of range error Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 073/365] sunrpc: fix expiry of auth creds Greg Kroah-Hartman
` (297 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Randy Dunlap, Greg Ungerer,
Geert Uytterhoeven, linux-m68k, uclinux-dev, Angelo Dureghello
From: Randy Dunlap <rdunlap@infradead.org>
commit 3c2bf173501652fced1d058834e9c983d295b126 upstream.
When CAN_FLEXCAN=y and M5441x is not set/enabled, there are build
errors in coldfire/device.c:
../arch/m68k/coldfire/device.c:595:26: error: 'MCFFLEXCAN_BASE0' undeclared here (not in a function); did you mean 'MCFDMA_BASE0'?
595 | .start = MCFFLEXCAN_BASE0,
../arch/m68k/coldfire/device.c:596:43: error: 'MCFFLEXCAN_SIZE' undeclared here (not in a function)
596 | .end = MCFFLEXCAN_BASE0 + MCFFLEXCAN_SIZE,
../arch/m68k/coldfire/device.c:600:26: error: 'MCF_IRQ_IFL0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'?
600 | .start = MCF_IRQ_IFL0,
../arch/m68k/coldfire/device.c:605:26: error: 'MCF_IRQ_BOFF0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'?
605 | .start = MCF_IRQ_BOFF0,
../arch/m68k/coldfire/device.c:610:26: error: 'MCF_IRQ_ERR0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'?
610 | .start = MCF_IRQ_ERR0,
Protect the FLEXCAN code blocks by checking if MCFFLEXCAN_SIZE
is defined.
Fixes: 35a9f9363a89 ("m68k: m5441x: add flexcan support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: uclinux-dev@uclinux.org
Cc: Angelo Dureghello <angelo@kernel-space.org>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/m68k/coldfire/device.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/arch/m68k/coldfire/device.c
+++ b/arch/m68k/coldfire/device.c
@@ -581,7 +581,7 @@ static struct platform_device mcf_esdhc
};
#endif /* MCFSDHC_BASE */
-#if IS_ENABLED(CONFIG_CAN_FLEXCAN)
+#ifdef MCFFLEXCAN_SIZE
#include <linux/can/platform/flexcan.h>
@@ -620,7 +620,7 @@ static struct platform_device mcf_flexca
.resource = mcf5441x_flexcan0_resource,
.dev.platform_data = &mcf5441x_flexcan_info,
};
-#endif /* IS_ENABLED(CONFIG_CAN_FLEXCAN) */
+#endif /* MCFFLEXCAN_SIZE */
static struct platform_device *mcf_devices[] __initdata = {
&mcf_uart,
@@ -657,7 +657,7 @@ static struct platform_device *mcf_devic
#ifdef MCFSDHC_BASE
&mcf_esdhc,
#endif
-#if IS_ENABLED(CONFIG_CAN_FLEXCAN)
+#ifdef MCFFLEXCAN_SIZE
&mcf_flexcan0,
#endif
};
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 073/365] sunrpc: fix expiry of auth creds
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 072/365] m68k: coldfire/device.c: protect FLEXCAN blocks Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 074/365] SUNRPC: Fix xdr_encode_bool() Greg Kroah-Hartman
` (296 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Dan Aloni, Trond Myklebust
From: Dan Aloni <dan.aloni@vastdata.com>
commit f1bafa7375c01ff71fb7cb97c06caadfcfe815f3 upstream.
Before this commit, with a large enough LRU of expired items (100), the
loop skipped all the expired items and was entirely ineffectual in
trimming the LRU list.
Fixes: 95cd623250ad ('SUNRPC: Clean up the AUTH cache code')
Signed-off-by: Dan Aloni <dan.aloni@vastdata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sunrpc/auth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -445,7 +445,7 @@ rpcauth_prune_expired(struct list_head *
* Enforce a 60 second garbage collection moratorium
* Note that the cred_unused list must be time-ordered.
*/
- if (!time_in_range(cred->cr_expire, expired, jiffies))
+ if (time_in_range(cred->cr_expire, expired, jiffies))
continue;
if (!rpcauth_unhash_cred(cred))
continue;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 074/365] SUNRPC: Fix xdr_encode_bool()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 073/365] sunrpc: fix expiry of auth creds Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 075/365] SUNRPC: Reinitialise the backchannel request buffers before reuse Greg Kroah-Hartman
` (295 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chuck Lever, Jeff Layton
From: Chuck Lever <chuck.lever@oracle.com>
commit c770f31d8f580ed4b965c64f924ec1cc50e41734 upstream.
I discovered that xdr_encode_bool() was returning the same address
that was passed in the @p parameter. The documenting comment states
that the intent is to return the address of the next buffer
location, just like the other "xdr_encode_*" helpers.
The result was the encoded results of NFSv3 PATHCONF operations were
not formed correctly.
Fixes: ded04a587f6c ("NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/sunrpc/xdr.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -419,8 +419,8 @@ static inline int xdr_stream_encode_item
*/
static inline __be32 *xdr_encode_bool(__be32 *p, u32 n)
{
- *p = n ? xdr_one : xdr_zero;
- return p++;
+ *p++ = n ? xdr_one : xdr_zero;
+ return p;
}
/**
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 075/365] SUNRPC: Reinitialise the backchannel request buffers before reuse
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 074/365] SUNRPC: Fix xdr_encode_bool() Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 076/365] SUNRPC: Dont reuse bvec on retransmission of the request Greg Kroah-Hartman
` (294 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Trond Myklebust
From: Trond Myklebust <trond.myklebust@hammerspace.com>
commit 6622e3a73112fc336c1c2c582428fb5ef18e456a upstream.
When we're reusing the backchannel requests instead of freeing them,
then we should reinitialise any values of the send/receive xdr_bufs so
that they reflect the available space.
Fixes: 0d2a970d0ae5 ("SUNRPC: Fix a backchannel race")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sunrpc/backchannel_rqst.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -64,6 +64,17 @@ static void xprt_free_allocation(struct
kfree(req);
}
+static void xprt_bc_reinit_xdr_buf(struct xdr_buf *buf)
+{
+ buf->head[0].iov_len = PAGE_SIZE;
+ buf->tail[0].iov_len = 0;
+ buf->pages = NULL;
+ buf->page_len = 0;
+ buf->flags = 0;
+ buf->len = 0;
+ buf->buflen = PAGE_SIZE;
+}
+
static int xprt_alloc_xdr_buf(struct xdr_buf *buf, gfp_t gfp_flags)
{
struct page *page;
@@ -292,6 +303,9 @@ void xprt_free_bc_rqst(struct rpc_rqst *
*/
spin_lock_bh(&xprt->bc_pa_lock);
if (xprt_need_to_requeue(xprt)) {
+ xprt_bc_reinit_xdr_buf(&req->rq_snd_buf);
+ xprt_bc_reinit_xdr_buf(&req->rq_rcv_buf);
+ req->rq_rcv_buf.len = PAGE_SIZE;
list_add_tail(&req->rq_bc_pa_list, &xprt->bc_pa_list);
xprt->bc_alloc_count++;
atomic_inc(&xprt->bc_slot_count);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 076/365] SUNRPC: Dont reuse bvec on retransmission of the request
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 075/365] SUNRPC: Reinitialise the backchannel request buffers before reuse Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 077/365] ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared Greg Kroah-Hartman
` (293 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Trond Myklebust
From: Trond Myklebust <trond.myklebust@hammerspace.com>
commit 72691a269f0baad6d5f4aa7af97c29081b86d70f upstream.
If a request is re-encoded and then retransmitted, we need to make sure
that we also re-encode the bvec, in case the page lists have changed.
Fixes: ff053dbbaffe ("SUNRPC: Move the call to xprt_send_pagedata() out of xprt_sock_sendmsg()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/sunrpc/xprt.h | 3 ++-
net/sunrpc/clnt.c | 1 -
net/sunrpc/xprt.c | 27 ++++++++++++++++++---------
net/sunrpc/xprtsock.c | 12 ++----------
4 files changed, 22 insertions(+), 21 deletions(-)
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -144,7 +144,8 @@ struct rpc_xprt_ops {
unsigned short (*get_srcport)(struct rpc_xprt *xprt);
int (*buf_alloc)(struct rpc_task *task);
void (*buf_free)(struct rpc_task *task);
- int (*prepare_request)(struct rpc_rqst *req);
+ int (*prepare_request)(struct rpc_rqst *req,
+ struct xdr_buf *buf);
int (*send_request)(struct rpc_rqst *req);
void (*wait_for_reply_request)(struct rpc_task *task);
void (*timer)(struct rpc_xprt *xprt, struct rpc_task *task);
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1856,7 +1856,6 @@ rpc_xdr_encode(struct rpc_task *task)
req->rq_snd_buf.head[0].iov_len = 0;
xdr_init_encode(&xdr, &req->rq_snd_buf,
req->rq_snd_buf.head[0].iov_base, req);
- xdr_free_bvec(&req->rq_snd_buf);
if (rpc_encode_header(task, &xdr))
return;
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -73,7 +73,7 @@ static void xprt_init(struct rpc_xprt *x
static __be32 xprt_alloc_xid(struct rpc_xprt *xprt);
static void xprt_destroy(struct rpc_xprt *xprt);
static void xprt_request_init(struct rpc_task *task);
-static int xprt_request_prepare(struct rpc_rqst *req);
+static int xprt_request_prepare(struct rpc_rqst *req, struct xdr_buf *buf);
static DEFINE_SPINLOCK(xprt_list_lock);
static LIST_HEAD(xprt_list);
@@ -1149,7 +1149,7 @@ xprt_request_enqueue_receive(struct rpc_
if (!xprt_request_need_enqueue_receive(task, req))
return 0;
- ret = xprt_request_prepare(task->tk_rqstp);
+ ret = xprt_request_prepare(task->tk_rqstp, &req->rq_rcv_buf);
if (ret)
return ret;
spin_lock(&xprt->queue_lock);
@@ -1179,8 +1179,11 @@ xprt_request_dequeue_receive_locked(stru
{
struct rpc_rqst *req = task->tk_rqstp;
- if (test_and_clear_bit(RPC_TASK_NEED_RECV, &task->tk_runstate))
+ if (test_and_clear_bit(RPC_TASK_NEED_RECV, &task->tk_runstate)) {
xprt_request_rb_remove(req->rq_xprt, req);
+ xdr_free_bvec(&req->rq_rcv_buf);
+ req->rq_private_buf.bvec = NULL;
+ }
}
/**
@@ -1336,8 +1339,14 @@ xprt_request_enqueue_transmit(struct rpc
{
struct rpc_rqst *pos, *req = task->tk_rqstp;
struct rpc_xprt *xprt = req->rq_xprt;
+ int ret;
if (xprt_request_need_enqueue_transmit(task, req)) {
+ ret = xprt_request_prepare(task->tk_rqstp, &req->rq_snd_buf);
+ if (ret) {
+ task->tk_status = ret;
+ return;
+ }
req->rq_bytes_sent = 0;
spin_lock(&xprt->queue_lock);
/*
@@ -1397,6 +1406,7 @@ xprt_request_dequeue_transmit_locked(str
} else
list_del(&req->rq_xmit2);
atomic_long_dec(&req->rq_xprt->xmit_queuelen);
+ xdr_free_bvec(&req->rq_snd_buf);
}
/**
@@ -1433,8 +1443,6 @@ xprt_request_dequeue_xprt(struct rpc_tas
test_bit(RPC_TASK_NEED_RECV, &task->tk_runstate) ||
xprt_is_pinned_rqst(req)) {
spin_lock(&xprt->queue_lock);
- xprt_request_dequeue_transmit_locked(task);
- xprt_request_dequeue_receive_locked(task);
while (xprt_is_pinned_rqst(req)) {
set_bit(RPC_TASK_MSG_PIN_WAIT, &task->tk_runstate);
spin_unlock(&xprt->queue_lock);
@@ -1442,6 +1450,8 @@ xprt_request_dequeue_xprt(struct rpc_tas
spin_lock(&xprt->queue_lock);
clear_bit(RPC_TASK_MSG_PIN_WAIT, &task->tk_runstate);
}
+ xprt_request_dequeue_transmit_locked(task);
+ xprt_request_dequeue_receive_locked(task);
spin_unlock(&xprt->queue_lock);
}
}
@@ -1449,18 +1459,19 @@ xprt_request_dequeue_xprt(struct rpc_tas
/**
* xprt_request_prepare - prepare an encoded request for transport
* @req: pointer to rpc_rqst
+ * @buf: pointer to send/rcv xdr_buf
*
* Calls into the transport layer to do whatever is needed to prepare
* the request for transmission or receive.
* Returns error, or zero.
*/
static int
-xprt_request_prepare(struct rpc_rqst *req)
+xprt_request_prepare(struct rpc_rqst *req, struct xdr_buf *buf)
{
struct rpc_xprt *xprt = req->rq_xprt;
if (xprt->ops->prepare_request)
- return xprt->ops->prepare_request(req);
+ return xprt->ops->prepare_request(req, buf);
return 0;
}
@@ -1961,8 +1972,6 @@ void xprt_release(struct rpc_task *task)
spin_unlock(&xprt->transport_lock);
if (req->rq_buffer)
xprt->ops->buf_free(task);
- xdr_free_bvec(&req->rq_rcv_buf);
- xdr_free_bvec(&req->rq_snd_buf);
if (req->rq_cred != NULL)
put_rpccred(req->rq_cred);
if (req->rq_release_snd_buf)
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -822,17 +822,9 @@ static int xs_stream_nospace(struct rpc_
return ret;
}
-static int
-xs_stream_prepare_request(struct rpc_rqst *req)
+static int xs_stream_prepare_request(struct rpc_rqst *req, struct xdr_buf *buf)
{
- gfp_t gfp = rpc_task_gfp_mask();
- int ret;
-
- ret = xdr_alloc_bvec(&req->rq_snd_buf, gfp);
- if (ret < 0)
- return ret;
- xdr_free_bvec(&req->rq_rcv_buf);
- return xdr_alloc_bvec(&req->rq_rcv_buf, gfp);
+ return xdr_alloc_bvec(buf, rpc_task_gfp_mask());
}
/*
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 077/365] ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 076/365] SUNRPC: Dont reuse bvec on retransmission of the request Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 078/365] virtio: VIRTIO_HARDEN_NOTIFICATION is broken Greg Kroah-Hartman
` (292 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Srinivasa Rao Mandadapu,
Srinivas Kandagatla, Mark Brown
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
commit 6548c884a595391fab172faeae39e2b329b848f3 upstream.
prepare callback can be called multiple times, so unprepare the stream
if its already prepared.
Without this DSP is not happy to setting the params on a already
prepared graph.
Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support")
Reported-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220610144818.511797-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/qcom/qdsp6/q6apm-dai.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/sound/soc/qcom/qdsp6/q6apm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6apm-dai.c
@@ -153,6 +153,12 @@ static int q6apm_dai_prepare(struct snd_
q6apm_unmap_memory_regions(prtd->graph, substream->stream);
}
+ if (prtd->state) {
+ /* clear the previous setup if any */
+ q6apm_graph_stop(prtd->graph);
+ q6apm_unmap_memory_regions(prtd->graph, substream->stream);
+ }
+
prtd->pcm_count = snd_pcm_lib_period_bytes(substream);
prtd->pos = 0;
/* rate and channels are sent to audio driver */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 078/365] virtio: VIRTIO_HARDEN_NOTIFICATION is broken
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 077/365] ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 079/365] virtio_net: fix memory leak inside XPD_TX with mergeable Greg Kroah-Hartman
` (291 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jason Wang, Michael S. Tsirkin
From: Michael S. Tsirkin <mst@redhat.com>
commit ebe797f25f68f28581f46a9cb9c1997ac15c39a0 upstream.
This option doesn't really work and breaks too many drivers.
Not yet sure what's the right thing to do, for now
let's make sure randconfig isn't broken by this.
Fixes: c346dae4f3fb ("virtio: disable notification hardening by default")
Cc: "Jason Wang" <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/virtio/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -35,11 +35,12 @@ if VIRTIO_MENU
config VIRTIO_HARDEN_NOTIFICATION
bool "Harden virtio notification"
+ depends on BROKEN
help
Enable this to harden the device notifications and suppress
those that happen at a time where notifications are illegal.
- Experimental: Note that several drivers still have bugs that
+ Experimental: Note that several drivers still have issues that
may cause crashes or hangs when correct handling of
notifications is enforced; depending on the subset of
drivers and devices you use, this may or may not work.
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 079/365] virtio_net: fix memory leak inside XPD_TX with mergeable
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 078/365] virtio: VIRTIO_HARDEN_NOTIFICATION is broken Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 080/365] virtio-blk: Avoid use-after-free on suspend/resume Greg Kroah-Hartman
` (290 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Xuan Zhuo, Jason Wang, David S. Miller
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
commit 7a542bee27c6a57e45c33cbbdc963325fd6493af upstream.
When we call xdp_convert_buff_to_frame() to get xdpf, if it returns
NULL, we should check if xdp_page was allocated by xdp_linearize_page().
If it is newly allocated, it should be freed here alone. Just like any
other "goto err_xdp".
Fixes: 44fa2dbd4759 ("xdp: transition into using xdp_frame for ndo_xdp_xmit")
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/virtio_net.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1057,8 +1057,11 @@ static struct sk_buff *receive_mergeable
case XDP_TX:
stats->xdp_tx++;
xdpf = xdp_convert_buff_to_frame(&xdp);
- if (unlikely(!xdpf))
+ if (unlikely(!xdpf)) {
+ if (unlikely(xdp_page != page))
+ put_page(xdp_page);
goto err_xdp;
+ }
err = virtnet_xdp_xmit(dev, 1, &xdpf, 0);
if (unlikely(!err)) {
xdp_return_frame_rx_napi(xdpf);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 080/365] virtio-blk: Avoid use-after-free on suspend/resume
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 079/365] virtio_net: fix memory leak inside XPD_TX with mergeable Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 081/365] devlink: Fix use-after-free after a failed reload Greg Kroah-Hartman
` (289 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Suwan Kim, Shigeru Yoshida,
Michael S. Tsirkin
From: Shigeru Yoshida <syoshida@redhat.com>
commit 8d12ec10292877751ee4463b11a63bd850bc09b5 upstream.
hctx->user_data is set to vq in virtblk_init_hctx(). However, vq is
freed on suspend and reallocated on resume. So, hctx->user_data is
invalid after resume, and it will cause use-after-free accessing which
will result in the kernel crash something like below:
[ 22.428391] Call Trace:
[ 22.428899] <TASK>
[ 22.429339] virtqueue_add_split+0x3eb/0x620
[ 22.430035] ? __blk_mq_alloc_requests+0x17f/0x2d0
[ 22.430789] ? kvm_clock_get_cycles+0x14/0x30
[ 22.431496] virtqueue_add_sgs+0xad/0xd0
[ 22.432108] virtblk_add_req+0xe8/0x150
[ 22.432692] virtio_queue_rqs+0xeb/0x210
[ 22.433330] blk_mq_flush_plug_list+0x1b8/0x280
[ 22.434059] __blk_flush_plug+0xe1/0x140
[ 22.434853] blk_finish_plug+0x20/0x40
[ 22.435512] read_pages+0x20a/0x2e0
[ 22.436063] ? folio_add_lru+0x62/0xa0
[ 22.436652] page_cache_ra_unbounded+0x112/0x160
[ 22.437365] filemap_get_pages+0xe1/0x5b0
[ 22.437964] ? context_to_sid+0x70/0x100
[ 22.438580] ? sidtab_context_to_sid+0x32/0x400
[ 22.439979] filemap_read+0xcd/0x3d0
[ 22.440917] xfs_file_buffered_read+0x4a/0xc0
[ 22.441984] xfs_file_read_iter+0x65/0xd0
[ 22.442970] __kernel_read+0x160/0x2e0
[ 22.443921] bprm_execve+0x21b/0x640
[ 22.444809] do_execveat_common.isra.0+0x1a8/0x220
[ 22.446008] __x64_sys_execve+0x2d/0x40
[ 22.446920] do_syscall_64+0x37/0x90
[ 22.447773] entry_SYSCALL_64_after_hwframe+0x63/0xcd
This patch fixes this issue by getting vq from vblk, and removes
virtblk_init_hctx().
Fixes: 4e0400525691 ("virtio-blk: support polling I/O")
Cc: "Suwan Kim" <suwan.kim027@gmail.com>
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Message-Id: <20220810160948.959781-1-syoshida@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/block/virtio_blk.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 6fc7850c2b0a..d756423e0059 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -101,6 +101,14 @@ static inline blk_status_t virtblk_result(struct virtblk_req *vbr)
}
}
+static inline struct virtio_blk_vq *get_virtio_blk_vq(struct blk_mq_hw_ctx *hctx)
+{
+ struct virtio_blk *vblk = hctx->queue->queuedata;
+ struct virtio_blk_vq *vq = &vblk->vqs[hctx->queue_num];
+
+ return vq;
+}
+
static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr)
{
struct scatterlist hdr, status, *sgs[3];
@@ -416,7 +424,7 @@ static void virtio_queue_rqs(struct request **rqlist)
struct request *requeue_list = NULL;
rq_list_for_each_safe(rqlist, req, next) {
- struct virtio_blk_vq *vq = req->mq_hctx->driver_data;
+ struct virtio_blk_vq *vq = get_virtio_blk_vq(req->mq_hctx);
bool kick;
if (!virtblk_prep_rq_batch(req)) {
@@ -837,7 +845,7 @@ static void virtblk_complete_batch(struct io_comp_batch *iob)
static int virtblk_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)
{
struct virtio_blk *vblk = hctx->queue->queuedata;
- struct virtio_blk_vq *vq = hctx->driver_data;
+ struct virtio_blk_vq *vq = get_virtio_blk_vq(hctx);
struct virtblk_req *vbr;
unsigned long flags;
unsigned int len;
@@ -862,22 +870,10 @@ static int virtblk_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)
return found;
}
-static int virtblk_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
- unsigned int hctx_idx)
-{
- struct virtio_blk *vblk = data;
- struct virtio_blk_vq *vq = &vblk->vqs[hctx_idx];
-
- WARN_ON(vblk->tag_set.tags[hctx_idx] != hctx->tags);
- hctx->driver_data = vq;
- return 0;
-}
-
static const struct blk_mq_ops virtio_mq_ops = {
.queue_rq = virtio_queue_rq,
.queue_rqs = virtio_queue_rqs,
.commit_rqs = virtio_commit_rqs,
- .init_hctx = virtblk_init_hctx,
.complete = virtblk_request_done,
.map_queues = virtblk_map_queues,
.poll = virtblk_poll,
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 081/365] devlink: Fix use-after-free after a failed reload
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 080/365] virtio-blk: Avoid use-after-free on suspend/resume Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 082/365] net: phy: Warn about incorrect mdio_bus_phy_resume() state Greg Kroah-Hartman
` (288 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ido Schimmel, Jiri Pirko, David S. Miller
From: Ido Schimmel <idosch@nvidia.com>
commit 6b4db2e528f650c7fb712961aac36455468d5902 upstream.
After a failed devlink reload, devlink parameters are still registered,
which means user space can set and get their values. In the case of the
mlxsw "acl_region_rehash_interval" parameter, these operations will
trigger a use-after-free [1].
Fix this by rejecting set and get operations while in the failed state.
Return the "-EOPNOTSUPP" error code which does not abort the parameters
dump, but instead causes it to skip over the problematic parameter.
Another possible fix is to perform these checks in the mlxsw parameter
callbacks, but other drivers might be affected by the same problem and I
am not aware of scenarios where these stricter checks will cause a
regression.
[1]
mlxsw_spectrum3 0000:00:10.0: Port 125: Failed to register netdev
mlxsw_spectrum3 0000:00:10.0: Failed to create ports
==================================================================
BUG: KASAN: use-after-free in mlxsw_sp_acl_tcam_vregion_rehash_intrvl_get+0xbd/0xd0 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c:904
Read of size 4 at addr ffff8880099dcfd8 by task kworker/u4:4/777
CPU: 1 PID: 777 Comm: kworker/u4:4 Not tainted 5.19.0-rc7-custom-126601-gfe26f28c586d #1
Hardware name: QEMU MSN4700, BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
Workqueue: netns cleanup_net
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x92/0xbd lib/dump_stack.c:106
print_address_description mm/kasan/report.c:313 [inline]
print_report.cold+0x5e/0x5cf mm/kasan/report.c:429
kasan_report+0xb9/0xf0 mm/kasan/report.c:491
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:306
mlxsw_sp_acl_tcam_vregion_rehash_intrvl_get+0xbd/0xd0 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c:904
mlxsw_sp_acl_region_rehash_intrvl_get+0x49/0x60 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c:1106
mlxsw_sp_params_acl_region_rehash_intrvl_get+0x33/0x80 drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3854
devlink_param_get net/core/devlink.c:4981 [inline]
devlink_nl_param_fill+0x238/0x12d0 net/core/devlink.c:5089
devlink_param_notify+0xe5/0x230 net/core/devlink.c:5168
devlink_ns_change_notify net/core/devlink.c:4417 [inline]
devlink_ns_change_notify net/core/devlink.c:4396 [inline]
devlink_reload+0x15f/0x700 net/core/devlink.c:4507
devlink_pernet_pre_exit+0x112/0x1d0 net/core/devlink.c:12272
ops_pre_exit_list net/core/net_namespace.c:152 [inline]
cleanup_net+0x494/0xc00 net/core/net_namespace.c:582
process_one_work+0x9fc/0x1710 kernel/workqueue.c:2289
worker_thread+0x675/0x10b0 kernel/workqueue.c:2436
kthread+0x30c/0x3d0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
The buggy address belongs to the physical page:
page:ffffea0000267700 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x99dc
flags: 0x100000000000000(node=0|zone=1)
raw: 0100000000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8880099dce80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880099dcf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880099dcf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8880099dd000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880099dd080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Fixes: 98bbf70c1c41 ("mlxsw: spectrum: add "acl_region_rehash_interval" devlink param")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/devlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4943,7 +4943,7 @@ static int devlink_param_get(struct devl
const struct devlink_param *param,
struct devlink_param_gset_ctx *ctx)
{
- if (!param->get)
+ if (!param->get || devlink->reload_failed)
return -EOPNOTSUPP;
return param->get(devlink, param->id, ctx);
}
@@ -4952,7 +4952,7 @@ static int devlink_param_set(struct devl
const struct devlink_param *param,
struct devlink_param_gset_ctx *ctx)
{
- if (!param->set)
+ if (!param->set || devlink->reload_failed)
return -EOPNOTSUPP;
return param->set(devlink, param->id, ctx);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 082/365] net: phy: Warn about incorrect mdio_bus_phy_resume() state
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 081/365] devlink: Fix use-after-free after a failed reload Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 083/365] net: bcmgenet: Indicate MAC is in charge of PHY PM Greg Kroah-Hartman
` (287 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Florian Fainelli, Jakub Kicinski
From: Florian Fainelli <f.fainelli@gmail.com>
commit 744d23c71af39c7dc77ac7c3cac87ae86a181a85 upstream.
Calling mdio_bus_phy_resume() with neither the PHY state machine set to
PHY_HALTED nor phydev->mac_managed_pm set to true is a good indication
that we can produce a race condition looking like this:
CPU0 CPU1
bcmgenet_resume
-> phy_resume
-> phy_init_hw
-> phy_start
-> phy_resume
phy_start_aneg()
mdio_bus_phy_resume
-> phy_resume
-> phy_write(..., BMCR_RESET)
-> usleep() -> phy_read()
with the phy_resume() function triggering a PHY behavior that might have
to be worked around with (see bf8bfc4336f7 ("net: phy: broadcom: Fix
brcm_fet_config_init()") for instance) that ultimately leads to an error
reading from the PHY.
Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220801233403.258871-1-f.fainelli@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/phy/phy_device.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -316,6 +316,12 @@ static __maybe_unused int mdio_bus_phy_r
phydev->suspended_by_mdio_bus = 0;
+ /* If we managed to get here with the PHY state machine in a state other
+ * than PHY_HALTED this is an indication that something went wrong and
+ * we should most likely be using MAC managed PM and we are not.
+ */
+ WARN_ON(phydev->state != PHY_HALTED && !phydev->mac_managed_pm);
+
ret = phy_init_hw(phydev);
if (ret < 0)
return ret;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 083/365] net: bcmgenet: Indicate MAC is in charge of PHY PM
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 082/365] net: phy: Warn about incorrect mdio_bus_phy_resume() state Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 084/365] net: phy: c45 baset1: do not skip aneg configuration if clock role is not specified Greg Kroah-Hartman
` (286 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Florian Fainelli, Jakub Kicinski
From: Florian Fainelli <f.fainelli@gmail.com>
commit bc3410f250219660a7be032c01c954a53b2c26ab upstream.
Avoid the PHY library call unnecessarily into the suspend/resume functions by
setting phydev->mac_managed_pm to true. The GENET driver essentially does
exactly what mdio_bus_phy_resume() does by calling phy_init_hw() plus
phy_resume().
Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220804173605.1266574-1-f.fainelli@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/broadcom/genet/bcmmii.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -393,6 +393,9 @@ int bcmgenet_mii_probe(struct net_device
if (priv->internal_phy && !GENET_IS_V5(priv))
dev->phydev->irq = PHY_MAC_INTERRUPT;
+ /* Indicate that the MAC is responsible for PHY PM */
+ dev->phydev->mac_managed_pm = true;
+
return 0;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 084/365] net: phy: c45 baset1: do not skip aneg configuration if clock role is not specified
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 083/365] net: bcmgenet: Indicate MAC is in charge of PHY PM Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 085/365] net: dsa: felix: suppress non-changes to the tagging protocol Greg Kroah-Hartman
` (285 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Oleksij Rempel, Andrew Lunn, Jakub Kicinski
From: Oleksij Rempel <o.rempel@pengutronix.de>
commit 3702e4041cfda50bc697363d29511ce8f6b24795 upstream.
In case master/slave clock role is not specified (which is default), the
aneg registers will not be written.
The visible impact of this is missing pause advertisement.
So, rework genphy_c45_baset1_an_config_aneg() to be able to write
advertisement registers even if clock role is unknown.
Fixes: 3da8ffd8545f ("net: phy: Add 10BASE-T1L support in phy-c45")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220805073159.908643-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/phy/phy-c45.c | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -190,44 +190,42 @@ EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_f
*/
static int genphy_c45_baset1_an_config_aneg(struct phy_device *phydev)
{
+ u16 adv_l_mask, adv_l = 0;
+ u16 adv_m_mask, adv_m = 0;
int changed = 0;
- u16 adv_l = 0;
- u16 adv_m = 0;
int ret;
+ adv_l_mask = MDIO_AN_T1_ADV_L_FORCE_MS | MDIO_AN_T1_ADV_L_PAUSE_CAP |
+ MDIO_AN_T1_ADV_L_PAUSE_ASYM;
+ adv_m_mask = MDIO_AN_T1_ADV_M_MST | MDIO_AN_T1_ADV_M_B10L;
+
switch (phydev->master_slave_set) {
case MASTER_SLAVE_CFG_MASTER_FORCE:
+ adv_m |= MDIO_AN_T1_ADV_M_MST;
+ fallthrough;
case MASTER_SLAVE_CFG_SLAVE_FORCE:
adv_l |= MDIO_AN_T1_ADV_L_FORCE_MS;
break;
case MASTER_SLAVE_CFG_MASTER_PREFERRED:
+ adv_m |= MDIO_AN_T1_ADV_M_MST;
+ fallthrough;
case MASTER_SLAVE_CFG_SLAVE_PREFERRED:
break;
case MASTER_SLAVE_CFG_UNKNOWN:
case MASTER_SLAVE_CFG_UNSUPPORTED:
- return 0;
+ /* if master/slave role is not specified, do not overwrite it */
+ adv_l_mask &= ~MDIO_AN_T1_ADV_L_FORCE_MS;
+ adv_m_mask &= ~MDIO_AN_T1_ADV_M_MST;
+ break;
default:
phydev_warn(phydev, "Unsupported Master/Slave mode\n");
return -EOPNOTSUPP;
}
- switch (phydev->master_slave_set) {
- case MASTER_SLAVE_CFG_MASTER_FORCE:
- case MASTER_SLAVE_CFG_MASTER_PREFERRED:
- adv_m |= MDIO_AN_T1_ADV_M_MST;
- break;
- case MASTER_SLAVE_CFG_SLAVE_FORCE:
- case MASTER_SLAVE_CFG_SLAVE_PREFERRED:
- break;
- default:
- break;
- }
-
adv_l |= linkmode_adv_to_mii_t1_adv_l_t(phydev->advertising);
ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_T1_ADV_L,
- (MDIO_AN_T1_ADV_L_FORCE_MS | MDIO_AN_T1_ADV_L_PAUSE_CAP
- | MDIO_AN_T1_ADV_L_PAUSE_ASYM), adv_l);
+ adv_l_mask, adv_l);
if (ret < 0)
return ret;
if (ret > 0)
@@ -236,7 +234,7 @@ static int genphy_c45_baset1_an_config_a
adv_m |= linkmode_adv_to_mii_t1_adv_m_t(phydev->advertising);
ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_T1_ADV_M,
- MDIO_AN_T1_ADV_M_MST | MDIO_AN_T1_ADV_M_B10L, adv_m);
+ adv_m_mask, adv_m);
if (ret < 0)
return ret;
if (ret > 0)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 085/365] net: dsa: felix: suppress non-changes to the tagging protocol
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 084/365] net: phy: c45 baset1: do not skip aneg configuration if clock role is not specified Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 086/365] net: bgmac: Fix a BUG triggered by wrong bytes_compl Greg Kroah-Hartman
` (284 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Vladimir Oltean, Florian Fainelli,
Jakub Kicinski
From: Vladimir Oltean <vladimir.oltean@nxp.com>
commit 4c46bb49460ee14c69629e813640d8b929e88941 upstream.
The way in which dsa_tree_change_tag_proto() works is that when
dsa_tree_notify() fails, it doesn't know whether the operation failed
mid way in a multi-switch tree, or it failed for a single-switch tree.
So even though drivers need to fail cleanly in
ds->ops->change_tag_protocol(), DSA will still call dsa_tree_notify()
again, to restore the old tag protocol for potential switches in the
tree where the change did succeeed (before failing for others).
This means for the felix driver that if we report an error in
felix_change_tag_protocol(), we'll get another call where proto_ops ==
old_proto_ops. If we proceed to act upon that, we may do unexpected
things. For example, we will call dsa_tag_8021q_register() twice in a
row, without any dsa_tag_8021q_unregister() in between. Then we will
actually call dsa_tag_8021q_unregister() via old_proto_ops->teardown,
which (if it manages to run at all, after walking through corrupted data
structures) will leave the ports inoperational anyway.
The bug can be readily reproduced if we force an error while in
tag_8021q mode; this crashes the kernel.
echo ocelot-8021q > /sys/class/net/eno2/dsa/tagging
echo edsa > /sys/class/net/eno2/dsa/tagging # -EPROTONOSUPPORT
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014
Call trace:
vcap_entry_get+0x24/0x124
ocelot_vcap_filter_del+0x198/0x270
felix_tag_8021q_vlan_del+0xd4/0x21c
dsa_switch_tag_8021q_vlan_del+0x168/0x2cc
dsa_switch_event+0x68/0x1170
dsa_tree_notify+0x14/0x34
dsa_port_tag_8021q_vlan_del+0x84/0x110
dsa_tag_8021q_unregister+0x15c/0x1c0
felix_tag_8021q_teardown+0x16c/0x180
felix_change_tag_protocol+0x1bc/0x230
dsa_switch_event+0x14c/0x1170
dsa_tree_change_tag_proto+0x118/0x1c0
Fixes: 7a29d220f4c0 ("net: dsa: felix: reimplement tagging protocol change with function pointers")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220808125127.3344094-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/dsa/ocelot/felix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 859196898a7d..aadb0bd7c24f 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -610,6 +610,9 @@ static int felix_change_tag_protocol(struct dsa_switch *ds,
old_proto_ops = felix->tag_proto_ops;
+ if (proto_ops == old_proto_ops)
+ return 0;
+
err = proto_ops->setup(ds);
if (err)
goto setup_failed;
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 086/365] net: bgmac: Fix a BUG triggered by wrong bytes_compl
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 085/365] net: dsa: felix: suppress non-changes to the tagging protocol Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 087/365] net: atm: bring back zatm uAPI Greg Kroah-Hartman
` (283 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sandor Bodo-Merle, Florian Fainelli,
Jakub Kicinski
From: Sandor Bodo-Merle <sbodomerle@gmail.com>
commit 1b7680c6c1f6de9904f1d9b05c952f0c64a03350 upstream.
On one of our machines we got:
kernel BUG at lib/dynamic_queue_limits.c:27!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
CPU: 0 PID: 1166 Comm: irq/41-bgmac Tainted: G W O 4.14.275-rt132 #1
Hardware name: BRCM XGS iProc
task: ee3415c0 task.stack: ee32a000
PC is at dql_completed+0x168/0x178
LR is at bgmac_poll+0x18c/0x6d8
pc : [<c03b9430>] lr : [<c04b5a18>] psr: 800a0313
sp : ee32be14 ip : 000005ea fp : 00000bd4
r10: ee558500 r9 : c0116298 r8 : 00000002
r7 : 00000000 r6 : ef128810 r5 : 01993267 r4 : 01993851
r3 : ee558000 r2 : 000070e1 r1 : 00000bd4 r0 : ee52c180
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
Control: 12c5387d Table: 8e88c04a DAC: 00000051
Process irq/41-bgmac (pid: 1166, stack limit = 0xee32a210)
Stack: (0xee32be14 to 0xee32c000)
be00: ee558520 ee52c100 ef128810
be20: 00000000 00000002 c0116298 c04b5a18 00000000 c0a0c8c4 c0951780 00000040
be40: c0701780 ee558500 ee55d520 ef05b340 ef6f9780 ee558520 00000001 00000040
be60: ffffe000 c0a56878 ef6fa040 c0952040 0000012c c0528744 ef6f97b0 fffcfb6a
be80: c0a04104 2eda8000 c0a0c4ec c0a0d368 ee32bf44 c0153534 ee32be98 ee32be98
bea0: ee32bea0 ee32bea0 ee32bea8 ee32bea8 00000000 c01462e4 ffffe000 ef6f22a8
bec0: ffffe000 00000008 ee32bee4 c0147430 ffffe000 c094a2a8 00000003 ffffe000
bee0: c0a54528 00208040 0000000c c0a0c8c4 c0a65980 c0124d3c 00000008 ee558520
bf00: c094a23c c0a02080 00000000 c07a9910 ef136970 ef136970 ee30a440 ef136900
bf20: ee30a440 00000001 ef136900 ee30a440 c016d990 00000000 c0108db0 c012500c
bf40: ef136900 c016da14 ee30a464 ffffe000 00000001 c016dd14 00000000 c016db28
bf60: ffffe000 ee21a080 ee30a400 00000000 ee32a000 ee30a440 c016dbfc ee25fd70
bf80: ee21a09c c013edcc ee32a000 ee30a400 c013ec7c 00000000 00000000 00000000
bfa0: 00000000 00000000 00000000 c0108470 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[<c03b9430>] (dql_completed) from [<c04b5a18>] (bgmac_poll+0x18c/0x6d8)
[<c04b5a18>] (bgmac_poll) from [<c0528744>] (net_rx_action+0x1c4/0x494)
[<c0528744>] (net_rx_action) from [<c0124d3c>] (do_current_softirqs+0x1ec/0x43c)
[<c0124d3c>] (do_current_softirqs) from [<c012500c>] (__local_bh_enable+0x80/0x98)
[<c012500c>] (__local_bh_enable) from [<c016da14>] (irq_forced_thread_fn+0x84/0x98)
[<c016da14>] (irq_forced_thread_fn) from [<c016dd14>] (irq_thread+0x118/0x1c0)
[<c016dd14>] (irq_thread) from [<c013edcc>] (kthread+0x150/0x158)
[<c013edcc>] (kthread) from [<c0108470>] (ret_from_fork+0x14/0x24)
Code: a83f15e0 0200001a 0630a0e1 c3ffffea (f201f0e7)
The issue seems similar to commit 90b3b339364c ("net: hisilicon: Fix a BUG
trigered by wrong bytes_compl") and potentially introduced by commit
b38c83dd0866 ("bgmac: simplify tx ring index handling").
If there is an RX interrupt between setting ring->end
and netdev_sent_queue() we can hit the BUG_ON as bgmac_dma_tx_free()
can miscalculate the queue size while called from bgmac_poll().
The machine which triggered the BUG runs a v4.14 RT kernel - but the issue
seems present in mainline too.
Fixes: b38c83dd0866 ("bgmac: simplify tx ring index handling")
Signed-off-by: Sandor Bodo-Merle <sbodomerle@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220808173939.193804-1-sbodomerle@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -189,8 +189,8 @@ static netdev_tx_t bgmac_dma_tx_add(stru
}
slot->skb = skb;
- ring->end += nr_frags + 1;
netdev_sent_queue(net_dev, skb->len);
+ ring->end += nr_frags + 1;
wmb();
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 087/365] net: atm: bring back zatm uAPI
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 086/365] net: bgmac: Fix a BUG triggered by wrong bytes_compl Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 088/365] selftests: forwarding: Fix failing tests with old libnet Greg Kroah-Hartman
` (282 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jiri Slaby, Jakub Kicinski
From: Jakub Kicinski <kuba@kernel.org>
commit c2e75634cbe368065f140dd30bf8b1a0355158fd upstream.
Jiri reports that linux-atm does not build without this header.
Bring it back. It's completely dead code but we can't break
the build for user space :(
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Fixes: 052e1f01bfae ("net: atm: remove support for ZeitNet ZN122x ATM devices")
Link: https://lore.kernel.org/all/8576aef3-37e4-8bae-bab5-08f82a78efd3@kernel.org/
Link: https://lore.kernel.org/r/20220810164547.484378-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/uapi/linux/atm_zatm.h | 47 +++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 include/uapi/linux/atm_zatm.h
diff --git a/include/uapi/linux/atm_zatm.h b/include/uapi/linux/atm_zatm.h
new file mode 100644
index 000000000000..5135027b93c1
--- /dev/null
+++ b/include/uapi/linux/atm_zatm.h
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by
+ driver-specific utilities) */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_ZATM_H
+#define LINUX_ATM_ZATM_H
+
+/*
+ * Note: non-kernel programs including this file must also include
+ * sys/types.h for struct timeval
+ */
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
+ /* get pool statistics */
+#define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
+ /* get statistics and zero */
+#define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc)
+ /* set pool parameters */
+
+struct zatm_pool_info {
+ int ref_count; /* free buffer pool usage counters */
+ int low_water,high_water; /* refill parameters */
+ int rqa_count,rqu_count; /* queue condition counters */
+ int offset,next_off; /* alignment optimizations: offset */
+ int next_cnt,next_thres; /* repetition counter and threshold */
+};
+
+struct zatm_pool_req {
+ int pool_num; /* pool number */
+ struct zatm_pool_info info; /* actual information */
+};
+
+#define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */
+#define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */
+#define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */
+#define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */
+
+#define ZATM_TIMER_HISTORY_SIZE 16 /* number of timer adjustments to
+ record; must be 2^n */
+
+#endif
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 088/365] selftests: forwarding: Fix failing tests with old libnet
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 087/365] net: atm: bring back zatm uAPI Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 089/365] dt-bindings: arm: qcom: fix Alcatel OneTouch Idol 3 compatibles Greg Kroah-Hartman
` (281 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ivan Vecera, Ido Schimmel,
Amit Cohen, Jakub Kicinski
From: Ido Schimmel <idosch@nvidia.com>
commit 8bcfb4ae4d970b9a9724ddfbac26c387934e0e94 upstream.
The custom multipath hash tests use mausezahn in order to test how
changes in various packet fields affect the packet distribution across
the available nexthops.
The tool uses the libnet library for various low-level packet
construction and injection. The library started using the
"SO_BINDTODEVICE" socket option for IPv6 sockets in version 1.1.6 and
for IPv4 sockets in version 1.2.
When the option is not set, packets are not routed according to the
table associated with the VRF master device and tests fail.
Fix this by prefixing the command with "ip vrf exec", which will cause
the route lookup to occur in the VRF routing table. This makes the tests
pass regardless of the libnet library version.
Fixes: 511e8db54036 ("selftests: forwarding: Add test for custom multipath hash")
Fixes: 185b0c190bb6 ("selftests: forwarding: Add test for custom multipath hash with IPv4 GRE")
Fixes: b7715acba4d3 ("selftests: forwarding: Add test for custom multipath hash with IPv6 GRE")
Reported-by: Ivan Vecera <ivecera@redhat.com>
Tested-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Link: https://lore.kernel.org/r/20220809113320.751413-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/net/forwarding/custom_multipath_hash.sh | 24 ++++++----
tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh | 24 ++++++----
tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh | 24 ++++++----
3 files changed, 48 insertions(+), 24 deletions(-)
--- a/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
+++ b/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
@@ -181,37 +181,43 @@ ping_ipv6()
send_src_ipv4()
{
- $MZ $h1 -q -p 64 -A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_dst_ipv4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_src_udp4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B 203.0.113.2 \
-d 1msec -t udp "sp=0-32768,dp=30000"
}
send_dst_udp4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B 203.0.113.2 \
-d 1msec -t udp "sp=20000,dp=0-32768"
}
send_src_ipv6()
{
- $MZ -6 $h1 -q -p 64 -A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:4::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:4::2 \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_dst_ipv6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B "2001:db8:4::2-2001:db8:4::fd" \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B "2001:db8:4::2-2001:db8:4::fd" \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
@@ -226,13 +232,15 @@ send_flowlabel()
send_src_udp6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:4::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B 2001:db8:4::2 \
-d 1msec -t udp "sp=0-32768,dp=30000"
}
send_dst_udp6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:4::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B 2001:db8:4::2 \
-d 1msec -t udp "sp=20000,dp=0-32768"
}
--- a/tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
+++ b/tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
@@ -276,37 +276,43 @@ ping_ipv6()
send_src_ipv4()
{
- $MZ $h1 -q -p 64 -A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_dst_ipv4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_src_udp4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B 203.0.113.2 \
-d 1msec -t udp "sp=0-32768,dp=30000"
}
send_dst_udp4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B 203.0.113.2 \
-d 1msec -t udp "sp=20000,dp=0-32768"
}
send_src_ipv6()
{
- $MZ -6 $h1 -q -p 64 -A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:2::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:2::2 \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_dst_ipv6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B "2001:db8:2::2-2001:db8:2::fd" \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B "2001:db8:2::2-2001:db8:2::fd" \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
@@ -321,13 +327,15 @@ send_flowlabel()
send_src_udp6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B 2001:db8:2::2 \
-d 1msec -t udp "sp=0-32768,dp=30000"
}
send_dst_udp6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B 2001:db8:2::2 \
-d 1msec -t udp "sp=20000,dp=0-32768"
}
--- a/tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh
+++ b/tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh
@@ -278,37 +278,43 @@ ping_ipv6()
send_src_ipv4()
{
- $MZ $h1 -q -p 64 -A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_dst_ipv4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_src_udp4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B 203.0.113.2 \
-d 1msec -t udp "sp=0-32768,dp=30000"
}
send_dst_udp4()
{
- $MZ $h1 -q -p 64 -A 198.51.100.2 -B 203.0.113.2 \
+ ip vrf exec v$h1 $MZ $h1 -q -p 64 \
+ -A 198.51.100.2 -B 203.0.113.2 \
-d 1msec -t udp "sp=20000,dp=0-32768"
}
send_src_ipv6()
{
- $MZ -6 $h1 -q -p 64 -A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:2::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:2::2 \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
send_dst_ipv6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B "2001:db8:2::2-2001:db8:2::fd" \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B "2001:db8:2::2-2001:db8:2::fd" \
-d 1msec -c 50 -t udp "sp=20000,dp=30000"
}
@@ -323,13 +329,15 @@ send_flowlabel()
send_src_udp6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B 2001:db8:2::2 \
-d 1msec -t udp "sp=0-32768,dp=30000"
}
send_dst_udp6()
{
- $MZ -6 $h1 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \
+ ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
+ -A 2001:db8:1::2 -B 2001:db8:2::2 \
-d 1msec -t udp "sp=20000,dp=0-32768"
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 089/365] dt-bindings: arm: qcom: fix Alcatel OneTouch Idol 3 compatibles
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 088/365] selftests: forwarding: Fix failing tests with old libnet Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 090/365] pinctrl: renesas: rzg2l: Return -EINVAL for pins which have input disabled Greg Kroah-Hartman
` (280 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Rob Herring, Krzysztof Kozlowski,
Stephan Gerhold, Bjorn Andersson
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit 944de5182f0269e72ffe0a8880c8dbeb30f473d8 upstream.
The MSM8916 Alcatel OneTouch Idol 3 does not use MTP fallbacks in
compatibles:
msm8916-alcatel-idol347.dtb: /: compatible: 'oneOf' conditional failed, one must be fixed:
['alcatel,idol347', 'qcom,msm8916'] is too short
Reported-by: Rob Herring <robh@kernel.org>
Fixes: e9dd2f7204ed ("dt-bindings: arm: qcom: Document alcatel,idol347 board")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20220520123252.365762-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/arm/qcom.yaml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -153,14 +153,13 @@ properties:
- const: qcom,msm8974
- items:
- - enum:
- - alcatel,idol347
- const: qcom,msm8916-mtp/1
- const: qcom,msm8916-mtp
- const: qcom,msm8916
- items:
- enum:
+ - alcatel,idol347
- longcheer,l8150
- samsung,a3u-eur
- samsung,a5u-eur
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 090/365] pinctrl: renesas: rzg2l: Return -EINVAL for pins which have input disabled
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 089/365] dt-bindings: arm: qcom: fix Alcatel OneTouch Idol 3 compatibles Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 091/365] dt-bindings: pinctrl: mt8192: Add drive-strength-microamp Greg Kroah-Hartman
` (279 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Phil Edworthy, Lad Prabhakar,
Geert Uytterhoeven
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit 5223c511eb4f919e6b423b2f66e02674e97e77e3 upstream.
Pin status reported by pinconf-pins file always reported pin status as
"input enabled" even for pins which had input disabled. Fix this by
returning -EINVAL for the pins which have input disabled.
Fixes: c4c4637eb57f2 ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver")
Reported-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Phil Edworthy <phil.edworthy@renesas.com>
Link: https://lore.kernel.org/r/20220511094057.3151-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -517,6 +517,8 @@ static int rzg2l_pinctrl_pinconf_get(str
if (!(cfg & PIN_CFG_IEN))
return -EINVAL;
arg = rzg2l_read_pin_config(pctrl, IEN(port_offset), bit, IEN_MASK);
+ if (!arg)
+ return -EINVAL;
break;
case PIN_CONFIG_POWER_SOURCE: {
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 091/365] dt-bindings: pinctrl: mt8192: Add drive-strength-microamp
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 090/365] pinctrl: renesas: rzg2l: Return -EINVAL for pins which have input disabled Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 092/365] dt-bindings: pinctrl: mt8192: Use generic bias instead of pull-*-adv Greg Kroah-Hartman
` (278 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Nícolas F . R . A . Prado,
AngeloGioacchino Del Regno, Rob Herring, Linus Walleij
From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
commit b52e695324bb44728053a414f17d25a5959ecb9d upstream.
Commit e5fabbe43f3f ("pinctrl: mediatek: paris: Support generic
PIN_CONFIG_DRIVE_STRENGTH_UA") added support for using
drive-strength-microamp instead of mediatek,drive-strength-adv.
Since there aren't any users of mediatek,drive-strength-adv on mt8192
yet, remove this property and add drive-strength-microamp in its place,
which has a clearer meaning.
Fixes: 4ac68333ff6d ("dt-bindings: pinctrl: mt8192: Add mediatek,drive-strength-adv property")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogiocchino.delregno@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220525155714.1837360-2-nfraprado@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../bindings/pinctrl/pinctrl-mt8192.yaml | 27 ++-----------------
1 file changed, 2 insertions(+), 25 deletions(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
index c90a132fbc79..8ede8b750237 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
@@ -80,31 +80,8 @@ patternProperties:
dt-bindings/pinctrl/mt65xx.h. It can only support 2/4/6/8/10/12/14/16mA in mt8192.
enum: [2, 4, 6, 8, 10, 12, 14, 16]
- mediatek,drive-strength-adv:
- description: |
- Describe the specific driving setup property.
- For I2C pins, the existing generic driving setup can only support
- 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they
- can support 0.125/0.25/0.5/1mA adjustment. If we enable specific
- driving setup, the existing generic setup will be disabled.
- The specific driving setup is controlled by E1E0EN.
- When E1=0/E0=0, the strength is 0.125mA.
- When E1=0/E0=1, the strength is 0.25mA.
- When E1=1/E0=0, the strength is 0.5mA.
- When E1=1/E0=1, the strength is 1mA.
- EN is used to enable or disable the specific driving setup.
- Valid arguments are described as below:
- 0: (E1, E0, EN) = (0, 0, 0)
- 1: (E1, E0, EN) = (0, 0, 1)
- 2: (E1, E0, EN) = (0, 1, 0)
- 3: (E1, E0, EN) = (0, 1, 1)
- 4: (E1, E0, EN) = (1, 0, 0)
- 5: (E1, E0, EN) = (1, 0, 1)
- 6: (E1, E0, EN) = (1, 1, 0)
- 7: (E1, E0, EN) = (1, 1, 1)
- So the valid arguments are from 0 to 7.
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2, 3, 4, 5, 6, 7]
+ drive-strength-microamp:
+ enum: [125, 250, 500, 1000]
mediatek,pull-up-adv:
description: |
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 092/365] dt-bindings: pinctrl: mt8192: Use generic bias instead of pull-*-adv
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 091/365] dt-bindings: pinctrl: mt8192: Add drive-strength-microamp Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 093/365] pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map Greg Kroah-Hartman
` (277 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Nícolas F . R . A . Prado,
AngeloGioacchino Del Regno, Rob Herring, Linus Walleij
From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
commit 353d2ef77f2be4c1b9b3c70f1637a9986f07b997 upstream.
Commit cafe19db7751 ("pinctrl: mediatek: Backward compatible to previous
Mediatek's bias-pull usage") allowed the bias-pull-up and bias-pull-down
properties to be used for setting PUPD/R1/R0 type bias on mtk-paris
based SoC's, which was previously only supported by the custom
mediatek,pull-up-adv and mediatek,pull-down-adv properties.
Since the bias-pull-{up,down} properties already have defines associated
thus being more descriptive and is more universal on MediaTek platforms,
and given that there are no mediatek,pull-{up,down}-adv users on mt8192
yet, remove the custom adv properties in favor of the generic ones.
Note that only mediatek,pull-up-adv was merged in the binding, but not
its down counterpart.
Fixes: edbacb36ea50 ("dt-bindings: pinctrl: mt8192: Add mediatek,pull-up-adv property")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogiocchino.delregno@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220525155714.1837360-3-nfraprado@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../bindings/pinctrl/pinctrl-mt8192.yaml | 29 ++++++++++---------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
index 8ede8b750237..e39f5893bf16 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
@@ -83,20 +83,21 @@ patternProperties:
drive-strength-microamp:
enum: [125, 250, 500, 1000]
- mediatek,pull-up-adv:
- description: |
- Pull up settings for 2 pull resistors, R0 and R1. User can
- configure those special pins. Valid arguments are described as below:
- 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
- 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
- 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
- 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2, 3]
-
- bias-pull-down: true
-
- bias-pull-up: true
+ bias-pull-down:
+ oneOf:
+ - type: boolean
+ description: normal pull down.
+ - enum: [100, 101, 102, 103]
+ description: PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0_
+ defines in dt-bindings/pinctrl/mt65xx.h.
+
+ bias-pull-up:
+ oneOf:
+ - type: boolean
+ description: normal pull up.
+ - enum: [100, 101, 102, 103]
+ description: PUPD/R1/R0 pull up type. See MTK_PUPD_SET_R1R0_
+ defines in dt-bindings/pinctrl/mt65xx.h.
bias-disable: true
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 093/365] pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 092/365] dt-bindings: pinctrl: mt8192: Use generic bias instead of pull-*-adv Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 094/365] pinctrl: qcom: msm8916: Allow CAMSS GP clocks to be muxed Greg Kroah-Hartman
` (276 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Miaoqian Lin, Linus Walleij
From: Miaoqian Lin <linmq006@gmail.com>
commit 4b32e054335ea0ce50967f63a7bfd4db058b14b9 upstream.
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak."
Fixes: c2f6d059abfc ("pinctrl: nomadik: refactor DT parser to take two paths")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220607111602.57355-1-linmq006@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1421,8 +1421,10 @@ static int nmk_pinctrl_dt_subnode_to_map
has_config = nmk_pinctrl_dt_get_config(np, &configs);
np_config = of_parse_phandle(np, "ste,config", 0);
- if (np_config)
+ if (np_config) {
has_config |= nmk_pinctrl_dt_get_config(np_config, &configs);
+ of_node_put(np_config);
+ }
if (has_config) {
const char *gpio_name;
const char *pin;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 094/365] pinctrl: qcom: msm8916: Allow CAMSS GP clocks to be muxed
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 093/365] pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 095/365] pinctrl: amd: Dont save/restore interrupt status and wake status bits Greg Kroah-Hartman
` (275 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Nikita Travkin, Linus Walleij
From: Nikita Travkin <nikita@trvn.ru>
commit 44339391c666e46cba522d19c65a6ad1071c68b7 upstream.
GPIO 31, 32 can be muxed to GCC_CAMSS_GP(1,2)_CLK respectively but the
function was never assigned to the pingroup (even though the function
exists already).
Add this mode to the related pins.
Fixes: 5373a2c5abb6 ("pinctrl: qcom: Add msm8916 pinctrl driver")
Signed-off-by: Nikita Travkin <nikita@trvn.ru>
Link: https://lore.kernel.org/r/20220612145955.385787-4-nikita@trvn.ru
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/qcom/pinctrl-msm8916.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/pinctrl/qcom/pinctrl-msm8916.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm8916.c
@@ -844,8 +844,8 @@ static const struct msm_pingroup msm8916
PINGROUP(28, pwr_modem_enabled_a, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, atest_combodac),
PINGROUP(29, cci_i2c, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, atest_combodac),
PINGROUP(30, cci_i2c, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
- PINGROUP(31, cci_timer0, NA, NA, NA, NA, NA, NA, NA, NA),
- PINGROUP(32, cci_timer1, NA, NA, NA, NA, NA, NA, NA, NA),
+ PINGROUP(31, cci_timer0, flash_strobe, NA, NA, NA, NA, NA, NA, NA),
+ PINGROUP(32, cci_timer1, flash_strobe, NA, NA, NA, NA, NA, NA, NA),
PINGROUP(33, cci_async, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
PINGROUP(34, pwr_nav_enabled_a, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
PINGROUP(35, pwr_crypto_enabled_a, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 095/365] pinctrl: amd: Dont save/restore interrupt status and wake status bits
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 094/365] pinctrl: qcom: msm8916: Allow CAMSS GP clocks to be muxed Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 096/365] dt-bindings: pinctrl: mt8195: Fix name for mediatek,rsel-resistance-in-si-unit Greg Kroah-Hartman
` (274 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mario Limonciello, Basavaraj Natikar,
Linus Walleij
From: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
commit b8c824a869f220c6b46df724f85794349bafbf23 upstream.
Saving/restoring interrupt and wake status bits across suspend can
cause the suspend to fail if an IRQ is serviced across the
suspend cycle.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Fixes: 79d2c8bede2c ("pinctrl/amd: save pin registers over suspend/resume")
Link: https://lore.kernel.org/r/20220613064127.220416-3-Basavaraj.Natikar@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/pinctrl-amd.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -917,6 +917,7 @@ static int amd_gpio_suspend(struct devic
{
struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
+ unsigned long flags;
int i;
for (i = 0; i < desc->npins; i++) {
@@ -925,7 +926,9 @@ static int amd_gpio_suspend(struct devic
if (!amd_gpio_should_save(gpio_dev, pin))
continue;
- gpio_dev->saved_regs[i] = readl(gpio_dev->base + pin*4);
+ raw_spin_lock_irqsave(&gpio_dev->lock, flags);
+ gpio_dev->saved_regs[i] = readl(gpio_dev->base + pin * 4) & ~PIN_IRQ_PENDING;
+ raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
}
return 0;
@@ -935,6 +938,7 @@ static int amd_gpio_resume(struct device
{
struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
+ unsigned long flags;
int i;
for (i = 0; i < desc->npins; i++) {
@@ -943,7 +947,10 @@ static int amd_gpio_resume(struct device
if (!amd_gpio_should_save(gpio_dev, pin))
continue;
- writel(gpio_dev->saved_regs[i], gpio_dev->base + pin*4);
+ raw_spin_lock_irqsave(&gpio_dev->lock, flags);
+ gpio_dev->saved_regs[i] |= readl(gpio_dev->base + pin * 4) & PIN_IRQ_PENDING;
+ writel(gpio_dev->saved_regs[i], gpio_dev->base + pin * 4);
+ raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
}
return 0;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 096/365] dt-bindings: pinctrl: mt8195: Fix name for mediatek,rsel-resistance-in-si-unit
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 095/365] pinctrl: amd: Dont save/restore interrupt status and wake status bits Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 097/365] dt-bindings: pinctrl: mt8195: Add and use drive-strength-microamp Greg Kroah-Hartman
` (273 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, AngeloGioacchino Del Regno,
Nícolas F . R . A . Prado, Rob Herring, Linus Walleij
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
commit 11bd0ffd165fce7aff1a2ed15c04c088239f3d42 upstream.
When this property was introduced, it contained underscores, but
the actual code wants dashes.
Change it from mediatek,rsel_resistance_in_si_unit to
mediatek,rsel-resistance-in-si-unit.
Fixes: 91e7edceda96 ("dt-bindings: pinctrl: mt8195: change pull up/down description")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220630122334.216903-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
@@ -49,7 +49,7 @@ properties:
description: The interrupt outputs to sysirq.
maxItems: 1
- mediatek,rsel_resistance_in_si_unit:
+ mediatek,rsel-resistance-in-si-unit:
type: boolean
description: |
Identifying i2c pins pull up/down type which is RSEL. It can support
@@ -142,7 +142,7 @@ patternProperties:
"MTK_PUPD_SET_R1R0_11" define in mt8195.
For pull down type is RSEL, it can add RSEL define & resistance
value(ohm) to set different resistance by identifying property
- "mediatek,rsel_resistance_in_si_unit".
+ "mediatek,rsel-resistance-in-si-unit".
It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
& "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011"
& "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101"
@@ -161,7 +161,7 @@ patternProperties:
};
An example of using si unit resistance value(ohm):
&pio {
- mediatek,rsel_resistance_in_si_unit;
+ mediatek,rsel-resistance-in-si-unit;
}
pincontroller {
i2c0_pin {
@@ -190,7 +190,7 @@ patternProperties:
"MTK_PUPD_SET_R1R0_11" define in mt8195.
For pull up type is RSEL, it can add RSEL define & resistance
value(ohm) to set different resistance by identifying property
- "mediatek,rsel_resistance_in_si_unit".
+ "mediatek,rsel-resistance-in-si-unit".
It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
& "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011"
& "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101"
@@ -209,7 +209,7 @@ patternProperties:
};
An example of using si unit resistance value(ohm):
&pio {
- mediatek,rsel_resistance_in_si_unit;
+ mediatek,rsel-resistance-in-si-unit;
}
pincontroller {
i2c0-pins {
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 097/365] dt-bindings: pinctrl: mt8195: Add and use drive-strength-microamp
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 096/365] dt-bindings: pinctrl: mt8195: Fix name for mediatek,rsel-resistance-in-si-unit Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 7:59 ` [PATCH 5.19 098/365] pinctrl: sunxi: Add I/O bias setting for H6 R-PIO Greg Kroah-Hartman
` (272 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, AngeloGioacchino Del Regno,
Nícolas F . R . A . Prado, Rob Herring, Linus Walleij
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
commit 1b3ab63e56f0c30193b6787b083be4f4071b7fc6 upstream.
As was already done for MT8192 in commit b52e695324bb ("dt-bindings:
pinctrl: mt8192: Add drive-strength-microamp"), replace the custom
mediatek,drive-strength-adv property with the standardized pinconf
'drive-strength-microamp' one.
Similarly to the mt8192 counterpart, there's no user of property
'mediatek,drive-strength-adv', hence removing it is safe.
Fixes: 69c3d58dc187 ("dt-bindings: pinctrl: mt8195: Add mediatek,drive-strength-adv property")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220630131543.225554-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../bindings/pinctrl/pinctrl-mt8195.yaml | 27 ++-----------------
1 file changed, 2 insertions(+), 25 deletions(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
index bb40398bb047..3d8afb3d5695 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
@@ -98,31 +98,8 @@ patternProperties:
drive-strength:
enum: [2, 4, 6, 8, 10, 12, 14, 16]
- mediatek,drive-strength-adv:
- description: |
- Describe the specific driving setup property.
- For I2C pins, the existing generic driving setup can only support
- 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they
- can support 0.125/0.25/0.5/1mA adjustment. If we enable specific
- driving setup, the existing generic setup will be disabled.
- The specific driving setup is controlled by E1E0EN.
- When E1=0/E0=0, the strength is 0.125mA.
- When E1=0/E0=1, the strength is 0.25mA.
- When E1=1/E0=0, the strength is 0.5mA.
- When E1=1/E0=1, the strength is 1mA.
- EN is used to enable or disable the specific driving setup.
- Valid arguments are described as below:
- 0: (E1, E0, EN) = (0, 0, 0)
- 1: (E1, E0, EN) = (0, 0, 1)
- 2: (E1, E0, EN) = (0, 1, 0)
- 3: (E1, E0, EN) = (0, 1, 1)
- 4: (E1, E0, EN) = (1, 0, 0)
- 5: (E1, E0, EN) = (1, 0, 1)
- 6: (E1, E0, EN) = (1, 1, 0)
- 7: (E1, E0, EN) = (1, 1, 1)
- So the valid arguments are from 0 to 7.
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2, 3, 4, 5, 6, 7]
+ drive-strength-microamp:
+ enum: [125, 250, 500, 1000]
bias-pull-down:
oneOf:
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 098/365] pinctrl: sunxi: Add I/O bias setting for H6 R-PIO
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 097/365] dt-bindings: pinctrl: mt8195: Add and use drive-strength-microamp Greg Kroah-Hartman
@ 2022-08-23 7:59 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 099/365] dt-bindings: pinctrl: mt8186: Add and use drive-strength-microamp Greg Kroah-Hartman
` (271 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 7:59 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jernej Skrabec, Heiko Stuebner,
Samuel Holland, Linus Walleij
From: Samuel Holland <samuel@sholland.org>
commit fc153c8f283bf5925615195fc9d4056414d7b168 upstream.
H6 requires I/O bias configuration on both of its PIO devices.
Previously it was only done for the main PIO.
The setting for Port L is at bit 0, so the bank calculation needs to
account for the pin base. Otherwise the wrong bit is used.
Fixes: cc62383fcebe ("pinctrl: sunxi: Support I/O bias voltage setting on H6")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220713025233.27248-3-samuel@sholland.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c | 1 +
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 7 ++++---
2 files changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c
@@ -107,6 +107,7 @@ static const struct sunxi_pinctrl_desc s
.npins = ARRAY_SIZE(sun50i_h6_r_pins),
.pin_base = PL_BASE,
.irq_banks = 2,
+ .io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL,
};
static int sun50i_h6_r_pinctrl_probe(struct platform_device *pdev)
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -624,7 +624,7 @@ static int sunxi_pinctrl_set_io_bias_cfg
unsigned pin,
struct regulator *supply)
{
- unsigned short bank = pin / PINS_PER_BANK;
+ unsigned short bank;
unsigned long flags;
u32 val, reg;
int uV;
@@ -640,6 +640,9 @@ static int sunxi_pinctrl_set_io_bias_cfg
if (uV == 0)
return 0;
+ pin -= pctl->desc->pin_base;
+ bank = pin / PINS_PER_BANK;
+
switch (pctl->desc->io_bias_cfg_variant) {
case BIAS_VOLTAGE_GRP_CONFIG:
/*
@@ -657,8 +660,6 @@ static int sunxi_pinctrl_set_io_bias_cfg
else
val = 0xD; /* 3.3V */
- pin -= pctl->desc->pin_base;
-
reg = readl(pctl->membase + sunxi_grp_config_reg(pin));
reg &= ~IO_BIAS_MASK;
writel(reg | val, pctl->membase + sunxi_grp_config_reg(pin));
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 099/365] dt-bindings: pinctrl: mt8186: Add and use drive-strength-microamp
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2022-08-23 7:59 ` [PATCH 5.19 098/365] pinctrl: sunxi: Add I/O bias setting for H6 R-PIO Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 100/365] pinctrl: qcom: sm8250: Fix PDC map Greg Kroah-Hartman
` (270 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Allen-KH Cheng,
AngeloGioacchino Del Regno, Rob Herring, Linus Walleij
From: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
commit f4526ae80dbdef7078ab2aae30dfc70bbc0098c6 upstream.
Commit e5fabbe43f3f ("pinctrl: mediatek: paris: Support generic
PIN_CONFIG_DRIVE_STRENGTH_UA") added support for using
drive-strength-microamp instead of mediatek,drive-strength-adv.
Similarly to the mt8192 and mt8195, there's no user of property
'mediatek,drive-strength-adv', hence removing it is safe.
Fixes: 338e953f1bd1 ("dt-bindings: pinctrl: mt8186: add pinctrl file and binding document")
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220725110702.11362-3-allen-kh.cheng@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/pinctrl/pinctrl-mt8186.yaml | 29 +---------
1 file changed, 3 insertions(+), 26 deletions(-)
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8186.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8186.yaml
@@ -105,31 +105,8 @@ patternProperties:
drive-strength:
enum: [2, 4, 6, 8, 10, 12, 14, 16]
- mediatek,drive-strength-adv:
- description: |
- Describe the specific driving setup property.
- For I2C pins, the existing generic driving setup can only support
- 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they
- can support 0.125/0.25/0.5/1mA adjustment. If we enable specific
- driving setup, the existing generic setup will be disabled.
- The specific driving setup is controlled by E1E0EN.
- When E1=0/E0=0, the strength is 0.125mA.
- When E1=0/E0=1, the strength is 0.25mA.
- When E1=1/E0=0, the strength is 0.5mA.
- When E1=1/E0=1, the strength is 1mA.
- EN is used to enable or disable the specific driving setup.
- Valid arguments are described as below:
- 0: (E1, E0, EN) = (0, 0, 0)
- 1: (E1, E0, EN) = (0, 0, 1)
- 2: (E1, E0, EN) = (0, 1, 0)
- 3: (E1, E0, EN) = (0, 1, 1)
- 4: (E1, E0, EN) = (1, 0, 0)
- 5: (E1, E0, EN) = (1, 0, 1)
- 6: (E1, E0, EN) = (1, 1, 0)
- 7: (E1, E0, EN) = (1, 1, 1)
- So the valid arguments are from 0 to 7.
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2, 3, 4, 5, 6, 7]
+ drive-strength-microamp:
+ enum: [125, 250, 500, 1000]
bias-pull-down:
oneOf:
@@ -291,7 +268,7 @@ examples:
pinmux = <PINMUX_GPIO127__FUNC_SCL0>,
<PINMUX_GPIO128__FUNC_SDA0>;
bias-pull-up = <MTK_PULL_SET_RSEL_001>;
- mediatek,drive-strength-adv = <7>;
+ drive-strength-microamp = <1000>;
};
};
};
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 100/365] pinctrl: qcom: sm8250: Fix PDC map
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 099/365] dt-bindings: pinctrl: mt8186: Add and use drive-strength-microamp Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 101/365] rtc: spear: set range max Greg Kroah-Hartman
` (269 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jianhua Lu, Konrad Dybcio, Linus Walleij
From: Jianhua Lu <lujianhua000@gmail.com>
commit 4b759ca15a4914f96ea204ea9200ceeb01d70666 upstream.
Fix the PDC mapping for SM8250, gpio39 is mapped to irq73(not irq37).
Fixes: b41efeed507a("pinctrl: qcom: sm8250: Specify PDC map.")
Signed-off-by: Jianhua Lu <lujianhua000@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Link: https://lore.kernel.org/r/20220803015645.22388-1-lujianhua000@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/qcom/pinctrl-sm8250.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pinctrl/qcom/pinctrl-sm8250.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8250.c
@@ -1316,7 +1316,7 @@ static const struct msm_pingroup sm8250_
static const struct msm_gpio_wakeirq_map sm8250_pdc_map[] = {
{ 0, 79 }, { 1, 84 }, { 2, 80 }, { 3, 82 }, { 4, 107 }, { 7, 43 },
{ 11, 42 }, { 14, 44 }, { 15, 52 }, { 19, 67 }, { 23, 68 }, { 24, 105 },
- { 27, 92 }, { 28, 106 }, { 31, 69 }, { 35, 70 }, { 39, 37 },
+ { 27, 92 }, { 28, 106 }, { 31, 69 }, { 35, 70 }, { 39, 73 },
{ 40, 108 }, { 43, 71 }, { 45, 72 }, { 47, 83 }, { 51, 74 }, { 55, 77 },
{ 59, 78 }, { 63, 75 }, { 64, 81 }, { 65, 87 }, { 66, 88 }, { 67, 89 },
{ 68, 54 }, { 70, 85 }, { 77, 46 }, { 80, 90 }, { 81, 91 }, { 83, 97 },
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 101/365] rtc: spear: set range max
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 100/365] pinctrl: qcom: sm8250: Fix PDC map Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 102/365] Input: exc3000 - fix return value check of wait_for_completion_timeout Greg Kroah-Hartman
` (268 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Zeng Jingxiang, Viresh Kumar,
Alexandre Belloni
From: Zeng Jingxiang <linuszeng@tencent.com>
commit 03c4cd6f89e074a51e289eb9129ac646f0f2bd29 upstream.
In the commit f395e1d3b28d7c2c67b73bd467c4fb79523e1c65
("rtc: spear: set range"), the value of
RTC_TIMESTAMP_END_9999 was incorrectly set to range_min.
390 config->rtc->range_min = RTC_TIMESTAMP_BEGIN_0000;
391 config->rtc->range_max = RTC_TIMESTAMP_END_9999;
Fixes: f395e1d3b28d ("rtc: spear: set range")
Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220728100101.1906801-1-zengjx95@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/rtc/rtc-spear.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index d4777b01ab22..736fe535cd45 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -388,7 +388,7 @@ static int spear_rtc_probe(struct platform_device *pdev)
config->rtc->ops = &spear_rtc_ops;
config->rtc->range_min = RTC_TIMESTAMP_BEGIN_0000;
- config->rtc->range_min = RTC_TIMESTAMP_END_9999;
+ config->rtc->range_max = RTC_TIMESTAMP_END_9999;
status = devm_rtc_register_device(config->rtc);
if (status)
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 102/365] Input: exc3000 - fix return value check of wait_for_completion_timeout
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 101/365] rtc: spear: set range max Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 103/365] Input: mt6779-keypad - match hardware matrix organization Greg Kroah-Hartman
` (267 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Miaoqian Lin, Dmitry Torokhov
From: Miaoqian Lin <linmq006@gmail.com>
commit 6bb7144c3fa16a5efb54a8e2aff1817b4168018e upstream.
wait_for_completion_timeout() returns unsigned long not int.
It returns 0 if timed out, and positive if completed.
The check for <= 0 is ambiguous and should be == 0 here
indicating timeout which is the only error case.
Fixes: 102feb1ddfd0 ("Input: exc3000 - factor out vendor data request")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220411105828.22140-1-linmq006@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/touchscreen/exc3000.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -220,6 +220,7 @@ static int exc3000_vendor_data_request(s
{
u8 buf[EXC3000_LEN_VENDOR_REQUEST] = { 0x67, 0x00, 0x42, 0x00, 0x03 };
int ret;
+ unsigned long time_left;
mutex_lock(&data->query_lock);
@@ -233,9 +234,9 @@ static int exc3000_vendor_data_request(s
goto out_unlock;
if (response) {
- ret = wait_for_completion_timeout(&data->wait_event,
- timeout * HZ);
- if (ret <= 0) {
+ time_left = wait_for_completion_timeout(&data->wait_event,
+ timeout * HZ);
+ if (time_left == 0) {
ret = -ETIMEDOUT;
goto out_unlock;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 103/365] Input: mt6779-keypad - match hardware matrix organization
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 102/365] Input: exc3000 - fix return value check of wait_for_completion_timeout Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 104/365] Input: iqs7222 - correct slider event disable logic Greg Kroah-Hartman
` (266 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Fabien Parent, Mattijs Korpershoek,
Dmitry Torokhov
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
commit d6ed52583034f9d2e39dead7c18e03380fd4edf2 upstream.
The MediaTek keypad has a set of bits representing keys,
from KEY0 to KEY77, arranged in 5 chunks of 15 bits split into 5 32-bit
registers.
In our implementation, we simply decided to use register number as row
and offset in the register as column when encoding our "matrix".
Because of this, we can have a 5x32 matrix which does not match the
hardware at all, which is confusing.
Change the row/column calculation to match the hardware.
Fixes: f28af984e771 ("Input: mt6779-keypad - add MediaTek keypad driver")
Co-developed-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220707075236.126631-2-mkorpershoek@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/keyboard/mt6779-keypad.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
index 2e7c9187c10f..bd86cb95bde3 100644
--- a/drivers/input/keyboard/mt6779-keypad.c
+++ b/drivers/input/keyboard/mt6779-keypad.c
@@ -42,7 +42,7 @@ static irqreturn_t mt6779_keypad_irq_handler(int irq, void *dev_id)
const unsigned short *keycode = keypad->input_dev->keycode;
DECLARE_BITMAP(new_state, MTK_KPD_NUM_BITS);
DECLARE_BITMAP(change, MTK_KPD_NUM_BITS);
- unsigned int bit_nr;
+ unsigned int bit_nr, key;
unsigned int row, col;
unsigned int scancode;
unsigned int row_shift = get_count_order(keypad->n_cols);
@@ -61,8 +61,10 @@ static irqreturn_t mt6779_keypad_irq_handler(int irq, void *dev_id)
if (bit_nr % 32 >= 16)
continue;
- row = bit_nr / 32;
- col = bit_nr % 32;
+ key = bit_nr / 32 * 16 + bit_nr % 32;
+ row = key / 9;
+ col = key % 9;
+
scancode = MATRIX_SCAN_CODE(row, col, row_shift);
/* 1: not pressed, 0: pressed */
pressed = !test_bit(bit_nr, new_state);
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 104/365] Input: iqs7222 - correct slider event disable logic
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 103/365] Input: mt6779-keypad - match hardware matrix organization Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 105/365] Input: iqs7222 - fortify slider event reporting Greg Kroah-Hartman
` (265 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 56a0c54c4c2bdb6c0952de90dd690020a703b50e upstream.
If a positive swipe/flick gesture is defined but the corresponding
negative gesture is not, the former is inadvertently disabled. Fix
this by gently refactoring the logic responsible for disabling all
gestures by default.
As part of this change, make the code a bit simpler by eliminating
a superfluous conditional check. If a slider event does not define
an enable control, the second term of the bitwise AND operation is
simply 0xFFFF.
Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-2-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/misc/iqs7222.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index 6b4138771a3f..53df74f3a982 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -2081,17 +2081,19 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index)
sldr_setup[0] |= dev_desc->wheel_enable;
}
+ /*
+ * The absence of a register offset makes it safe to assume the device
+ * supports gestures, each of which is first disabled until explicitly
+ * enabled.
+ */
+ if (!reg_offset)
+ for (i = 0; i < ARRAY_SIZE(iqs7222_sl_events); i++)
+ sldr_setup[9] &= ~iqs7222_sl_events[i].enable;
+
for (i = 0; i < ARRAY_SIZE(iqs7222_sl_events); i++) {
const char *event_name = iqs7222_sl_events[i].name;
struct fwnode_handle *event_node;
- /*
- * The absence of a register offset means the remaining fields
- * in the group represent gesture settings.
- */
- if (iqs7222_sl_events[i].enable && !reg_offset)
- sldr_setup[9] &= ~iqs7222_sl_events[i].enable;
-
event_node = fwnode_get_named_child_node(sldr_node, event_name);
if (!event_node)
continue;
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 105/365] Input: iqs7222 - fortify slider event reporting
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 104/365] Input: iqs7222 - correct slider event disable logic Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 106/365] Input: iqs7222 - protect volatile registers Greg Kroah-Hartman
` (264 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 95215d3d19c5b47b8ccef8cb61c9dcd17ac7a669 upstream.
The release cycle of any key mapped to a slider gesture relies upon
trailing interrupts generated by other unmasked sources, the timing
and presence of which are inconsistent.
To solve this problem, explicitly report a release cycle to emulate
a full keystroke. Also, unmask touch interrupts if the slider press
event is defined; this ensures the device reports a final interrupt
with coordinate = 0xFFFF once the finger is lifted.
As a result of how the logic has been refactored, the press/release
event can now be mapped to a GPIO. This is more convenient than the
previous solution, which required each channel within the slider to
specify the same GPIO.
As part of this change, use the device's resolution rather than its
number of interrupt status registers to more safely determine if it
is capable of reporting gestures.
Last but not least, make the code a bit simpler by eliminating some
unnecessarily complex conditional statements and a macro that could
be derived using information that is already available.
Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-3-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/misc/iqs7222.c | 96 ++++++++++++++++++++++--------------
1 file changed, 58 insertions(+), 38 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index 53df74f3a982..57616a7ebeae 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -40,7 +40,6 @@
#define IQS7222_SLDR_SETUP_2_RES_MASK GENMASK(15, 8)
#define IQS7222_SLDR_SETUP_2_RES_SHIFT 8
#define IQS7222_SLDR_SETUP_2_TOP_SPEED_MASK GENMASK(7, 0)
-#define IQS7222_SLDR_SETUP_3_CHAN_SEL_MASK GENMASK(9, 0)
#define IQS7222_GPIO_SETUP_0_GPIO_EN BIT(0)
@@ -54,6 +53,9 @@
#define IQS7222_SYS_SETUP_ACK_RESET BIT(0)
#define IQS7222_EVENT_MASK_ATI BIT(12)
+#define IQS7222_EVENT_MASK_SLDR BIT(10)
+#define IQS7222_EVENT_MASK_TOUCH BIT(1)
+#define IQS7222_EVENT_MASK_PROX BIT(0)
#define IQS7222_COMMS_HOLD BIT(0)
#define IQS7222_COMMS_ERROR 0xEEEE
@@ -135,12 +137,12 @@ struct iqs7222_event_desc {
static const struct iqs7222_event_desc iqs7222_kp_events[] = {
{
.name = "event-prox",
- .enable = BIT(0),
+ .enable = IQS7222_EVENT_MASK_PROX,
.reg_key = IQS7222_REG_KEY_PROX,
},
{
.name = "event-touch",
- .enable = BIT(1),
+ .enable = IQS7222_EVENT_MASK_TOUCH,
.reg_key = IQS7222_REG_KEY_TOUCH,
},
};
@@ -1957,8 +1959,8 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index)
int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row;
int ext_chan = rounddown(num_chan, 10);
int count, error, reg_offset, i;
+ u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset];
u16 *sldr_setup = iqs7222->sldr_setup[sldr_index];
- u16 *sys_setup = iqs7222->sys_setup;
unsigned int chan_sel[4], val;
error = iqs7222_parse_props(iqs7222, &sldr_node, sldr_index,
@@ -2003,7 +2005,7 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index)
reg_offset = dev_desc->sldr_res < U16_MAX ? 0 : 1;
sldr_setup[0] |= count;
- sldr_setup[3 + reg_offset] &= ~IQS7222_SLDR_SETUP_3_CHAN_SEL_MASK;
+ sldr_setup[3 + reg_offset] &= ~GENMASK(ext_chan - 1, 0);
for (i = 0; i < ARRAY_SIZE(chan_sel); i++) {
sldr_setup[5 + reg_offset + i] = 0;
@@ -2106,6 +2108,22 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index)
if (error)
return error;
+ /*
+ * The press/release event does not expose a direct GPIO link,
+ * but one can be emulated by tying each of the participating
+ * channels to the same GPIO.
+ */
+ error = iqs7222_gpio_select(iqs7222, event_node,
+ i ? iqs7222_sl_events[i].enable
+ : sldr_setup[3 + reg_offset],
+ i ? 1568 + sldr_index * 30
+ : sldr_setup[4 + reg_offset]);
+ if (error)
+ return error;
+
+ if (!reg_offset)
+ sldr_setup[9] |= iqs7222_sl_events[i].enable;
+
error = fwnode_property_read_u32(event_node, "linux,code",
&val);
if (error) {
@@ -2117,26 +2135,20 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, int sldr_index)
iqs7222->sl_code[sldr_index][i] = val;
input_set_capability(iqs7222->keypad, EV_KEY, val);
- /*
- * The press/release event is determined based on whether the
- * coordinate field reports 0xFFFF and has no explicit enable
- * control.
- */
- if (!iqs7222_sl_events[i].enable || reg_offset)
- continue;
-
- sldr_setup[9] |= iqs7222_sl_events[i].enable;
-
- error = iqs7222_gpio_select(iqs7222, event_node,
- iqs7222_sl_events[i].enable,
- 1568 + sldr_index * 30);
- if (error)
- return error;
-
if (!dev_desc->event_offset)
continue;
- sys_setup[dev_desc->event_offset] |= BIT(10 + sldr_index);
+ /*
+ * The press/release event is determined based on whether the
+ * coordinate field reports 0xFFFF and solely relies on touch
+ * or proximity interrupts to be unmasked.
+ */
+ if (i && !reg_offset)
+ *event_mask |= (IQS7222_EVENT_MASK_SLDR << sldr_index);
+ else if (sldr_setup[4 + reg_offset] == dev_desc->touch_link)
+ *event_mask |= IQS7222_EVENT_MASK_TOUCH;
+ else
+ *event_mask |= IQS7222_EVENT_MASK_PROX;
}
/*
@@ -2301,29 +2313,37 @@ static int iqs7222_report(struct iqs7222_private *iqs7222)
input_report_abs(iqs7222->keypad, iqs7222->sl_axis[i],
sldr_pos);
- for (j = 0; j < ARRAY_SIZE(iqs7222_sl_events); j++) {
- u16 mask = iqs7222_sl_events[j].mask;
- u16 val = iqs7222_sl_events[j].val;
+ input_report_key(iqs7222->keypad, iqs7222->sl_code[i][0],
+ sldr_pos < dev_desc->sldr_res);
- if (!iqs7222_sl_events[j].enable) {
- input_report_key(iqs7222->keypad,
- iqs7222->sl_code[i][j],
- sldr_pos < dev_desc->sldr_res);
- continue;
- }
+ /*
+ * A maximum resolution indicates the device does not support
+ * gestures, in which case the remaining fields are ignored.
+ */
+ if (dev_desc->sldr_res == U16_MAX)
+ continue;
- /*
- * The remaining offsets represent gesture state, and
- * are discarded in the case of IQS7222C because only
- * absolute position is reported.
- */
- if (num_stat < IQS7222_MAX_COLS_STAT)
- continue;
+ if (!(le16_to_cpu(status[1]) & IQS7222_EVENT_MASK_SLDR << i))
+ continue;
+
+ /*
+ * Skip the press/release event, as it does not have separate
+ * status fields and is handled separately.
+ */
+ for (j = 1; j < ARRAY_SIZE(iqs7222_sl_events); j++) {
+ u16 mask = iqs7222_sl_events[j].mask;
+ u16 val = iqs7222_sl_events[j].val;
input_report_key(iqs7222->keypad,
iqs7222->sl_code[i][j],
(state & mask) == val);
}
+
+ input_sync(iqs7222->keypad);
+
+ for (j = 1; j < ARRAY_SIZE(iqs7222_sl_events); j++)
+ input_report_key(iqs7222->keypad,
+ iqs7222->sl_code[i][j], 0);
}
input_sync(iqs7222->keypad);
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 106/365] Input: iqs7222 - protect volatile registers
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 105/365] Input: iqs7222 - fortify slider event reporting Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 107/365] Input: iqs7222 - acknowledge reset before writing registers Greg Kroah-Hartman
` (263 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 1e4189d8af2749e2db406f92bdc4abccbab63138 upstream.
Select variants of silicon silently mirror part of the event mask
register to the system setup register (0xD0), and vice versa. For
the following sequence:
1. Read registers 0xD0 onward and store their contents.
2. Modify the contents, including event mask fields.
3. Write registers 0xD0 onward with the modified contents.
4. Write register 0xD0 on its own again later, using the contents
from step 1 to populate any reserved fields.
...the event mask register (e.g. address 0xDA) has been corrupted
by writing register 0xD0 with contents that were made stale after
step 3.
To solve this problem, read register 0xD0 once more between steps
3 and 4. When register 0xD0 is written during step 4, the portion
which is mirrored to the event mask register already matches what
was written in step 3.
Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-4-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/misc/iqs7222.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index 57616a7ebeae..c46d3c8f0230 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -1274,9 +1274,22 @@ static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222)
struct i2c_client *client = iqs7222->client;
ktime_t ati_timeout;
u16 sys_status = 0;
- u16 sys_setup = iqs7222->sys_setup[0] & ~IQS7222_SYS_SETUP_ACK_RESET;
+ u16 sys_setup;
int error, i;
+ /*
+ * The reserved fields of the system setup register may have changed
+ * as a result of other registers having been written. As such, read
+ * the register's latest value to avoid unexpected behavior when the
+ * register is written in the loop that follows.
+ */
+ error = iqs7222_read_word(iqs7222, IQS7222_SYS_SETUP, &sys_setup);
+ if (error)
+ return error;
+
+ sys_setup &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK;
+ sys_setup &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK;
+
for (i = 0; i < IQS7222_NUM_RETRIES; i++) {
/*
* Trigger ATI from streaming and normal-power modes so that
@@ -2241,9 +2254,6 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222)
return error;
}
- sys_setup[0] &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK;
- sys_setup[0] &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK;
-
sys_setup[0] |= IQS7222_SYS_SETUP_ACK_RESET;
return iqs7222_parse_props(iqs7222, NULL, 0, IQS7222_REG_GRP_SYS,
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 107/365] Input: iqs7222 - acknowledge reset before writing registers
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 106/365] Input: iqs7222 - protect volatile registers Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 108/365] Input: iqs7222 - handle reset during ATI Greg Kroah-Hartman
` (262 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 2e70ef525b7309287b2d4dd24e7c9c038a006328 upstream.
If the device suffers a spurious reset while reacting to a previous
spurious reset, the second reset interrupt is preempted because the
ACK_RESET bit is written last.
To solve this problem, write the ACK_RESET bit prior to writing any
other registers. This ensures that any registers written before the
second spurious reset will be rewritten.
Last but not least, the order in which the ACK_RESET bit is written
relative to the second filter beta register is important for select
variants of silicon. Enforce the correct order so as to not clobber
the system status register.
Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-5-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/misc/iqs7222.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index c46d3c8f0230..aa46f2cd4d34 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -94,11 +94,11 @@ enum iqs7222_reg_key_id {
enum iqs7222_reg_grp_id {
IQS7222_REG_GRP_STAT,
+ IQS7222_REG_GRP_FILT,
IQS7222_REG_GRP_CYCLE,
IQS7222_REG_GRP_GLBL,
IQS7222_REG_GRP_BTN,
IQS7222_REG_GRP_CHAN,
- IQS7222_REG_GRP_FILT,
IQS7222_REG_GRP_SLDR,
IQS7222_REG_GRP_GPIO,
IQS7222_REG_GRP_SYS,
@@ -1348,6 +1348,34 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
int comms_offset = dev_desc->comms_offset;
int error, i, j, k;
+ /*
+ * Acknowledge reset before writing any registers in case the device
+ * suffers a spurious reset during initialization. Because this step
+ * may change the reserved fields of the second filter beta register,
+ * its cache must be updated.
+ *
+ * Writing the second filter beta register, in turn, may clobber the
+ * system status register. As such, the filter beta register pair is
+ * written first to protect against this hazard.
+ */
+ if (dir == WRITE) {
+ u16 reg = dev_desc->reg_grps[IQS7222_REG_GRP_FILT].base + 1;
+ u16 filt_setup;
+
+ error = iqs7222_write_word(iqs7222, IQS7222_SYS_SETUP,
+ iqs7222->sys_setup[0] |
+ IQS7222_SYS_SETUP_ACK_RESET);
+ if (error)
+ return error;
+
+ error = iqs7222_read_word(iqs7222, reg, &filt_setup);
+ if (error)
+ return error;
+
+ iqs7222->filt_setup[1] &= GENMASK(7, 0);
+ iqs7222->filt_setup[1] |= (filt_setup & ~GENMASK(7, 0));
+ }
+
/*
* Take advantage of the stop-bit disable function, if available, to
* save the trouble of having to reopen a communication window after
@@ -2254,8 +2282,6 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222)
return error;
}
- sys_setup[0] |= IQS7222_SYS_SETUP_ACK_RESET;
-
return iqs7222_parse_props(iqs7222, NULL, 0, IQS7222_REG_GRP_SYS,
IQS7222_REG_KEY_NONE);
}
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 108/365] Input: iqs7222 - handle reset during ATI
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 107/365] Input: iqs7222 - acknowledge reset before writing registers Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 109/365] Input: iqs7222 - remove support for RF filter Greg Kroah-Hartman
` (261 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 8635c68891c6d786d644747d599c41bdf512fbbf upstream.
If the device suffers a spurious reset during ATI, there is no point
in enduring any further retries. Instead, simply return successfully
from the polling loop.
In this case, the interrupt handler will intervene and recognize the
device has been reset. It then proceeds to initialize the device and
trigger ATI once more.
As part of this change, swap the order of status field evaluation to
match that of the interrupt handler, and correct a nearby off-by-one
error that causes an error message to suggest the final attempt will
be retried.
Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-6-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/misc/iqs7222.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index aa46f2cd4d34..e65260d290cc 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -1314,12 +1314,15 @@ static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222)
if (error)
return error;
- if (sys_status & IQS7222_SYS_STATUS_ATI_ACTIVE)
- continue;
+ if (sys_status & IQS7222_SYS_STATUS_RESET)
+ return 0;
if (sys_status & IQS7222_SYS_STATUS_ATI_ERROR)
break;
+ if (sys_status & IQS7222_SYS_STATUS_ATI_ACTIVE)
+ continue;
+
/*
* Use stream-in-touch mode if either slider reports
* absolute position.
@@ -1336,7 +1339,7 @@ static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222)
dev_err(&client->dev,
"ATI attempt %d of %d failed with status 0x%02X, %s\n",
i + 1, IQS7222_NUM_RETRIES, (u8)sys_status,
- i < IQS7222_NUM_RETRIES ? "retrying..." : "stopping");
+ i + 1 < IQS7222_NUM_RETRIES ? "retrying" : "stopping");
}
return -ETIMEDOUT;
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 109/365] Input: iqs7222 - remove support for RF filter
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 108/365] Input: iqs7222 - handle reset during ATI Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 110/365] dt-bindings: input: iqs7222: Remove " Greg Kroah-Hartman
` (260 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 381932cf61d52bde656c8596c0cb8f46bed53dc0 upstream.
The vendor has marked the RF filter enable control as reserved in
the datasheet; remove it from the driver.
Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-7-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/misc/iqs7222.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index e65260d290cc..b2e8097a2e6d 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -557,13 +557,6 @@ static const struct iqs7222_prop_desc iqs7222_props[] = {
.reg_width = 4,
.label = "current reference trim",
},
- {
- .name = "azoteq,rf-filt-enable",
- .reg_grp = IQS7222_REG_GRP_GLBL,
- .reg_offset = 0,
- .reg_shift = 15,
- .reg_width = 1,
- },
{
.name = "azoteq,max-counts",
.reg_grp = IQS7222_REG_GRP_GLBL,
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 110/365] dt-bindings: input: iqs7222: Remove support for RF filter
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 109/365] Input: iqs7222 - remove support for RF filter Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 111/365] dt-bindings: input: iqs7222: Correct bottom speed step size Greg Kroah-Hartman
` (259 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit f5d2c1ed72c26152e6883ed67dc3004a39165098 upstream.
The vendor has marked the RF filter enable control as reserved in
the datasheet; remove it from the binding.
Fixes: 44dc42d254bf ("dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-8-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
index a3a1e5a65306..6180f7ee2284 100644
--- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
+++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
@@ -37,10 +37,6 @@ properties:
device is temporarily held in hardware reset prior to initialization if
this property is present.
- azoteq,rf-filt-enable:
- type: boolean
- description: Enables the device's internal RF filter.
-
azoteq,max-counts:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 111/365] dt-bindings: input: iqs7222: Correct bottom speed step size
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 110/365] dt-bindings: input: iqs7222: Remove " Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 112/365] dt-bindings: input: iqs7222: Extend slider-mapped GPIO to IQS7222C Greg Kroah-Hartman
` (258 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit 6cfb357851bd3ef0a48e14bccfb5ca6b8104ea61 upstream.
The bottom speed property is specified in steps of 1, not 4.
Fixes: 44dc42d254bf ("dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-9-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
index 6180f7ee2284..c9c3a1e9bcae 100644
--- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
+++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
@@ -533,9 +533,8 @@ patternProperties:
azoteq,bottom-speed:
$ref: /schemas/types.yaml#/definitions/uint32
- multipleOf: 4
minimum: 0
- maximum: 1020
+ maximum: 255
description:
Specifies the speed of movement after which coordinate filtering is
linearly reduced.
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 112/365] dt-bindings: input: iqs7222: Extend slider-mapped GPIO to IQS7222C
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 111/365] dt-bindings: input: iqs7222: Correct bottom speed step size Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 113/365] um: Add missing apply_returns() Greg Kroah-Hartman
` (257 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeff LaBundy, Dmitry Torokhov
From: Jeff LaBundy <jeff@labundy.com>
commit f0ea452715d72bc365d2b401ceb458f5ae82eeec upstream.
Although the IQS7222C does not offer slider gesture support, the
press/release event can still be mapped to any of the IQS7222C's
three GPIO pins. Update the binding to reflect this relationship.
Fixes: 44dc42d254bf ("dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-10-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../bindings/input/azoteq,iqs7222.yaml | 21 ++++++++++++-------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
index c9c3a1e9bcae..32d0d5190334 100644
--- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
+++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
@@ -611,16 +611,15 @@ patternProperties:
azoteq,gpio-select:
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
- maxItems: 1
+ maxItems: 3
items:
minimum: 0
- maximum: 0
+ maximum: 2
description: |
- Specifies an individual GPIO mapped to a tap, swipe or flick
- gesture as follows:
+ Specifies one or more GPIO mapped to the event as follows:
0: GPIO0
- 1: GPIO3 (reserved)
- 2: GPIO4 (reserved)
+ 1: GPIO3 (IQS7222C only)
+ 2: GPIO4 (IQS7222C only)
Note that although multiple events can be mapped to a single
GPIO, they must all be of the same type (proximity, touch or
@@ -705,6 +704,14 @@ allOf:
multipleOf: 4
maximum: 1020
+ patternProperties:
+ "^event-(press|tap|(swipe|flick)-(pos|neg))$":
+ properties:
+ azoteq,gpio-select:
+ maxItems: 1
+ items:
+ maximum: 0
+
else:
patternProperties:
"^channel-([0-9]|1[0-9])$":
@@ -721,8 +728,6 @@ allOf:
azoteq,gesture-dist: false
- azoteq,gpio-select: false
-
required:
- compatible
- reg
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 113/365] um: Add missing apply_returns()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 112/365] dt-bindings: input: iqs7222: Extend slider-mapped GPIO to IQS7222C Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 114/365] octeontx2-pf: Fix NIX_AF_TL3_TL2X_LINKX_CFG register configuration Greg Kroah-Hartman
` (256 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Peter Zijlstra (Intel), Richard Weinberger
From: Peter Zijlstra <peterz@infradead.org>
commit 637285e7f8d6da70a70c64e7895cb0672357a1f7 upstream.
Implement apply_returns() stub for UM, just like all the other patching
routines.
Fixes: 15e67227c49a ("x86: Undo return-thunk damage")
Reported-by: Randy Dunlap <rdunlap@infradead.org)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/um/kernel/um_arch.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -444,6 +444,10 @@ void apply_returns(s32 *start, s32 *end)
{
}
+void apply_returns(s32 *start, s32 *end)
+{
+}
+
void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
{
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 114/365] octeontx2-pf: Fix NIX_AF_TL3_TL2X_LINKX_CFG register configuration
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 113/365] um: Add missing apply_returns() Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 115/365] octeontx2-af: Apply tx nibble fixup always Greg Kroah-Hartman
` (255 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Naveen Mamindlapalli,
Sunil Kovvuri Goutham, Jakub Kicinski
From: Naveen Mamindlapalli <naveenm@marvell.com>
commit 13c9f4dc102f2856e80b92486c41841e25e23772 upstream.
For packets scheduled to RPM and LBK, NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL]
selects the TL3 or TL2 scheduling level as the one used for link/channel
selection and backpressure. For each scheduling queue at the selected
level: Setting NIX_AF_TL3_TL2(0..255)_LINK(0..12)_CFG[ENA] = 1 allows
the TL3/TL2 queue to schedule packets to a specified RPM or LBK link
and channel.
There is an issue in the code where NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL]
is set to TL3 where as the NIX_AF_TL3_TL2(0..255)_LINK(0..12)_CFG is
configured for TL2 queue in some cases. As a result packets will not
transmit on that link/channel. This patch fixes the issue by configuring
the NIX_AF_TL3_TL2(0..255)_LINK(0..12)_CFG register depending on the
NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL] value.
Fixes: caa2da34fd25a ("octeontx2-pf: Initialize and config queues")
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Link: https://lore.kernel.org/r/20220802142813.25031-1-naveenm@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 19 +++++++++++----
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 1
2 files changed, 15 insertions(+), 5 deletions(-)
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -632,6 +632,12 @@ int otx2_txschq_config(struct otx2_nic *
req->num_regs++;
req->reg[1] = NIX_AF_TL3X_SCHEDULE(schq);
req->regval[1] = dwrr_val;
+ if (lvl == hw->txschq_link_cfg_lvl) {
+ req->num_regs++;
+ req->reg[2] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, hw->tx_link);
+ /* Enable this queue and backpressure */
+ req->regval[2] = BIT_ULL(13) | BIT_ULL(12);
+ }
} else if (lvl == NIX_TXSCH_LVL_TL2) {
parent = hw->txschq_list[NIX_TXSCH_LVL_TL1][0];
req->reg[0] = NIX_AF_TL2X_PARENT(schq);
@@ -641,11 +647,12 @@ int otx2_txschq_config(struct otx2_nic *
req->reg[1] = NIX_AF_TL2X_SCHEDULE(schq);
req->regval[1] = TXSCH_TL1_DFLT_RR_PRIO << 24 | dwrr_val;
- req->num_regs++;
- req->reg[2] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, hw->tx_link);
- /* Enable this queue and backpressure */
- req->regval[2] = BIT_ULL(13) | BIT_ULL(12);
-
+ if (lvl == hw->txschq_link_cfg_lvl) {
+ req->num_regs++;
+ req->reg[2] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, hw->tx_link);
+ /* Enable this queue and backpressure */
+ req->regval[2] = BIT_ULL(13) | BIT_ULL(12);
+ }
} else if (lvl == NIX_TXSCH_LVL_TL1) {
/* Default config for TL1.
* For VF this is always ignored.
@@ -1591,6 +1598,8 @@ void mbox_handler_nix_txsch_alloc(struct
for (schq = 0; schq < rsp->schq[lvl]; schq++)
pf->hw.txschq_list[lvl][schq] =
rsp->schq_list[lvl][schq];
+
+ pf->hw.txschq_link_cfg_lvl = rsp->link_cfg_lvl;
}
EXPORT_SYMBOL(mbox_handler_nix_txsch_alloc);
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
@@ -195,6 +195,7 @@ struct otx2_hw {
u16 sqb_size;
/* NIX */
+ u8 txschq_link_cfg_lvl;
u16 txschq_list[NIX_TXSCH_LVL_CNT][MAX_TXSCHQ_PER_FUNC];
u16 matchall_ipolicer;
u32 dwrr_mtu;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 115/365] octeontx2-af: Apply tx nibble fixup always
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 114/365] octeontx2-pf: Fix NIX_AF_TL3_TL2X_LINKX_CFG register configuration Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 116/365] octeontx2-af: suppress external profile loading warning Greg Kroah-Hartman
` (254 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Stanislaw Kardach, Subbaraya Sundeep,
Sunil Goutham, Jakub Kicinski
From: Stanislaw Kardach <skardach@marvell.com>
commit dd1d1a8a6b29b6b472fd0d449b29eb806c411dd2 upstream.
NPC_PARSE_NIBBLE for TX interface has to be equal to the RX one for some
silicon revisions. Mistakenly this fixup was only applied to the default
MKEX profile while it should also be applied to any loaded profile.
Fixes: 1c1935c9945d ("octeontx2-af: Add NIX1 interfaces to NPC")
Signed-off-by: Stanislaw Kardach <skardach@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -1915,6 +1915,7 @@ static void rvu_npc_hw_init(struct rvu *
static void rvu_npc_setup_interfaces(struct rvu *rvu, int blkaddr)
{
+ struct npc_mcam_kex *mkex = rvu->kpu.mkex;
struct npc_mcam *mcam = &rvu->hw->mcam;
struct rvu_hwinfo *hw = rvu->hw;
u64 nibble_ena, rx_kex, tx_kex;
@@ -1927,15 +1928,15 @@ static void rvu_npc_setup_interfaces(str
mcam->counters.max--;
mcam->rx_miss_act_cntr = mcam->counters.max;
- rx_kex = npc_mkex_default.keyx_cfg[NIX_INTF_RX];
- tx_kex = npc_mkex_default.keyx_cfg[NIX_INTF_TX];
+ rx_kex = mkex->keyx_cfg[NIX_INTF_RX];
+ tx_kex = mkex->keyx_cfg[NIX_INTF_TX];
nibble_ena = FIELD_GET(NPC_PARSE_NIBBLE, rx_kex);
nibble_ena = rvu_npc_get_tx_nibble_cfg(rvu, nibble_ena);
if (nibble_ena) {
tx_kex &= ~NPC_PARSE_NIBBLE;
tx_kex |= FIELD_PREP(NPC_PARSE_NIBBLE, nibble_ena);
- npc_mkex_default.keyx_cfg[NIX_INTF_TX] = tx_kex;
+ mkex->keyx_cfg[NIX_INTF_TX] = tx_kex;
}
/* Configure RX interfaces */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 116/365] octeontx2-af: suppress external profile loading warning
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 115/365] octeontx2-af: Apply tx nibble fixup always Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 117/365] octeontx2-af: Fix mcam entry resource leak Greg Kroah-Hartman
` (253 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Harman Kalra, Subbaraya Sundeep,
Sunil Goutham, Jakub Kicinski
From: Harman Kalra <hkalra@marvell.com>
commit cf2437626502b5271d19686b03dea306efe17ea0 upstream.
The packet parser profile supplied as firmware may not
be present all the time and default profile is used mostly.
Hence suppress firmware loading warning from kernel due to
absence of firmware in kernel image.
Fixes: 3a7244152f9c ("octeontx2-af: add support for custom KPU entries")
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -1650,7 +1650,7 @@ static void npc_load_kpu_profile(struct
* Firmware database method.
* Default KPU profile.
*/
- if (!request_firmware(&fw, kpu_profile, rvu->dev)) {
+ if (!request_firmware_direct(&fw, kpu_profile, rvu->dev)) {
dev_info(rvu->dev, "Loading KPU profile from firmware: %s\n",
kpu_profile);
rvu->kpu_fwdata = kzalloc(fw->size, GFP_KERNEL);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 117/365] octeontx2-af: Fix mcam entry resource leak
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 116/365] octeontx2-af: suppress external profile loading warning Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 118/365] octeontx2-af: Fix key checking for source mac Greg Kroah-Hartman
` (252 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Subbaraya Sundeep, Sunil Goutham,
Jakub Kicinski
From: Subbaraya Sundeep <sbhatta@marvell.com>
commit 3f8fe40ab7730cf8eb6f8b8ff412012f7f6f8f48 upstream.
The teardown sequence in FLR handler returns if no NIX LF
is attached to PF/VF because it indicates that graceful
shutdown of resources already happened. But there is a
chance of all allocated MCAM entries not being freed by
PF/VF. Hence free mcam entries even in case of detached LF.
Fixes: c554f9c1574e ("octeontx2-af: Teardown NPA, NIX LF upon receiving FLR")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 6 ++++++
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 6 ++++++
2 files changed, 12 insertions(+)
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -2564,6 +2564,12 @@ static void __rvu_flr_handler(struct rvu
rvu_blklf_teardown(rvu, pcifunc, BLKADDR_NPA);
rvu_reset_lmt_map_tbl(rvu, pcifunc);
rvu_detach_rsrcs(rvu, NULL, pcifunc);
+ /* In scenarios where PF/VF drivers detach NIXLF without freeing MCAM
+ * entries, check and free the MCAM entries explicitly to avoid leak.
+ * Since LF is detached use LF number as -1.
+ */
+ rvu_npc_free_mcam_entries(rvu, pcifunc, -1);
+
mutex_unlock(&rvu->flr_lock);
}
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -1096,6 +1096,9 @@ static void npc_enadis_default_entries(s
void rvu_npc_disable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf)
{
+ if (nixlf < 0)
+ return;
+
npc_enadis_default_entries(rvu, pcifunc, nixlf, false);
/* Delete multicast and promisc MCAM entries */
@@ -1107,6 +1110,9 @@ void rvu_npc_disable_default_entries(str
void rvu_npc_enable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf)
{
+ if (nixlf < 0)
+ return;
+
/* Enables only broadcast match entry. Promisc/Allmulti are enabled
* in set_rx_mode mbox handler.
*/
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 118/365] octeontx2-af: Fix key checking for source mac
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 117/365] octeontx2-af: Fix mcam entry resource leak Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 119/365] ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool Greg Kroah-Hartman
` (251 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Subbaraya Sundeep, Sunil Goutham,
Jakub Kicinski
From: Subbaraya Sundeep <sbhatta@marvell.com>
commit c3c290276927a3ae79342a4e17ec0500c138c63a upstream.
Given a field with its location/offset in input packet,
the key checking logic verifies whether extracting the
field can be supported or not based on the mkex profile
loaded in hardware. This logic is wrong wrt source mac
and this patch fixes that.
Fixes: 9b179a960a96 ("octeontx2-af: Generate key field bit mask from KEX profile")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
@@ -445,7 +445,8 @@ do { \
NPC_SCAN_HDR(NPC_VLAN_TAG1, NPC_LID_LB, NPC_LT_LB_CTAG, 2, 2);
NPC_SCAN_HDR(NPC_VLAN_TAG2, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 2, 2);
NPC_SCAN_HDR(NPC_DMAC, NPC_LID_LA, la_ltype, la_start, 6);
- NPC_SCAN_HDR(NPC_SMAC, NPC_LID_LA, la_ltype, la_start, 6);
+ /* SMAC follows the DMAC(which is 6 bytes) */
+ NPC_SCAN_HDR(NPC_SMAC, NPC_LID_LA, la_ltype, la_start + 6, 6);
/* PF_FUNC is 2 bytes at 0th byte of NPC_LT_LA_IH_NIX_ETHER */
NPC_SCAN_HDR(NPC_PF_FUNC, NPC_LID_LA, NPC_LT_LA_IH_NIX_ETHER, 0, 2);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 119/365] ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 118/365] octeontx2-af: Fix key checking for source mac Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 120/365] geneve: do not use RT_TOS for IPv6 flowlabel Greg Kroah-Hartman
` (250 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sakari Ailus, Andy Shevchenko,
Rafael J. Wysocki
From: Sakari Ailus <sakari.ailus@linux.intel.com>
commit 85140ef275f577f64e8a2c5789447222dfc14fc4 upstream.
The value acpi_add_nondev_subnodes() returns is bool so change the return
type of the function to match that.
Fixes: 445b0eb058f5 ("ACPI / property: Add support for data-only subnodes")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -155,10 +155,10 @@ static bool acpi_nondev_subnode_ok(acpi_
return acpi_nondev_subnode_data_ok(handle, link, list, parent);
}
-static int acpi_add_nondev_subnodes(acpi_handle scope,
- const union acpi_object *links,
- struct list_head *list,
- struct fwnode_handle *parent)
+static bool acpi_add_nondev_subnodes(acpi_handle scope,
+ const union acpi_object *links,
+ struct list_head *list,
+ struct fwnode_handle *parent)
{
bool ret = false;
int i;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 120/365] geneve: do not use RT_TOS for IPv6 flowlabel
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 119/365] ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 121/365] vxlan: " Greg Kroah-Hartman
` (249 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Guillaume Nault, Matthias May,
Jakub Kicinski
From: Matthias May <matthias.may@westermo.com>
commit ca2bb69514a8bc7f83914122f0d596371352416c upstream.
According to Guillaume Nault RT_TOS should never be used for IPv6.
Quote:
RT_TOS() is an old macro used to interprete IPv4 TOS as described in
the obsolete RFC 1349. It's conceptually wrong to use it even in IPv4
code, although, given the current state of the code, most of the
existing calls have no consequence.
But using RT_TOS() in IPv6 code is always a bug: IPv6 never had a "TOS"
field to be interpreted the RFC 1349 way. There's no historical
compatibility to worry about.
Fixes: 3a56f86f1be6 ("geneve: handle ipv6 priority like ipv4 tos")
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Matthias May <matthias.may@westermo.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/geneve.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -876,8 +876,7 @@ static struct dst_entry *geneve_get_v6_d
use_cache = false;
}
- fl6->flowlabel = ip6_make_flowinfo(RT_TOS(prio),
- info->key.label);
+ fl6->flowlabel = ip6_make_flowinfo(prio, info->key.label);
dst_cache = (struct dst_cache *)&info->dst_cache;
if (use_cache) {
dst = dst_cache_get_ip6(dst_cache, &fl6->saddr);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 121/365] vxlan: do not use RT_TOS for IPv6 flowlabel
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 120/365] geneve: do not use RT_TOS for IPv6 flowlabel Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 122/365] mlx5: " Greg Kroah-Hartman
` (248 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Guillaume Nault, Matthias May,
Jakub Kicinski
From: Matthias May <matthias.may@westermo.com>
commit e488d4f5d6e4cd1e728ba4ddbdcd7ef5f4d13a21 upstream.
According to Guillaume Nault RT_TOS should never be used for IPv6.
Quote:
RT_TOS() is an old macro used to interprete IPv4 TOS as described in
the obsolete RFC 1349. It's conceptually wrong to use it even in IPv4
code, although, given the current state of the code, most of the
existing calls have no consequence.
But using RT_TOS() in IPv6 code is always a bug: IPv6 never had a "TOS"
field to be interpreted the RFC 1349 way. There's no historical
compatibility to worry about.
Fixes: 1400615d64cf ("vxlan: allow setting ipv6 traffic class")
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Matthias May <matthias.may@westermo.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/vxlan/vxlan_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -2321,7 +2321,7 @@ static struct dst_entry *vxlan6_get_rout
fl6.flowi6_oif = oif;
fl6.daddr = *daddr;
fl6.saddr = *saddr;
- fl6.flowlabel = ip6_make_flowinfo(RT_TOS(tos), label);
+ fl6.flowlabel = ip6_make_flowinfo(tos, label);
fl6.flowi6_mark = skb->mark;
fl6.flowi6_proto = IPPROTO_UDP;
fl6.fl6_dport = dport;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 122/365] mlx5: do not use RT_TOS for IPv6 flowlabel
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 121/365] vxlan: " Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 123/365] ipv6: " Greg Kroah-Hartman
` (247 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Guillaume Nault, Matthias May,
Jakub Kicinski
From: Matthias May <matthias.may@westermo.com>
commit bcb0da7fffee9464073998b267ce5543da2356d2 upstream.
According to Guillaume Nault RT_TOS should never be used for IPv6.
Quote:
RT_TOS() is an old macro used to interprete IPv4 TOS as described in
the obsolete RFC 1349. It's conceptually wrong to use it even in IPv4
code, although, given the current state of the code, most of the
existing calls have no consequence.
But using RT_TOS() in IPv6 code is always a bug: IPv6 never had a "TOS"
field to be interpreted the RFC 1349 way. There's no historical
compatibility to worry about.
Fixes: ce99f6b97fcd ("net/mlx5e: Support SRIOV TC encapsulation offloads for IPv6 tunnels")
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Matthias May <matthias.may@westermo.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
@@ -506,7 +506,7 @@ int mlx5e_tc_tun_create_header_ipv6(stru
int err;
attr.ttl = tun_key->ttl;
- attr.fl.fl6.flowlabel = ip6_make_flowinfo(RT_TOS(tun_key->tos), tun_key->label);
+ attr.fl.fl6.flowlabel = ip6_make_flowinfo(tun_key->tos, tun_key->label);
attr.fl.fl6.daddr = tun_key->u.ipv6.dst;
attr.fl.fl6.saddr = tun_key->u.ipv6.src;
@@ -620,7 +620,7 @@ int mlx5e_tc_tun_update_header_ipv6(stru
attr.ttl = tun_key->ttl;
- attr.fl.fl6.flowlabel = ip6_make_flowinfo(RT_TOS(tun_key->tos), tun_key->label);
+ attr.fl.fl6.flowlabel = ip6_make_flowinfo(tun_key->tos, tun_key->label);
attr.fl.fl6.daddr = tun_key->u.ipv6.dst;
attr.fl.fl6.saddr = tun_key->u.ipv6.src;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 123/365] ipv6: do not use RT_TOS for IPv6 flowlabel
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 122/365] mlx5: " Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 124/365] plip: avoid rcu debug splat Greg Kroah-Hartman
` (246 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Guillaume Nault, Matthias May,
Jakub Kicinski
From: Matthias May <matthias.may@westermo.com>
commit ab7e2e0dfa5d37540ab1dc5376e9a2cb9188925d upstream.
According to Guillaume Nault RT_TOS should never be used for IPv6.
Quote:
RT_TOS() is an old macro used to interprete IPv4 TOS as described in
the obsolete RFC 1349. It's conceptually wrong to use it even in IPv4
code, although, given the current state of the code, most of the
existing calls have no consequence.
But using RT_TOS() in IPv6 code is always a bug: IPv6 never had a "TOS"
field to be interpreted the RFC 1349 way. There's no historical
compatibility to worry about.
Fixes: 571912c69f0e ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.")
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Matthias May <matthias.may@westermo.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/ip6_output.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1311,8 +1311,7 @@ struct dst_entry *ip6_dst_lookup_tunnel(
fl6.daddr = info->key.u.ipv6.dst;
fl6.saddr = info->key.u.ipv6.src;
prio = info->key.tos;
- fl6.flowlabel = ip6_make_flowinfo(RT_TOS(prio),
- info->key.label);
+ fl6.flowlabel = ip6_make_flowinfo(prio, info->key.label);
dst = ipv6_stub->ipv6_dst_lookup_flow(net, sock->sk, &fl6,
NULL);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 124/365] plip: avoid rcu debug splat
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 123/365] ipv6: " Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 125/365] vsock: Fix memory leak in vsock_connect() Greg Kroah-Hartman
` (245 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, kernel test robot, Florian Westphal,
Jakub Kicinski
From: Florian Westphal <fw@strlen.de>
commit bc3c8fe3c79bcdae4d90e3726054fac5cca8ac32 upstream.
WARNING: suspicious RCU usage
5.2.0-rc2-00605-g2638eb8b50cfc #1 Not tainted
drivers/net/plip/plip.c:1110 suspicious rcu_dereference_check() usage!
plip_open is called with RTNL held, switch to the correct helper.
Fixes: 2638eb8b50cf ("net: ipv4: provide __rcu annotation for ifa_list")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://lore.kernel.org/r/20220807115304.13257-1-fw@strlen.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/plip/plip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -1111,7 +1111,7 @@ plip_open(struct net_device *dev)
/* Any address will do - we take the first. We already
have the first two bytes filled with 0xfc, from
plip_init_dev(). */
- const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list);
+ const struct in_ifaddr *ifa = rtnl_dereference(in_dev->ifa_list);
if (ifa != NULL) {
dev_addr_mod(dev, 2, &ifa->ifa_local, 4);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 125/365] vsock: Fix memory leak in vsock_connect()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 124/365] plip: avoid rcu debug splat Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 126/365] vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout() Greg Kroah-Hartman
` (244 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Stefano Garzarella, Peilin Ye,
David S. Miller, syzbot+b03f55bf128f9a38f064
From: Peilin Ye <peilin.ye@bytedance.com>
commit 7e97cfed9929eaabc41829c395eb0d1350fccb9d upstream.
An O_NONBLOCK vsock_connect() request may try to reschedule
@connect_work. Imagine the following sequence of vsock_connect()
requests:
1. The 1st, non-blocking request schedules @connect_work, which will
expire after 200 jiffies. Socket state is now SS_CONNECTING;
2. Later, the 2nd, blocking request gets interrupted by a signal after
a few jiffies while waiting for the connection to be established.
Socket state is back to SS_UNCONNECTED, but @connect_work is still
pending, and will expire after 100 jiffies.
3. Now, the 3rd, non-blocking request tries to schedule @connect_work
again. Since @connect_work is already scheduled,
schedule_delayed_work() silently returns. sock_hold() is called
twice, but sock_put() will only be called once in
vsock_connect_timeout(), causing a memory leak reported by syzbot:
BUG: memory leak
unreferenced object 0xffff88810ea56a40 (size 1232):
comm "syz-executor756", pid 3604, jiffies 4294947681 (age 12.350s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
28 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 (..@............
backtrace:
[<ffffffff837c830e>] sk_prot_alloc+0x3e/0x1b0 net/core/sock.c:1930
[<ffffffff837cbe22>] sk_alloc+0x32/0x2e0 net/core/sock.c:1989
[<ffffffff842ccf68>] __vsock_create.constprop.0+0x38/0x320 net/vmw_vsock/af_vsock.c:734
[<ffffffff842ce8f1>] vsock_create+0xc1/0x2d0 net/vmw_vsock/af_vsock.c:2203
[<ffffffff837c0cbb>] __sock_create+0x1ab/0x2b0 net/socket.c:1468
[<ffffffff837c3acf>] sock_create net/socket.c:1519 [inline]
[<ffffffff837c3acf>] __sys_socket+0x6f/0x140 net/socket.c:1561
[<ffffffff837c3bba>] __do_sys_socket net/socket.c:1570 [inline]
[<ffffffff837c3bba>] __se_sys_socket net/socket.c:1568 [inline]
[<ffffffff837c3bba>] __x64_sys_socket+0x1a/0x20 net/socket.c:1568
[<ffffffff84512815>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff84512815>] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
[<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
<...>
Use mod_delayed_work() instead: if @connect_work is already scheduled,
reschedule it, and undo sock_hold() to keep the reference count
balanced.
Reported-and-tested-by: syzbot+b03f55bf128f9a38f064@syzkaller.appspotmail.com
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Co-developed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/vmw_vsock/af_vsock.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1391,7 +1391,14 @@ static int vsock_connect(struct socket *
* timeout fires.
*/
sock_hold(sk);
- schedule_delayed_work(&vsk->connect_work, timeout);
+
+ /* If the timeout function is already scheduled,
+ * reschedule it, then ungrab the socket refcount to
+ * keep it balanced.
+ */
+ if (mod_delayed_work(system_wq, &vsk->connect_work,
+ timeout))
+ sock_put(sk);
/* Skip ahead to preserve error code set above. */
goto out_wait;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 126/365] vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 125/365] vsock: Fix memory leak in vsock_connect() Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 127/365] dt-bindings: gpio: zynq: Add missing compatible strings Greg Kroah-Hartman
` (243 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Stefano Garzarella, Peilin Ye,
David S. Miller
From: Peilin Ye <peilin.ye@bytedance.com>
commit a3e7b29e30854ed67be0d17687e744ad0c769c4b upstream.
Imagine two non-blocking vsock_connect() requests on the same socket.
The first request schedules @connect_work, and after it times out,
vsock_connect_timeout() sets *sock* state back to TCP_CLOSE, but keeps
*socket* state as SS_CONNECTING.
Later, the second request returns -EALREADY, meaning the socket "already
has a pending connection in progress", even though the first request has
already timed out.
As suggested by Stefano, fix it by setting *socket* state back to
SS_UNCONNECTED, so that the second request will return -ETIMEDOUT.
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/vmw_vsock/af_vsock.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1286,6 +1286,7 @@ static void vsock_connect_timeout(struct
if (sk->sk_state == TCP_SYN_SENT &&
(sk->sk_shutdown != SHUTDOWN_MASK)) {
sk->sk_state = TCP_CLOSE;
+ sk->sk_socket->state = SS_UNCONNECTED;
sk->sk_err = ETIMEDOUT;
sk_error_report(sk);
vsock_transport_cancel_pkt(vsk);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 127/365] dt-bindings: gpio: zynq: Add missing compatible strings
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 126/365] vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout() Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 128/365] dt-bindings: arm: qcom: fix Longcheer L8150 compatibles Greg Kroah-Hartman
` (242 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Michal Simek, Linus Walleij,
Rob Herring, Michal Simek
From: Michal Simek <michal.simek@xilinx.com>
commit 7668048e5c697a9493ffc0e6001c322b2efe90ae upstream.
"xlnx,zynqmp-gpio-1.0", "xlnx,versal-gpio-1.0" and "xlnx,pmc-gpio-1.0"
compatible strings were not moved to yaml format. But they were in origin
text file.
Fixes: 45ca16072b70 ("dt-bindings: gpio: zynq: convert bindings to YAML")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/72c973da5670b5ae81d050c582948894ee4174f8.1634206453.git.michal.simek@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/gpio/gpio-zynq.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/Documentation/devicetree/bindings/gpio/gpio-zynq.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-zynq.yaml
@@ -11,7 +11,11 @@ maintainers:
properties:
compatible:
- const: xlnx,zynq-gpio-1.0
+ enum:
+ - xlnx,zynq-gpio-1.0
+ - xlnx,zynqmp-gpio-1.0
+ - xlnx,versal-gpio-1.0
+ - xlnx,pmc-gpio-1.0
reg:
maxItems: 1
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 128/365] dt-bindings: arm: qcom: fix Longcheer L8150 compatibles
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 127/365] dt-bindings: gpio: zynq: Add missing compatible strings Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 129/365] dt-bindings: arm: qcom: fix MSM8916 MTP compatibles Greg Kroah-Hartman
` (241 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Rob Herring,
Stephan Gerhold, Bjorn Andersson
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit 25d203d0751ca191301bc578ba5d59fa401f1fbf upstream.
The MSM8916 Longcheer L8150 uses a fallback in compatible:
msm8916-longcheer-l8150.dtb: /: compatible: 'oneOf' conditional failed, one must be fixed:
['longcheer,l8150', 'qcom,msm8916-v1-qrd/9-v1', 'qcom,msm8916'] is too long
Fixes: b72160fa886d ("dt-bindings: qcom: Document bindings for new MSM8916 devices")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20220520123252.365762-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/arm/qcom.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -160,12 +160,16 @@ properties:
- items:
- enum:
- alcatel,idol347
- - longcheer,l8150
- samsung,a3u-eur
- samsung,a5u-eur
- const: qcom,msm8916
- items:
+ - const: longcheer,l8150
+ - const: qcom,msm8916-v1-qrd/9-v1
+ - const: qcom,msm8916
+
+ - items:
- enum:
- sony,karin_windy
- sony,karin-row
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 129/365] dt-bindings: arm: qcom: fix MSM8916 MTP compatibles
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 128/365] dt-bindings: arm: qcom: fix Longcheer L8150 compatibles Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 130/365] dt-bindings: arm: qcom: fix MSM8994 boards compatibles Greg Kroah-Hartman
` (240 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Rob Herring,
Bjorn Andersson
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit bb35fe1efbae4114bd288fae0f56070f563adcfc upstream.
The order of compatibles for MSM8916 MTP board is different:
msm8916-mtp.dtb: /: compatible: 'oneOf' conditional failed, one must be fixed:
['qcom,msm8916-mtp', 'qcom,msm8916-mtp/1', 'qcom,msm8916'] is too long
Fixes: 9d3ef77fe568 ("dt-bindings: arm: Convert QCom board/soc bindings to json-schema")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220520123252.365762-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/arm/qcom.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -153,8 +153,8 @@ properties:
- const: qcom,msm8974
- items:
- - const: qcom,msm8916-mtp/1
- const: qcom,msm8916-mtp
+ - const: qcom,msm8916-mtp/1
- const: qcom,msm8916
- items:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 130/365] dt-bindings: arm: qcom: fix MSM8994 boards compatibles
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 129/365] dt-bindings: arm: qcom: fix MSM8916 MTP compatibles Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 131/365] dt-bindings: clock: qcom,gcc-msm8996: add more GCC clock sources Greg Kroah-Hartman
` (239 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Rob Herring,
Bjorn Andersson
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit c704bd373f58a84193eebe40bd271d6b73c138b0 upstream.
The compatibles for APQ8094/MSM8994 boards are different than specified
in bindings. None of them use fallback to other SoC variant.
Fixes: 9ad3c08f6f1b ("dt-bindings: arm: qcom: Document sony boards for apq8094")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220520123252.365762-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/arm/qcom.yaml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -172,12 +172,15 @@ properties:
- items:
- enum:
- sony,karin_windy
+ - const: qcom,apq8094
+
+ - items:
+ - enum:
- sony,karin-row
- sony,satsuki-row
- sony,sumire-row
- sony,suzuran-row
- - qcom,msm8994
- - const: qcom,apq8094
+ - const: qcom,msm8994
- items:
- enum:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 131/365] dt-bindings: clock: qcom,gcc-msm8996: add more GCC clock sources
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 130/365] dt-bindings: arm: qcom: fix MSM8994 boards compatibles Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 132/365] dt-bindings: PCI: qcom: Fix reset conditional Greg Kroah-Hartman
` (238 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dmitry Baryshkov,
Krzysztof Kozlowski, Bjorn Andersson
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
commit 2b4e75a7a7c8d3531a40ebb103b92f88ff693f79 upstream.
Add additional GCC clock sources. This includes PCIe and USB PIPE and
UFS symbol clocks.
Fixes: 2a8aa18c1131 ("dt-bindings: clk: qcom: Fix self-validation, split, and clean cruft")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220620071936.1558906-2-dmitry.baryshkov@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/clock/qcom,gcc-msm8996.yaml | 16 ++++++++++
1 file changed, 16 insertions(+)
--- a/Documentation/devicetree/bindings/clock/qcom,gcc-msm8996.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,gcc-msm8996.yaml
@@ -22,16 +22,32 @@ properties:
const: qcom,gcc-msm8996
clocks:
+ minItems: 3
items:
- description: XO source
- description: Second XO source
- description: Sleep clock source
+ - description: PCIe 0 PIPE clock (optional)
+ - description: PCIe 1 PIPE clock (optional)
+ - description: PCIe 2 PIPE clock (optional)
+ - description: USB3 PIPE clock (optional)
+ - description: UFS RX symbol 0 clock (optional)
+ - description: UFS RX symbol 1 clock (optional)
+ - description: UFS TX symbol 0 clock (optional)
clock-names:
+ minItems: 3
items:
- const: cxo
- const: cxo2
- const: sleep_clk
+ - const: pcie_0_pipe_clk_src
+ - const: pcie_1_pipe_clk_src
+ - const: pcie_2_pipe_clk_src
+ - const: usb3_phy_pipe_clk_src
+ - const: ufs_rx_symbol_0_clk_src
+ - const: ufs_rx_symbol_1_clk_src
+ - const: ufs_tx_symbol_0_clk_src
'#clock-cells':
const: 1
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 132/365] dt-bindings: PCI: qcom: Fix reset conditional
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 131/365] dt-bindings: clock: qcom,gcc-msm8996: add more GCC clock sources Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 133/365] spi: dt-bindings: cadence: add missing required Greg Kroah-Hartman
` (237 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Johan Hovold, Bjorn Helgaas,
Manivannan Sadhasivam, Dmitry Baryshkov, Krzysztof Kozlowski
From: Johan Hovold <johan+linaro@kernel.org>
commit 839fbdee4c080eb95567cbcf6366072a56d3a3cc upstream.
Fix the reset conditional which always evaluated to true due to a
misspelled property name ("compatibles" in plural).
Fixes: 6700a9b00f0a ("dt-bindings: PCI: qcom: Do not require resets on msm8996 platforms")
Link: https://lore.kernel.org/r/20220629141000.18111-2-johan+linaro@kernel.org
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/pci/qcom,pcie.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml
index c40ba753707c..92402f1d3fda 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml
@@ -614,7 +614,7 @@ allOf:
- if:
not:
properties:
- compatibles:
+ compatible:
contains:
enum:
- qcom,pcie-msm8996
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 133/365] spi: dt-bindings: cadence: add missing required
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 132/365] dt-bindings: PCI: qcom: Fix reset conditional Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 134/365] spi: dt-bindings: zynqmp-qspi: " Greg Kroah-Hartman
` (236 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Michal Simek,
Mark Brown
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit 6eee27c598fde65988723b785a9c9192d5ffb93a upstream.
During the conversion the bindings lost list of required properties.
Fixes: aa7968682a2b ("spi: convert Cadence SPI bindings to YAML")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220704130618.199231-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/spi/spi-cadence.yaml | 7 +++++++
1 file changed, 7 insertions(+)
--- a/Documentation/devicetree/bindings/spi/spi-cadence.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-cadence.yaml
@@ -49,6 +49,13 @@ properties:
enum: [ 0, 1 ]
default: 0
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clock-names
+ - clocks
+
unevaluatedProperties: false
examples:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 134/365] spi: dt-bindings: zynqmp-qspi: add missing required
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 133/365] spi: dt-bindings: cadence: add missing required Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 135/365] dt-bindings: opp: opp-v2-kryo-cpu: Fix example binding checks Greg Kroah-Hartman
` (235 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Michal Simek,
Mark Brown
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit acfc34f008c3e66bbcb7b9162c80c8327b6e800f upstream.
During the conversion the bindings lost list of required properties.
Fixes: c58db2abb19f ("spi: convert Xilinx Zynq UltraScale+ MPSoC GQSPI bindings to YAML")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220704130618.199231-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/spi/spi-zynqmp-qspi.yaml | 7 +++++++
1 file changed, 7 insertions(+)
--- a/Documentation/devicetree/bindings/spi/spi-zynqmp-qspi.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-zynqmp-qspi.yaml
@@ -30,6 +30,13 @@ properties:
clocks:
maxItems: 2
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clock-names
+ - clocks
+
unevaluatedProperties: false
examples:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 135/365] dt-bindings: opp: opp-v2-kryo-cpu: Fix example binding checks
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 134/365] spi: dt-bindings: zynqmp-qspi: " Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 136/365] spi: dt-bindings: qcom,spi-geni-qcom: allow three interconnects Greg Kroah-Hartman
` (234 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Bryan ODonoghue, Viresh Kumar
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
commit 3b4916a6e422394aa129fe9b204f4d489ae484a6 upstream.
Adding missing compat entries to the cpufreq node
Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml shows up
a dt_binding_check in this file.
opp-v2-kryo-cpu.example.dtb: /: cpus:cpu@0: 'power-domains' is a required property
opp-v2-kryo-cpu.example.dtb: /: cpus:cpu@0: 'power-domain-names' is a required property
opp-v2-kryo-cpu.example.dtb: /: opp-table-0:opp-307200000: 'required-opps' is a required property
Fixes: ec24d1d55469 ("dt-bindings: opp: Convert qcom-nvmem-cpufreq to DT schema")
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../devicetree/bindings/opp/opp-v2-kryo-cpu.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
index 30f7b596d609..59663e897dae 100644
--- a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
+++ b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
@@ -98,6 +98,8 @@ examples:
capacity-dmips-mhz = <1024>;
clocks = <&kryocc 0>;
operating-points-v2 = <&cluster0_opp>;
+ power-domains = <&cpr>;
+ power-domain-names = "cpr";
#cooling-cells = <2>;
next-level-cache = <&L2_0>;
L2_0: l2-cache {
@@ -115,6 +117,8 @@ examples:
capacity-dmips-mhz = <1024>;
clocks = <&kryocc 0>;
operating-points-v2 = <&cluster0_opp>;
+ power-domains = <&cpr>;
+ power-domain-names = "cpr";
#cooling-cells = <2>;
next-level-cache = <&L2_0>;
};
@@ -128,6 +132,8 @@ examples:
capacity-dmips-mhz = <1024>;
clocks = <&kryocc 1>;
operating-points-v2 = <&cluster1_opp>;
+ power-domains = <&cpr>;
+ power-domain-names = "cpr";
#cooling-cells = <2>;
next-level-cache = <&L2_1>;
L2_1: l2-cache {
@@ -145,6 +151,8 @@ examples:
capacity-dmips-mhz = <1024>;
clocks = <&kryocc 1>;
operating-points-v2 = <&cluster1_opp>;
+ power-domains = <&cpr>;
+ power-domain-names = "cpr";
#cooling-cells = <2>;
next-level-cache = <&L2_1>;
};
@@ -182,18 +190,21 @@ examples:
opp-microvolt = <905000 905000 1140000>;
opp-supported-hw = <0x7>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp1>;
};
opp-1401600000 {
opp-hz = /bits/ 64 <1401600000>;
opp-microvolt = <1140000 905000 1140000>;
opp-supported-hw = <0x5>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp2>;
};
opp-1593600000 {
opp-hz = /bits/ 64 <1593600000>;
opp-microvolt = <1140000 905000 1140000>;
opp-supported-hw = <0x1>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp3>;
};
};
@@ -207,24 +218,28 @@ examples:
opp-microvolt = <905000 905000 1140000>;
opp-supported-hw = <0x7>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp1>;
};
opp-1804800000 {
opp-hz = /bits/ 64 <1804800000>;
opp-microvolt = <1140000 905000 1140000>;
opp-supported-hw = <0x6>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp4>;
};
opp-1900800000 {
opp-hz = /bits/ 64 <1900800000>;
opp-microvolt = <1140000 905000 1140000>;
opp-supported-hw = <0x4>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp5>;
};
opp-2150400000 {
opp-hz = /bits/ 64 <2150400000>;
opp-microvolt = <1140000 905000 1140000>;
opp-supported-hw = <0x1>;
clock-latency-ns = <200000>;
+ required-opps = <&cpr_opp6>;
};
};
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 136/365] spi: dt-bindings: qcom,spi-geni-qcom: allow three interconnects
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 135/365] dt-bindings: opp: opp-v2-kryo-cpu: Fix example binding checks Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 137/365] ceph: use correct index when encoding client supported features Greg Kroah-Hartman
` (233 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Rob Herring, Mark Brown
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
commit ee912312db5a5e877120b9f519a034fc34315c9b upstream.
Recent Qualcomm Geni SPI nodes, e.g. on SM8450, come also with three
interconnects. This fixes dtbs_check warnings like:
sm8450-qrd.dtb: spi@a98000: interconnects: [[46, 1, 0, 46, 4, 0], [47, 2, 0, 48, 12, 0], [49, 1, 0, 50, 1, 0]] is too long
sm8450-qrd.dtb: spi@a98000: interconnect-names: ['qup-core', 'qup-config', 'qup-memory'] is too long
Fixes: 5bdcae1fe1c5 ("spi: dt-bindings: qcom,spi-geni-qcom: convert to dtschema")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220720163841.7283-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../devicetree/bindings/spi/qcom,spi-geni-qcom.yaml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
index e2c7b934c50d..47e1b3ee8b1b 100644
--- a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
+++ b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
@@ -45,12 +45,15 @@ properties:
- const: rx
interconnects:
- maxItems: 2
+ minItems: 2
+ maxItems: 3
interconnect-names:
+ minItems: 2
items:
- const: qup-core
- const: qup-config
+ - const: qup-memory
interrupts:
maxItems: 1
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 137/365] ceph: use correct index when encoding client supported features
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 136/365] spi: dt-bindings: qcom,spi-geni-qcom: allow three interconnects Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 138/365] tools/testing/cxl: Fix decoder default state Greg Kroah-Hartman
` (232 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Luís Henriques, Jeff Layton,
Xiubo Li, Ilya Dryomov
From: Luís Henriques <lhenriques@suse.de>
commit fea013e020e6ecc7be75bea0d61697b7e916b44d upstream.
Feature bits have to be encoded into the correct locations. This hasn't
been an issue so far because the only hole in the feature bits was in bit
10 (CEPHFS_FEATURE_RECLAIM_CLIENT), which is located in the 2nd byte. When
adding more bits that go beyond the this 2nd byte, the bug will show up.
[xiubli: remove incorrect comment for CEPHFS_FEATURES_CLIENT_SUPPORTED]
Fixes: 9ba1e224538a ("ceph: allocate the correct amount of extra bytes for the session features")
Signed-off-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ceph/mds_client.c | 7 +++++--
fs/ceph/mds_client.h | 6 ------
2 files changed, 5 insertions(+), 8 deletions(-)
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1220,14 +1220,17 @@ static int encode_supported_features(voi
if (count > 0) {
size_t i;
size_t size = FEATURE_BYTES(count);
+ unsigned long bit;
if (WARN_ON_ONCE(*p + 4 + size > end))
return -ERANGE;
ceph_encode_32(p, size);
memset(*p, 0, size);
- for (i = 0; i < count; i++)
- ((unsigned char*)(*p))[i / 8] |= BIT(feature_bits[i] % 8);
+ for (i = 0; i < count; i++) {
+ bit = feature_bits[i];
+ ((unsigned char *)(*p))[bit / 8] |= BIT(bit % 8);
+ }
*p += size;
} else {
if (WARN_ON_ONCE(*p + 4 > end))
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -33,10 +33,6 @@ enum ceph_feature_type {
CEPHFS_FEATURE_MAX = CEPHFS_FEATURE_METRIC_COLLECT,
};
-/*
- * This will always have the highest feature bit value
- * as the last element of the array.
- */
#define CEPHFS_FEATURES_CLIENT_SUPPORTED { \
0, 1, 2, 3, 4, 5, 6, 7, \
CEPHFS_FEATURE_MIMIC, \
@@ -45,8 +41,6 @@ enum ceph_feature_type {
CEPHFS_FEATURE_MULTI_RECONNECT, \
CEPHFS_FEATURE_DELEG_INO, \
CEPHFS_FEATURE_METRIC_COLLECT, \
- \
- CEPHFS_FEATURE_MAX, \
}
#define CEPHFS_FEATURES_CLIENT_REQUIRED {}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 138/365] tools/testing/cxl: Fix decoder default state
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 137/365] ceph: use correct index when encoding client supported features Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 139/365] tools/vm/slabinfo: use alphabetic order when two values are equal Greg Kroah-Hartman
` (231 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jonathan Cameron, Dan Williams
From: Dan Williams <dan.j.williams@intel.com>
commit 08f8d040a11d539481b9aee7b482430561281a28 upstream.
The 'enabled' state is reserved for committed decoders. By default,
cxl_test decoders are uncommitted at init time.
Fixes: 7c7d68db0254 ("tools/testing/cxl: Enumerate mock decoders")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/165603888091.551046.6312322707378021172.stgit@dwillia2-xfh
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/cxl/test/cxl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index 91444279f9a2..6e086fbc5c5b 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -466,7 +466,6 @@ static int mock_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm)
.end = -1,
};
- cxld->flags = CXL_DECODER_F_ENABLE;
cxld->interleave_ways = min_not_zero(target_count, 1);
cxld->interleave_granularity = SZ_4K;
cxld->target_type = CXL_DECODER_EXPANDER;
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 139/365] tools/vm/slabinfo: use alphabetic order when two values are equal
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 138/365] tools/testing/cxl: Fix decoder default state Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 140/365] ceph: dont leak snap_rwsem in handle_cap_grant Greg Kroah-Hartman
` (230 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Yuanzheng Song, Tobin C. Harding,
Andrew Morton
From: Yuanzheng Song <songyuanzheng@huawei.com>
commit 4f5ceb8851f0081af54313abbf56de1615911faf upstream.
When the number of partial slabs in each cache is the same (e.g., the
value are 0), the results of the `slabinfo -X -N5` and `slabinfo -P -N5`
are different.
/ # slabinfo -X -N5
...
Slabs sorted by number of partial slabs
---------------------------------------
Name Objects Objsize Space Slabs/Part/Cpu O/S O %Fr %Ef Flg
inode_cache 15180 392 6217728 758/0/1 20 1 0 95 a
kernfs_node_cache 22494 88 2002944 488/0/1 46 0 0 98
shmem_inode_cache 663 464 319488 38/0/1 17 1 0 96
biovec-max 50 3072 163840 4/0/1 10 3 0 93 A
dentry 19050 136 2600960 633/0/2 30 0 0 99 a
/ # slabinfo -P -N5
Name Objects Objsize Space Slabs/Part/Cpu O/S O %Fr %Ef Flg
bdev_cache 32 984 32.7K 1/0/1 16 2 0 96 Aa
ext4_inode_cache 42 752 32.7K 1/0/1 21 2 0 96 a
dentry 19050 136 2.6M 633/0/2 30 0 0 99 a
TCPv6 17 1840 32.7K 0/0/1 17 3 0 95 A
RAWv6 18 856 16.3K 0/0/1 18 2 0 94 A
This problem is caused by the sort_slabs(). So let's use alphabetic order
when two values are equal in the sort_slabs().
By the way, the content of the `slabinfo -h` is not aligned because the
`-P|--partial Sort by number of partial slabs`
uses tabs instead of spaces. So let's use spaces instead of tabs to fix
it.
Link: https://lkml.kernel.org/r/20220528063117.935158-1-songyuanzheng@huawei.com
Fixes: 1106b205a3fe ("tools/vm/slabinfo: add partial slab listing to -X")
Signed-off-by: Yuanzheng Song <songyuanzheng@huawei.com>
Cc: "Tobin C. Harding" <tobin@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/vm/slabinfo.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
--- a/tools/vm/slabinfo.c
+++ b/tools/vm/slabinfo.c
@@ -125,7 +125,7 @@ static void usage(void)
"-n|--numa Show NUMA information\n"
"-N|--lines=K Show the first K slabs\n"
"-o|--ops Show kmem_cache_ops\n"
- "-P|--partial Sort by number of partial slabs\n"
+ "-P|--partial Sort by number of partial slabs\n"
"-r|--report Detailed report on single slabs\n"
"-s|--shrink Shrink slabs\n"
"-S|--Size Sort by size\n"
@@ -1067,15 +1067,27 @@ static void sort_slabs(void)
for (s2 = s1 + 1; s2 < slabinfo + slabs; s2++) {
int result;
- if (sort_size)
- result = slab_size(s1) < slab_size(s2);
- else if (sort_active)
- result = slab_activity(s1) < slab_activity(s2);
- else if (sort_loss)
- result = slab_waste(s1) < slab_waste(s2);
- else if (sort_partial)
- result = s1->partial < s2->partial;
- else
+ if (sort_size) {
+ if (slab_size(s1) == slab_size(s2))
+ result = strcasecmp(s1->name, s2->name);
+ else
+ result = slab_size(s1) < slab_size(s2);
+ } else if (sort_active) {
+ if (slab_activity(s1) == slab_activity(s2))
+ result = strcasecmp(s1->name, s2->name);
+ else
+ result = slab_activity(s1) < slab_activity(s2);
+ } else if (sort_loss) {
+ if (slab_waste(s1) == slab_waste(s2))
+ result = strcasecmp(s1->name, s2->name);
+ else
+ result = slab_waste(s1) < slab_waste(s2);
+ } else if (sort_partial) {
+ if (s1->partial == s2->partial)
+ result = strcasecmp(s1->name, s2->name);
+ else
+ result = s1->partial < s2->partial;
+ } else
result = strcasecmp(s1->name, s2->name);
if (show_inverted)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 140/365] ceph: dont leak snap_rwsem in handle_cap_grant
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 139/365] tools/vm/slabinfo: use alphabetic order when two values are equal Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 141/365] clk: imx93: Correct the edma1s parent clock Greg Kroah-Hartman
` (229 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jeff Layton, Luís Henriques,
Ilya Dryomov
From: Jeff Layton <jlayton@kernel.org>
commit 58dd4385577ed7969b80cdc9e2a31575aba6c712 upstream.
When handle_cap_grant is called on an IMPORT op, then the snap_rwsem is
held and the function is expected to release it before returning. It
currently fails to do that in all cases which could lead to a deadlock.
Fixes: 6f05b30ea063 ("ceph: reset i_requested_max_size if file write is not wanted")
Link: https://tracker.ceph.com/issues/55857
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Luís Henriques <lhenriques@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ceph/caps.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3578,24 +3578,23 @@ static void handle_cap_grant(struct inod
fill_inline = true;
}
- if (ci->i_auth_cap == cap &&
- le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) {
- if (newcaps & ~extra_info->issued)
- wake = true;
+ if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) {
+ if (ci->i_auth_cap == cap) {
+ if (newcaps & ~extra_info->issued)
+ wake = true;
- if (ci->i_requested_max_size > max_size ||
- !(le32_to_cpu(grant->wanted) & CEPH_CAP_ANY_FILE_WR)) {
- /* re-request max_size if necessary */
- ci->i_requested_max_size = 0;
- wake = true;
- }
+ if (ci->i_requested_max_size > max_size ||
+ !(le32_to_cpu(grant->wanted) & CEPH_CAP_ANY_FILE_WR)) {
+ /* re-request max_size if necessary */
+ ci->i_requested_max_size = 0;
+ wake = true;
+ }
- ceph_kick_flushing_inode_caps(session, ci);
- spin_unlock(&ci->i_ceph_lock);
+ ceph_kick_flushing_inode_caps(session, ci);
+ }
up_read(&session->s_mdsc->snap_rwsem);
- } else {
- spin_unlock(&ci->i_ceph_lock);
}
+ spin_unlock(&ci->i_ceph_lock);
if (fill_inline)
ceph_fill_inline_data(inode, NULL, extra_info->inline_data,
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 141/365] clk: imx93: Correct the edma1s parent clock
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 140/365] ceph: dont leak snap_rwsem in handle_cap_grant Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 142/365] vdpa_sim: use max_iotlb_entries as a limit in vhost_iotlb_init Greg Kroah-Hartman
` (228 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jacky Bai, Peng Fan, Abel Vesa
From: Jacky Bai <ping.bai@nxp.com>
commit ebb4f1eb9360036be5ea70de82c5703ca0e64d43 upstream.
For EDMA1 in AONMIX, its parent clock should be from cm33_root,
so Correct it.
Fixes: 24defbe194b65("clk: imx: add i.MX93 clk")
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20220609132902.3504651-4-peng.fan@oss.nxp.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/clk/imx/clk-imx93.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c
index 26885bd3971c..f5c9fa40491c 100644
--- a/drivers/clk/imx/clk-imx93.c
+++ b/drivers/clk/imx/clk-imx93.c
@@ -160,7 +160,7 @@ static const struct imx93_clk_ccgr {
{ IMX93_CLK_SEMA2_GATE, "sema2", "bus_wakeup_root", 0x8480, },
{ IMX93_CLK_MU_A_GATE, "mu_a", "bus_aon_root", 0x84c0, },
{ IMX93_CLK_MU_B_GATE, "mu_b", "bus_aon_root", 0x8500, },
- { IMX93_CLK_EDMA1_GATE, "edma1", "wakeup_axi_root", 0x8540, },
+ { IMX93_CLK_EDMA1_GATE, "edma1", "m33_root", 0x8540, },
{ IMX93_CLK_EDMA2_GATE, "edma2", "wakeup_axi_root", 0x8580, },
{ IMX93_CLK_FLEXSPI1_GATE, "flexspi", "flexspi_root", 0x8640, },
{ IMX93_CLK_GPIO1_GATE, "gpio1", "m33_root", 0x8880, },
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 142/365] vdpa_sim: use max_iotlb_entries as a limit in vhost_iotlb_init
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 141/365] clk: imx93: Correct the edma1s parent clock Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 143/365] vdpa_sim_blk: set number of address spaces and virtqueue groups Greg Kroah-Hartman
` (227 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, gautam.dawar, Stefano Garzarella,
Michael S. Tsirkin, Eugenio Pérez
From: Stefano Garzarella <sgarzare@redhat.com>
commit 67f8f10c0bd78c4a0f0e983e050ab90da015323b upstream.
Commit bda324fd037a ("vdpasim: control virtqueue support") changed
the allocation of iotlbs calling vhost_iotlb_init() for each address
space, instead of vhost_iotlb_alloc().
With this change we forgot to use the limit we had introduced with
the `max_iotlb_entries` module parameter.
Fixes: bda324fd037a ("vdpasim: control virtqueue support")
Cc: gautam.dawar@xilinx.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220621151208.189959-1-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 0f2865899647..3e81532c01cb 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -33,7 +33,7 @@ MODULE_PARM_DESC(batch_mapping, "Batched mapping 1 -Enable; 0 - Disable");
static int max_iotlb_entries = 2048;
module_param(max_iotlb_entries, int, 0444);
MODULE_PARM_DESC(max_iotlb_entries,
- "Maximum number of iotlb entries. 0 means unlimited. (default: 2048)");
+ "Maximum number of iotlb entries for each address space. 0 means unlimited. (default: 2048)");
#define VDPASIM_QUEUE_ALIGN PAGE_SIZE
#define VDPASIM_QUEUE_MAX 256
@@ -291,7 +291,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr)
goto err_iommu;
for (i = 0; i < vdpasim->dev_attr.nas; i++)
- vhost_iotlb_init(&vdpasim->iommu[i], 0, 0);
+ vhost_iotlb_init(&vdpasim->iommu[i], max_iotlb_entries, 0);
vdpasim->buffer = kvmalloc(dev_attr->buffer_size, GFP_KERNEL);
if (!vdpasim->buffer)
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 143/365] vdpa_sim_blk: set number of address spaces and virtqueue groups
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 142/365] vdpa_sim: use max_iotlb_entries as a limit in vhost_iotlb_init Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 144/365] tools/testing/cxl: Fix cxl_hdm_decode_init() calling convention Greg Kroah-Hartman
` (226 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, gautam.dawar, Stefano Garzarella,
Michael S. Tsirkin, Eugenio Pérez
From: Stefano Garzarella <sgarzare@redhat.com>
commit 19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809 upstream.
Commit bda324fd037a ("vdpasim: control virtqueue support") added two
new fields (nas, ngroups) to vdpasim_dev_attr, but we forgot to
initialize them for vdpa_sim_blk.
When creating a new vdpa_sim_blk device this causes the kernel
to panic in this way:
$ vdpa dev add mgmtdev vdpasim_blk name blk0
BUG: kernel NULL pointer dereference, address: 0000000000000030
...
RIP: 0010:vhost_iotlb_add_range_ctx+0x41/0x220 [vhost_iotlb]
...
Call Trace:
<TASK>
vhost_iotlb_add_range+0x11/0x800 [vhost_iotlb]
vdpasim_map_range+0x91/0xd0 [vdpa_sim]
vdpasim_alloc_coherent+0x56/0x90 [vdpa_sim]
...
This happens because vdpasim->iommu[0] is not initialized when
dev_attr.nas is 0.
Let's fix this issue by initializing both (nas, ngroups) to 1 for
vdpa_sim_blk.
Fixes: bda324fd037a ("vdpasim: control virtqueue support")
Cc: gautam.dawar@xilinx.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220621151323.190431-1-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c
@@ -34,7 +34,11 @@
#define VDPASIM_BLK_CAPACITY 0x40000
#define VDPASIM_BLK_SIZE_MAX 0x1000
#define VDPASIM_BLK_SEG_MAX 32
+
+/* 1 virtqueue, 1 address space, 1 virtqueue group */
#define VDPASIM_BLK_VQ_NUM 1
+#define VDPASIM_BLK_AS_NUM 1
+#define VDPASIM_BLK_GROUP_NUM 1
static char vdpasim_blk_id[VIRTIO_BLK_ID_BYTES] = "vdpa_blk_sim";
@@ -260,6 +264,8 @@ static int vdpasim_blk_dev_add(struct vd
dev_attr.id = VIRTIO_ID_BLOCK;
dev_attr.supported_features = VDPASIM_BLK_FEATURES;
dev_attr.nvqs = VDPASIM_BLK_VQ_NUM;
+ dev_attr.ngroups = VDPASIM_BLK_GROUP_NUM;
+ dev_attr.nas = VDPASIM_BLK_AS_NUM;
dev_attr.config_size = sizeof(struct virtio_blk_config);
dev_attr.get_config = vdpasim_blk_get_config;
dev_attr.work_fn = vdpasim_blk_work;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 144/365] tools/testing/cxl: Fix cxl_hdm_decode_init() calling convention
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 143/365] vdpa_sim_blk: set number of address spaces and virtqueue groups Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 145/365] kbuild: dummy-tools: avoid tmpdir leak in dummy gcc Greg Kroah-Hartman
` (225 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Jonathan Cameron, Adam Manzanares,
Dan Williams
From: Dan Williams <dan.j.williams@intel.com>
commit 863fdccdc5ed1e187a30a4a103340be4569904c8 upstream.
This failing signature:
[ 8.392669] cxl_bus_probe: cxl_port endpoint2: probe: 970997760
[ 8.392670] cxl_port: probe of endpoint2 failed with error 970997760
[ 8.392719] create_endpoint: cxl_mem mem0: add: endpoint2
[ 8.392721] cxl_mem mem0: endpoint2 failed probe
[ 8.392725] cxl_bus_probe: cxl_mem mem0: probe: -6
...shows cxl_hdm_decode_init() resulting in a return code ("970997760")
that looks like stack corruption. The problem goes away if
cxl_hdm_decode_init() is not mocked via __wrap_cxl_hdm_decode_init().
The corruption results from the mismatch that the calling convention for
cxl_hdm_decode_init() is:
int cxl_hdm_decode_init(struct cxl_dev_state *cxlds, struct cxl_hdm *cxlhdm)
...and __wrap_cxl_hdm_decode_init() is:
bool __wrap_cxl_hdm_decode_init(struct cxl_dev_state *cxlds, struct cxl_hdm *cxlhdm)
...i.e. an int is expected but __wrap_hdm_decode_init() returns bool.
Fix the convention and cleanup the organization to match
__wrap_cxl_await_media_ready() as the difference was a red herring that
distracted from finding the bug.
Fixes: 92804edb11f0 ("cxl/pci: Drop @info argument to cxl_hdm_decode_init()")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Adam Manzanares <a.manzanares@samsung.com>
Link: https://lore.kernel.org/r/165603870776.551046.8709990108936497723.stgit@dwillia2-xfh
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/cxl/test/mock.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/testing/cxl/test/mock.c b/tools/testing/cxl/test/mock.c
index f1f8c40948c5..bce6a21df0d5 100644
--- a/tools/testing/cxl/test/mock.c
+++ b/tools/testing/cxl/test/mock.c
@@ -208,13 +208,15 @@ int __wrap_cxl_await_media_ready(struct cxl_dev_state *cxlds)
}
EXPORT_SYMBOL_NS_GPL(__wrap_cxl_await_media_ready, CXL);
-bool __wrap_cxl_hdm_decode_init(struct cxl_dev_state *cxlds,
- struct cxl_hdm *cxlhdm)
+int __wrap_cxl_hdm_decode_init(struct cxl_dev_state *cxlds,
+ struct cxl_hdm *cxlhdm)
{
int rc = 0, index;
struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
- if (!ops || !ops->is_mock_dev(cxlds->dev))
+ if (ops && ops->is_mock_dev(cxlds->dev))
+ rc = 0;
+ else
rc = cxl_hdm_decode_init(cxlds, cxlhdm);
put_cxl_mock_ops(index);
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 145/365] kbuild: dummy-tools: avoid tmpdir leak in dummy gcc
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 144/365] tools/testing/cxl: Fix cxl_hdm_decode_init() calling convention Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-27 7:51 ` Jiri Slaby
2022-08-23 8:00 ` [PATCH 5.19 146/365] tools build: Switch to new openssl API for test-libcrypto Greg Kroah-Hartman
` (224 subsequent siblings)
369 siblings, 1 reply; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ondrej Mosnacek, Masahiro Yamada
From: Ondrej Mosnacek <omosnace@redhat.com>
commit aac289653fa5adf9e9985e4912c1d24a3e8cbab2 upstream.
When passed -print-file-name=plugin, the dummy gcc script creates a
temporary directory that is never cleaned up. To avoid cluttering
$TMPDIR, instead use a static directory included in the source tree.
Fixes: 76426e238834 ("kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../dummy-tools/dummy-plugin-dir/include/plugin-version.h | 0
scripts/dummy-tools/gcc | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
create mode 100644 scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h
--- a/scripts/dummy-tools/gcc
+++ b/scripts/dummy-tools/gcc
@@ -96,12 +96,8 @@ fi
# To set GCC_PLUGINS
if arg_contain -print-file-name=plugin "$@"; then
- plugin_dir=$(mktemp -d)
-
- mkdir -p $plugin_dir/include
- touch $plugin_dir/include/plugin-version.h
-
- echo $plugin_dir
+ # Use $0 to find the in-tree dummy directory
+ echo "$(dirname "$(readlink -f "$0")")/dummy-plugin-dir"
exit 0
fi
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 146/365] tools build: Switch to new openssl API for test-libcrypto
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 145/365] kbuild: dummy-tools: avoid tmpdir leak in dummy gcc Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 147/365] NTB: ntb_tool: uninitialized heap data in tool_fn_write() Greg Kroah-Hartman
` (223 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Roberto Sassu, Alexei Starovoitov,
Andrii Nakryiko, bpf, Daniel Borkmann, Ingo Molnar,
John Fastabend, KP Singh, llvm, Martin KaFai Lau,
Nathan Chancellor, Nick Desaulniers, Nick Terrell,
Peter Zijlstra, Quentin Monnet, Song Liu, Stanislav Fomichev,
Arnaldo Carvalho de Melo
From: Roberto Sassu <roberto.sassu@huawei.com>
commit 5b245985a6de5ac18b5088c37068816d413fb8ed upstream.
Switch to new EVP API for detecting libcrypto, as Fedora 36 returns an
error when it encounters the deprecated function MD5_Init() and the others.
The error would be interpreted as missing libcrypto, while in reality it is
not.
Fixes: 6e8ccb4f624a73c5 ("tools/bpf: properly account for libbfd variations")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: llvm@lists.linux.dev
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Monnet <quentin@isovalent.com>
Cc: Song Liu <song@kernel.org>
Cc: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20220719170555.2576993-4-roberto.sassu@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/build/feature/test-libcrypto.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/tools/build/feature/test-libcrypto.c
+++ b/tools/build/feature/test-libcrypto.c
@@ -1,16 +1,23 @@
// SPDX-License-Identifier: GPL-2.0
+#include <openssl/evp.h>
#include <openssl/sha.h>
#include <openssl/md5.h>
int main(void)
{
- MD5_CTX context;
+ EVP_MD_CTX *mdctx;
unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH];
unsigned char dat[] = "12345";
+ unsigned int digest_len;
- MD5_Init(&context);
- MD5_Update(&context, &dat[0], sizeof(dat));
- MD5_Final(&md[0], &context);
+ mdctx = EVP_MD_CTX_new();
+ if (!mdctx)
+ return 0;
+
+ EVP_DigestInit_ex(mdctx, EVP_md5(), NULL);
+ EVP_DigestUpdate(mdctx, &dat[0], sizeof(dat));
+ EVP_DigestFinal_ex(mdctx, &md[0], &digest_len);
+ EVP_MD_CTX_free(mdctx);
SHA1(&dat[0], sizeof(dat), &md[0]);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 147/365] NTB: ntb_tool: uninitialized heap data in tool_fn_write()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 146/365] tools build: Switch to new openssl API for test-libcrypto Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 148/365] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Greg Kroah-Hartman
` (222 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Jon Mason
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 45e1058b77feade4e36402828bfe3e0d3363177b upstream.
The call to:
ret = simple_write_to_buffer(buf, size, offp, ubuf, size);
will return success if it is able to write even one byte to "buf".
The value of "*offp" controls which byte. This could result in
reading uninitialized data when we do the sscanf() on the next line.
This code is not really desigined to handle partial writes where
*offp is non-zero and the "buf" is preserved and re-used between writes.
Just ban partial writes and replace the simple_write_to_buffer() with
copy_from_user().
Fixes: 578b881ba9c4 ("NTB: Add tool test client")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/ntb/test/ntb_tool.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/ntb/test/ntb_tool.c
+++ b/drivers/ntb/test/ntb_tool.c
@@ -367,14 +367,16 @@ static ssize_t tool_fn_write(struct tool
u64 bits;
int n;
+ if (*offp)
+ return 0;
+
buf = kmalloc(size + 1, GFP_KERNEL);
if (!buf)
return -ENOMEM;
- ret = simple_write_to_buffer(buf, size, offp, ubuf, size);
- if (ret < 0) {
+ if (copy_from_user(buf, ubuf, size)) {
kfree(buf);
- return ret;
+ return -EFAULT;
}
buf[size] = 0;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 148/365] nfp: ethtool: fix the display error of `ethtool -m DEVNAME`
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 147/365] NTB: ntb_tool: uninitialized heap data in tool_fn_write() Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 149/365] xen/xenbus: fix return type in xenbus_file_read() Greg Kroah-Hartman
` (221 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Louis Peens, Yu Xiao, Simon Horman,
Jakub Kicinski
From: Yu Xiao <yu.xiao@corigine.com>
commit 4ae97cae07e15d41e5c0ebabba64c6eefdeb0bbe upstream.
The port flag isn't set to `NFP_PORT_CHANGED` when using
`ethtool -m DEVNAME` before, so the port state (e.g. interface)
cannot be updated. Therefore, it caused that `ethtool -m DEVNAME`
sometimes cannot read the correct information.
E.g. `ethtool -m DEVNAME` cannot work when load driver before plug
in optical module, as the port interface is still NONE without port
update.
Now update the port state before sending info to NIC to ensure that
port interface is correct (latest state).
Fixes: 61f7c6f44870 ("nfp: implement ethtool get module EEPROM")
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Yu Xiao <yu.xiao@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20220802093355.69065-1-simon.horman@corigine.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
@@ -1230,6 +1230,8 @@ nfp_port_get_module_info(struct net_devi
u8 data;
port = nfp_port_from_netdev(netdev);
+ /* update port state to get latest interface */
+ set_bit(NFP_PORT_CHANGED, &port->flags);
eth_port = nfp_port_get_eth_port(port);
if (!eth_port)
return -EOPNOTSUPP;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 149/365] xen/xenbus: fix return type in xenbus_file_read()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 148/365] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 150/365] tsnep: Fix tsnep_tx_unmap() error path usage Greg Kroah-Hartman
` (220 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Oleksandr Tyshchenko,
Juergen Gross
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 32ad11127b95236dfc52375f3707853194a7f4b4 upstream.
This code tries to store -EFAULT in an unsigned int. The
xenbus_file_read() function returns type ssize_t so the negative value
is returned as a positive value to the user.
This change forces another change to the min() macro. Originally, the
min() macro used "unsigned" type which checkpatch complains about. Also
unsigned type would break if "len" were not capped at MAX_RW_COUNT. Use
size_t for the min(). (No effect on runtime for the min_t() change).
Fixes: 2fb3683e7b16 ("xen: Add xenbus device driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Link: https://lore.kernel.org/r/YutxJUaUYRG/VLVc@kili
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/xenbus/xenbus_dev_frontend.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -128,7 +128,7 @@ static ssize_t xenbus_file_read(struct f
{
struct xenbus_file_priv *u = filp->private_data;
struct read_buffer *rb;
- unsigned i;
+ ssize_t i;
int ret;
mutex_lock(&u->reply_mutex);
@@ -148,7 +148,7 @@ again:
rb = list_entry(u->read_buffers.next, struct read_buffer, list);
i = 0;
while (i < len) {
- unsigned sz = min((unsigned)len - i, rb->len - rb->cons);
+ size_t sz = min_t(size_t, len - i, rb->len - rb->cons);
ret = copy_to_user(ubuf + i, &rb->msg[rb->cons], sz);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 150/365] tsnep: Fix tsnep_tx_unmap() error path usage
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 149/365] xen/xenbus: fix return type in xenbus_file_read() Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 151/365] atm: idt77252: fix use-after-free bugs caused by tst_timer Greg Kroah-Hartman
` (219 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Gerhard Engleder, Jakub Kicinski
From: Gerhard Engleder <gerhard@engleder-embedded.com>
commit b3bb8628bf64440065976c71e4ab09186c393597 upstream.
If tsnep_tx_map() fails, then tsnep_tx_unmap() shall start at the write
index like tsnep_tx_map(). This is different to the normal operation.
Thus, add an additional parameter to tsnep_tx_unmap() to enable start at
different positions for successful TX and failed TX.
Fixes: 403f69bbdbad ("tsnep: Add TSN endpoint Ethernet MAC driver")
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/engleder/tsnep_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c
index d98199f3414b..a5f7152a1716 100644
--- a/drivers/net/ethernet/engleder/tsnep_main.c
+++ b/drivers/net/ethernet/engleder/tsnep_main.c
@@ -340,14 +340,14 @@ static int tsnep_tx_map(struct sk_buff *skb, struct tsnep_tx *tx, int count)
return 0;
}
-static void tsnep_tx_unmap(struct tsnep_tx *tx, int count)
+static void tsnep_tx_unmap(struct tsnep_tx *tx, int index, int count)
{
struct device *dmadev = tx->adapter->dmadev;
struct tsnep_tx_entry *entry;
int i;
for (i = 0; i < count; i++) {
- entry = &tx->entry[(tx->read + i) % TSNEP_RING_SIZE];
+ entry = &tx->entry[(index + i) % TSNEP_RING_SIZE];
if (entry->len) {
if (i == 0)
@@ -395,7 +395,7 @@ static netdev_tx_t tsnep_xmit_frame_ring(struct sk_buff *skb,
retval = tsnep_tx_map(skb, tx, count);
if (retval != 0) {
- tsnep_tx_unmap(tx, count);
+ tsnep_tx_unmap(tx, tx->write, count);
dev_kfree_skb_any(entry->skb);
entry->skb = NULL;
@@ -464,7 +464,7 @@ static bool tsnep_tx_poll(struct tsnep_tx *tx, int napi_budget)
if (skb_shinfo(entry->skb)->nr_frags > 0)
count += skb_shinfo(entry->skb)->nr_frags;
- tsnep_tx_unmap(tx, count);
+ tsnep_tx_unmap(tx, tx->read, count);
if ((skb_shinfo(entry->skb)->tx_flags & SKBTX_IN_PROGRESS) &&
(__le32_to_cpu(entry->desc_wb->properties) &
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 151/365] atm: idt77252: fix use-after-free bugs caused by tst_timer
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 150/365] tsnep: Fix tsnep_tx_unmap() error path usage Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 152/365] fscache: dont leak cookie access refs if invalidation is in progress or failed Greg Kroah-Hartman
` (218 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Duoming Zhou, Jakub Kicinski
From: Duoming Zhou <duoming@zju.edu.cn>
commit 3f4093e2bf4673f218c0bf17d8362337c400e77b upstream.
There are use-after-free bugs caused by tst_timer. The root cause
is that there are no functions to stop tst_timer in idt77252_exit().
One of the possible race conditions is shown below:
(thread 1) | (thread 2)
| idt77252_init_one
| init_card
| fill_tst
| mod_timer(&card->tst_timer, ...)
idt77252_exit | (wait a time)
| tst_timer
|
| ...
kfree(card) // FREE |
| card->soft_tst[e] // USE
The idt77252_dev is deallocated in idt77252_exit() and used in
timer handler.
This patch adds del_timer_sync() in idt77252_exit() in order that
the timer handler could be stopped before the idt77252_dev is
deallocated.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220805070008.18007-1-duoming@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/atm/idt77252.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -3752,6 +3752,7 @@ static void __exit idt77252_exit(void)
card = idt77252_chain;
dev = card->atmdev;
idt77252_chain = card->next;
+ del_timer_sync(&card->tst_timer);
if (dev->phy->stop)
dev->phy->stop(dev);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 152/365] fscache: dont leak cookie access refs if invalidation is in progress or failed
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 151/365] atm: idt77252: fix use-after-free bugs caused by tst_timer Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 153/365] geneve: fix TOS inheriting for ipv4 Greg Kroah-Hartman
` (217 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, David Howells, Jeff Layton
From: Jeff Layton <jlayton@kernel.org>
commit fb24771faf72a2fd62b3b6287af3c610c3ec9cf1 upstream.
It's possible for a request to invalidate a fscache_cookie will come in
while we're already processing an invalidation. If that happens we
currently take an extra access reference that will leak. Only call
__fscache_begin_cookie_access if the FSCACHE_COOKIE_DO_INVALIDATE bit
was previously clear.
Also, ensure that we attempt to clear the bit when the cookie is
"FAILED" and put the reference to avoid an access leak.
Fixes: 85e4ea1049c7 ("fscache: Fix invalidation/lookup race")
Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/fscache/cookie.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 74920826d8f6..26a6d395737a 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -739,6 +739,9 @@ static void fscache_cookie_state_machine(struct fscache_cookie *cookie)
fallthrough;
case FSCACHE_COOKIE_STATE_FAILED:
+ if (test_and_clear_bit(FSCACHE_COOKIE_DO_INVALIDATE, &cookie->flags))
+ fscache_end_cookie_access(cookie, fscache_access_invalidate_cookie_end);
+
if (atomic_read(&cookie->n_accesses) != 0)
break;
if (test_bit(FSCACHE_COOKIE_DO_RELINQUISH, &cookie->flags)) {
@@ -1063,8 +1066,8 @@ void __fscache_invalidate(struct fscache_cookie *cookie,
return;
case FSCACHE_COOKIE_STATE_LOOKING_UP:
- __fscache_begin_cookie_access(cookie, fscache_access_invalidate_cookie);
- set_bit(FSCACHE_COOKIE_DO_INVALIDATE, &cookie->flags);
+ if (!test_and_set_bit(FSCACHE_COOKIE_DO_INVALIDATE, &cookie->flags))
+ __fscache_begin_cookie_access(cookie, fscache_access_invalidate_cookie);
fallthrough;
case FSCACHE_COOKIE_STATE_CREATING:
spin_unlock(&cookie->lock);
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 153/365] geneve: fix TOS inheriting for ipv4
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 152/365] fscache: dont leak cookie access refs if invalidation is in progress or failed Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 154/365] nvme-fc: fix the fc_appid_store return value Greg Kroah-Hartman
` (216 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Matthias May, Guillaume Nault,
Jakub Kicinski
From: Matthias May <matthias.may@westermo.com>
commit b4ab94d6adaa5cf842b68bd28f4b50bc774496bd upstream.
The current code retrieves the TOS field after the lookup
on the ipv4 routing table. The routing process currently
only allows routing based on the original 3 TOS bits, and
not on the full 6 DSCP bits.
As a result the retrieved TOS is cut to the 3 bits.
However for inheriting purposes the full 6 bits should be used.
Extract the full 6 bits before the route lookup and use
that instead of the cut off 3 TOS bits.
Fixes: e305ac6cf5a1 ("geneve: Add support to collect tunnel metadata.")
Signed-off-by: Matthias May <matthias.may@westermo.com>
Acked-by: Guillaume Nault <gnault@redhat.com>
Link: https://lore.kernel.org/r/20220805190006.8078-1-matthias.may@westermo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/geneve.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -797,7 +797,8 @@ static struct rtable *geneve_get_v4_rt(s
struct geneve_sock *gs4,
struct flowi4 *fl4,
const struct ip_tunnel_info *info,
- __be16 dport, __be16 sport)
+ __be16 dport, __be16 sport,
+ __u8 *full_tos)
{
bool use_cache = ip_tunnel_dst_cache_usable(skb, info);
struct geneve_dev *geneve = netdev_priv(dev);
@@ -823,6 +824,8 @@ static struct rtable *geneve_get_v4_rt(s
use_cache = false;
}
fl4->flowi4_tos = RT_TOS(tos);
+ if (full_tos)
+ *full_tos = tos;
dst_cache = (struct dst_cache *)&info->dst_cache;
if (use_cache) {
@@ -910,6 +913,7 @@ static int geneve_xmit_skb(struct sk_buf
const struct ip_tunnel_key *key = &info->key;
struct rtable *rt;
struct flowi4 fl4;
+ __u8 full_tos;
__u8 tos, ttl;
__be16 df = 0;
__be16 sport;
@@ -920,7 +924,7 @@ static int geneve_xmit_skb(struct sk_buf
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info,
- geneve->cfg.info.key.tp_dst, sport);
+ geneve->cfg.info.key.tp_dst, sport, &full_tos);
if (IS_ERR(rt))
return PTR_ERR(rt);
@@ -964,7 +968,7 @@ static int geneve_xmit_skb(struct sk_buf
df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
} else {
- tos = ip_tunnel_ecn_encap(fl4.flowi4_tos, ip_hdr(skb), skb);
+ tos = ip_tunnel_ecn_encap(full_tos, ip_hdr(skb), skb);
if (geneve->cfg.ttl_inherit)
ttl = ip_tunnel_get_ttl(ip_hdr(skb), skb);
else
@@ -1148,7 +1152,7 @@ static int geneve_fill_metadata_dst(stru
1, USHRT_MAX, true);
rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info,
- geneve->cfg.info.key.tp_dst, sport);
+ geneve->cfg.info.key.tp_dst, sport, NULL);
if (IS_ERR(rt))
return PTR_ERR(rt);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 154/365] nvme-fc: fix the fc_appid_store return value
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 153/365] geneve: fix TOS inheriting for ipv4 Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 155/365] perf probe: Fix an error handling path in parse_perf_probe_command() Greg Kroah-Hartman
` (215 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Christoph Hellwig,
Chaitanya Kulkarni, Ewan D. Milne, James Smart,
Muneendra Kumar M
From: Christoph Hellwig <hch@lst.de>
commit 9317d0014499182c77a03cd095e83bcfb0f53750 upstream.
"nvme-fc: fold t fc_update_appid into fc_appid_store" accidentally
changed the userspace interface for the appid attribute, because the code
that decrements "count" to remove a trailing '\n' in the parsing results
in the decremented value being incorrectly be returned from the sysfs
write. Fix this by keeping an orig_count variable for the full length
of the write.
Fixes: c814153c83a8 ("nvme-fc: fold t fc_update_appid into fc_appid_store")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Tested-by: Muneendra Kumar M <muneendra.kumar@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvme/host/fc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 8d14df8eeab8..127abaf9ba5d 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -3880,6 +3880,7 @@ static int fc_parse_cgrpid(const char *buf, u64 *id)
static ssize_t fc_appid_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
+ size_t orig_count = count;
u64 cgrp_id;
int appid_len = 0;
int cgrpid_len = 0;
@@ -3904,7 +3905,7 @@ static ssize_t fc_appid_store(struct device *dev,
ret = blkcg_set_fc_appid(app_id, cgrp_id, sizeof(app_id));
if (ret < 0)
return ret;
- return count;
+ return orig_count;
}
static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store);
#endif /* CONFIG_BLK_CGROUP_FC_APPID */
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 155/365] perf probe: Fix an error handling path in parse_perf_probe_command()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 154/365] nvme-fc: fix the fc_appid_store return value Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 156/365] i2c: qcom-geni: Fix GPI DMA buffer sync-back Greg Kroah-Hartman
` (214 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Christophe JAILLET, Masami Hiramatsu,
Alexander Shishkin, Ingo Molnar, Jiri Olsa, kernel-janitors,
Mark Rutland, Namhyung Kim, Peter Zijlstra,
Arnaldo Carvalho de Melo
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
commit 4bf6dcaa93bcd083a13c278a91418fe10e6d23a0 upstream.
If a memory allocation fail, we should branch to the error handling path
in order to free some resources allocated a few lines above.
Fixes: 15354d54698648e2 ("perf probe: Generate event name with line number")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: kernel-janitors@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/b71bcb01fa0c7b9778647235c3ab490f699ba278.1659797452.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/perf/util/probe-event.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1775,8 +1775,10 @@ int parse_perf_probe_command(const char
if (!pev->event && pev->point.function && pev->point.line
&& !pev->point.lazy_line && !pev->point.offset) {
if (asprintf(&pev->event, "%s_L%d", pev->point.function,
- pev->point.line) < 0)
- return -ENOMEM;
+ pev->point.line) < 0) {
+ ret = -ENOMEM;
+ goto out;
+ }
}
/* Copy arguments and ensure return probe has no C argument */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 156/365] i2c: qcom-geni: Fix GPI DMA buffer sync-back
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 155/365] perf probe: Fix an error handling path in parse_perf_probe_command() Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 157/365] perf parse-events: Fix segfault when event parser gets an error Greg Kroah-Hartman
` (213 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Robin Reckmann, Luca Weiss,
Caleb Connolly, Konrad Dybcio, Wolfram Sang
From: Robin Reckmann <robin.reckmann@googlemail.com>
commit 8689b80b22dbf1f5e993233370fe57f08731b14d upstream.
Fix i2c transfers using GPI DMA mode for all message types that do not set
the I2C_M_DMA_SAFE flag (e.g. SMBus "read byte").
In this case a bounce buffer is returned by i2c_get_dma_safe_msg_buf(),
and it has to synced back to the message after the transfer is done.
Add missing assignment of dma buffer in geni_i2c_gpi().
Set xferred in i2c_put_dma_safe_msg_buf() to true in case of no error to
ensure the sync-back of this dma buffer to the message.
Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA")
Signed-off-by: Robin Reckmann <robin.reckmann@gmail.com>
Tested-by: Luca Weiss <luca.weiss@fairphone.com>
Tested-by: Caleb Connolly <caleb@connolly.tech>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/i2c/busses/i2c-qcom-geni.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -484,12 +484,12 @@ static void geni_i2c_gpi_unmap(struct ge
{
if (tx_buf) {
dma_unmap_single(gi2c->se.dev->parent, tx_addr, msg->len, DMA_TO_DEVICE);
- i2c_put_dma_safe_msg_buf(tx_buf, msg, false);
+ i2c_put_dma_safe_msg_buf(tx_buf, msg, !gi2c->err);
}
if (rx_buf) {
dma_unmap_single(gi2c->se.dev->parent, rx_addr, msg->len, DMA_FROM_DEVICE);
- i2c_put_dma_safe_msg_buf(rx_buf, msg, false);
+ i2c_put_dma_safe_msg_buf(rx_buf, msg, !gi2c->err);
}
}
@@ -553,6 +553,7 @@ static int geni_i2c_gpi(struct geni_i2c_
desc->callback_param = gi2c;
dmaengine_submit(desc);
+ *buf = dma_buf;
*dma_addr_p = addr;
return 0;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 157/365] perf parse-events: Fix segfault when event parser gets an error
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (155 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 156/365] i2c: qcom-geni: Fix GPI DMA buffer sync-back Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:00 ` [PATCH 5.19 158/365] perf tests: Fix Track with sched_switch test for hybrid case Greg Kroah-Hartman
` (212 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Adrian Hunter, Ian Rogers, Jin Yao,
Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo
From: Adrian Hunter <adrian.hunter@intel.com>
commit 2e828582b81f5bc76a4fe8e7812df259ab208302 upstream.
parse_events() is often called with parse_events_error set to NULL.
Make parse_events_error__handle() not segfault in that case.
A subsequent patch changes to avoid passing NULL in the first place.
Fixes: 43eb05d066795bdf ("perf tests: Support 'Track with sched_switch' test for hybrid")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20220809080702.6921-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/perf/util/parse-events.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2391,9 +2391,12 @@ void parse_events_error__exit(struct par
void parse_events_error__handle(struct parse_events_error *err, int idx,
char *str, char *help)
{
- if (WARN(!str, "WARNING: failed to provide error string\n")) {
- free(help);
- return;
+ if (WARN(!str, "WARNING: failed to provide error string\n"))
+ goto out_free;
+ if (!err) {
+ /* Assume caller does not want message printed */
+ pr_debug("event syntax error: %s\n", str);
+ goto out_free;
}
switch (err->num_errors) {
case 0:
@@ -2419,6 +2422,11 @@ void parse_events_error__handle(struct p
break;
}
err->num_errors++;
+ return;
+
+out_free:
+ free(str);
+ free(help);
}
#define MAX_WIDTH 1000
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 158/365] perf tests: Fix Track with sched_switch test for hybrid case
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (156 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 157/365] perf parse-events: Fix segfault when event parser gets an error Greg Kroah-Hartman
@ 2022-08-23 8:00 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 159/365] dpaa2-eth: trace the allocated address instead of page struct Greg Kroah-Hartman
` (211 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:00 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Adrian Hunter, Ian Rogers, Jin Yao,
Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo
From: Adrian Hunter <adrian.hunter@intel.com>
commit 1da1d60774014137d776d0400fdf2f1779d8d4d5 upstream.
If cpu_core PMU event fails to parse, try also cpu_atom PMU event when
parsing cycles event.
Fixes: 43eb05d066795bdf ("perf tests: Support 'Track with sched_switch' test for hybrid")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20220809080702.6921-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/perf/tests/switch-tracking.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -324,6 +324,7 @@ out_free_nodes:
static int test__switch_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{
const char *sched_switch = "sched:sched_switch";
+ const char *cycles = "cycles:u";
struct switch_tracking switch_tracking = { .tids = NULL, };
struct record_opts opts = {
.mmap_pages = UINT_MAX,
@@ -372,12 +373,19 @@ static int test__switch_tracking(struct
cpu_clocks_evsel = evlist__last(evlist);
/* Second event */
- if (perf_pmu__has_hybrid())
- err = parse_events(evlist, "cpu_core/cycles/u", NULL);
- else
- err = parse_events(evlist, "cycles:u", NULL);
+ if (perf_pmu__has_hybrid()) {
+ cycles = "cpu_core/cycles/u";
+ err = parse_events(evlist, cycles, NULL);
+ if (err) {
+ cycles = "cpu_atom/cycles/u";
+ pr_debug("Trying %s\n", cycles);
+ err = parse_events(evlist, cycles, NULL);
+ }
+ } else {
+ err = parse_events(evlist, cycles, NULL);
+ }
if (err) {
- pr_debug("Failed to parse event cycles:u\n");
+ pr_debug("Failed to parse event %s\n", cycles);
goto out_err;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 159/365] dpaa2-eth: trace the allocated address instead of page struct
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (157 preceding siblings ...)
2022-08-23 8:00 ` [PATCH 5.19 158/365] perf tests: Fix Track with sched_switch test for hybrid case Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 160/365] fs/ntfs3: Fix using uninitialized value n when calling indx_read Greg Kroah-Hartman
` (210 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Chen Lin, Ioana Ciornei, Jakub Kicinski
From: Chen Lin <chen45464546@163.com>
commit e34f49348f8b7a53205b6f77707a3a6a40cf420b upstream.
We should trace the allocated address instead of page struct.
Fixes: 27c874867c4e ("dpaa2-eth: Use a single page per Rx buffer")
Signed-off-by: Chen Lin <chen.lin5@zte.com.cn>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20220811151651.3327-1-chen45464546@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -1660,8 +1660,8 @@ static int dpaa2_eth_add_bufs(struct dpa
buf_array[i] = addr;
/* tracing point */
- trace_dpaa2_eth_buf_seed(priv->net_dev,
- page, DPAA2_ETH_RX_BUF_RAW_SIZE,
+ trace_dpaa2_eth_buf_seed(priv->net_dev, page_address(page),
+ DPAA2_ETH_RX_BUF_RAW_SIZE,
addr, priv->rx_buf_size,
bpid);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 160/365] fs/ntfs3: Fix using uninitialized value n when calling indx_read
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (158 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 159/365] dpaa2-eth: trace the allocated address instead of page struct Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 161/365] fs/ntfs3: Fix NULL deref in ntfs_update_mftmirr Greg Kroah-Hartman
` (209 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Yan Lei, Konstantin Komarov
From: Yan Lei <chinayanlei2002@163.com>
commit ae5a4e46916fc307288227b64c1d062352eb93b7 upstream.
This value is checked in indx_read, so it must be initialized
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Yan Lei <chinayanlei2002@163.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/index.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -1994,7 +1994,7 @@ static int indx_free_children(struct ntf
const struct NTFS_DE *e, bool trim)
{
int err;
- struct indx_node *n;
+ struct indx_node *n = NULL;
struct INDEX_HDR *hdr;
CLST vbn = de_get_vbn(e);
size_t i;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 161/365] fs/ntfs3: Fix NULL deref in ntfs_update_mftmirr
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (159 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 160/365] fs/ntfs3: Fix using uninitialized value n when calling indx_read Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 162/365] fs/ntfs3: Dont clear upper bits accidentally in log_replay() Greg Kroah-Hartman
` (208 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Pavel Skripkin, Konstantin Komarov,
syzbot+c95173762127ad76a824
From: Pavel Skripkin <paskripkin@gmail.com>
commit 321460ca3b55f48b3ba6008248264ab2bd6407d9 upstream.
If ntfs_fill_super() wasn't called then sbi->sb will be equal to NULL.
Code should check this ptr before dereferencing. Syzbot hit this issue
via passing wrong mount param as can be seen from log below
Fail log:
ntfs3: Unknown parameter 'iochvrset'
general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 1 PID: 3589 Comm: syz-executor210 Not tainted 5.18.0-rc3-syzkaller-00016-gb253435746d9 #0
...
Call Trace:
<TASK>
put_ntfs+0x1ed/0x2a0 fs/ntfs3/super.c:463
ntfs_fs_free+0x6a/0xe0 fs/ntfs3/super.c:1363
put_fs_context+0x119/0x7a0 fs/fs_context.c:469
do_new_mount+0x2b4/0xad0 fs/namespace.c:3044
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Reported-and-tested-by: syzbot+c95173762127ad76a824@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/fsntfs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -831,10 +831,15 @@ int ntfs_update_mftmirr(struct ntfs_sb_i
{
int err;
struct super_block *sb = sbi->sb;
- u32 blocksize = sb->s_blocksize;
+ u32 blocksize;
sector_t block1, block2;
u32 bytes;
+ if (!sb)
+ return -EINVAL;
+
+ blocksize = sb->s_blocksize;
+
if (!(sbi->flags & NTFS_FLAGS_MFTMIRR))
return 0;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 162/365] fs/ntfs3: Dont clear upper bits accidentally in log_replay()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (160 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 161/365] fs/ntfs3: Fix NULL deref in ntfs_update_mftmirr Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 163/365] fs/ntfs3: Fix double free on remount Greg Kroah-Hartman
` (207 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Namjae Jeon,
Konstantin Komarov
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 926034353d3c67db1ffeab47dcb7f6bdac02a263 upstream.
The "vcn" variable is a 64 bit. The "log->clst_per_page" variable is a
u32. This means that the mask accidentally clears out the high 32 bits
when it was only supposed to clear some low bits. Fix this by adding a
cast to u64.
Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/fslog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -5057,7 +5057,7 @@ undo_action_next:
goto add_allocated_vcns;
vcn = le64_to_cpu(lrh->target_vcn);
- vcn &= ~(log->clst_per_page - 1);
+ vcn &= ~(u64)(log->clst_per_page - 1);
add_allocated_vcns:
for (i = 0, vcn = le64_to_cpu(lrh->target_vcn),
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 163/365] fs/ntfs3: Fix double free on remount
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (161 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 162/365] fs/ntfs3: Dont clear upper bits accidentally in log_replay() Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 164/365] fs/ntfs3: Do not change mode if ntfs_set_ea failed Greg Kroah-Hartman
` (206 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Konstantin Komarov
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
commit cd39981fb92adf0cc736112f87e3e61602baa415 upstream.
Pointer to options was freed twice on remount
Fixes xfstest generic/361
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/super.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -30,6 +30,7 @@
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#include <linux/log2.h>
+#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/nls.h>
#include <linux/seq_file.h>
@@ -390,7 +391,7 @@ static int ntfs_fs_reconfigure(struct fs
return -EINVAL;
}
- memcpy(sbi->options, new_opts, sizeof(*new_opts));
+ swap(sbi->options, fc->fs_private);
return 0;
}
@@ -900,6 +901,8 @@ static int ntfs_fill_super(struct super_
ref.high = 0;
sbi->sb = sb;
+ sbi->options = fc->fs_private;
+ fc->fs_private = NULL;
sb->s_flags |= SB_NODIRATIME;
sb->s_magic = 0x7366746e; // "ntfs"
sb->s_op = &ntfs_sops;
@@ -1262,8 +1265,6 @@ load_root:
goto put_inode_out;
}
- fc->fs_private = NULL;
-
return 0;
put_inode_out:
@@ -1416,7 +1417,6 @@ static int ntfs_init_fs_context(struct f
mutex_init(&sbi->compress.mtx_lzx);
#endif
- sbi->options = opts;
fc->s_fs_info = sbi;
ok:
fc->fs_private = opts;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 164/365] fs/ntfs3: Do not change mode if ntfs_set_ea failed
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (162 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 163/365] fs/ntfs3: Fix double free on remount Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 165/365] fs/ntfs3: Fix missing i_op in ntfs_read_mft Greg Kroah-Hartman
` (205 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Konstantin Komarov
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
commit 460bbf2990b3fdc597601c2cf669a3371c069242 upstream.
ntfs_set_ea can fail with NOSPC, so we don't need to
change mode in this situation.
Fixes xfstest generic/449
Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations")
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/xattr.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -547,28 +547,23 @@ static noinline int ntfs_set_acl_ex(stru
{
const char *name;
size_t size, name_len;
- void *value = NULL;
- int err = 0;
+ void *value;
+ int err;
int flags;
+ umode_t mode;
if (S_ISLNK(inode->i_mode))
return -EOPNOTSUPP;
+ mode = inode->i_mode;
switch (type) {
case ACL_TYPE_ACCESS:
/* Do not change i_mode if we are in init_acl */
if (acl && !init_acl) {
- umode_t mode;
-
err = posix_acl_update_mode(mnt_userns, inode, &mode,
&acl);
if (err)
goto out;
-
- if (inode->i_mode != mode) {
- inode->i_mode = mode;
- mark_inode_dirty(inode);
- }
}
name = XATTR_NAME_POSIX_ACL_ACCESS;
name_len = sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1;
@@ -604,8 +599,13 @@ static noinline int ntfs_set_acl_ex(stru
err = ntfs_set_ea(inode, name, name_len, value, size, flags, 0);
if (err == -ENODATA && !size)
err = 0; /* Removing non existed xattr. */
- if (!err)
+ if (!err) {
set_cached_acl(inode, type, acl);
+ if (inode->i_mode != mode) {
+ inode->i_mode = mode;
+ mark_inode_dirty(inode);
+ }
+ }
out:
kfree(value);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 165/365] fs/ntfs3: Fix missing i_op in ntfs_read_mft
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (163 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 164/365] fs/ntfs3: Do not change mode if ntfs_set_ea failed Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 166/365] nios2: page fault et.al. are *not* restartable syscalls Greg Kroah-Hartman
` (204 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Liangbin Lian, Konstantin Komarov
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
commit 37a530bfe56ca9a0d3129598803f2794c7428aae upstream.
There is null pointer dereference because i_op == NULL.
The bug happens because we don't initialize i_op for records in $Extend.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Reported-by: Liangbin Lian <jjm2473@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/inode.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -430,6 +430,7 @@ end_enum:
} else if (fname && fname->home.low == cpu_to_le32(MFT_REC_EXTEND) &&
fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) {
/* Records in $Extend are not a files or general directories. */
+ inode->i_op = &ntfs_file_inode_operations;
} else {
err = -EINVAL;
goto out;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 166/365] nios2: page fault et.al. are *not* restartable syscalls...
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (164 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 165/365] fs/ntfs3: Fix missing i_op in ntfs_read_mft Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 167/365] nios2: dont leave NULLs in sys_call_table[] Greg Kroah-Hartman
` (203 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Al Viro, Dinh Nguyen
From: Al Viro <viro@zeniv.linux.org.uk>
commit 8535c239ac674f7ead0f2652932d35c52c4123b2 upstream.
make sure that ->orig_r2 is negative for everything except
the syscalls.
Fixes: 82ed08dd1b0e ("nios2: Exception handling")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/nios2/include/asm/entry.h | 3 ++-
arch/nios2/kernel/entry.S | 4 +---
2 files changed, 3 insertions(+), 4 deletions(-)
--- a/arch/nios2/include/asm/entry.h
+++ b/arch/nios2/include/asm/entry.h
@@ -50,7 +50,8 @@
stw r13, PT_R13(sp)
stw r14, PT_R14(sp)
stw r15, PT_R15(sp)
- stw r2, PT_ORIG_R2(sp)
+ movi r24, -1
+ stw r24, PT_ORIG_R2(sp)
stw r7, PT_ORIG_R7(sp)
stw ra, PT_RA(sp)
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -185,6 +185,7 @@ ENTRY(handle_system_call)
ldw r5, PT_R5(sp)
local_restart:
+ stw r2, PT_ORIG_R2(sp)
/* Check that the requested system call is within limits */
movui r1, __NR_syscalls
bgeu r2, r1, ret_invsyscall
@@ -336,9 +337,6 @@ external_interrupt:
/* skip if no interrupt is pending */
beq r12, r0, ret_from_interrupt
- movi r24, -1
- stw r24, PT_ORIG_R2(sp)
-
/*
* Process an external hardware interrupt.
*/
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 167/365] nios2: dont leave NULLs in sys_call_table[]
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (165 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 166/365] nios2: page fault et.al. are *not* restartable syscalls Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 168/365] nios2: traced syscall does need to check the syscall number Greg Kroah-Hartman
` (202 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Al Viro, Dinh Nguyen
From: Al Viro <viro@zeniv.linux.org.uk>
commit 45ec746c65097c25e77d24eae8fee0def5b6cc5d upstream.
fill the gaps in there with sys_ni_syscall, as everyone does...
Fixes: 82ed08dd1b0e ("nios2: Exception handling")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/nios2/kernel/entry.S | 1 -
arch/nios2/kernel/syscall_table.c | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -193,7 +193,6 @@ local_restart:
movhi r11, %hiadj(sys_call_table)
add r1, r1, r11
ldw r1, %lo(sys_call_table)(r1)
- beq r1, r0, ret_invsyscall
/* Check if we are being traced */
GET_THREAD_INFO r11
--- a/arch/nios2/kernel/syscall_table.c
+++ b/arch/nios2/kernel/syscall_table.c
@@ -13,5 +13,6 @@
#define __SYSCALL(nr, call) [nr] = (call),
void *sys_call_table[__NR_syscalls] = {
+ [0 ... __NR_syscalls-1] = sys_ni_syscall,
#include <asm/unistd.h>
};
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 168/365] nios2: traced syscall does need to check the syscall number
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (166 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 167/365] nios2: dont leave NULLs in sys_call_table[] Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 169/365] nios2: fix syscall restart checks Greg Kroah-Hartman
` (201 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Al Viro, Dinh Nguyen
From: Al Viro <viro@zeniv.linux.org.uk>
commit 25ba820ef36bdbaf9884adeac69b6e1821a7df76 upstream.
all checks done before letting the tracer modify the register
state are worthless...
Fixes: 82ed08dd1b0e ("nios2: Exception handling")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/nios2/kernel/entry.S | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -255,9 +255,9 @@ traced_system_call:
ldw r6, PT_R6(sp)
ldw r7, PT_R7(sp)
- /* Fetch the syscall function, we don't need to check the boundaries
- * since this is already done.
- */
+ /* Fetch the syscall function. */
+ movui r1, __NR_syscalls
+ bgeu r2, r1, traced_invsyscall
slli r1, r2, 2
movhi r11,%hiadj(sys_call_table)
add r1, r1, r11
@@ -287,6 +287,11 @@ end_translate_rc_and_ret2:
RESTORE_SWITCH_STACK
br ret_from_exception
+ /* If the syscall number was invalid return ENOSYS */
+traced_invsyscall:
+ movi r2, -ENOSYS
+ br translate_rc_and_ret2
+
Luser_return:
GET_THREAD_INFO r11 /* get thread_info pointer */
ldw r10, TI_FLAGS(r11) /* get thread_info->flags */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 169/365] nios2: fix syscall restart checks
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (167 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 168/365] nios2: traced syscall does need to check the syscall number Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 170/365] nios2: restarts apply only to the first sigframe we build Greg Kroah-Hartman
` (200 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Al Viro, Dinh Nguyen
From: Al Viro <viro@zeniv.linux.org.uk>
commit 2d631bd58fe0ea3e3350212e23c9aba1fb606514 upstream.
sys_foo() returns -512 (aka -ERESTARTSYS) => do_signal() sees
512 in r2 and 1 in r1.
sys_foo() returns 512 => do_signal() sees 512 in r2 and 0 in r1.
The former is restart-worthy; the latter obviously isn't.
Fixes: b53e906d255d ("nios2: Signal handling support")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/nios2/kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/nios2/kernel/signal.c
+++ b/arch/nios2/kernel/signal.c
@@ -242,7 +242,7 @@ static int do_signal(struct pt_regs *reg
/*
* If we were from a system call, check for system call restarting...
*/
- if (regs->orig_r2 >= 0) {
+ if (regs->orig_r2 >= 0 && regs->r1) {
continue_addr = regs->ea;
restart_addr = continue_addr - 4;
retval = regs->r2;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 170/365] nios2: restarts apply only to the first sigframe we build...
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (168 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 169/365] nios2: fix syscall restart checks Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 171/365] nios2: add force_successful_syscall_return() Greg Kroah-Hartman
` (199 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Al Viro, Dinh Nguyen
From: Al Viro <viro@zeniv.linux.org.uk>
commit 411a76b7219555c55867466c82d70ce928d6c9e1 upstream.
Fixes: b53e906d255d ("nios2: Signal handling support")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/nios2/kernel/signal.c | 1 +
1 file changed, 1 insertion(+)
--- a/arch/nios2/kernel/signal.c
+++ b/arch/nios2/kernel/signal.c
@@ -264,6 +264,7 @@ static int do_signal(struct pt_regs *reg
regs->ea = restart_addr;
break;
}
+ regs->orig_r2 = -1;
}
if (get_signal(&ksig)) {
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 171/365] nios2: add force_successful_syscall_return()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (169 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 170/365] nios2: restarts apply only to the first sigframe we build Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 172/365] iavf: Fix adminq error handling Greg Kroah-Hartman
` (198 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Al Viro, Dinh Nguyen
From: Al Viro <viro@zeniv.linux.org.uk>
commit fd0c153daad135d0ec1a53c5dbe6936a724d6ae1 upstream.
If we use the ancient SysV syscall ABI, we'd better have tell the
kernel how to claim that a negative return value is a success.
Use ->orig_r2 for that - it's inaccessible via ptrace, so it's
a fair game for changes and it's normally[*] non-negative on return
from syscall. Set to -1; syscall is not going to be restart-worthy
by definition, so we won't interfere with that use either.
[*] the only exception is rt_sigreturn(), where we skip the entire
messing with r1/r2 anyway.
Fixes: 82ed08dd1b0e ("nios2: Exception handling")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/nios2/include/asm/ptrace.h | 2 ++
arch/nios2/kernel/entry.S | 6 ++++++
2 files changed, 8 insertions(+)
--- a/arch/nios2/include/asm/ptrace.h
+++ b/arch/nios2/include/asm/ptrace.h
@@ -74,6 +74,8 @@ extern void show_regs(struct pt_regs *);
((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE)\
- 1)
+#define force_successful_syscall_return() (current_pt_regs()->orig_r2 = -1)
+
int do_syscall_trace_enter(void);
void do_syscall_trace_exit(void);
#endif /* __ASSEMBLY__ */
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -213,6 +213,9 @@ local_restart:
translate_rc_and_ret:
movi r1, 0
bge r2, zero, 3f
+ ldw r1, PT_ORIG_R2(sp)
+ addi r1, r1, 1
+ beq r1, zero, 3f
sub r2, zero, r2
movi r1, 1
3:
@@ -276,6 +279,9 @@ traced_system_call:
translate_rc_and_ret2:
movi r1, 0
bge r2, zero, 4f
+ ldw r1, PT_ORIG_R2(sp)
+ addi r1, r1, 1
+ beq r1, zero, 4f
sub r2, zero, r2
movi r1, 1
4:
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 172/365] iavf: Fix adminq error handling
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (170 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 171/365] nios2: add force_successful_syscall_return() Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 173/365] iavf: Fix NULL pointer dereference in iavf_get_link_ksettings Greg Kroah-Hartman
` (197 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Przemyslaw Patynowski,
Jedrzej Jagielski, Marek Szlosek, Tony Nguyen
From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
commit 419831617ed349992c84344dbd9e627f9e68f842 upstream.
iavf_alloc_asq_bufs/iavf_alloc_arq_bufs allocates with dma_alloc_coherent
memory for VF mailbox.
Free DMA regions for both ASQ and ARQ in case error happens during
configuration of ASQ/ARQ registers.
Without this change it is possible to see when unloading interface:
74626.583369: dma_debug_device_change: device driver has pending DMA allocations while released from device [count=32]
One of leaked entries details: [device address=0x0000000b27ff9000] [size=4096 bytes] [mapped with DMA_BIDIRECTIONAL] [mapped as coherent]
Fixes: d358aa9a7a2d ("i40evf: init code and hardware support")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
@@ -324,6 +324,7 @@ static enum iavf_status iavf_config_arq_
static enum iavf_status iavf_init_asq(struct iavf_hw *hw)
{
enum iavf_status ret_code = 0;
+ int i;
if (hw->aq.asq.count > 0) {
/* queue already initialized */
@@ -354,12 +355,17 @@ static enum iavf_status iavf_init_asq(st
/* initialize base registers */
ret_code = iavf_config_asq_regs(hw);
if (ret_code)
- goto init_adminq_free_rings;
+ goto init_free_asq_bufs;
/* success! */
hw->aq.asq.count = hw->aq.num_asq_entries;
goto init_adminq_exit;
+init_free_asq_bufs:
+ for (i = 0; i < hw->aq.num_asq_entries; i++)
+ iavf_free_dma_mem(hw, &hw->aq.asq.r.asq_bi[i]);
+ iavf_free_virt_mem(hw, &hw->aq.asq.dma_head);
+
init_adminq_free_rings:
iavf_free_adminq_asq(hw);
@@ -383,6 +389,7 @@ init_adminq_exit:
static enum iavf_status iavf_init_arq(struct iavf_hw *hw)
{
enum iavf_status ret_code = 0;
+ int i;
if (hw->aq.arq.count > 0) {
/* queue already initialized */
@@ -413,12 +420,16 @@ static enum iavf_status iavf_init_arq(st
/* initialize base registers */
ret_code = iavf_config_arq_regs(hw);
if (ret_code)
- goto init_adminq_free_rings;
+ goto init_free_arq_bufs;
/* success! */
hw->aq.arq.count = hw->aq.num_arq_entries;
goto init_adminq_exit;
+init_free_arq_bufs:
+ for (i = 0; i < hw->aq.num_arq_entries; i++)
+ iavf_free_dma_mem(hw, &hw->aq.arq.r.arq_bi[i]);
+ iavf_free_virt_mem(hw, &hw->aq.arq.dma_head);
init_adminq_free_rings:
iavf_free_adminq_arq(hw);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 173/365] iavf: Fix NULL pointer dereference in iavf_get_link_ksettings
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (171 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 172/365] iavf: Fix adminq error handling Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 174/365] iavf: Fix reset error handling Greg Kroah-Hartman
` (196 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Przemyslaw Patynowski,
Jedrzej Jagielski, Marek Szlosek, Tony Nguyen
From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
commit 541a1af451b0cb3779e915d48d08efb17915207b upstream.
Fix possible NULL pointer dereference, due to freeing of adapter->vf_res
in iavf_init_get_resources. Previous commit introduced a regression,
where receiving IAVF_ERR_ADMIN_QUEUE_NO_WORK from iavf_get_vf_config
would free adapter->vf_res. However, netdev is still registered, so
ethtool_ops can be called. Calling iavf_get_link_ksettings with no vf_res,
will result with:
[ 9385.242676] BUG: kernel NULL pointer dereference, address: 0000000000000008
[ 9385.242683] #PF: supervisor read access in kernel mode
[ 9385.242686] #PF: error_code(0x0000) - not-present page
[ 9385.242690] PGD 0 P4D 0
[ 9385.242696] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI
[ 9385.242701] CPU: 6 PID: 3217 Comm: pmdalinux Kdump: loaded Tainted: G S E 5.18.0-04958-ga54ce3703613-dirty #1
[ 9385.242708] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.11.0 11/02/2019
[ 9385.242710] RIP: 0010:iavf_get_link_ksettings+0x29/0xd0 [iavf]
[ 9385.242745] Code: 00 0f 1f 44 00 00 b8 01 ef ff ff 48 c7 46 30 00 00 00 00 48 c7 46 38 00 00 00 00 c6 46 0b 00 66 89 46 08 48 8b 87 68 0e 00 00 <f6> 40 08 80 75 50 8b 87 5c 0e 00 00 83 f8 08 74 7a 76 1d 83 f8 20
[ 9385.242749] RSP: 0018:ffffc0560ec7fbd0 EFLAGS: 00010246
[ 9385.242755] RAX: 0000000000000000 RBX: ffffc0560ec7fc08 RCX: 0000000000000000
[ 9385.242759] RDX: ffffffffc0ad4550 RSI: ffffc0560ec7fc08 RDI: ffffa0fc66674000
[ 9385.242762] RBP: 00007ffd1fb2bf50 R08: b6a2d54b892363ee R09: ffffa101dc14fb00
[ 9385.242765] R10: 0000000000000000 R11: 0000000000000004 R12: ffffa0fc66674000
[ 9385.242768] R13: 0000000000000000 R14: ffffa0fc66674000 R15: 00000000ffffffa1
[ 9385.242771] FS: 00007f93711a2980(0000) GS:ffffa0fad72c0000(0000) knlGS:0000000000000000
[ 9385.242775] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 9385.242778] CR2: 0000000000000008 CR3: 0000000a8e61c003 CR4: 00000000003706e0
[ 9385.242781] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 9385.242784] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 9385.242787] Call Trace:
[ 9385.242791] <TASK>
[ 9385.242793] ethtool_get_settings+0x71/0x1a0
[ 9385.242814] __dev_ethtool+0x426/0x2f40
[ 9385.242823] ? slab_post_alloc_hook+0x4f/0x280
[ 9385.242836] ? kmem_cache_alloc_trace+0x15d/0x2f0
[ 9385.242841] ? dev_ethtool+0x59/0x170
[ 9385.242848] dev_ethtool+0xa7/0x170
[ 9385.242856] dev_ioctl+0xc3/0x520
[ 9385.242866] sock_do_ioctl+0xa0/0xe0
[ 9385.242877] sock_ioctl+0x22f/0x320
[ 9385.242885] __x64_sys_ioctl+0x84/0xc0
[ 9385.242896] do_syscall_64+0x3a/0x80
[ 9385.242904] entry_SYSCALL_64_after_hwframe+0x46/0xb0
[ 9385.242918] RIP: 0033:0x7f93702396db
[ 9385.242923] Code: 73 01 c3 48 8b 0d ad 57 38 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 7d 57 38 00 f7 d8 64 89 01 48
[ 9385.242927] RSP: 002b:00007ffd1fb2bf18 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 9385.242932] RAX: ffffffffffffffda RBX: 000055671b1d2fe0 RCX: 00007f93702396db
[ 9385.242935] RDX: 00007ffd1fb2bf20 RSI: 0000000000008946 RDI: 0000000000000007
[ 9385.242937] RBP: 00007ffd1fb2bf20 R08: 0000000000000003 R09: 0030763066307330
[ 9385.242940] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd1fb2bf80
[ 9385.242942] R13: 0000000000000007 R14: 0000556719f6de90 R15: 00007ffd1fb2c1b0
[ 9385.242948] </TASK>
[ 9385.242949] Modules linked in: iavf(E) xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nft_compat nf_nat_tftp nft_objref nf_conntrack_tftp bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables rfkill nfnetlink vfat fat irdma ib_uverbs ib_core intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm iTCO_wdt iTCO_vendor_support ice irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel rapl i40e pcspkr intel_cstate joydev mei_me intel_uncore mxm_wmi mei ipmi_ssif lpc_ich ipmi_si acpi_power_meter xfs libcrc32c mgag200 i2c_algo_bit drm_shmem_helper drm_kms_helper sd_mod t10_pi crc64_rocksoft crc64 syscopyarea sg sysfillrect sysimgblt fb_sys_fops drm ixgbe ahci libahci libata crc32c_intel mdio dca wmi dm_mirror dm_region_hash dm_log dm_mod ipmi_devintf ipmi_msghandler fuse
[ 9385.243065] [last unloaded: iavf]
Dereference happens in if (ADV_LINK_SUPPORT(adapter)) statement
Fixes: 209f2f9c7181 ("iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 negotiation")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2281,7 +2281,7 @@ static void iavf_init_get_resources(stru
err = iavf_get_vf_config(adapter);
if (err == -EALREADY) {
err = iavf_send_vf_config_msg(adapter);
- goto err_alloc;
+ goto err;
} else if (err == -EINVAL) {
/* We only get -EINVAL if the device is in a very bad
* state or if we've been disabled for previous bad
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 174/365] iavf: Fix reset error handling
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (172 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 173/365] iavf: Fix NULL pointer dereference in iavf_get_link_ksettings Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 175/365] iavf: Fix deadlock in initialization Greg Kroah-Hartman
` (195 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Przemyslaw Patynowski,
Jedrzej Jagielski, Marek Szlosek, Tony Nguyen
From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
commit 31071173771e079f7bc08dacd61e0db913262fbf upstream.
Do not call iavf_close in iavf_reset_task error handling. Doing so can
lead to double call of napi_disable, which can lead to deadlock there.
Removing VF would lead to iavf_remove task being stuck, because it
requires crit_lock, which is held by iavf_close.
Call iavf_disable_vf if reset fail, so that driver will clean up
remaining invalid resources.
During rapid VF resets, HW can fail to setup VF mailbox. Wrong
error handling can lead to iavf_remove being stuck with:
[ 5218.999087] iavf 0000:82:01.0: Failed to init adminq: -53
...
[ 5267.189211] INFO: task repro.sh:11219 blocked for more than 30 seconds.
[ 5267.189520] Tainted: G S E 5.18.0-04958-ga54ce3703613-dirty #1
[ 5267.189764] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 5267.190062] task:repro.sh state:D stack: 0 pid:11219 ppid: 8162 flags:0x00000000
[ 5267.190347] Call Trace:
[ 5267.190647] <TASK>
[ 5267.190927] __schedule+0x460/0x9f0
[ 5267.191264] schedule+0x44/0xb0
[ 5267.191563] schedule_preempt_disabled+0x14/0x20
[ 5267.191890] __mutex_lock.isra.12+0x6e3/0xac0
[ 5267.192237] ? iavf_remove+0xf9/0x6c0 [iavf]
[ 5267.192565] iavf_remove+0x12a/0x6c0 [iavf]
[ 5267.192911] ? _raw_spin_unlock_irqrestore+0x1e/0x40
[ 5267.193285] pci_device_remove+0x36/0xb0
[ 5267.193619] device_release_driver_internal+0xc1/0x150
[ 5267.193974] pci_stop_bus_device+0x69/0x90
[ 5267.194361] pci_stop_and_remove_bus_device+0xe/0x20
[ 5267.194735] pci_iov_remove_virtfn+0xba/0x120
[ 5267.195130] sriov_disable+0x2f/0xe0
[ 5267.195506] ice_free_vfs+0x7d/0x2f0 [ice]
[ 5267.196056] ? pci_get_device+0x4f/0x70
[ 5267.196496] ice_sriov_configure+0x78/0x1a0 [ice]
[ 5267.196995] sriov_numvfs_store+0xfe/0x140
[ 5267.197466] kernfs_fop_write_iter+0x12e/0x1c0
[ 5267.197918] new_sync_write+0x10c/0x190
[ 5267.198404] vfs_write+0x24e/0x2d0
[ 5267.198886] ksys_write+0x5c/0xd0
[ 5267.199367] do_syscall_64+0x3a/0x80
[ 5267.199827] entry_SYSCALL_64_after_hwframe+0x46/0xb0
[ 5267.200317] RIP: 0033:0x7f5b381205c8
[ 5267.200814] RSP: 002b:00007fff8c7e8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 5267.201981] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f5b381205c8
[ 5267.202620] RDX: 0000000000000002 RSI: 00005569420ee900 RDI: 0000000000000001
[ 5267.203426] RBP: 00005569420ee900 R08: 000000000000000a R09: 00007f5b38180820
[ 5267.204327] R10: 000000000000000a R11: 0000000000000246 R12: 00007f5b383c06e0
[ 5267.205193] R13: 0000000000000002 R14: 00007f5b383bb880 R15: 0000000000000002
[ 5267.206041] </TASK>
[ 5267.206970] Kernel panic - not syncing: hung_task: blocked tasks
[ 5267.207809] CPU: 48 PID: 551 Comm: khungtaskd Kdump: loaded Tainted: G S E 5.18.0-04958-ga54ce3703613-dirty #1
[ 5267.208726] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.11.0 11/02/2019
[ 5267.209623] Call Trace:
[ 5267.210569] <TASK>
[ 5267.211480] dump_stack_lvl+0x33/0x42
[ 5267.212472] panic+0x107/0x294
[ 5267.213467] watchdog.cold.8+0xc/0xbb
[ 5267.214413] ? proc_dohung_task_timeout_secs+0x30/0x30
[ 5267.215511] kthread+0xf4/0x120
[ 5267.216459] ? kthread_complete_and_exit+0x20/0x20
[ 5267.217505] ret_from_fork+0x22/0x30
[ 5267.218459] </TASK>
Fixes: f0db78928783 ("i40evf: use netdev variable in reset task")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2998,12 +2998,15 @@ continue_reset:
return;
reset_err:
+ if (running) {
+ set_bit(__IAVF_VSI_DOWN, adapter->vsi.state);
+ iavf_free_traffic_irqs(adapter);
+ }
+ iavf_disable_vf(adapter);
+
mutex_unlock(&adapter->client_lock);
mutex_unlock(&adapter->crit_lock);
- if (running)
- iavf_change_state(adapter, __IAVF_RUNNING);
dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
- iavf_close(netdev);
}
/**
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 175/365] iavf: Fix deadlock in initialization
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (173 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 174/365] iavf: Fix reset error handling Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 176/365] ASoC: Intel: avs: Fix potential buffer overflow by snprintf() Greg Kroah-Hartman
` (194 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Ivan Vecera, Konrad Jankowski, Tony Nguyen
From: Ivan Vecera <ivecera@redhat.com>
commit cbe9e51126305832cf407ee6bb556ce831488ffe upstream.
Fix deadlock that occurs when iavf interface is a part of failover
configuration.
1. Mutex crit_lock is taken at the beginning of iavf_watchdog_task()
2. Function iavf_init_config_adapter() is called when adapter
state is __IAVF_INIT_CONFIG_ADAPTER
3. iavf_init_config_adapter() calls register_netdevice() that emits
NETDEV_REGISTER event
4. Notifier function failover_event() then calls
net_failover_slave_register() that calls dev_open()
5. dev_open() calls iavf_open() that tries to take crit_lock in
end-less loop
Stack trace:
...
[ 790.251876] usleep_range_state+0x5b/0x80
[ 790.252547] iavf_open+0x37/0x1d0 [iavf]
[ 790.253139] __dev_open+0xcd/0x160
[ 790.253699] dev_open+0x47/0x90
[ 790.254323] net_failover_slave_register+0x122/0x220 [net_failover]
[ 790.255213] failover_slave_register.part.7+0xd2/0x180 [failover]
[ 790.256050] failover_event+0x122/0x1ab [failover]
[ 790.256821] notifier_call_chain+0x47/0x70
[ 790.257510] register_netdevice+0x20f/0x550
[ 790.258263] iavf_watchdog_task+0x7c8/0xea0 [iavf]
[ 790.259009] process_one_work+0x1a7/0x360
[ 790.259705] worker_thread+0x30/0x390
To fix the situation we should check the current adapter state after
first unsuccessful mutex_trylock() and return with -EBUSY if it is
__IAVF_INIT_CONFIG_ADAPTER.
Fixes: 226d528512cf ("iavf: fix locking of critical sections")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -3989,8 +3989,17 @@ static int iavf_open(struct net_device *
return -EIO;
}
- while (!mutex_trylock(&adapter->crit_lock))
+ while (!mutex_trylock(&adapter->crit_lock)) {
+ /* If we are in __IAVF_INIT_CONFIG_ADAPTER state the crit_lock
+ * is already taken and iavf_open is called from an upper
+ * device's notifier reacting on NETDEV_REGISTER event.
+ * We have to leave here to avoid dead lock.
+ */
+ if (adapter->state == __IAVF_INIT_CONFIG_ADAPTER)
+ return -EBUSY;
+
usleep_range(500, 1000);
+ }
if (adapter->state != __IAVF_DOWN) {
err = -EBUSY;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 176/365] ASoC: Intel: avs: Fix potential buffer overflow by snprintf()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (174 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 175/365] iavf: Fix deadlock in initialization Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 177/365] ASoC: SOF: debug: " Greg Kroah-Hartman
` (193 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Takashi Iwai, Cezary Rojewski, Mark Brown
From: Takashi Iwai <tiwai@suse.de>
commit ca3b7b9dc9bc1fa552f4697b7cccfa0258a44d00 upstream.
snprintf() returns the would-be-filled size when the string overflows
the given buffer size, hence using this value may result in a buffer
overflow (although it's unrealistic).
This patch replaces it with a safer version, scnprintf() for papering
over such a potential issue.
Fixes: f1b3b320bd65 ("ASoC: Intel: avs: Generic soc component driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220801165420.25978-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/intel/avs/pcm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -636,8 +636,8 @@ static ssize_t topology_name_read(struct
char buf[64];
size_t len;
- len = snprintf(buf, sizeof(buf), "%s/%s\n", component->driver->topology_name_prefix,
- mach->tplg_filename);
+ len = scnprintf(buf, sizeof(buf), "%s/%s\n", component->driver->topology_name_prefix,
+ mach->tplg_filename);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 177/365] ASoC: SOF: debug: Fix potential buffer overflow by snprintf()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (175 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 176/365] ASoC: Intel: avs: Fix potential buffer overflow by snprintf() Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 178/365] ASoC: SOF: Intel: hda: " Greg Kroah-Hartman
` (192 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai, Mark Brown
From: Takashi Iwai <tiwai@suse.de>
commit 1eb123ce985e6cf302ac6e3f19862d132d86fa8f upstream.
snprintf() returns the would-be-filled size when the string overflows
the given buffer size, hence using this value may result in the buffer
overflow (although it's unrealistic).
This patch replaces with a safer version, scnprintf() for papering
over such a potential issue.
Fixes: 5b10b6298921 ("ASoC: SOF: Add `memory_info` file to debugfs")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220801165420.25978-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/debug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -252,9 +252,9 @@ static int memory_info_update(struct snd
}
for (i = 0, len = 0; i < reply->num_elems; i++) {
- ret = snprintf(buf + len, buff_size - len, "zone %d.%d used %#8x free %#8x\n",
- reply->elems[i].zone, reply->elems[i].id,
- reply->elems[i].used, reply->elems[i].free);
+ ret = scnprintf(buf + len, buff_size - len, "zone %d.%d used %#8x free %#8x\n",
+ reply->elems[i].zone, reply->elems[i].id,
+ reply->elems[i].used, reply->elems[i].free);
if (ret < 0)
goto error;
len += ret;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 178/365] ASoC: SOF: Intel: hda: Fix potential buffer overflow by snprintf()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (176 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 177/365] ASoC: SOF: debug: " Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 179/365] ASoC: DPCM: Dont pick up BE without substream Greg Kroah-Hartman
` (191 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai, Mark Brown
From: Takashi Iwai <tiwai@suse.de>
commit 94c1ceb043c1a002de9649bb630c8e8347645982 upstream.
snprintf() returns the would-be-filled size when the string overflows
the given buffer size, hence using this value may result in the buffer
overflow (although it's unrealistic).
This patch replaces with a safer version, scnprintf() for papering
over such a potential issue.
Fixes: 29c8e4398f02 ("ASoC: SOF: Intel: hda: add extended rom status dump to error log")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220801165420.25978-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/intel/hda.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -467,7 +467,7 @@ static void hda_dsp_dump_ext_rom_status(
chip = get_chip_info(sdev->pdata);
for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4);
- len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
+ len += scnprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
}
dev_printk(level, sdev->dev, "extended rom status: %s", msg);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 179/365] ASoC: DPCM: Dont pick up BE without substream
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (177 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 178/365] ASoC: SOF: Intel: hda: " Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 180/365] ASoC: tas2770: Set correct FSYNC polarity Greg Kroah-Hartman
` (190 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Alex Natalsson, Pierre-Louis Bossart,
Péter Ujfalusi, Takashi Iwai, Mark Brown
From: Takashi Iwai <tiwai@suse.de>
commit 754590651ccbbcc74a7c20907be4bb15d642bde3 upstream.
When DPCM tries to add valid BE connections at dpcm_add_paths(), it
doesn't check whether the picked BE actually supports for the given
stream direction. Due to that, when an asymmetric BE stream is
present, it picks up wrongly and this may result in a NULL dereference
at a later point where the code assumes the existence of a
corresponding BE substream.
This patch adds the check for the presence of the substream for the
target BE for avoiding the problem above.
Note that we have already some fix for non-existing BE substream at
commit 6246f283d5e0 ("ASoC: dpcm: skip missing substream while
applying symmetry"). But the code path we've hit recently is rather
happening before the previous fix. So this patch tries to fix at
picking up a BE instead of parsing BE lists.
Fixes: bbf7d3b1c4f4 ("ASoC: soc-pcm: align BE 'atomicity' with that of the FE")
Reported-by: Alex Natalsson <harmoniesworlds@gmail.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/CADs9LoPZH_D+eJ9qjTxSLE5jGyhKsjMN7g2NighZ16biVxsyKw@mail.gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220801170510.26582-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/soc-pcm.c | 3 +++
1 file changed, 3 insertions(+)
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1318,6 +1318,9 @@ static struct snd_soc_pcm_runtime *dpcm_
if (!be->dai_link->no_pcm)
continue;
+ if (!snd_soc_dpcm_get_substream(be, stream))
+ continue;
+
for_each_rtd_dais(be, i, dai) {
w = snd_soc_dai_get_widget(dai, stream);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 180/365] ASoC: tas2770: Set correct FSYNC polarity
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (178 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 179/365] ASoC: DPCM: Dont pick up BE without substream Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 181/365] ASoC: tas2770: Allow mono streams Greg Kroah-Hartman
` (189 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Martin Povišer, Mark Brown
From: Martin Povišer <povik+lin@cutebit.org>
commit e9ac31f0a5d0e246b046c20348954519f91a297f upstream.
Fix setting of FSYNC polarity for DAI formats other than I2S. Also
add support for polarity inversion.
Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220808141246.5749-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/codecs/tas2770.c | 20 +++++++++++++++++++-
sound/soc/codecs/tas2770.h | 3 +++
2 files changed, 22 insertions(+), 1 deletion(-)
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -337,7 +337,7 @@ static int tas2770_set_fmt(struct snd_so
struct snd_soc_component *component = dai->component;
struct tas2770_priv *tas2770 =
snd_soc_component_get_drvdata(component);
- u8 tdm_rx_start_slot = 0, asi_cfg_1 = 0;
+ u8 tdm_rx_start_slot = 0, invert_fpol = 0, fpol_preinv = 0, asi_cfg_1 = 0;
int ret;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -349,9 +349,15 @@ static int tas2770_set_fmt(struct snd_so
}
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_IF:
+ invert_fpol = 1;
+ fallthrough;
case SND_SOC_DAIFMT_NB_NF:
asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_RSING;
break;
+ case SND_SOC_DAIFMT_IB_IF:
+ invert_fpol = 1;
+ fallthrough;
case SND_SOC_DAIFMT_IB_NF:
asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_FALING;
break;
@@ -369,15 +375,19 @@ static int tas2770_set_fmt(struct snd_so
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
tdm_rx_start_slot = 1;
+ fpol_preinv = 0;
break;
case SND_SOC_DAIFMT_DSP_A:
tdm_rx_start_slot = 0;
+ fpol_preinv = 1;
break;
case SND_SOC_DAIFMT_DSP_B:
tdm_rx_start_slot = 1;
+ fpol_preinv = 1;
break;
case SND_SOC_DAIFMT_LEFT_J:
tdm_rx_start_slot = 0;
+ fpol_preinv = 1;
break;
default:
dev_err(tas2770->dev,
@@ -391,6 +401,14 @@ static int tas2770_set_fmt(struct snd_so
if (ret < 0)
return ret;
+ ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG0,
+ TAS2770_TDM_CFG_REG0_FPOL_MASK,
+ (fpol_preinv ^ invert_fpol)
+ ? TAS2770_TDM_CFG_REG0_FPOL_RSING
+ : TAS2770_TDM_CFG_REG0_FPOL_FALING);
+ if (ret < 0)
+ return ret;
+
return 0;
}
--- a/sound/soc/codecs/tas2770.h
+++ b/sound/soc/codecs/tas2770.h
@@ -41,6 +41,9 @@
#define TAS2770_TDM_CFG_REG0_31_44_1_48KHZ 0x6
#define TAS2770_TDM_CFG_REG0_31_88_2_96KHZ 0x8
#define TAS2770_TDM_CFG_REG0_31_176_4_192KHZ 0xa
+#define TAS2770_TDM_CFG_REG0_FPOL_MASK BIT(0)
+#define TAS2770_TDM_CFG_REG0_FPOL_RSING 0
+#define TAS2770_TDM_CFG_REG0_FPOL_FALING 1
/* TDM Configuration Reg1 */
#define TAS2770_TDM_CFG_REG1 TAS2770_REG(0X0, 0x0B)
#define TAS2770_TDM_CFG_REG1_MASK GENMASK(5, 1)
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 181/365] ASoC: tas2770: Allow mono streams
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (179 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 180/365] ASoC: tas2770: Set correct FSYNC polarity Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 182/365] ASoC: tas2770: Drop conflicting set_bias_level power setting Greg Kroah-Hartman
` (188 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Martin Povišer, Mark Brown
From: Martin Povišer <povik+lin@cutebit.org>
commit bf54d97a835dfe62d4d29e245e170c63d0089be7 upstream.
The part is a mono speaker amp, but it can do downmix and switch between
left and right channel, so the right channel range is 1 to 2.
Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220808141246.5749-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/codecs/tas2770.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -507,7 +507,7 @@ static struct snd_soc_dai_driver tas2770
.id = 0,
.playback = {
.stream_name = "ASI1 Playback",
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = TAS2770_RATES,
.formats = TAS2770_FORMATS,
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 182/365] ASoC: tas2770: Drop conflicting set_bias_level power setting
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (180 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 181/365] ASoC: tas2770: Allow mono streams Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 183/365] ASoC: tas2770: Fix handling of mute/unmute Greg Kroah-Hartman
` (187 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Martin Povišer, Mark Brown
From: Martin Povišer <povik+lin@cutebit.org>
commit 482c23fbc7e9bf5a7a74defd0735d5346215db58 upstream.
The driver is setting the PWR_CTRL field in both the set_bias_level
callback and on DAPM events of the DAC widget (and also in the
mute_stream method). Drop the set_bias_level callback altogether as the
power setting it does is in conflict with the other code paths.
Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220808141246.5749-4-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/codecs/tas2770.c | 33 ---------------------------------
1 file changed, 33 deletions(-)
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -46,38 +46,6 @@ static void tas2770_reset(struct tas2770
usleep_range(1000, 2000);
}
-static int tas2770_set_bias_level(struct snd_soc_component *component,
- enum snd_soc_bias_level level)
-{
- struct tas2770_priv *tas2770 =
- snd_soc_component_get_drvdata(component);
-
- switch (level) {
- case SND_SOC_BIAS_ON:
- snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_ACTIVE);
- break;
- case SND_SOC_BIAS_STANDBY:
- case SND_SOC_BIAS_PREPARE:
- snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_MUTE);
- break;
- case SND_SOC_BIAS_OFF:
- snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_SHUTDOWN);
- break;
-
- default:
- dev_err(tas2770->dev, "wrong power level setting %d\n", level);
- return -EINVAL;
- }
-
- return 0;
-}
-
#ifdef CONFIG_PM
static int tas2770_codec_suspend(struct snd_soc_component *component)
{
@@ -555,7 +523,6 @@ static const struct snd_soc_component_dr
.probe = tas2770_codec_probe,
.suspend = tas2770_codec_suspend,
.resume = tas2770_codec_resume,
- .set_bias_level = tas2770_set_bias_level,
.controls = tas2770_snd_controls,
.num_controls = ARRAY_SIZE(tas2770_snd_controls),
.dapm_widgets = tas2770_dapm_widgets,
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 183/365] ASoC: tas2770: Fix handling of mute/unmute
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (181 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 182/365] ASoC: tas2770: Drop conflicting set_bias_level power setting Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 184/365] ASoC: codec: tlv320aic32x4: fix mono playback via I2S Greg Kroah-Hartman
` (186 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Martin Povišer, Mark Brown
From: Martin Povišer <povik+lin@cutebit.org>
commit 1e5907bcb3a3b569be0a03ebe668bba2ed320a50 upstream.
Because the PWR_CTRL field is modeled as the power state of the DAC
widget, and at the same time it is used to implement mute/unmute, we
need some additional book-keeping to have the right end result no matter
the sequence of calls. Without this fix, one can mute an ongoing stream
by toggling a speaker pin control.
Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220808141246.5749-5-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/codecs/tas2770.c | 57 +++++++++++++++++++++++----------------------
sound/soc/codecs/tas2770.h | 2 +
2 files changed, 32 insertions(+), 27 deletions(-)
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -46,6 +46,26 @@ static void tas2770_reset(struct tas2770
usleep_range(1000, 2000);
}
+static int tas2770_update_pwr_ctrl(struct tas2770_priv *tas2770)
+{
+ struct snd_soc_component *component = tas2770->component;
+ unsigned int val;
+ int ret;
+
+ if (tas2770->dac_powered)
+ val = tas2770->unmuted ?
+ TAS2770_PWR_CTRL_ACTIVE : TAS2770_PWR_CTRL_MUTE;
+ else
+ val = TAS2770_PWR_CTRL_SHUTDOWN;
+
+ ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
+ TAS2770_PWR_CTRL_MASK, val);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
#ifdef CONFIG_PM
static int tas2770_codec_suspend(struct snd_soc_component *component)
{
@@ -82,9 +102,7 @@ static int tas2770_codec_resume(struct s
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
usleep_range(1000, 2000);
} else {
- ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_ACTIVE);
+ ret = tas2770_update_pwr_ctrl(tas2770);
if (ret < 0)
return ret;
}
@@ -120,24 +138,19 @@ static int tas2770_dac_event(struct snd_
switch (event) {
case SND_SOC_DAPM_POST_PMU:
- ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_MUTE);
+ tas2770->dac_powered = 1;
+ ret = tas2770_update_pwr_ctrl(tas2770);
break;
case SND_SOC_DAPM_PRE_PMD:
- ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_SHUTDOWN);
+ tas2770->dac_powered = 0;
+ ret = tas2770_update_pwr_ctrl(tas2770);
break;
default:
dev_err(tas2770->dev, "Not supported evevt\n");
return -EINVAL;
}
- if (ret < 0)
- return ret;
-
- return 0;
+ return ret;
}
static const struct snd_kcontrol_new isense_switch =
@@ -171,21 +184,11 @@ static const struct snd_soc_dapm_route t
static int tas2770_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;
- int ret;
-
- if (mute)
- ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_MUTE);
- else
- ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
- TAS2770_PWR_CTRL_MASK,
- TAS2770_PWR_CTRL_ACTIVE);
-
- if (ret < 0)
- return ret;
+ struct tas2770_priv *tas2770 =
+ snd_soc_component_get_drvdata(component);
- return 0;
+ tas2770->unmuted = !mute;
+ return tas2770_update_pwr_ctrl(tas2770);
}
static int tas2770_set_bitwidth(struct tas2770_priv *tas2770, int bitwidth)
--- a/sound/soc/codecs/tas2770.h
+++ b/sound/soc/codecs/tas2770.h
@@ -138,6 +138,8 @@ struct tas2770_priv {
struct device *dev;
int v_sense_slot;
int i_sense_slot;
+ bool dac_powered;
+ bool unmuted;
};
#endif /* __TAS2770__ */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 184/365] ASoC: codec: tlv320aic32x4: fix mono playback via I2S
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (182 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 183/365] ASoC: tas2770: Fix handling of mute/unmute Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 185/365] IB/iser: Fix login with authentication Greg Kroah-Hartman
` (185 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Philipp Zabel, Mark Brown
From: Philipp Zabel <p.zabel@pengutronix.de>
commit b4b5f29a076e52181f63e45a2ad1bc88593072e3 upstream.
The two commits referenced below break mono playback via I2S DAI because
they set BCLK to half the required speed. For PCM transport over I2S, the
number of transmitted channels is always 2, even for mono playback.
Fixes: dcd79364bff3 ("ASoC: codec: tlv3204: Enable 24 bit audio support")
Fixes: 40b37136287b ("ASoC: tlv320aic32x4: Fix bdiv clock rate derivation")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220810104156.665452-1-p.zabel@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/codecs/tlv320aic32x4.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -49,6 +49,8 @@ struct aic32x4_priv {
struct aic32x4_setup_data *setup;
struct device *dev;
enum aic32x4_type type;
+
+ unsigned int fmt;
};
static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w,
@@ -611,6 +613,7 @@ static int aic32x4_set_dai_sysclk(struct
static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{
struct snd_soc_component *component = codec_dai->component;
+ struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
u8 iface_reg_1 = 0;
u8 iface_reg_2 = 0;
u8 iface_reg_3 = 0;
@@ -654,6 +657,8 @@ static int aic32x4_set_dai_fmt(struct sn
return -EINVAL;
}
+ aic32x4->fmt = fmt;
+
snd_soc_component_update_bits(component, AIC32X4_IFACE1,
AIC32X4_IFACE1_DATATYPE_MASK |
AIC32X4_IFACE1_MASTER_MASK, iface_reg_1);
@@ -758,6 +763,10 @@ static int aic32x4_setup_clocks(struct s
return -EINVAL;
}
+ /* PCM over I2S is always 2-channel */
+ if ((aic32x4->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S)
+ channels = 2;
+
madc = DIV_ROUND_UP((32 * adc_resource_class), aosr);
max_dosr = (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) *
dosr_increment;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 185/365] IB/iser: Fix login with authentication
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (183 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 184/365] ASoC: codec: tlv320aic32x4: fix mono playback via I2S Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 186/365] RDMA/mlx5: Use the proper number of ports Greg Kroah-Hartman
` (184 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergey Gorenko, Max Gurtovoy,
Leon Romanovsky
From: Sergey Gorenko <sergeygo@nvidia.com>
commit d6d142cb7f79bec6051c5ecf744b7a5309c5a0ee upstream.
The iSER Initiator uses two types of receive buffers:
- one big login buffer posted by iser_post_recvl();
- several small message buffers posted by iser_post_recvm().
The login buffer is used at the login phase and full feature phase in
the discovery session. It may take a few requests and responses to
complete the login phase. The message buffers are only used in the
normal operational session at the full feature phase.
After the commit referred in the fixes line, the login operation fails
if the authentication is enabled. That happens because the Initiator
posts a small receive buffer after the first response from Target. So,
the next send operation fails because Target's second response does not
fit into the small receive buffer.
This commit adds additional checks to prevent posting small receive
buffers until the full feature phase.
Fixes: 39b169ea0d36 ("IB/iser: Fix RNR errors")
Link: https://lore.kernel.org/r/20220805060135.18493-1-sergeygo@nvidia.com
Signed-off-by: Sergey Gorenko <sergeygo@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/ulp/iser/iser_initiator.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -537,6 +537,7 @@ void iser_login_rsp(struct ib_cq *cq, st
struct iscsi_hdr *hdr;
char *data;
int length;
+ bool full_feature_phase;
if (unlikely(wc->status != IB_WC_SUCCESS)) {
iser_err_comp(wc, "login_rsp");
@@ -550,6 +551,9 @@ void iser_login_rsp(struct ib_cq *cq, st
hdr = desc->rsp + sizeof(struct iser_ctrl);
data = desc->rsp + ISER_HEADERS_LEN;
length = wc->byte_len - ISER_HEADERS_LEN;
+ full_feature_phase = ((hdr->flags & ISCSI_FULL_FEATURE_PHASE) ==
+ ISCSI_FULL_FEATURE_PHASE) &&
+ (hdr->flags & ISCSI_FLAG_CMD_FINAL);
iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode,
hdr->itt, length);
@@ -560,7 +564,8 @@ void iser_login_rsp(struct ib_cq *cq, st
desc->rsp_dma, ISER_RX_LOGIN_SIZE,
DMA_FROM_DEVICE);
- if (iser_conn->iscsi_conn->session->discovery_sess)
+ if (!full_feature_phase ||
+ iser_conn->iscsi_conn->session->discovery_sess)
return;
/* Post the first RX buffer that is skipped in iser_post_rx_bufs() */
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 186/365] RDMA/mlx5: Use the proper number of ports
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (184 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 185/365] IB/iser: Fix login with authentication Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 187/365] RDMA/cxgb4: fix accept failure due to increased cpl_t5_pass_accept_rpl size Greg Kroah-Hartman
` (183 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Mark Bloch, Leon Romanovsky
From: Mark Bloch <mbloch@nvidia.com>
commit 4b83c3caf289b80acecc539c79f10a6937cc42dd upstream.
The cited commit allowed the driver to operate over HCAs that have
4 physical ports. Use the number of ports of the RDMA device in the for
loop instead of using the struct size.
Fixes: 4cd14d44b11d ("net/mlx5: Support devices with more than 2 ports")
Link: https://lore.kernel.org/r/a54a56c2ede16044a29d119209b35189c662ac72.1659944855.git.leonro@nvidia.com
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx5/main.c | 34 +++++++++++++++----------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index a174a0eee8dc..fc94a1b25485 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -2738,26 +2738,24 @@ static int set_has_smi_cap(struct mlx5_ib_dev *dev)
int err;
int port;
- for (port = 1; port <= ARRAY_SIZE(dev->port_caps); port++) {
- dev->port_caps[port - 1].has_smi = false;
- if (MLX5_CAP_GEN(dev->mdev, port_type) ==
- MLX5_CAP_PORT_TYPE_IB) {
- if (MLX5_CAP_GEN(dev->mdev, ib_virt)) {
- err = mlx5_query_hca_vport_context(dev->mdev, 0,
- port, 0,
- &vport_ctx);
- if (err) {
- mlx5_ib_err(dev, "query_hca_vport_context for port=%d failed %d\n",
- port, err);
- return err;
- }
- dev->port_caps[port - 1].has_smi =
- vport_ctx.has_smi;
- } else {
- dev->port_caps[port - 1].has_smi = true;
- }
+ if (MLX5_CAP_GEN(dev->mdev, port_type) != MLX5_CAP_PORT_TYPE_IB)
+ return 0;
+
+ for (port = 1; port <= dev->num_ports; port++) {
+ if (!MLX5_CAP_GEN(dev->mdev, ib_virt)) {
+ dev->port_caps[port - 1].has_smi = true;
+ continue;
}
+ err = mlx5_query_hca_vport_context(dev->mdev, 0, port, 0,
+ &vport_ctx);
+ if (err) {
+ mlx5_ib_err(dev, "query_hca_vport_context for port=%d failed %d\n",
+ port, err);
+ return err;
+ }
+ dev->port_caps[port - 1].has_smi = vport_ctx.has_smi;
}
+
return 0;
}
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 187/365] RDMA/cxgb4: fix accept failure due to increased cpl_t5_pass_accept_rpl size
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (185 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 186/365] RDMA/mlx5: Use the proper number of ports Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 188/365] netfilter: nfnetlink: re-enable conntrack expectation events Greg Kroah-Hartman
` (182 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Potnuri Bharat Teja,
Rahul Lakkireddy, Kees Cook, Leon Romanovsky
From: Potnuri Bharat Teja <bharat@chelsio.com>
commit ef0162298abf46b881e4a4d0c604d1a066228647 upstream.
Commit 'c2ed5611afd7' has increased the cpl_t5_pass_accept_rpl{} structure
size by 8B to avoid roundup. cpl_t5_pass_accept_rpl{} is a HW specific
structure and increasing its size will lead to unwanted adapter errors.
Current commit reverts the cpl_t5_pass_accept_rpl{} back to its original
and allocates zeroed skb buffer there by avoiding the memset for iss field.
Reorder code to minimize chip type checks.
Fixes: c2ed5611afd7 ("iw_cxgb4: Use memset_startat() for cpl_t5_pass_accept_rpl")
Link: https://lore.kernel.org/r/20220809184118.2029-1-rahul.lakkireddy@chelsio.com
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/cxgb4/cm.c | 25 ++++++++-------------
drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | 2 +-
2 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index c16017f6e8db..14392c942f49 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -2468,31 +2468,24 @@ static int accept_cr(struct c4iw_ep *ep, struct sk_buff *skb,
opt2 |= CCTRL_ECN_V(1);
}
- skb_get(skb);
- rpl = cplhdr(skb);
if (!is_t4(adapter_type)) {
- BUILD_BUG_ON(sizeof(*rpl5) != roundup(sizeof(*rpl5), 16));
- skb_trim(skb, sizeof(*rpl5));
- rpl5 = (void *)rpl;
- INIT_TP_WR(rpl5, ep->hwtid);
- } else {
- skb_trim(skb, sizeof(*rpl));
- INIT_TP_WR(rpl, ep->hwtid);
- }
- OPCODE_TID(rpl) = cpu_to_be32(MK_OPCODE_TID(CPL_PASS_ACCEPT_RPL,
- ep->hwtid));
-
- if (CHELSIO_CHIP_VERSION(adapter_type) > CHELSIO_T4) {
u32 isn = (prandom_u32() & ~7UL) - 1;
+
+ skb = get_skb(skb, roundup(sizeof(*rpl5), 16), GFP_KERNEL);
+ rpl5 = __skb_put_zero(skb, roundup(sizeof(*rpl5), 16));
+ rpl = (void *)rpl5;
+ INIT_TP_WR_CPL(rpl5, CPL_PASS_ACCEPT_RPL, ep->hwtid);
opt2 |= T5_OPT_2_VALID_F;
opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE);
opt2 |= T5_ISS_F;
- rpl5 = (void *)rpl;
- memset_after(rpl5, 0, iss);
if (peer2peer)
isn += 4;
rpl5->iss = cpu_to_be32(isn);
pr_debug("iss %u\n", be32_to_cpu(rpl5->iss));
+ } else {
+ skb = get_skb(skb, sizeof(*rpl), GFP_KERNEL);
+ rpl = __skb_put_zero(skb, sizeof(*rpl));
+ INIT_TP_WR_CPL(rpl, CPL_PASS_ACCEPT_RPL, ep->hwtid);
}
rpl->opt0 = cpu_to_be64(opt0);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
index 26433a62d7f0..fed5f93bf620 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
@@ -497,7 +497,7 @@ struct cpl_t5_pass_accept_rpl {
__be32 opt2;
__be64 opt0;
__be32 iss;
- __be32 rsvd[3];
+ __be32 rsvd;
};
struct cpl_act_open_req {
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 188/365] netfilter: nfnetlink: re-enable conntrack expectation events
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (186 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 187/365] RDMA/cxgb4: fix accept failure due to increased cpl_t5_pass_accept_rpl size Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 189/365] netfilter: nf_tables: use READ_ONCE and WRITE_ONCE for shared generation id access Greg Kroah-Hartman
` (181 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Yi Chen, Florian Westphal
From: Florian Westphal <fw@strlen.de>
commit 0b2f3212b551a87fe936701fa0813032861a3308 upstream.
To avoid allocation of the conntrack extension area when possible,
the default behaviour was changed to only allocate the event extension
if a userspace program is subscribed to a notification group.
Problem is that while 'conntrack -E' does enable the event allocation
behind the scenes, 'conntrack -E expect' does not: no expectation events
are delivered unless user sets
"net.netfilter.nf_conntrack_events" back to 1 (always on).
Fix the autodetection to also consider EXP type group.
We need to track the 6 event groups (3+3, new/update/destroy for events and
for expectations each) independently, else we'd disable events again
if an expectation group becomes empty while there is still an active
event group.
Fixes: 2794cdb0b97b ("netfilter: nfnetlink: allow to detect if ctnetlink listeners exist")
Reported-by: Yi Chen <yiche@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/netns/conntrack.h | 2 -
net/netfilter/nfnetlink.c | 83 +++++++++++++++++++++++++++++++++++-------
2 files changed, 72 insertions(+), 13 deletions(-)
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -95,7 +95,7 @@ struct nf_ip_net {
struct netns_ct {
#ifdef CONFIG_NF_CONNTRACK_EVENTS
- bool ctnetlink_has_listener;
+ u8 ctnetlink_has_listener;
bool ecache_dwork_pending;
#endif
u8 sysctl_log_invalid; /* Log invalid packets */
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -44,6 +44,10 @@ MODULE_DESCRIPTION("Netfilter messages v
static unsigned int nfnetlink_pernet_id __read_mostly;
+#ifdef CONFIG_NF_CONNTRACK_EVENTS
+static DEFINE_SPINLOCK(nfnl_grp_active_lock);
+#endif
+
struct nfnl_net {
struct sock *nfnl;
};
@@ -654,6 +658,44 @@ static void nfnetlink_rcv(struct sk_buff
netlink_rcv_skb(skb, nfnetlink_rcv_msg);
}
+static void nfnetlink_bind_event(struct net *net, unsigned int group)
+{
+#ifdef CONFIG_NF_CONNTRACK_EVENTS
+ int type, group_bit;
+ u8 v;
+
+ /* All NFNLGRP_CONNTRACK_* group bits fit into u8.
+ * The other groups are not relevant and can be ignored.
+ */
+ if (group >= 8)
+ return;
+
+ type = nfnl_group2type[group];
+
+ switch (type) {
+ case NFNL_SUBSYS_CTNETLINK:
+ break;
+ case NFNL_SUBSYS_CTNETLINK_EXP:
+ break;
+ default:
+ return;
+ }
+
+ group_bit = (1 << group);
+
+ spin_lock(&nfnl_grp_active_lock);
+ v = READ_ONCE(net->ct.ctnetlink_has_listener);
+ if ((v & group_bit) == 0) {
+ v |= group_bit;
+
+ /* read concurrently without nfnl_grp_active_lock held. */
+ WRITE_ONCE(net->ct.ctnetlink_has_listener, v);
+ }
+
+ spin_unlock(&nfnl_grp_active_lock);
+#endif
+}
+
static int nfnetlink_bind(struct net *net, int group)
{
const struct nfnetlink_subsystem *ss;
@@ -670,28 +712,45 @@ static int nfnetlink_bind(struct net *ne
if (!ss)
request_module_nowait("nfnetlink-subsys-%d", type);
-#ifdef CONFIG_NF_CONNTRACK_EVENTS
- if (type == NFNL_SUBSYS_CTNETLINK) {
- nfnl_lock(NFNL_SUBSYS_CTNETLINK);
- WRITE_ONCE(net->ct.ctnetlink_has_listener, true);
- nfnl_unlock(NFNL_SUBSYS_CTNETLINK);
- }
-#endif
+ nfnetlink_bind_event(net, group);
return 0;
}
static void nfnetlink_unbind(struct net *net, int group)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS
+ int type, group_bit;
+
if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX)
return;
- if (nfnl_group2type[group] == NFNL_SUBSYS_CTNETLINK) {
- nfnl_lock(NFNL_SUBSYS_CTNETLINK);
- if (!nfnetlink_has_listeners(net, group))
- WRITE_ONCE(net->ct.ctnetlink_has_listener, false);
- nfnl_unlock(NFNL_SUBSYS_CTNETLINK);
+ type = nfnl_group2type[group];
+
+ switch (type) {
+ case NFNL_SUBSYS_CTNETLINK:
+ break;
+ case NFNL_SUBSYS_CTNETLINK_EXP:
+ break;
+ default:
+ return;
+ }
+
+ /* ctnetlink_has_listener is u8 */
+ if (group >= 8)
+ return;
+
+ group_bit = (1 << group);
+
+ spin_lock(&nfnl_grp_active_lock);
+ if (!nfnetlink_has_listeners(net, group)) {
+ u8 v = READ_ONCE(net->ct.ctnetlink_has_listener);
+
+ v &= ~group_bit;
+
+ /* read concurrently without nfnl_grp_active_lock held. */
+ WRITE_ONCE(net->ct.ctnetlink_has_listener, v);
}
+ spin_unlock(&nfnl_grp_active_lock);
#endif
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 189/365] netfilter: nf_tables: use READ_ONCE and WRITE_ONCE for shared generation id access
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (187 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 188/365] netfilter: nfnetlink: re-enable conntrack expectation events Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 190/365] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex() Greg Kroah-Hartman
` (180 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 3400278328285a8c2f121904496aff5e7b610a01 upstream.
The generation ID is bumped from the commit path while holding the
mutex, however, netlink dump operations rely on RCU.
This patch also adds missing cb->base_eq initialization in
nf_tables_dump_set().
Fixes: 38e029f14a97 ("netfilter: nf_tables: set NLM_F_DUMP_INTR if netlink dumping is stale")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -889,7 +889,7 @@ static int nf_tables_dump_tables(struct
rcu_read_lock();
nft_net = nft_pernet(net);
- cb->seq = nft_net->base_seq;
+ cb->seq = READ_ONCE(nft_net->base_seq);
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (family != NFPROTO_UNSPEC && family != table->family)
@@ -1705,7 +1705,7 @@ static int nf_tables_dump_chains(struct
rcu_read_lock();
nft_net = nft_pernet(net);
- cb->seq = nft_net->base_seq;
+ cb->seq = READ_ONCE(nft_net->base_seq);
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (family != NFPROTO_UNSPEC && family != table->family)
@@ -3149,7 +3149,7 @@ static int nf_tables_dump_rules(struct s
rcu_read_lock();
nft_net = nft_pernet(net);
- cb->seq = nft_net->base_seq;
+ cb->seq = READ_ONCE(nft_net->base_seq);
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (family != NFPROTO_UNSPEC && family != table->family)
@@ -4133,7 +4133,7 @@ static int nf_tables_dump_sets(struct sk
rcu_read_lock();
nft_net = nft_pernet(net);
- cb->seq = nft_net->base_seq;
+ cb->seq = READ_ONCE(nft_net->base_seq);
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (ctx->family != NFPROTO_UNSPEC &&
@@ -5061,6 +5061,8 @@ static int nf_tables_dump_set(struct sk_
rcu_read_lock();
nft_net = nft_pernet(net);
+ cb->seq = READ_ONCE(nft_net->base_seq);
+
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (dump_ctx->ctx.family != NFPROTO_UNSPEC &&
dump_ctx->ctx.family != table->family)
@@ -6887,7 +6889,7 @@ static int nf_tables_dump_obj(struct sk_
rcu_read_lock();
nft_net = nft_pernet(net);
- cb->seq = nft_net->base_seq;
+ cb->seq = READ_ONCE(nft_net->base_seq);
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (family != NFPROTO_UNSPEC && family != table->family)
@@ -7819,7 +7821,7 @@ static int nf_tables_dump_flowtable(stru
rcu_read_lock();
nft_net = nft_pernet(net);
- cb->seq = nft_net->base_seq;
+ cb->seq = READ_ONCE(nft_net->base_seq);
list_for_each_entry_rcu(table, &nft_net->tables, list) {
if (family != NFPROTO_UNSPEC && family != table->family)
@@ -8752,6 +8754,7 @@ static int nf_tables_commit(struct net *
struct nft_trans_elem *te;
struct nft_chain *chain;
struct nft_table *table;
+ unsigned int base_seq;
LIST_HEAD(adl);
int err;
@@ -8801,9 +8804,12 @@ static int nf_tables_commit(struct net *
* Bump generation counter, invalidate any dump in progress.
* Cannot fail after this point.
*/
- while (++nft_net->base_seq == 0)
+ base_seq = READ_ONCE(nft_net->base_seq);
+ while (++base_seq == 0)
;
+ WRITE_ONCE(nft_net->base_seq, base_seq);
+
/* step 3. Start new generation, rules_gen_X now in use. */
net->nft.gencursor = nft_gencursor_next(net);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 190/365] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (188 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 189/365] netfilter: nf_tables: use READ_ONCE and WRITE_ONCE for shared generation id access Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 191/365] netfilter: nf_tables: disallow NFTA_SET_ELEM_KEY_END with NFT_SET_ELEM_INTERVAL_END flag Greg Kroah-Hartman
` (179 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Konstantin Komarov
From: Dan Carpenter <dan.carpenter@oracle.com>
commit d4073595d0c61463ec3a87411b19e2a90f76d3f8 upstream.
The goto out calls kfree(value) on an uninitialized pointer. Just
return directly as the other error paths do.
Fixes: 460bbf2990b3 ("fs/ntfs3: Do not change mode if ntfs_set_ea failed")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/xattr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -563,7 +563,7 @@ static noinline int ntfs_set_acl_ex(stru
err = posix_acl_update_mode(mnt_userns, inode, &mode,
&acl);
if (err)
- goto out;
+ return err;
}
name = XATTR_NAME_POSIX_ACL_ACCESS;
name_len = sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 191/365] netfilter: nf_tables: disallow NFTA_SET_ELEM_KEY_END with NFT_SET_ELEM_INTERVAL_END flag
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (189 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 190/365] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex() Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 192/365] netfilter: nf_ct_sane: remove pseudo skb linearization Greg Kroah-Hartman
` (178 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 4963674c2e71fc062f8f089f0f58ffbb5533060b upstream.
These are mutually exclusive, actually NFTA_SET_ELEM_KEY_END replaces
the flag notation.
Fixes: 7b225d0b5c6d ("netfilter: nf_tables: add NFTA_SET_ELEM_KEY_END attribute")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5855,6 +5855,7 @@ static int nft_add_set_elem(struct nft_c
nla[NFTA_SET_ELEM_EXPIRATION] ||
nla[NFTA_SET_ELEM_USERDATA] ||
nla[NFTA_SET_ELEM_EXPR] ||
+ nla[NFTA_SET_ELEM_KEY_END] ||
nla[NFTA_SET_ELEM_EXPRESSIONS]))
return -EINVAL;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 192/365] netfilter: nf_ct_sane: remove pseudo skb linearization
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (190 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 191/365] netfilter: nf_tables: disallow NFTA_SET_ELEM_KEY_END with NFT_SET_ELEM_INTERVAL_END flag Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 193/365] netfilter: nf_ct_h323: cap packet size at 64k Greg Kroah-Hartman
` (177 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Florian Westphal, Pablo Neira Ayuso
From: Florian Westphal <fw@strlen.de>
commit a664375da76c6da8f83dc7997e43c568e1eb9a6a upstream.
For historical reason this code performs pseudo linearization of skbs
via skb_header_pointer and a global 64k buffer.
With arrival of BIG TCP, packets generated by TCP stack can exceed 64kb.
Rewrite this to only extract the needed header data. This also allows
to get rid of the locking.
Fixes: 7c4e983c4f3c ("net: allow gso_max_size to exceed 65536")
Fixes: 0fe79f28bfaf ("net: allow gro_max_size to exceed 65536")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_conntrack_sane.c | 68 ++++++++++++++++----------------------
1 file changed, 30 insertions(+), 38 deletions(-)
--- a/net/netfilter/nf_conntrack_sane.c
+++ b/net/netfilter/nf_conntrack_sane.c
@@ -34,10 +34,6 @@ MODULE_AUTHOR("Michal Schmidt <mschmidt@
MODULE_DESCRIPTION("SANE connection tracking helper");
MODULE_ALIAS_NFCT_HELPER(HELPER_NAME);
-static char *sane_buffer;
-
-static DEFINE_SPINLOCK(nf_sane_lock);
-
#define MAX_PORTS 8
static u_int16_t ports[MAX_PORTS];
static unsigned int ports_c;
@@ -67,14 +63,16 @@ static int help(struct sk_buff *skb,
unsigned int dataoff, datalen;
const struct tcphdr *th;
struct tcphdr _tcph;
- void *sb_ptr;
int ret = NF_ACCEPT;
int dir = CTINFO2DIR(ctinfo);
struct nf_ct_sane_master *ct_sane_info = nfct_help_data(ct);
struct nf_conntrack_expect *exp;
struct nf_conntrack_tuple *tuple;
- struct sane_request *req;
struct sane_reply_net_start *reply;
+ union {
+ struct sane_request req;
+ struct sane_reply_net_start repl;
+ } buf;
/* Until there's been traffic both ways, don't look in packets. */
if (ctinfo != IP_CT_ESTABLISHED &&
@@ -92,59 +90,62 @@ static int help(struct sk_buff *skb,
return NF_ACCEPT;
datalen = skb->len - dataoff;
-
- spin_lock_bh(&nf_sane_lock);
- sb_ptr = skb_header_pointer(skb, dataoff, datalen, sane_buffer);
- if (!sb_ptr) {
- spin_unlock_bh(&nf_sane_lock);
- return NF_ACCEPT;
- }
-
if (dir == IP_CT_DIR_ORIGINAL) {
+ const struct sane_request *req;
+
if (datalen != sizeof(struct sane_request))
- goto out;
+ return NF_ACCEPT;
+
+ req = skb_header_pointer(skb, dataoff, datalen, &buf.req);
+ if (!req)
+ return NF_ACCEPT;
- req = sb_ptr;
if (req->RPC_code != htonl(SANE_NET_START)) {
/* Not an interesting command */
- ct_sane_info->state = SANE_STATE_NORMAL;
- goto out;
+ WRITE_ONCE(ct_sane_info->state, SANE_STATE_NORMAL);
+ return NF_ACCEPT;
}
/* We're interested in the next reply */
- ct_sane_info->state = SANE_STATE_START_REQUESTED;
- goto out;
+ WRITE_ONCE(ct_sane_info->state, SANE_STATE_START_REQUESTED);
+ return NF_ACCEPT;
}
+ /* IP_CT_DIR_REPLY */
+
/* Is it a reply to an uninteresting command? */
- if (ct_sane_info->state != SANE_STATE_START_REQUESTED)
- goto out;
+ if (READ_ONCE(ct_sane_info->state) != SANE_STATE_START_REQUESTED)
+ return NF_ACCEPT;
/* It's a reply to SANE_NET_START. */
- ct_sane_info->state = SANE_STATE_NORMAL;
+ WRITE_ONCE(ct_sane_info->state, SANE_STATE_NORMAL);
if (datalen < sizeof(struct sane_reply_net_start)) {
pr_debug("NET_START reply too short\n");
- goto out;
+ return NF_ACCEPT;
}
- reply = sb_ptr;
+ datalen = sizeof(struct sane_reply_net_start);
+
+ reply = skb_header_pointer(skb, dataoff, datalen, &buf.repl);
+ if (!reply)
+ return NF_ACCEPT;
+
if (reply->status != htonl(SANE_STATUS_SUCCESS)) {
/* saned refused the command */
pr_debug("unsuccessful SANE_STATUS = %u\n",
ntohl(reply->status));
- goto out;
+ return NF_ACCEPT;
}
/* Invalid saned reply? Ignore it. */
if (reply->zero != 0)
- goto out;
+ return NF_ACCEPT;
exp = nf_ct_expect_alloc(ct);
if (exp == NULL) {
nf_ct_helper_log(skb, ct, "cannot alloc expectation");
- ret = NF_DROP;
- goto out;
+ return NF_DROP;
}
tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
@@ -162,9 +163,6 @@ static int help(struct sk_buff *skb,
}
nf_ct_expect_put(exp);
-
-out:
- spin_unlock_bh(&nf_sane_lock);
return ret;
}
@@ -178,7 +176,6 @@ static const struct nf_conntrack_expect_
static void __exit nf_conntrack_sane_fini(void)
{
nf_conntrack_helpers_unregister(sane, ports_c * 2);
- kfree(sane_buffer);
}
static int __init nf_conntrack_sane_init(void)
@@ -187,10 +184,6 @@ static int __init nf_conntrack_sane_init
NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nf_ct_sane_master));
- sane_buffer = kmalloc(65536, GFP_KERNEL);
- if (!sane_buffer)
- return -ENOMEM;
-
if (ports_c == 0)
ports[ports_c++] = SANE_PORT;
@@ -210,7 +203,6 @@ static int __init nf_conntrack_sane_init
ret = nf_conntrack_helpers_register(sane, ports_c * 2);
if (ret < 0) {
pr_err("failed to register helpers\n");
- kfree(sane_buffer);
return ret;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 193/365] netfilter: nf_ct_h323: cap packet size at 64k
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (191 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 192/365] netfilter: nf_ct_sane: remove pseudo skb linearization Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 194/365] netfilter: nf_ct_ftp: prefer skb_linearize Greg Kroah-Hartman
` (176 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Florian Westphal, Pablo Neira Ayuso
From: Florian Westphal <fw@strlen.de>
commit f3e124c36f70d5ffcdd4e8bdbe7bb28a98a715c0 upstream.
With BIG TCP, packets generated by tcp stack may exceed 64kb.
Cap datalen at 64kb. The internal message format uses 16bit fields,
so no embedded message can exceed 64k size.
Multiple h323 messages in a single superpacket may now result
in a message to get treated as incomplete/truncated, but thats
better than scribbling past h323_buffer.
Another alternative suitable for net tree would be a switch to
skb_linearize().
Fixes: 7c4e983c4f3c ("net: allow gso_max_size to exceed 65536")
Fixes: 0fe79f28bfaf ("net: allow gro_max_size to exceed 65536")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_conntrack_h323_main.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -34,6 +34,8 @@
#include <net/netfilter/nf_conntrack_zones.h>
#include <linux/netfilter/nf_conntrack_h323.h>
+#define H323_MAX_SIZE 65535
+
/* Parameters */
static unsigned int default_rrq_ttl __read_mostly = 300;
module_param(default_rrq_ttl, uint, 0600);
@@ -142,6 +144,9 @@ static int get_tpkt_data(struct sk_buff
if (tcpdatalen <= 0) /* No TCP data */
goto clear_out;
+ if (tcpdatalen > H323_MAX_SIZE)
+ tcpdatalen = H323_MAX_SIZE;
+
if (*data == NULL) { /* first TPKT */
/* Get first TPKT pointer */
tpkt = skb_header_pointer(skb, tcpdataoff, tcpdatalen,
@@ -1220,6 +1225,9 @@ static unsigned char *get_udp_data(struc
if (dataoff >= skb->len)
return NULL;
*datalen = skb->len - dataoff;
+ if (*datalen > H323_MAX_SIZE)
+ *datalen = H323_MAX_SIZE;
+
return skb_header_pointer(skb, dataoff, *datalen, h323_buffer);
}
@@ -1821,7 +1829,7 @@ static int __init nf_conntrack_h323_init
NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nf_ct_h323_master));
- h323_buffer = kmalloc(65536, GFP_KERNEL);
+ h323_buffer = kmalloc(H323_MAX_SIZE + 1, GFP_KERNEL);
if (!h323_buffer)
return -ENOMEM;
ret = h323_helper_init();
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 194/365] netfilter: nf_ct_ftp: prefer skb_linearize
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (192 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 193/365] netfilter: nf_ct_h323: cap packet size at 64k Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 195/365] netfilter: nf_ct_irc: cap packet search space to 4k Greg Kroah-Hartman
` (175 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Florian Westphal, Pablo Neira Ayuso
From: Florian Westphal <fw@strlen.de>
commit c783a29c7e5934eabac2b760571489ad83bf4fd1 upstream.
This uses a pseudo-linearization scheme with a 64k global buffer,
but BIG TCP arrival means IPv6 TCP stack can generate skbs
that exceed this size.
Use skb_linearize. It should be possible to rewrite this to properly
deal with segmented skbs (i.e., only do small chunk-wise accesses),
but this is going to be a lot more intrusive than this because every
helper function needs to get the sk_buff instead of a pointer to a raw
data buffer.
In practice, provided we're really looking at FTP control channel packets,
there should never be a case where we deal with huge packets.
Fixes: 7c4e983c4f3c ("net: allow gso_max_size to exceed 65536")
Fixes: 0fe79f28bfaf ("net: allow gro_max_size to exceed 65536")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_conntrack_ftp.c | 24 ++++++------------------
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c
index a414274338cf..0d9332e9cf71 100644
--- a/net/netfilter/nf_conntrack_ftp.c
+++ b/net/netfilter/nf_conntrack_ftp.c
@@ -34,11 +34,6 @@ MODULE_DESCRIPTION("ftp connection tracking helper");
MODULE_ALIAS("ip_conntrack_ftp");
MODULE_ALIAS_NFCT_HELPER(HELPER_NAME);
-/* This is slow, but it's simple. --RR */
-static char *ftp_buffer;
-
-static DEFINE_SPINLOCK(nf_ftp_lock);
-
#define MAX_PORTS 8
static u_int16_t ports[MAX_PORTS];
static unsigned int ports_c;
@@ -398,6 +393,9 @@ static int help(struct sk_buff *skb,
return NF_ACCEPT;
}
+ if (unlikely(skb_linearize(skb)))
+ return NF_DROP;
+
th = skb_header_pointer(skb, protoff, sizeof(_tcph), &_tcph);
if (th == NULL)
return NF_ACCEPT;
@@ -411,12 +409,8 @@ static int help(struct sk_buff *skb,
}
datalen = skb->len - dataoff;
- spin_lock_bh(&nf_ftp_lock);
- fb_ptr = skb_header_pointer(skb, dataoff, datalen, ftp_buffer);
- if (!fb_ptr) {
- spin_unlock_bh(&nf_ftp_lock);
- return NF_ACCEPT;
- }
+ spin_lock_bh(&ct->lock);
+ fb_ptr = skb->data + dataoff;
ends_in_nl = (fb_ptr[datalen - 1] == '\n');
seq = ntohl(th->seq) + datalen;
@@ -544,7 +538,7 @@ static int help(struct sk_buff *skb,
if (ends_in_nl)
update_nl_seq(ct, seq, ct_ftp_info, dir, skb);
out:
- spin_unlock_bh(&nf_ftp_lock);
+ spin_unlock_bh(&ct->lock);
return ret;
}
@@ -571,7 +565,6 @@ static const struct nf_conntrack_expect_policy ftp_exp_policy = {
static void __exit nf_conntrack_ftp_fini(void)
{
nf_conntrack_helpers_unregister(ftp, ports_c * 2);
- kfree(ftp_buffer);
}
static int __init nf_conntrack_ftp_init(void)
@@ -580,10 +573,6 @@ static int __init nf_conntrack_ftp_init(void)
NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nf_ct_ftp_master));
- ftp_buffer = kmalloc(65536, GFP_KERNEL);
- if (!ftp_buffer)
- return -ENOMEM;
-
if (ports_c == 0)
ports[ports_c++] = FTP_PORT;
@@ -603,7 +592,6 @@ static int __init nf_conntrack_ftp_init(void)
ret = nf_conntrack_helpers_register(ftp, ports_c * 2);
if (ret < 0) {
pr_err("failed to register helpers\n");
- kfree(ftp_buffer);
return ret;
}
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 195/365] netfilter: nf_ct_irc: cap packet search space to 4k
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (193 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 194/365] netfilter: nf_ct_ftp: prefer skb_linearize Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 196/365] netfilter: nf_tables: possible module reference underflow in error path Greg Kroah-Hartman
` (174 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Florian Westphal, Pablo Neira Ayuso
From: Florian Westphal <fw@strlen.de>
commit 976bf59c69cd2e2c17f0ab20a14c0e700cba0f15 upstream.
This uses a pseudo-linearization scheme with a 64k global buffer,
but BIG TCP arrival means IPv6 TCP stack can generate skbs
that exceed this size.
In practice, IRC commands are not expected to exceed 512 bytes, plus
this is interactive protocol, so we should not see large packets
in practice.
Given most IRC connections nowadays use TLS so this helper could also be
removed in the near future.
Fixes: 7c4e983c4f3c ("net: allow gso_max_size to exceed 65536")
Fixes: 0fe79f28bfaf ("net: allow gro_max_size to exceed 65536")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_conntrack_irc.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
index 08ee4e760a3d..1796c456ac98 100644
--- a/net/netfilter/nf_conntrack_irc.c
+++ b/net/netfilter/nf_conntrack_irc.c
@@ -39,6 +39,7 @@ unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
EXPORT_SYMBOL_GPL(nf_nat_irc_hook);
#define HELPER_NAME "irc"
+#define MAX_SEARCH_SIZE 4095
MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
MODULE_DESCRIPTION("IRC (DCC) connection tracking helper");
@@ -121,6 +122,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,
int i, ret = NF_ACCEPT;
char *addr_beg_p, *addr_end_p;
typeof(nf_nat_irc_hook) nf_nat_irc;
+ unsigned int datalen;
/* If packet is coming from IRC server */
if (dir == IP_CT_DIR_REPLY)
@@ -140,8 +142,12 @@ static int help(struct sk_buff *skb, unsigned int protoff,
if (dataoff >= skb->len)
return NF_ACCEPT;
+ datalen = skb->len - dataoff;
+ if (datalen > MAX_SEARCH_SIZE)
+ datalen = MAX_SEARCH_SIZE;
+
spin_lock_bh(&irc_buffer_lock);
- ib_ptr = skb_header_pointer(skb, dataoff, skb->len - dataoff,
+ ib_ptr = skb_header_pointer(skb, dataoff, datalen,
irc_buffer);
if (!ib_ptr) {
spin_unlock_bh(&irc_buffer_lock);
@@ -149,7 +155,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,
}
data = ib_ptr;
- data_limit = ib_ptr + skb->len - dataoff;
+ data_limit = ib_ptr + datalen;
/* strlen("\1DCC SENT t AAAAAAAA P\1\n")=24
* 5+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=14 */
@@ -251,7 +257,7 @@ static int __init nf_conntrack_irc_init(void)
irc_exp_policy.max_expected = max_dcc_channels;
irc_exp_policy.timeout = dcc_timeout;
- irc_buffer = kmalloc(65536, GFP_KERNEL);
+ irc_buffer = kmalloc(MAX_SEARCH_SIZE + 1, GFP_KERNEL);
if (!irc_buffer)
return -ENOMEM;
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 196/365] netfilter: nf_tables: possible module reference underflow in error path
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (194 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 195/365] netfilter: nf_ct_irc: cap packet search space to 4k Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 197/365] netfilter: nf_tables: really skip inactive sets when allocating name Greg Kroah-Hartman
` (173 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit c485c35ff6783ccd12c160fcac6a0e504e83e0bf upstream.
dst->ops is set on when nft_expr_clone() fails, but module refcount has
not been bumped yet, therefore nft_expr_destroy() leads to module
reference underflow.
Fixes: 8cfd9b0f8515 ("netfilter: nftables: generalize set expressions support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5566,7 +5566,7 @@ int nft_set_elem_expr_clone(const struct
err = nft_expr_clone(expr, set->exprs[i]);
if (err < 0) {
- nft_expr_destroy(ctx, expr);
+ kfree(expr);
goto err_expr;
}
expr_array[i] = expr;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 197/365] netfilter: nf_tables: really skip inactive sets when allocating name
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (195 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 196/365] netfilter: nf_tables: possible module reference underflow in error path Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 198/365] netfilter: nf_tables: fix scheduling-while-atomic splat Greg Kroah-Hartman
` (172 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 271c5ca826e0c3c53e0eb4032f8eaedea1ee391c upstream.
While looping to build the bitmap of used anonymous set names, check the
current set in the iteration, instead of the one that is being created.
Fixes: 37a9cc525525 ("netfilter: nf_tables: add generation mask to sets")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3907,7 +3907,7 @@ cont:
list_for_each_entry(i, &ctx->table->sets, list) {
int tmp;
- if (!nft_is_active_next(ctx->net, set))
+ if (!nft_is_active_next(ctx->net, i))
continue;
if (!sscanf(i->name, name, &tmp))
continue;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 198/365] netfilter: nf_tables: fix scheduling-while-atomic splat
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (196 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 197/365] netfilter: nf_tables: really skip inactive sets when allocating name Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 199/365] netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag Greg Kroah-Hartman
` (171 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Florian Westphal, Pablo Neira Ayuso
From: Florian Westphal <fw@strlen.de>
commit 2024439bd5ceb145eeeb428b2a59e9b905153ac3 upstream.
nf_tables_check_loops() can be called from rhashtable list
walk so cond_resched() cannot be used here.
Fixes: 81ea01066741 ("netfilter: nf_tables: add rescheduling points during loop detection walks")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 4 ----
1 file changed, 4 deletions(-)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -9372,13 +9372,9 @@ static int nf_tables_check_loops(const s
break;
}
}
-
- cond_resched();
}
list_for_each_entry(set, &ctx->table->sets, list) {
- cond_resched();
-
if (!nft_is_active_next(ctx->net, set))
continue;
if (!(set->flags & NFT_SET_MAP) ||
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 199/365] netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (197 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 198/365] netfilter: nf_tables: fix scheduling-while-atomic splat Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 200/365] netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags Greg Kroah-Hartman
` (170 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 5a2f3dc31811e93be15522d9eb13ed61460b76c8 upstream.
If the NFTA_SET_ELEM_OBJREF netlink attribute is present and
NFT_SET_OBJECT flag is set on, report EINVAL.
Move existing sanity check earlier to validate that NFT_SET_OBJECT
requires NFTA_SET_ELEM_OBJREF.
Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5848,6 +5848,15 @@ static int nft_add_set_elem(struct nft_c
return -EINVAL;
}
+ if (set->flags & NFT_SET_OBJECT) {
+ if (!nla[NFTA_SET_ELEM_OBJREF] &&
+ !(flags & NFT_SET_ELEM_INTERVAL_END))
+ return -EINVAL;
+ } else {
+ if (nla[NFTA_SET_ELEM_OBJREF])
+ return -EINVAL;
+ }
+
if ((flags & NFT_SET_ELEM_INTERVAL_END) &&
(nla[NFTA_SET_ELEM_DATA] ||
nla[NFTA_SET_ELEM_OBJREF] ||
@@ -5986,10 +5995,6 @@ static int nft_add_set_elem(struct nft_c
}
if (nla[NFTA_SET_ELEM_OBJREF] != NULL) {
- if (!(set->flags & NFT_SET_OBJECT)) {
- err = -EINVAL;
- goto err_parse_key_end;
- }
obj = nft_obj_lookup(ctx->net, ctx->table,
nla[NFTA_SET_ELEM_OBJREF],
set->objtype, genmask);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 200/365] netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (198 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 199/365] netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 201/365] netfilter: nf_tables: disallow NFT_SET_ELEM_CATCHALL and NFT_SET_ELEM_INTERVAL_END Greg Kroah-Hartman
` (169 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 88cccd908d51397f9754f89a937cd13fa59dee37 upstream.
If the NFT_SET_CONCAT|NFT_SET_INTERVAL flags are set on, then the
netlink attribute NFTA_SET_ELEM_KEY_END must be specified. Otherwise,
NFTA_SET_ELEM_KEY_END should not be present.
For catch-all element, NFTA_SET_ELEM_KEY_END should not be present.
The NFT_SET_ELEM_INTERVAL_END is never used with this set flags
combination.
Fixes: 7b225d0b5c6d ("netfilter: nf_tables: add NFTA_SET_ELEM_KEY_END attribute")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5798,6 +5798,24 @@ static void nft_setelem_remove(const str
set->ops->remove(net, set, elem);
}
+static bool nft_setelem_valid_key_end(const struct nft_set *set,
+ struct nlattr **nla, u32 flags)
+{
+ if ((set->flags & (NFT_SET_CONCAT | NFT_SET_INTERVAL)) ==
+ (NFT_SET_CONCAT | NFT_SET_INTERVAL)) {
+ if (flags & NFT_SET_ELEM_INTERVAL_END)
+ return false;
+ if (!nla[NFTA_SET_ELEM_KEY_END] &&
+ !(flags & NFT_SET_ELEM_CATCHALL))
+ return false;
+ } else {
+ if (nla[NFTA_SET_ELEM_KEY_END])
+ return false;
+ }
+
+ return true;
+}
+
static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
const struct nlattr *attr, u32 nlmsg_flags)
{
@@ -5857,6 +5875,9 @@ static int nft_add_set_elem(struct nft_c
return -EINVAL;
}
+ if (!nft_setelem_valid_key_end(set, nla, flags))
+ return -EINVAL;
+
if ((flags & NFT_SET_ELEM_INTERVAL_END) &&
(nla[NFTA_SET_ELEM_DATA] ||
nla[NFTA_SET_ELEM_OBJREF] ||
@@ -6281,6 +6302,9 @@ static int nft_del_setelem(struct nft_ct
if (!nla[NFTA_SET_ELEM_KEY] && !(flags & NFT_SET_ELEM_CATCHALL))
return -EINVAL;
+ if (!nft_setelem_valid_key_end(set, nla, flags))
+ return -EINVAL;
+
nft_set_ext_prepare(&tmpl);
if (flags != 0) {
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 201/365] netfilter: nf_tables: disallow NFT_SET_ELEM_CATCHALL and NFT_SET_ELEM_INTERVAL_END
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (199 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 200/365] netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 202/365] netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified Greg Kroah-Hartman
` (168 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit fc0ae524b5fd2938c94d56da3f749f11eb3273d5 upstream.
These flags are mutually exclusive, report EINVAL in this case.
Fixes: aaa31047a6d2 ("netfilter: nftables: add catch-all set element support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5198,6 +5198,9 @@ static int nft_setelem_parse_flags(const
if (!(set->flags & NFT_SET_INTERVAL) &&
*flags & NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
+ if ((*flags & (NFT_SET_ELEM_INTERVAL_END | NFT_SET_ELEM_CATCHALL)) ==
+ (NFT_SET_ELEM_INTERVAL_END | NFT_SET_ELEM_CATCHALL))
+ return -EINVAL;
return 0;
}
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 202/365] netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (200 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 201/365] netfilter: nf_tables: disallow NFT_SET_ELEM_CATCHALL and NFT_SET_ELEM_INTERVAL_END Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 203/365] powerpc/pci: Fix get_phb_number() locking Greg Kroah-Hartman
` (167 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit 1b6345d4160ecd3d04bd8cd75df90c67811e8cc9 upstream.
Since f3a2181e16f1 ("netfilter: nf_tables: Support for sets with
multiple ranged fields"), it possible to combine intervals and
concatenations. Later on, ef516e8625dd ("netfilter: nf_tables:
reintroduce the NFT_SET_CONCAT flag") provides the NFT_SET_CONCAT flag
for userspace to report that the set stores a concatenation.
Make sure NFT_SET_CONCAT is set on if field_count is specified for
consistency. Otherwise, if NFT_SET_CONCAT is specified with no
field_count, bail out with EINVAL.
Fixes: ef516e8625dd ("netfilter: nf_tables: reintroduce the NFT_SET_CONCAT flag")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_tables_api.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -4451,6 +4451,11 @@ static int nf_tables_newset(struct sk_bu
err = nf_tables_set_desc_parse(&desc, nla[NFTA_SET_DESC]);
if (err < 0)
return err;
+
+ if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT))
+ return -EINVAL;
+ } else if (flags & NFT_SET_CONCAT) {
+ return -EINVAL;
}
if (nla[NFTA_SET_EXPR] || nla[NFTA_SET_EXPRESSIONS])
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 203/365] powerpc/pci: Fix get_phb_number() locking
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (201 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 202/365] netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 204/365] spi: meson-spicc: add local pow2 clock ops to preserve rate between messages Greg Kroah-Hartman
` (166 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Guenter Roeck, Michael Ellerman
From: Michael Ellerman <mpe@ellerman.id.au>
commit 8d48562a2729742f767b0fdd994d6b2a56a49c63 upstream.
The recent change to get_phb_number() causes a DEBUG_ATOMIC_SLEEP
warning on some systems:
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
1 lock held by swapper/1:
#0: c157efb0 (hose_spinlock){+.+.}-{2:2}, at: pcibios_alloc_controller+0x64/0x220
Preemption disabled at:
[<00000000>] 0x0
CPU: 0 PID: 1 Comm: swapper Not tainted 5.19.0-yocto-standard+ #1
Call Trace:
[d101dc90] [c073b264] dump_stack_lvl+0x50/0x8c (unreliable)
[d101dcb0] [c0093b70] __might_resched+0x258/0x2a8
[d101dcd0] [c0d3e634] __mutex_lock+0x6c/0x6ec
[d101dd50] [c0a84174] of_alias_get_id+0x50/0xf4
[d101dd80] [c002ec78] pcibios_alloc_controller+0x1b8/0x220
[d101ddd0] [c140c9dc] pmac_pci_init+0x198/0x784
[d101de50] [c140852c] discover_phbs+0x30/0x4c
[d101de60] [c0007fd4] do_one_initcall+0x94/0x344
[d101ded0] [c1403b40] kernel_init_freeable+0x1a8/0x22c
[d101df10] [c00086e0] kernel_init+0x34/0x160
[d101df30] [c001b334] ret_from_kernel_thread+0x5c/0x64
This is because pcibios_alloc_controller() holds hose_spinlock but
of_alias_get_id() takes of_mutex which can sleep.
The hose_spinlock protects the phb_bitmap, and also the hose_list, but
it doesn't need to be held while get_phb_number() calls the OF routines,
because those are only looking up information in the device tree.
So fix it by having get_phb_number() take the hose_spinlock itself, only
where required, and then dropping the lock before returning.
pcibios_alloc_controller() then needs to take the lock again before the
list_add() but that's safe, the order of the list is not important.
Fixes: 0fe1e96fef0a ("powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220815065550.1303620-1-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/kernel/pci-common.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -67,10 +67,6 @@ void __init set_pci_dma_ops(const struct
pci_dma_ops = dma_ops;
}
-/*
- * This function should run under locking protection, specifically
- * hose_spinlock.
- */
static int get_phb_number(struct device_node *dn)
{
int ret, phb_id = -1;
@@ -107,15 +103,20 @@ static int get_phb_number(struct device_
if (!ret)
phb_id = (int)(prop & (MAX_PHBS - 1));
+ spin_lock(&hose_spinlock);
+
/* We need to be sure to not use the same PHB number twice. */
if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap))
- return phb_id;
+ goto out_unlock;
/* If everything fails then fallback to dynamic PHB numbering. */
phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS);
BUG_ON(phb_id >= MAX_PHBS);
set_bit(phb_id, phb_bitmap);
+out_unlock:
+ spin_unlock(&hose_spinlock);
+
return phb_id;
}
@@ -126,10 +127,13 @@ struct pci_controller *pcibios_alloc_con
phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
if (phb == NULL)
return NULL;
- spin_lock(&hose_spinlock);
+
phb->global_number = get_phb_number(dev);
+
+ spin_lock(&hose_spinlock);
list_add_tail(&phb->list_node, &hose_list);
spin_unlock(&hose_spinlock);
+
phb->dn = dev;
phb->is_dynamic = slab_is_available();
#ifdef CONFIG_PPC64
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 204/365] spi: meson-spicc: add local pow2 clock ops to preserve rate between messages
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (202 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 203/365] powerpc/pci: Fix get_phb_number() locking Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 205/365] net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() Greg Kroah-Hartman
` (165 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Da Xue, Neil Armstrong, Mark Brown
From: Neil Armstrong <narmstrong@baylibre.com>
commit 09992025dacd258c823f50e82db09d7ef06cdac4 upstream.
At the end of a message, the HW gets a reset in meson_spicc_unprepare_transfer(),
this resets the SPICC_CONREG register and notably the value set by the
Common Clock Framework.
This is problematic because:
- the register value CCF can be different from the corresponding CCF cached rate
- CCF is allowed to change the clock rate whenever the HW state
This introduces:
- local pow2 clock ops checking the HW state before allowing a clock operation
- separation of legacy pow2 clock patch and new enhanced clock path
- SPICC_CONREG datarate value is now value kepts across messages
It has been checked that:
- SPICC_CONREG datarate value is kept across messages
- CCF is only allowed to change the SPICC_CONREG datarate value when busy
- SPICC_CONREG datarate value is correct for each transfer
This didn't appear before commit 3e0cf4d3fc29 ("spi: meson-spicc: add a linear clock divider support")
because we recalculated and wrote the rate for each xfer.
Fixes: 3e0cf4d3fc29 ("spi: meson-spicc: add a linear clock divider support")
Reported-by: Da Xue <da@libre.computer>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220811134445.678446-1-narmstrong@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi-meson-spicc.c | 129 ++++++++++++++++++++++++++++++++----------
1 file changed, 101 insertions(+), 28 deletions(-)
--- a/drivers/spi/spi-meson-spicc.c
+++ b/drivers/spi/spi-meson-spicc.c
@@ -156,6 +156,7 @@ struct meson_spicc_device {
void __iomem *base;
struct clk *core;
struct clk *pclk;
+ struct clk_divider pow2_div;
struct clk *clk;
struct spi_message *message;
struct spi_transfer *xfer;
@@ -168,6 +169,8 @@ struct meson_spicc_device {
unsigned long xfer_remain;
};
+#define pow2_clk_to_spicc(_div) container_of(_div, struct meson_spicc_device, pow2_div)
+
static void meson_spicc_oen_enable(struct meson_spicc_device *spicc)
{
u32 conf;
@@ -421,7 +424,7 @@ static int meson_spicc_prepare_message(s
{
struct meson_spicc_device *spicc = spi_master_get_devdata(master);
struct spi_device *spi = message->spi;
- u32 conf = 0;
+ u32 conf = readl_relaxed(spicc->base + SPICC_CONREG) & SPICC_DATARATE_MASK;
/* Store current message */
spicc->message = message;
@@ -458,8 +461,6 @@ static int meson_spicc_prepare_message(s
/* Select CS */
conf |= FIELD_PREP(SPICC_CS_MASK, spi->chip_select);
- /* Default Clock rate core/4 */
-
/* Default 8bit word */
conf |= FIELD_PREP(SPICC_BITLENGTH_MASK, 8 - 1);
@@ -476,12 +477,16 @@ static int meson_spicc_prepare_message(s
static int meson_spicc_unprepare_transfer(struct spi_master *master)
{
struct meson_spicc_device *spicc = spi_master_get_devdata(master);
+ u32 conf = readl_relaxed(spicc->base + SPICC_CONREG) & SPICC_DATARATE_MASK;
/* Disable all IRQs */
writel(0, spicc->base + SPICC_INTREG);
device_reset_optional(&spicc->pdev->dev);
+ /* Set default configuration, keeping datarate field */
+ writel_relaxed(conf, spicc->base + SPICC_CONREG);
+
return 0;
}
@@ -518,14 +523,60 @@ static void meson_spicc_cleanup(struct s
* Clk path for G12A series:
* pclk -> pow2 fixed div -> pow2 div -> mux -> out
* pclk -> enh fixed div -> enh div -> mux -> out
+ *
+ * The pow2 divider is tied to the controller HW state, and the
+ * divider is only valid when the controller is initialized.
+ *
+ * A set of clock ops is added to make sure we don't read/set this
+ * clock rate while the controller is in an unknown state.
*/
-static int meson_spicc_clk_init(struct meson_spicc_device *spicc)
+static unsigned long meson_spicc_pow2_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct clk_divider *divider = to_clk_divider(hw);
+ struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
+
+ if (!spicc->master->cur_msg || !spicc->master->busy)
+ return 0;
+
+ return clk_divider_ops.recalc_rate(hw, parent_rate);
+}
+
+static int meson_spicc_pow2_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
+{
+ struct clk_divider *divider = to_clk_divider(hw);
+ struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
+
+ if (!spicc->master->cur_msg || !spicc->master->busy)
+ return -EINVAL;
+
+ return clk_divider_ops.determine_rate(hw, req);
+}
+
+static int meson_spicc_pow2_set_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct clk_divider *divider = to_clk_divider(hw);
+ struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
+
+ if (!spicc->master->cur_msg || !spicc->master->busy)
+ return -EINVAL;
+
+ return clk_divider_ops.set_rate(hw, rate, parent_rate);
+}
+
+const struct clk_ops meson_spicc_pow2_clk_ops = {
+ .recalc_rate = meson_spicc_pow2_recalc_rate,
+ .determine_rate = meson_spicc_pow2_determine_rate,
+ .set_rate = meson_spicc_pow2_set_rate,
+};
+
+static int meson_spicc_pow2_clk_init(struct meson_spicc_device *spicc)
{
struct device *dev = &spicc->pdev->dev;
- struct clk_fixed_factor *pow2_fixed_div, *enh_fixed_div;
- struct clk_divider *pow2_div, *enh_div;
- struct clk_mux *mux;
+ struct clk_fixed_factor *pow2_fixed_div;
struct clk_init_data init;
struct clk *clk;
struct clk_parent_data parent_data[2];
@@ -560,31 +611,45 @@ static int meson_spicc_clk_init(struct m
if (WARN_ON(IS_ERR(clk)))
return PTR_ERR(clk);
- pow2_div = devm_kzalloc(dev, sizeof(*pow2_div), GFP_KERNEL);
- if (!pow2_div)
- return -ENOMEM;
-
snprintf(name, sizeof(name), "%s#pow2_div", dev_name(dev));
init.name = name;
- init.ops = &clk_divider_ops;
- init.flags = CLK_SET_RATE_PARENT;
+ init.ops = &meson_spicc_pow2_clk_ops;
+ /*
+ * Set NOCACHE here to make sure we read the actual HW value
+ * since we reset the HW after each transfer.
+ */
+ init.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE;
parent_data[0].hw = &pow2_fixed_div->hw;
init.num_parents = 1;
- pow2_div->shift = 16,
- pow2_div->width = 3,
- pow2_div->flags = CLK_DIVIDER_POWER_OF_TWO,
- pow2_div->reg = spicc->base + SPICC_CONREG;
- pow2_div->hw.init = &init;
+ spicc->pow2_div.shift = 16,
+ spicc->pow2_div.width = 3,
+ spicc->pow2_div.flags = CLK_DIVIDER_POWER_OF_TWO,
+ spicc->pow2_div.reg = spicc->base + SPICC_CONREG;
+ spicc->pow2_div.hw.init = &init;
- clk = devm_clk_register(dev, &pow2_div->hw);
- if (WARN_ON(IS_ERR(clk)))
- return PTR_ERR(clk);
+ spicc->clk = devm_clk_register(dev, &spicc->pow2_div.hw);
+ if (WARN_ON(IS_ERR(spicc->clk)))
+ return PTR_ERR(spicc->clk);
- if (!spicc->data->has_enhance_clk_div) {
- spicc->clk = clk;
- return 0;
- }
+ return 0;
+}
+
+static int meson_spicc_enh_clk_init(struct meson_spicc_device *spicc)
+{
+ struct device *dev = &spicc->pdev->dev;
+ struct clk_fixed_factor *enh_fixed_div;
+ struct clk_divider *enh_div;
+ struct clk_mux *mux;
+ struct clk_init_data init;
+ struct clk *clk;
+ struct clk_parent_data parent_data[2];
+ char name[64];
+
+ memset(&init, 0, sizeof(init));
+ memset(&parent_data, 0, sizeof(parent_data));
+
+ init.parent_data = parent_data;
/* algorithm for enh div: rate = freq / 2 / (N + 1) */
@@ -637,7 +702,7 @@ static int meson_spicc_clk_init(struct m
snprintf(name, sizeof(name), "%s#sel", dev_name(dev));
init.name = name;
init.ops = &clk_mux_ops;
- parent_data[0].hw = &pow2_div->hw;
+ parent_data[0].hw = &spicc->pow2_div.hw;
parent_data[1].hw = &enh_div->hw;
init.num_parents = 2;
init.flags = CLK_SET_RATE_PARENT;
@@ -754,12 +819,20 @@ static int meson_spicc_probe(struct plat
meson_spicc_oen_enable(spicc);
- ret = meson_spicc_clk_init(spicc);
+ ret = meson_spicc_pow2_clk_init(spicc);
if (ret) {
- dev_err(&pdev->dev, "clock registration failed\n");
+ dev_err(&pdev->dev, "pow2 clock registration failed\n");
goto out_clk;
}
+ if (spicc->data->has_enhance_clk_div) {
+ ret = meson_spicc_enh_clk_init(spicc);
+ if (ret) {
+ dev_err(&pdev->dev, "clock registration failed\n");
+ goto out_clk;
+ }
+ }
+
ret = devm_spi_register_master(&pdev->dev, master);
if (ret) {
dev_err(&pdev->dev, "spi master registration failed\n");
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 205/365] net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (203 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 204/365] spi: meson-spicc: add local pow2 clock ops to preserve rate between messages Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 206/365] net: dsa: mv88e6060: prevent crash on an unused port Greg Kroah-Hartman
` (164 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Xin Xiong, Xin Tan, David S. Miller
From: Xin Xiong <xiongx18@fudan.edu.cn>
commit bfc48f1b0505ffcb03a6d749139b7577d6b81ae0 upstream.
The issue happens on some error handling paths. When the function
fails to grab the object `xprt`, it simply returns 0, forgetting to
decrease the reference count of another object `xps`, which is
increased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount
leaks. Also, the function forgets to check whether `xps` is valid
before using it, which may result in NULL-dereferencing issues.
Fix it by adding proper error handling code when either `xprt` or
`xps` is NULL.
Fixes: 5b7eb78486cd ("SUNRPC: take a xprt offline using sysfs")
Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sunrpc/sysfs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/sunrpc/sysfs.c
+++ b/net/sunrpc/sysfs.c
@@ -291,8 +291,10 @@ static ssize_t rpc_sysfs_xprt_state_chan
int offline = 0, online = 0, remove = 0;
struct rpc_xprt_switch *xps = rpc_sysfs_xprt_kobj_get_xprt_switch(kobj);
- if (!xprt)
- return 0;
+ if (!xprt || !xps) {
+ count = 0;
+ goto out_put;
+ }
if (!strncmp(buf, "offline", 7))
offline = 1;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 206/365] net: dsa: mv88e6060: prevent crash on an unused port
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (204 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 205/365] net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 207/365] net: qrtr: start MHI channel after endpoit creation Greg Kroah-Hartman
` (163 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Vivien Didelot, Florian Fainelli,
Sergei Antonov, Vladimir Oltean, Jakub Kicinski
From: Sergei Antonov <saproj@gmail.com>
commit 246bbf2f977ea36aaf41f5d24370fef433250728 upstream.
If the port isn't a CPU port nor a user port, 'cpu_dp'
is a null pointer and a crash happened on dereferencing
it in mv88e6060_setup_port():
[ 9.575872] Unable to handle kernel NULL pointer dereference at virtual address 00000014
...
[ 9.942216] mv88e6060_setup from dsa_register_switch+0x814/0xe84
[ 9.948616] dsa_register_switch from mdio_probe+0x2c/0x54
[ 9.954433] mdio_probe from really_probe.part.0+0x98/0x2a0
[ 9.960375] really_probe.part.0 from driver_probe_device+0x30/0x10c
[ 9.967029] driver_probe_device from __device_attach_driver+0xb8/0x13c
[ 9.973946] __device_attach_driver from bus_for_each_drv+0x90/0xe0
[ 9.980509] bus_for_each_drv from __device_attach+0x110/0x184
[ 9.986632] __device_attach from bus_probe_device+0x8c/0x94
[ 9.992577] bus_probe_device from deferred_probe_work_func+0x78/0xa8
[ 9.999311] deferred_probe_work_func from process_one_work+0x290/0x73c
[ 10.006292] process_one_work from worker_thread+0x30/0x4b8
[ 10.012155] worker_thread from kthread+0xd4/0x10c
[ 10.017238] kthread from ret_from_fork+0x14/0x3c
Fixes: 0abfd494deef ("net: dsa: use dedicated CPU port")
CC: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
CC: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220811070939.1717146-1-saproj@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/dsa/mv88e6060.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c
@@ -118,6 +118,9 @@ static int mv88e6060_setup_port(struct m
int addr = REG_PORT(p);
int ret;
+ if (dsa_is_unused_port(priv->ds, p))
+ return 0;
+
/* Do not force flow control, disable Ingress and Egress
* Header tagging, disable VLAN tunneling, and set the port
* state to Forwarding. Additionally, if this is the CPU
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 207/365] net: qrtr: start MHI channel after endpoit creation
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (205 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 206/365] net: dsa: mv88e6060: prevent crash on an unused port Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 208/365] virtio_net: fix endian-ness for RSS Greg Kroah-Hartman
` (162 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Maxim Kochetkov, Hemant Kumar,
Manivannan Sadhasivam, Loic Poulain, David S. Miller
From: Maxim Kochetkov <fido_max@inbox.ru>
commit 68a838b84effb7b57ba7d50b1863fc6ae35a54ce upstream.
MHI channel may generates event/interrupt right after enabling.
It may leads to 2 race conditions issues.
1)
Such event may be dropped by qcom_mhi_qrtr_dl_callback() at check:
if (!qdev || mhi_res->transaction_status)
return;
Because dev_set_drvdata(&mhi_dev->dev, qdev) may be not performed at
this moment. In this situation qrtr-ns will be unable to enumerate
services in device.
---------------------------------------------------------------
2)
Such event may come at the moment after dev_set_drvdata() and
before qrtr_endpoint_register(). In this case kernel will panic with
accessing wrong pointer at qcom_mhi_qrtr_dl_callback():
rc = qrtr_endpoint_post(&qdev->ep, mhi_res->buf_addr,
mhi_res->bytes_xferd);
Because endpoint is not created yet.
--------------------------------------------------------------
So move mhi_prepare_for_transfer_autoqueue after endpoint creation
to fix it.
Fixes: a2e2cc0dbb11 ("net: qrtr: Start MHI channels during init")
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Reviewed-by: Hemant Kumar <quic_hemantk@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/qrtr/mhi.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/net/qrtr/mhi.c
+++ b/net/qrtr/mhi.c
@@ -78,11 +78,6 @@ static int qcom_mhi_qrtr_probe(struct mh
struct qrtr_mhi_dev *qdev;
int rc;
- /* start channels */
- rc = mhi_prepare_for_transfer_autoqueue(mhi_dev);
- if (rc)
- return rc;
-
qdev = devm_kzalloc(&mhi_dev->dev, sizeof(*qdev), GFP_KERNEL);
if (!qdev)
return -ENOMEM;
@@ -96,6 +91,13 @@ static int qcom_mhi_qrtr_probe(struct mh
if (rc)
return rc;
+ /* start channels */
+ rc = mhi_prepare_for_transfer_autoqueue(mhi_dev);
+ if (rc) {
+ qrtr_endpoint_unregister(&qdev->ep);
+ return rc;
+ }
+
dev_dbg(qdev->dev, "Qualcomm MHI QRTR driver probed\n");
return 0;
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 208/365] virtio_net: fix endian-ness for RSS
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (206 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 207/365] net: qrtr: start MHI channel after endpoit creation Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 209/365] mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice Greg Kroah-Hartman
` (161 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Andrew Melnychenko,
Michael S. Tsirkin, David S. Miller
From: Michael S. Tsirkin <mst@redhat.com>
commit 95bb633048fab742230eb2cdf20b8e2676240a54 upstream.
Using native endian-ness for device supplied fields is wrong
on BE platforms. Sparse warns about this.
Fixes: 91f41f01d219 ("drivers/net/virtio_net: Added RSS hash report.")
Cc: "Andrew Melnychenko" <andrew@daynix.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/virtio_net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 3b3eebad3977..d4e0a775b1ba 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1199,7 +1199,7 @@ static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
if (!hdr_hash || !skb)
return;
- switch ((int)hdr_hash->hash_report) {
+ switch (__le16_to_cpu(hdr_hash->hash_report)) {
case VIRTIO_NET_HASH_REPORT_TCPv4:
case VIRTIO_NET_HASH_REPORT_UDPv4:
case VIRTIO_NET_HASH_REPORT_TCPv6:
@@ -1217,7 +1217,7 @@ static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
default:
rss_hash_type = PKT_HASH_TYPE_NONE;
}
- skb_set_hash(skb, (unsigned int)hdr_hash->hash_value, rss_hash_type);
+ skb_set_hash(skb, __le32_to_cpu(hdr_hash->hash_value), rss_hash_type);
}
static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
--
2.37.2
^ permalink raw reply related [flat|nested] 386+ messages in thread
* [PATCH 5.19 209/365] mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (207 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 208/365] virtio_net: fix endian-ness for RSS Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 210/365] net: moxa: pass pdev instead of ndev to DMA functions Greg Kroah-Hartman
` (160 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Amit Cohen, Ido Schimmel,
Petr Machata, David S. Miller
From: Amit Cohen <amcohen@nvidia.com>
commit a159e986ad26d3f35c0157ac92760ba5e44e6785 upstream.
Currently as part of removing port, PTP API is called to clear the
existing configuration and set the 'rx_filter' and 'tx_type' to zero.
The clearing is done before unregistering the netdevice, which means that
there is a window of time in which the user can reconfigure PTP in the
port, and this configuration will not be cleared.
Reorder the operations, clear PTP configuration after unregistering the
netdevice.
Fixes: 8748642751ede ("mlxsw: spectrum: PTP: Support SIOCGHWTSTAMP, SIOCSHWTSTAMP ioctls")
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1822,9 +1822,9 @@ static void mlxsw_sp_port_remove(struct
cancel_delayed_work_sync(&mlxsw_sp_port->periodic_hw_stats.update_dw);
cancel_delayed_work_sync(&mlxsw_sp_port->ptp.shaper_dw);
- mlxsw_sp_port_ptp_clear(mlxsw_sp_port);
mlxsw_core_port_clear(mlxsw_sp->core, local_port, mlxsw_sp);
unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */
+ mlxsw_sp_port_ptp_clear(mlxsw_sp_port);
mlxsw_sp_port_vlan_classification_set(mlxsw_sp_port, true, true);
mlxsw_sp->ports[local_port] = NULL;
mlxsw_sp_port_vlan_flush(mlxsw_sp_port, true);
^ permalink raw reply [flat|nested] 386+ messages in thread
* [PATCH 5.19 210/365] net: moxa: pass pdev instead of ndev to DMA functions
2022-08-23 7:58 [PATCH 5.19 000/365] 5.19.4-rc1 review Greg Kroah-Hartman
` (208 preceding siblings ...)
2022-08-23 8:01 ` [PATCH 5.19 209/365] mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice Greg Kroah-Hartman
@ 2022-08-23 8:01 ` Greg Kroah-Hartman
2022-08-23 8:01 ` [PATCH 5.19 211/365] net: fix potential refcount leak in ndisc_router_discovery() Greg Kroah-Hartman
` (159 subsequent siblings)
369 siblings, 0 replies; 386+ messages in thread
From: Greg Kroah-Hartman @ 2022-08-23 8:01 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sergei Antonov, Andrew Lunn, Jakub Kicinski
From: Sergei Antonov <saproj@gmail.com>
commit 3a12df22a8f68954a4ba48435c06b3d1791c87c4 upstream.
dma_map_single() calls fail in moxart_mac_setup_desc_ring() and
moxart_mac_start_xmit() which leads to an incessant output of this:
[ 16.043925]