5.10.103-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainercover 5.10.103-rc1 review
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.103-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.10.103-rc1
Miaohe Lin <[email protected]>
memblock: use kfree() to release kmalloced memblock regions
Marc Zyngier <[email protected]>
gpio: tegra186: Fix chip_data type confusion
[email protected] <[email protected]>
tty: n_gsm: fix deadlock in gsmtty_open()
[email protected] <[email protected]>
tty: n_gsm: fix wrong tty control line for flow control
[email protected] <[email protected]>
tty: n_gsm: fix NULL pointer access due to DLCI release
[email protected] <[email protected]>
tty: n_gsm: fix proper link termination after failed open
[email protected] <[email protected]>
tty: n_gsm: fix encoding of control signal octet bit DV
Changbin Du <[email protected]>
riscv: fix oops caused by irqsoff latency tracer
Chuansheng Liu <[email protected]>
thermal: int340x: fix memory leak in int3400_notify()
Jason Gunthorpe <[email protected]>
RDMA/cma: Do not change route.addr.src_addr outside state checks
Mårten Lindahl <[email protected]>
driver core: Free DMA range map when device is released
Hongyu Xie <[email protected]>
xhci: Prevent futile URB re-submissions due to incorrect return value.
Puma Hsu <[email protected]>
xhci: re-initialize the HC during resume if HCE was set
Sebastian Andrzej Siewior <[email protected]>
usb: dwc3: gadget: Let the interrupt handler disable bottom halves.
Hans de Goede <[email protected]>
usb: dwc3: pci: Fix Bay Trail phy GPIO mappings
Fabrice Gasnier <[email protected]>
usb: dwc2: drd: fix soft connect when gadget is unconfigured
Daniele Palmas <[email protected]>
USB: serial: option: add Telit LE910R1 compositions
Slark Xiao <[email protected]>
USB: serial: option: add support for DW5829e
Steven Rostedt (Google) <[email protected]>
tracefs: Set the group ownership in apply_options() not parse_options()
Szymon Heidrich <[email protected]>
USB: gadget: validate endpoint index for xilinx udc
Daehwan Jung <[email protected]>
usb: gadget: rndis: add spinlock for rndis response list
Dmytro Bagrii <[email protected]>
Revert "USB: serial: ch341: add new Product ID for CH341A"
Sergey Shtylyov <[email protected]>
ata: pata_hpt37x: disable primary channel on HPT371
Phil Elwell <[email protected]>
sc16is7xx: Fix for incorrect data being transmitted
Miaoqian Lin <[email protected]>
iio: Fix error handling for PM
Lorenzo Bianconi <[email protected]>
iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
Cosmin Tanislav <[email protected]>
iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits
Christophe JAILLET <[email protected]>
iio: adc: men_z188_adc: Fix a resource leak in an error handling path
Steven Rostedt (Google) <[email protected]>
tracing: Have traceon and traceoff trigger honor the instance
Bart Van Assche <[email protected]>
RDMA/ib_srp: Fix a deadlock
ChenXiaoSong <[email protected]>
configfs: fix a race in configfs_{,un}register_subsystem()
Md Haris Iqbal <[email protected]>
RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close
Guoqing Jiang <[email protected]>
RDMA/rtrs-clt: Kill wait_for_inflight_permits
Md Haris Iqbal <[email protected]>
RDMA/rtrs-clt: Fix possible double free in error case
Prasad Kumpatla <[email protected]>
regmap-irq: Update interrupt clear register for proper reset
Zhou Qingyang <[email protected]>
spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op()
Tariq Toukan <[email protected]>
net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets
Ariel Levkovich <[email protected]>
net/mlx5: Fix wrong limitation of metadata match on ecpf
Maor Gottlieb <[email protected]>
net/mlx5: Fix possible deadlock on rule deletion
Dan Carpenter <[email protected]>
udp_tunnel: Fix end of loop test in udp_tunnel_nic_unregister()
Hans de Goede <[email protected]>
surface: surface3_power: Fix battery readings on batteries without a serial number
Fabio M. De Francesco <[email protected]>
net/smc: Use a mutex for locking "struct smc_pnettable"
Florian Westphal <[email protected]>
netfilter: nf_tables: fix memory leak during stateful obj update
Christophe JAILLET <[email protected]>
nfp: flower: Fix a potential leak in nfp_tunnel_add_shared_mac()
Christophe Leroy <[email protected]>
net: Force inlining of checksum functions in net/checksum.h
Xiaoke Wang <[email protected]>
net: ll_temac: check the return value of devm_kmalloc()
Paul Blakey <[email protected]>
net/sched: act_ct: Fix flow table lookup after ct clear or switching zones
Gal Pressman <[email protected]>
net/mlx5e: Fix wrong return value on ioctl EEPROM query failure
Maxime Ripard <[email protected]>
drm/edid: Always set RGB444
Paul Blakey <[email protected]>
openvswitch: Fix setting ipv6 fields causing hw csum failure
Tao Liu <[email protected]>
gso: do not skip outer ip header in case of ipip and net_failover
Dan Carpenter <[email protected]>
tipc: Fix end of loop tests for list_for_each_entry()
Eric Dumazet <[email protected]>
net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends
Eric Dumazet <[email protected]>
io_uring: add a schedule point in io_add_buffers()
Eric Dumazet <[email protected]>
bpf: Add schedule points in batch ops
Felix Maurer <[email protected]>
selftests: bpf: Check bpf_msg_push_data return value
Felix Maurer <[email protected]>
bpf: Do not try bpf_msg_push_data with len 0
Guenter Roeck <[email protected]>
hwmon: Handle failure to register sensor with thermal zone correctly
Somnath Kotur <[email protected]>
bnxt_en: Fix active FEC reporting to ethtool
Manish Chopra <[email protected]>
bnx2x: fix driver load from initrd
Alexey Bayduraev <[email protected]>
perf data: Fix double free in perf_session__delete()
Xin Long <[email protected]>
ping: remove pr_err from ping_lookup
Jens Wiklander <[email protected]>
optee: use driver internal tee_context for some rpc
Jens Wiklander <[email protected]>
tee: export teedev_open() and teedev_close_context()
Brian Geffon <[email protected]>
x86/fpu: Correct pkru/xstate inconsistency
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables_offload: incorrect flow offload action array size
Oliver Neukum <[email protected]>
CDC-NCM: avoid overflow in sanity checking
Oliver Neukum <[email protected]>
USB: zaurus: support another broken Zaurus
Oliver Neukum <[email protected]>
sr9700: sanity check for packet length
Ville Syrjälä <[email protected]>
drm/i915: Correctly populate use_sagv_wm for all pipes
Qiang Yu <[email protected]>
drm/amdgpu: check vm ready by amdgpu_vm->evicting flag
Evan Quan <[email protected]>
drm/amdgpu: disable MMHUB PG for Picasso
Liang Zhang <[email protected]>
KVM: x86/mmu: make apf token non-zero to fix bug
Helge Deller <[email protected]>
parisc/unaligned: Fix ldw() and stw() unalignment handlers
Helge Deller <[email protected]>
parisc/unaligned: Fix fldd and fstd unaligned handlers on 32-bit kernel
Stefano Garzarella <[email protected]>
vhost/vsock: don't check owner in vhost_vsock_stop() while releasing
Siarhei Volkau <[email protected]>
clk: jz4725b: fix mmc0 clock gating
Su Yue <[email protected]>
btrfs: tree-checker: check item_size for dev_item
Su Yue <[email protected]>
btrfs: tree-checker: check item_size for inode_item
Zhang Qiao <[email protected]>
cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug
-------------
Diffstat:
Makefile | 4 +- arch/parisc/kernel/unaligned.c | 14 +++--- arch/riscv/kernel/Makefile | 2 + arch/riscv/kernel/entry.S | 10 ++-- arch/riscv/kernel/trace_irq.c | 27 +++++++++++ arch/riscv/kernel/trace_irq.h | 11 +++++ arch/x86/include/asm/fpu/internal.h | 13 +++-- arch/x86/kernel/process_32.c | 6 +-- arch/x86/kernel/process_64.c | 6 +-- arch/x86/kvm/mmu/mmu.c | 13 ++++- drivers/ata/pata_hpt37x.c | 14 ++++++ drivers/base/dd.c | 5 ++ drivers/base/regmap/regmap-irq.c | 20 +++----- drivers/clk/ingenic/jz4725b-cgu.c | 3 +- drivers/gpio/gpio-tegra186.c | 14 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++- drivers/gpu/drm/amd/amdgpu/soc15.c | 5 +- drivers/gpu/drm/drm_edid.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 22 ++++----- drivers/hwmon/hwmon.c | 14 +++--- drivers/iio/accel/bmc150-accel-core.c | 5 +- drivers/iio/accel/kxcjk-1013.c | 5 +- drivers/iio/accel/mma9551.c | 5 +- drivers/iio/accel/mma9553.c | 5 +- drivers/iio/adc/ad7124.c | 2 +- drivers/iio/adc/men_z188_adc.c | 9 +++- drivers/iio/gyro/bmg160_core.c | 5 +- drivers/iio/imu/kmx61.c | 5 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 6 ++- drivers/iio/magnetometer/bmc150_magn.c | 5 +- drivers/infiniband/core/cma.c | 40 +++++++++------- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 56 +++++++++++----------- drivers/infiniband/ulp/srp/ib_srp.c | 6 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 3 ++ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 ++ .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 +- .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 4 -- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 + .../ethernet/netronome/nfp/flower/tunnel_conf.c | 4 +- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 + drivers/net/usb/cdc_ether.c | 12 +++++ drivers/net/usb/cdc_ncm.c | 8 ++-- drivers/net/usb/sr9700.c | 2 +- drivers/net/usb/zaurus.c | 12 +++++ drivers/platform/x86/surface3_power.c | 13 +++-- drivers/spi/spi-zynq-qspi.c | 3 ++ drivers/tee/optee/core.c | 8 ++++ drivers/tee/optee/optee_private.h | 2 + drivers/tee/optee/rpc.c | 8 ++-- drivers/tee/tee_core.c | 6 ++- .../intel/int340x_thermal/int3400_thermal.c | 4 ++ drivers/tty/n_gsm.c | 22 ++++++--- drivers/tty/serial/sc16is7xx.c | 3 ++ drivers/usb/dwc2/core.h | 2 + drivers/usb/dwc2/drd.c | 6 ++- drivers/usb/dwc3/dwc3-pci.c | 4 +- drivers/usb/dwc3/gadget.c | 2 + drivers/usb/gadget/function/rndis.c | 8 ++++ drivers/usb/gadget/function/rndis.h | 1 + drivers/usb/gadget/udc/udc-xilinx.c | 6 +++ drivers/usb/host/xhci.c | 28 +++++++---- drivers/usb/serial/ch341.c | 1 - drivers/usb/serial/option.c | 12 +++++ drivers/vhost/vsock.c | 21 +++++--- fs/btrfs/tree-checker.c | 15 ++++++ fs/configfs/dir.c | 14 ++++++ fs/io_uring.c | 1 + fs/tracefs/inode.c | 5 +- include/linux/tee_drv.h | 14 ++++++ include/net/checksum.h | 48 +++++++++++-------- include/net/netfilter/nf_tables.h | 2 +- include/net/netfilter/nf_tables_offload.h | 2 - kernel/bpf/syscall.c | 3 ++ kernel/cgroup/cpuset.c | 2 + kernel/trace/trace_events_trigger.c | 52 +++++++++++++++++--- mm/memblock.c | 10 +++- net/core/filter.c | 3 ++ net/core/skbuff.c | 4 +- net/ipv4/af_inet.c | 5 +- net/ipv4/ping.c | 1 - net/ipv4/udp_tunnel_nic.c | 2 +- net/ipv6/ip6_offload.c | 2 + net/netfilter/nf_tables_api.c | 13 +++-- net/netfilter/nf_tables_offload.c | 3 +- net/netfilter/nft_dup_netdev.c | 6 +++ net/netfilter/nft_fwd_netdev.c | 6 +++ net/netfilter/nft_immediate.c | 12 ++++- net/openvswitch/actions.c | 46 ++++++++++++++---- net/sched/act_ct.c | 5 -- net/smc/smc_pnet.c | 42 ++++++++-------- net/smc/smc_pnet.h | 2 +- net/tipc/name_table.c | 2 +- net/tipc/socket.c | 2 +- tools/perf/util/data.c | 7 ++- .../selftests/bpf/progs/test_sockmap_kern.h | 26 ++++++---- 96 files changed, 672 insertions(+), 270 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/80 cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug
From: Zhang Qiao <[email protected]>
commit 05c7b7a92cc87ff8d7fde189d0fade250697573c upstream.
As previously discussed(https://lkml.org/lkml/2022/1/20/51), cpuset_attach() is affected with similar cpu hotplug race, as follow scenario:
cpuset_attach() cpu hotplug
--------------------------- ----------------------
down_write(cpuset_rwsem)
guarantee_online_cpus() // (load cpus_attach)
sched_cpu_deactivate
set_cpu_active()
// will change cpu_active_mask
set_cpus_allowed_ptr(cpus_attach)
__set_cpus_allowed_ptr_locked()
// (if the intersection of cpus_attach and
cpu_active_mask is empty, will return -EINVAL)
up_write(cpuset_rwsem)To avoid races such as described above, protect cpuset_attach() call with cpu_hotplug_lock.
--- kernel/cgroup/cpuset.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/cgroup/cpuset.c +2 -0
@@ -2212,6 +2212,7 @@ static void cpuset_attach(struct cgroup_cgroup_taskset_first (tset, &css); cs =css_cs (css); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);/* prepare for attach */
@@ -2267,6 +2268,7 @@ static void cpuset_attach(struct cgroup_wake_up (&cpuset_attach_wq);percpu_up_write (&cpuset_rwsem); +cpus_read_unlock (); }/* The various types of files and directories in a cpuset file system */
Greg Kroah-Hartman
maintainerPATCH 2/80 btrfs: tree-checker: check item_size for inode_item
In reply to Greg Kroah-HartmanFrom: Su Yue <[email protected]>
commit 0c982944af27d131d3b74242f3528169f66950ad upstream.
while mounting the crafted image, out-of-bounds access happens:
[350.429619] UBSAN: array-index-out-of-bounds in fs/btrfs/struct-funcs.c:161:1 [350.429636] index 1048096 is out of range for type 'page *[16]' [350.429650] CPU: 0 PID: 9 Comm: kworker/u8:1 Not tainted 5.16.0-rc4 #1 [350.429652] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [350.429653] Workqueue: btrfs-endio-meta btrfs_work_helper [btrfs] [350.429772] Call Trace: [350.429774] <TASK> [350.429776] dump_stack_lvl+0x47/0x5c [350.429780] ubsan_epilogue+0x5/0x50 [350.429786] __ubsan_handle_out_of_bounds+0x66/0x70 [350.429791] btrfs_get_16+0xfd/0x120 [btrfs] [350.429832] check_leaf+0x754/0x1a40 [btrfs] [350.429874] ? filemap_read+0x34a/0x390 [350.429878] ? load_balance+0x175/0xfc0 [350.429881] validate_extent_buffer+0x244/0x310 [btrfs] [350.429911] btrfs_validate_metadata_buffer+0xf8/0x100 [btrfs] [350.429935] end_bio_extent_readpage+0x3af/0x850 [btrfs] [350.429969] ? newidle_balance+0x259/0x480 [350.429972] end_workqueue_fn+0x29/0x40 [btrfs] [350.429995] btrfs_work_helper+0x71/0x330 [btrfs] [350.430030] ? __schedule+0x2fb/0xa40 [350.430033] process_one_work+0x1f6/0x400 [350.430035] ? process_one_work+0x400/0x400 [350.430036] worker_thread+0x2d/0x3d0 [350.430037] ? process_one_work+0x400/0x400 [350.430038] kthread+0x165/0x190 [350.430041] ? set_kthread_struct+0x40/0x40 [350.430043] ret_from_fork+0x1f/0x30 [350.430047] </TASK> [350.430077] BTRFS warning (device loop0): bad eb member start: ptr 0xffe20f4e start 20975616 member offset 4293005178 size 2
check_leaf() is checking the leaf:
corrupt leaf: root=4 block=29396992 slot=1, bad key order, prev (16140901064495857664 1 0) current (1 204 12582912) leaf 29396992 items 6 free space 3565 generation 6 owner DEV_TREE
leaf 29396992 flags 0x1(WRITTEN) backref revision 1
fs uuid a62e00e8-e94e-4200-8217-12444de93c2e
chunk uuid cecbd0f7-9ca0-441e-ae9f-f782f9732bd8
item 0 key (16140901064495857664 INODE_ITEM 0) itemoff 3955 itemsize 40 generation 0 transid 0 size 0 nbytes 17592186044416 block group 0 mode 52667 links 33 uid 0 gid 2104132511 rdev 94223634821136 sequence 100305 flags 0x2409000(none) atime 0.0 (1970-01-01 08:00:00) ctime 2973280098083405823.4294967295 (-269783007-01-01 21:37:03) mtime 18446744071572723616.4026825121 (1902-04-16 12:40:00) otime 9249929404488876031.4294967295 (622322949-04-16 04:25:58) item 1 key (1 DEV_EXTENT 12582912) itemoff 3907 itemsize 48 dev extent chunk_tree 3 chunk_objectid 256 chunk_offset 12582912 length 8388608 chunk_tree_uuid cecbd0f7-9ca0-441e-ae9f-f782f9732bd8
The corrupted leaf of device tree has an inode item. The leaf passed checksum and others checks in validate_extent_buffer until check_leaf_item(). Because of the key type BTRFS_INODE_ITEM, check_inode_item() is called even we are in the device tree. Since the
item offset + sizeof(struct btrfs_inode_item) > eb->len, out-of-bounds access is triggered.
The item end vs leaf boundary check has been done before check_leaf_item(), so fix it by checking item size in check_inode_item() before access of the inode item in extent buffer.
Other check functions except check_dev_item() in check_leaf_item() have their item size checks.
The commit for check_dev_item() is followed.
No regression observed during running fstests.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215299
--- fs/btrfs/tree-checker.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/btrfs/tree-checker.c +7 -0
@@ -989,6 +989,7 @@ static int check_inode_item(struct extenstruct btrfs_inode_item *iitem;u64 super_gen =btrfs_super_generation (fs_info->super_copy);u32 valid_mask = (S_IFMT |S_ISUID |S_ISGID |S_ISVTX |0777 ); +const u32 item_size =btrfs_item_size_nr (leaf, slot);u32 mode;int ret;
@@ -996,6 +997,12 @@ static int check_inode_item(struct extenif (ret <0 )return ret; +if (unlikely (item_size !=sizeof (*iitem))) { +generic_err (leaf, slot,"invalid item size: has %u expect %zu" , + item_size,sizeof (*iitem)); +return -EUCLEAN ; + } + iitem = btrfs_item_ptr(leaf, slot, struct btrfs_inode_item);/* Here we use super block generation + 1 to handle log tree */
Greg Kroah-Hartman
maintainerPATCH 3/80 btrfs: tree-checker: check item_size for dev_item
In reply to Greg Kroah-HartmanFrom: Su Yue <[email protected]>
commit ea1d1ca4025ac6c075709f549f9aa036b5b6597d upstream.
Check item size before accessing the device item to avoid out of bound access, similar to inode_item check.
--- fs/btrfs/tree-checker.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/btrfs/tree-checker.c +8 -0
@@ -947,6 +947,7 @@ static int check_dev_item(struct extent_ struct btrfs_key *key, int slot) {struct btrfs_dev_item *ditem; +const u32 item_size =btrfs_item_size_nr (leaf, slot);if (key->objectid !=BTRFS_DEV_ITEMS_OBJECTID ) { dev_item_err(leaf, slot,
@@ -954,6 +955,13 @@ static int check_dev_item(struct extent_ key->objectid, BTRFS_DEV_ITEMS_OBJECTID);return -EUCLEAN ; } + +if (unlikely (item_size !=sizeof (*ditem))) { +dev_item_err (leaf, slot,"invalid item size: has %u expect %zu" , + item_size,sizeof (*ditem)); +return -EUCLEAN ; + } + ditem = btrfs_item_ptr(leaf, slot, struct btrfs_dev_item);if (btrfs_device_id (leaf, ditem) != key->offset) { dev_item_err(leaf, slot,
Greg Kroah-Hartman
maintainerPATCH 4/80 clk: jz4725b: fix mmc0 clock gating
In reply to Greg Kroah-HartmanFrom: Siarhei Volkau <[email protected]>
commit 2f0754f27a230fee6e6d753f07585cee03bedfe3 upstream.
The mmc0 clock gate bit was mistakenly assigned to "i2s" clock. You can find that the same bit is assigned to "mmc0" too. It leads to mmc0 hang for a long time after any sound activity also it prevented PM_SLEEP to work properly.
I guess it was introduced by copy-paste from jz4740 driver where it is really controls I2S clock gate.
--- drivers/clk/ingenic/jz4725b-cgu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/ingenic/jz4725b-cgu.c +1 -2
@@ -139,11 +139,10 @@ static const struct ingenic_cgu_clk_info }, [JZ4725B_CLK_I2S] = { -"i2s" ,CGU_CLK_MUX |CGU_CLK_DIV |CGU_CLK_GATE , +"i2s" ,CGU_CLK_MUX |CGU_CLK_DIV , .parents = { JZ4725B_CLK_EXT, JZ4725B_CLK_PLL_HALF, -1, -1 }, .mux = { CGU_REG_CPCCR, 31, 1 }, .div = { CGU_REG_I2SCDR, 0, 1, 9, -1, -1, -1 }, - .gate = { CGU_REG_CLKGR, 6 }, }, [JZ4725B_CLK_SPI] = {
Greg Kroah-Hartman
maintainerPATCH 5/80 vhost/vsock: dont check owner in vhost_vsock_stop() while releasing
In reply to Greg Kroah-HartmanFrom: Stefano Garzarella <[email protected]>
commit a58da53ffd70294ebea8ecd0eb45fd0d74add9f9 upstream.
vhost_vsock_stop() calls vhost_dev_check_owner() to check the device ownership. It expects current->mm to be valid.
vhost_vsock_stop() is also called by vhost_vsock_dev_release() when the user has not done close(), so when we are in do_exit(). In this case current->mm is invalid and we're releasing the device, so we should clean it anyway.
Let's check the owner only when vhost_vsock_stop() is called by an ioctl.
When invoked from release we can not fail so we don't check return code of vhost_vsock_stop(). We need to stop vsock even if it's not the owner.
--- drivers/vhost/vsock.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/vhost/vsock.c +14 -7
@@ -573,16 +573,18 @@ err:return ret; } -static int vhost_vsock_stop (struct vhost_vsock *vsock) +static int vhost_vsock_stop (struct vhost_vsock *vsock,bool check_owner) {size_t i; -int ret; +int ret =0 ;mutex_lock (&vsock->dev.mutex); - ret =vhost_dev_check_owner (&vsock->dev); -if (ret) - goto err; +if (check_owner) { + ret =vhost_dev_check_owner (&vsock->dev); +if (ret) + goto err; + }for (i =0 ; i <ARRAY_SIZE (vsock->vqs); i++) {struct vhost_virtqueue *vq = &vsock->vqs[i];
@@ -697,7 +699,12 @@ static int vhost_vsock_dev_release(struc* inefficient. Room for improvement here. */ vsock_for_each_connected_socket (vhost_vsock_reset_orphans); -vhost_vsock_stop (vsock); +/* Don't check the owner, because we are in the release path, so we +* need to stop the vsock device in any case. +* vhost_vsock_stop() can not fail in this case, so we don't need to +* check the return code. +*/ +vhost_vsock_stop (vsock, false);vhost_vsock_flush (vsock);vhost_dev_stop (&vsock->dev);
@@ -801,7 +808,7 @@ static long vhost_vsock_dev_ioctl(structif (start)return vhost_vsock_start (vsock);else -return vhost_vsock_stop (vsock); +return vhost_vsock_stop (vsock, true);case VHOST_GET_FEATURES : features =VHOST_VSOCK_FEATURES ;if (copy_to_user (argp, &features,sizeof (features)))
Greg Kroah-Hartman
maintainerPATCH 6/80 parisc/unaligned: Fix fldd and fstd unaligned handlers on 32-bit kernel
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit dd2288f4a020d693360e3e8d72f8b9d9c25f5ef6 upstream.
Usually the kernel provides fixup routines to emulate the fldd and fstd floating-point instructions if they load or store 8-byte from/to a not natuarally aligned memory location.
On a 32-bit kernel I noticed that those unaligned handlers didn't worked and instead the application got a SEGV.
While checking the code I found two problems:
First, the OPCODE_FLDD_L and OPCODE_FSTD_L cases were ifdef'ed out by the CONFIG_PA20 option, and as such those weren't built on a pure 32-bit kernel. This is now fixed by moving the CONFIG_PA20 #ifdef to prevent the compilation of OPCODE_LDD_L and OPCODE_FSTD_L only, and handling the fldd and fstd instructions.
The second problem are two bugs in the 32-bit inline assembly code, where the wrong registers where used. The calculation of the natural alignment used %2 (vall) instead of %3 (ior), and the first word was stored back to address %1 (valh) instead of %3 (ior).
--- arch/parisc/kernel/unaligned.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/parisc/kernel/unaligned.c +4 -4
@@ -397,7 +397,7 @@ static int emulate_std(struct pt_regs *r __asm__ __volatile__ (" mtsp %4, %%sr1\n" " zdep %2, 29, 2, %%r19\n" -" dep %%r0, 31, 2, %2\n" +" dep %%r0, 31, 2, %3\n" " mtsar %%r19\n" " zvdepi -2, 32, %%r19\n" "1: ldw 0(%%sr1,%3),%%r20\n"
@@ -409,7 +409,7 @@ static int emulate_std(struct pt_regs *r" andcm %%r21, %%r19, %%r21\n" " or %1, %%r20, %1\n" " or %2, %%r21, %2\n" -"3: stw %1,0(%%sr1,%1)\n" +"3: stw %1,0(%%sr1,%3)\n" "4: stw %%r1,4(%%sr1,%3)\n" "5: stw %2,8(%%sr1,%3)\n" " copy %%r0, %0\n"
@@ -596,7 +596,6 @@ void handle_unaligned(struct pt_regs *re ret =ERR_NOTHANDLED ;/* "undefined", but lets kill them. */ break ; } -#ifdef CONFIG_PA20 switch (regs->iir &OPCODE2_MASK ) {case OPCODE_FLDD_L :
@@ -607,14 +606,15 @@ void handle_unaligned(struct pt_regs *re flop=1 ; ret =emulate_std (regs,R2 (regs->iir),1 );break ; +#ifdef CONFIG_PA20 case OPCODE_LDD_L : ret =emulate_ldd (regs,R2 (regs->iir),0 );break ;case OPCODE_STD_L : ret =emulate_std (regs,R2 (regs->iir),0 );break ; - }#endif + }switch (regs->iir &OPCODE3_MASK ) {case OPCODE_FLDW_L :
Greg Kroah-Hartman
maintainerPATCH 7/80 parisc/unaligned: Fix ldw() and stw() unalignment handlers
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit a97279836867b1cb50a3d4f0b1bf60e0abe6d46c upstream.
Fix 3 bugs:
a) emulate_stw() doesn't return the error code value, so faulting instructions are not reported and aborted.
b) Tell emulate_ldw() to handle fldw_l as floating point instruction
c) Tell emulate_ldw() to handle ldw_m as integer instruction
--- arch/parisc/kernel/unaligned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/parisc/kernel/unaligned.c +3 -3
@@ -340,7 +340,7 @@ static int emulate_stw(struct pt_regs *r : "r" (val), "r" (regs->ior), "r" (regs->isr) : "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER ); -return 0 ; +return ret; }static int emulate_std (struct pt_regs *regs,int frreg,int flop) {
@@ -619,10 +619,10 @@ void handle_unaligned(struct pt_regs *re {case OPCODE_FLDW_L : flop=1 ; - ret =emulate_ldw (regs,R2 (regs->iir),0 ); + ret =emulate_ldw (regs,R2 (regs->iir),1 );break ;case OPCODE_LDW_M : - ret =emulate_ldw (regs,R2 (regs->iir),1 ); + ret =emulate_ldw (regs,R2 (regs->iir),0 );break ;case OPCODE_FSTW_L :
Greg Kroah-Hartman
maintainerPATCH 8/80 KVM: x86/mmu: make apf token non-zero to fix bug
In reply to Greg Kroah-HartmanFrom: Liang Zhang <[email protected]>
commit 6f3c1fc53d86d580d8d6d749c4af23705e4f6f79 upstream.
In current async pagefault logic, when a page is ready, KVM relies on kvm_arch_can_dequeue_async_page_present() to determine whether to deliver a READY event to the Guest. This function test token value of struct kvm_vcpu_pv_apf_data, which must be reset to zero by Guest kernel when a READY event is finished by Guest. If value is zero meaning that a READY event is done, so the KVM can deliver another.
But the kvm_arch_setup_async_pf() may produce a valid token with zero value, which is confused with previous mention and may lead the loss of this READY event.
This bug may cause task blocked forever in Guest:
INFO: task stress:7532 blocked for more than 1254 seconds.
Not tainted 5.10.0 #16
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:stress state:D stack: 0 pid: 7532 ppid: 1409
flags:0x00000080
Call Trace:
__schedule+0x1e7/0x650
schedule+0x46/0xb0
kvm_async_pf_task_wait_schedule+0xad/0xe0
? exit_to_user_mode_prepare+0x60/0x70
__kvm_handle_async_pf+0x4f/0xb0
? asm_exc_page_fault+0x8/0x30
exc_page_fault+0x6f/0x110
? asm_exc_page_fault+0x8/0x30
asm_exc_page_fault+0x1e/0x30
RIP: 0033:0x402d00
RSP: 002b:00007ffd31912500 EFLAGS: 00010206
RAX: 0000000000071000 RBX: ffffffffffffffff RCX: 00000000021a32b0
RDX: 000000000007d011 RSI: 000000000007d000 RDI: 00000000021262b0
RBP: 00000000021262b0 R08: 0000000000000003 R09: 0000000000000086
R10: 00000000000000eb R11: 00007fefbdf2baa0 R12: 0000000000000000
R13: 0000000000000002 R14: 000000000007d000 R15: 0000000000001000Message-Id: <[email protected]>
--- arch/x86/kvm/mmu/mmu.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
arch/x86/kvm/mmu/mmu.c +12 -1
@@ -3631,12 +3631,23 @@ static void shadow_page_table_clear_floowalk_shadow_page_lockless_end (vcpu); } +static u32 alloc_apf_token (struct kvm_vcpu *vcpu) +{ +/* make sure the token value is not 0 */ +u32 id = vcpu->arch.apf.id; + +if (id <<12 ==0 ) + vcpu->arch.apf.id =1 ; + +return (vcpu->arch.apf.id++ <<12 ) | vcpu->vcpu_id; +} +static bool kvm_arch_setup_async_pf (struct kvm_vcpu *vcpu,gpa_t cr2_or_gpa,gfn_t gfn) {struct kvm_arch_async_pf arch; - arch.token = (vcpu->arch.apf.id++ <<12 ) | vcpu->vcpu_id; + arch.token =alloc_apf_token (vcpu); arch.gfn = gfn; arch.direct_map = vcpu->arch.mmu->direct_map; arch.cr3 = vcpu->arch.mmu->get_guest_pgd (vcpu);
Greg Kroah-Hartman
maintainerPATCH 9/80 drm/amdgpu: disable MMHUB PG for Picasso
In reply to Greg Kroah-HartmanFrom: Evan Quan <[email protected]>
commit f626dd0ff05043e5a7154770cc7cda66acee33a3 upstream.
MMHUB PG needs to be disabled for Picasso for stability reasons.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +4 -1
@@ -1194,8 +1194,11 @@ static int soc15_common_early_init(voidAMD_CG_SUPPORT_SDMA_MGCG |AMD_CG_SUPPORT_SDMA_LS ; +/* +* MMHUB PG needs to be disabled for Picasso for +* stability reasons. +*/ adev->pg_flags =AMD_PG_SUPPORT_SDMA | -AMD_PG_SUPPORT_MMHUB |AMD_PG_SUPPORT_VCN ; }else { adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG |
Greg Kroah-Hartman
maintainerPATCH 10/80 drm/amdgpu: check vm ready by amdgpu_vm->evicting flag
In reply to Greg Kroah-HartmanFrom: Qiang Yu <[email protected]>
commit c1a66c3bc425ff93774fb2f6eefa67b83170dd7e upstream.
Workstation application ANSA/META v21.1.4 get this error dmesg when running CI test suite provided by ANSA/META:
[drm:amdgpu_gem_va_ioctl [amdgpu]] *ERROR* Couldn't update BO_VA (-16)
This is caused by:
1. create a 256MB buffer in invisible VRAM
2. CPU map the buffer and access it causes vm_fault and try to move it to visible VRAM
3. force visible VRAM space and traverse all VRAM bos to check if evicting this bo is valuable
4. when checking a VM bo (in invisible VRAM), amdgpu_vm_evictable() will set amdgpu_vm->evicting, but latter due to not in visible VRAM, won't really evict it so not add it to amdgpu_vm->evicted
5. before next CS to clear the amdgpu_vm->evicting, user VM ops ioctl will pass amdgpu_vm_ready() (check amdgpu_vm->evicted) but fail in amdgpu_vm_bo_update_mapping() (check amdgpu_vm->evicting) and get this error log
This error won't affect functionality as next CS will finish the waiting VM ops. But we'd better clear the error log by checking the amdgpu_vm->evicting flag in amdgpu_vm_ready() to stop calling amdgpu_vm_bo_update_mapping() later.
Another reason is amdgpu_vm->evicted list holds all BOs (both user buffer and page table), but only page table BOs' eviction prevent VM ops. amdgpu_vm->evicting flag is set only for page table BOs, so we should use evicting flag instead of evicted list in amdgpu_vm_ready().
The side effect of this change is: previously blocked VM op (user buffer in "evicted" list but no page table in it) gets done immediately.
v2: update commit comments.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7 -2
@@ -715,11 +715,16 @@ int amdgpu_vm_validate_pt_bos(struct amd* Check if all VM PDs/PTs are ready for updates * * Returns: -* True if eviction list is empty. +* True if VM is not evicting. */ bool amdgpu_vm_ready (struct amdgpu_vm *vm) { -return list_empty (&vm->evicted); +bool ret; + +amdgpu_vm_eviction_lock (vm); + ret = !vm->evicting; +amdgpu_vm_eviction_unlock (vm); +return ret; }/**
Greg Kroah-Hartman
maintainerPATCH 11/80 drm/i915: Correctly populate use_sagv_wm for all pipes
In reply to Greg Kroah-HartmanFrom: Ville Syrjälä <[email protected]>
commit afc189df6bcc6be65961deb54e15ec60e7f85337 upstream.
When changing between SAGV vs. no SAGV on tgl+ we have to update the use_sagv_wm flag for all the crtcs or else an active pipe not already in the state will end up using the wrong watermarks. That is especially bad when we end up with the tighter non-SAGV watermarks with SAGV enabled. Usually ends up in underruns.
--- drivers/gpu/drm/i915/intel_pm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +11 -11
@@ -3996,6 +3996,17 @@ static int intel_compute_sagv_mask(strucreturn ret; } +if (intel_can_enable_sagv (dev_priv, new_bw_state) != +intel_can_enable_sagv (dev_priv, old_bw_state)) { + ret =intel_atomic_serialize_global_state (&new_bw_state->base); +if (ret) +return ret; + }else if (new_bw_state->pipe_sagv_reject != old_bw_state->pipe_sagv_reject) { + ret =intel_atomic_lock_global_state (&new_bw_state->base); +if (ret) +return ret; + } +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) {struct skl_pipe_wm *pipe_wm = &new_crtc_state->wm.skl.optimal;
@@ -4010,17 +4021,6 @@ static int intel_compute_sagv_mask(strucintel_can_enable_sagv (dev_priv, new_bw_state); } -if (intel_can_enable_sagv (dev_priv, new_bw_state) != -intel_can_enable_sagv (dev_priv, old_bw_state)) { - ret =intel_atomic_serialize_global_state (&new_bw_state->base); -if (ret) -return ret; - }else if (new_bw_state->pipe_sagv_reject != old_bw_state->pipe_sagv_reject) { - ret =intel_atomic_lock_global_state (&new_bw_state->base); -if (ret) -return ret; - } -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 12/80 sr9700: sanity check for packet length
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit e9da0b56fe27206b49f39805f7dcda8a89379062 upstream.
A malicious device can leak heap data to user space providing bogus frame lengths. Introduce a sanity check.
--- drivers/net/usb/sr9700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/sr9700.c +1 -1
@@ -410,7 +410,7 @@ static int sr9700_rx_fixup(struct usbnet/* ignore the CRC length */ len = (skb->data[1 ] | (skb->data[2 ] <<8 )) -4 ; -if (len >ETH_FRAME_LEN ) +if (len >ETH_FRAME_LEN || len > skb->len)return 0 ;/* the last packet of current skb */
Greg Kroah-Hartman
maintainerPATCH 13/80 USB: zaurus: support another broken Zaurus
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 6605cc67ca18b9d583eb96e18a20f5f4e726103c upstream.
This SL-6000 says Direct Line, not Ethernet
v2: added Reporter and Link
--- drivers/net/usb/cdc_ether.c | 12 ++++++++++++ drivers/net/usb/zaurus.c | 12 ++++++++++++ 2 files changed, 24 insertions(+)
drivers/net/usb/cdc_ether.c +12 -0
@@ -570,6 +570,11 @@ static const struct usb_device_id produc .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \ .bInterfaceProtocol = USB_CDC_PROTO_NONE +#define ZAURUS_FAKE_INTERFACE \ + .bInterfaceClass = USB_CLASS_COMM, \ + .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \ + .bInterfaceProtocol = USB_CDC_PROTO_NONE +/* SA-1100 based Sharp Zaurus ("collie"), or compatible; * wire-incompatible with true CDC Ethernet implementations. * (And, it seems, needlessly so...)
@@ -625,6 +630,13 @@ static const struct usb_device_id produc .driver_info = 0, }, { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = 0x04DD, + .idProduct =0x9032 ,/* SL-6000 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = 0, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO |USB_DEVICE_ID_MATCH_DEVICE , .idVendor = 0x04DD,/* reported with some C860 units */
drivers/net/usb/zaurus.c +12 -0
@@ -256,6 +256,11 @@ static const struct usb_device_id produc .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \ .bInterfaceProtocol = USB_CDC_PROTO_NONE +#define ZAURUS_FAKE_INTERFACE \ + .bInterfaceClass = USB_CLASS_COMM, \ + .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \ + .bInterfaceProtocol = USB_CDC_PROTO_NONE +/* SA-1100 based Sharp Zaurus ("collie"), or compatible. */ { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
@@ -315,6 +320,13 @@ static const struct usb_device_id produc .driver_info = ZAURUS_PXA_INFO, }, { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = 0x04DD, + .idProduct =0x9032 ,/* SL-6000 */ +ZAURUS_FAKE_INTERFACE , + .driver_info = (unsigned long)&bogus_mdlm_info, +}, { + .match_flags =USB_DEVICE_ID_MATCH_INT_INFO |USB_DEVICE_ID_MATCH_DEVICE , .idVendor = 0x04DD,/* reported with some C860 units */
Greg Kroah-Hartman
maintainerPATCH 14/80 CDC-NCM: avoid overflow in sanity checking
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 8d2b1a1ec9f559d30b724877da4ce592edc41fdc upstream.
A broken device may give an extreme offset like 0xFFF0 and a reasonable length for a fragment. In the sanity check as formulated now, this will create an integer overflow, defeating the sanity check. Both offset and offset + len need to be checked in such a manner that no overflow can occur.
And those quantities should be unsigned.
--- drivers/net/usb/cdc_ncm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/usb/cdc_ncm.c +4 -4
@@ -1702,10 +1702,10 @@ int cdc_ncm_rx_fixup(struct usbnet *dev, {struct sk_buff *skb;struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0 ]; -int len; +unsigned int len;int nframes;int x; -int offset; +unsigned int offset;union {struct usb_cdc_ncm_ndp16 *ndp16;struct usb_cdc_ncm_ndp32 *ndp32;
@@ -1777,8 +1777,8 @@ next_ndp:break ; } -/* sanity checking */ -if (((offset + len) > skb_in->len) || +/* sanity checking - watch out for integer wrap*/ +if ((offset > skb_in->len) || (len > skb_in->len - offset) || (len > ctx->rx_max) || (len <ETH_HLEN )) { netif_dbg(dev, rx_err, dev->net, "invalid frame detected (ignored) offset[%u]=%u, length=%u, skb=%p\n",
Greg Kroah-Hartman
maintainerPATCH 15/80 netfilter: nf_tables_offload: incorrect flow offload action array size
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
commit b1a5983f56e371046dcf164f90bfaf704d2b89f6 upstream.
immediate verdict expression needs to allocate one slot in the flow offload action array, however, immediate data expression does not need to do so.
fwd and dup expression need to allocate one slot, this is missing.
Add a new offload_action interface to report if this expression needs to allocate one slot in the flow offload action array.
--- include/net/netfilter/nf_tables.h | 2 +- include/net/netfilter/nf_tables_offload.h | 2 -- net/netfilter/nf_tables_offload.c | 3 ++- net/netfilter/nft_dup_netdev.c | 6 ++++++ net/netfilter/nft_fwd_netdev.c | 6 ++++++ net/netfilter/nft_immediate.c | 12 +++++++++++- 6 files changed, 26 insertions(+), 5 deletions(-)
include/net/netfilter/nf_tables.h +1 -1
@@ -825,7 +825,7 @@ struct nft_expr_ops {int (*offload)(struct nft_offload_ctx *ctx,struct nft_flow_rule *flow,const struct nft_expr *expr); -u32 offload_flags; +bool (*offload_action)(const struct nft_expr *expr);const struct nft_expr_type *type;void *data; };
include/net/netfilter/nf_tables_offload.h +0 -2
@@ -67,8 +67,6 @@ struct nft_flow_rule {struct flow_rule *rule; }; -#define NFT_OFFLOAD_F_ACTION (1 << 0) -void nft_flow_rule_set_addr_type (struct nft_flow_rule *flow,enum flow_dissector_key_id addr_type);
net/netfilter/nf_tables_offload.c +2 -1
@@ -94,7 +94,8 @@ struct nft_flow_rule *nft_flow_rule_crea expr =nft_expr_first (rule);while (nft_expr_more (rule, expr)) { -if (expr->ops->offload_flags &NFT_OFFLOAD_F_ACTION ) +if (expr->ops->offload_action && + expr->ops->offload_action (expr)) num_actions++; expr =nft_expr_next (expr);
net/netfilter/nft_dup_netdev.c +6 -0
@@ -67,6 +67,11 @@ static int nft_dup_netdev_offload(structreturn nft_fwd_dup_netdev_offload (ctx, flow,FLOW_ACTION_MIRRED , oif); } +static bool nft_dup_netdev_offload_action (const struct nft_expr *expr) +{ +return true; +} +static struct nft_expr_type nft_dup_netdev_type;static const struct nft_expr_ops nft_dup_netdev_ops = { .type = &nft_dup_netdev_type,
@@ -75,6 +80,7 @@ static const struct nft_expr_ops nft_dup .init = nft_dup_netdev_init, .dump = nft_dup_netdev_dump, .offload = nft_dup_netdev_offload, + .offload_action = nft_dup_netdev_offload_action, };static struct nft_expr_type nft_dup_netdev_type__read_mostly = {
net/netfilter/nft_fwd_netdev.c +6 -0
@@ -77,6 +77,11 @@ static int nft_fwd_netdev_offload(structreturn nft_fwd_dup_netdev_offload (ctx, flow,FLOW_ACTION_REDIRECT , oif); } +static bool nft_fwd_netdev_offload_action (const struct nft_expr *expr) +{ +return true; +} +struct nft_fwd_neigh {enum nft_registers sreg_dev:8 ;enum nft_registers sreg_addr:8 ;
@@ -219,6 +224,7 @@ static const struct nft_expr_ops nft_fwd .dump = nft_fwd_netdev_dump, .validate = nft_fwd_validate, .offload = nft_fwd_netdev_offload, + .offload_action = nft_fwd_netdev_offload_action, }; static const struct nft_expr_ops *
net/netfilter/nft_immediate.c +11 -1
@@ -213,6 +213,16 @@ static int nft_immediate_offload(structreturn 0 ; } +static bool nft_immediate_offload_action (const struct nft_expr *expr) +{ +const struct nft_immediate_expr *priv =nft_expr_priv (expr); + +if (priv->dreg ==NFT_REG_VERDICT ) +return true; + +return false; +} +static const struct nft_expr_ops nft_imm_ops = { .type = &nft_imm_type, .size =NFT_EXPR_SIZE (sizeof (struct nft_immediate_expr )),
@@ -224,7 +234,7 @@ static const struct nft_expr_ops nft_imm .dump = nft_immediate_dump, .validate = nft_immediate_validate, .offload = nft_immediate_offload, - .offload_flags = NFT_OFFLOAD_F_ACTION, + .offload_action = nft_immediate_offload_action, };struct nft_expr_type nft_imm_type__read_mostly = {
Greg Kroah-Hartman
maintainerPATCH 16/80 x86/fpu: Correct pkru/xstate inconsistency
In reply to Greg Kroah-HartmanFrom: Brian Geffon <[email protected]>
When eagerly switching PKRU in switch_fpu_finish() it checks that current is not a kernel thread as kernel threads will never use PKRU. It's possible that this_cpu_read_stable() on current_task (ie. get_current()) is returning an old cached value. To resolve this reference next_p directly rather than relying on current.
As written it's possible when switching from a kernel thread to a userspace thread to observe a cached PF_KTHREAD flag and never restore the PKRU. And as a result this issue only occurs when switching from a kernel thread to a userspace thread, switching from a non kernel thread works perfectly fine because all that is considered in that situation are the flags from some other non kernel task and the next fpu is passed in to switch_fpu_finish().
This behavior only exists between 5.2 and 5.13 when it was fixed by a rewrite decoupling PKRU from xstate, in:
commit 954436989cc5 ("x86/fpu: Remove PKRU handling from switch_fpu_finish()")
Unfortunately backporting the fix from 5.13 is probably not realistic as it's part of a 60+ patch series which rewrites most of the PKRU handling.
--- arch/x86/include/asm/fpu/internal.h | 13 ++++++++----- arch/x86/kernel/process_32.c | 6 ++---- arch/x86/kernel/process_64.c | 6 ++---- 3 files changed, 12 insertions(+), 13 deletions(-)
arch/x86/include/asm/fpu/internal.h +8 -5
@@ -531,9 +531,11 @@ static inline void __fpregs_load_activat* The FPU context is only stored/restored for a user task and * PF_KTHREAD is used to distinguish between kernel and user threads. */ -static inline void switch_fpu_prepare (struct fpu *old_fpu,int cpu) +static inline void switch_fpu_prepare (struct task_struct *prev,int cpu) { -if (static_cpu_has (X86_FEATURE_FPU ) && !(current->flags &PF_KTHREAD )) { +struct fpu *old_fpu = &prev->thread.fpu; + +if (static_cpu_has (X86_FEATURE_FPU ) && !(prev->flags &PF_KTHREAD )) {if (!copy_fpregs_to_fpstate (old_fpu)) old_fpu->last_cpu =-1 ;else
@@ -552,10 +554,11 @@ static inline void switch_fpu_prepare(st* Load PKRU from the FPU context if available. Delay loading of the * complete FPU state until the return to userland. */ -static inline void switch_fpu_finish (struct fpu *new_fpu) +static inline void switch_fpu_finish (struct task_struct *next) {u32 pkru_val = init_pkru_value;struct pkru_state *pk; +struct fpu *next_fpu = &next->thread.fpu;if (!static_cpu_has (X86_FEATURE_FPU ))return ;
@@ -569,7 +572,7 @@ static inline void switch_fpu_finish(str* PKRU state is switched eagerly because it needs to be valid before we * return to userland e.g. for a copy_to_user() operation. */ -if (!(current->flags &PF_KTHREAD )) { +if (!(next->flags &PF_KTHREAD )) {/* * If the PKRU bit in xsave.header.xfeatures is not set, * then the PKRU component was in init state, which means
@@ -578,7 +581,7 @@ static inline void switch_fpu_finish(str* in memory is not valid. This means pkru_val has to be * set to 0 and not to init_pkru_value. */ - pk =get_xsave_addr (&new_fpu->state.xsave,XFEATURE_PKRU ); + pk =get_xsave_addr (&next_fpu->state.xsave,XFEATURE_PKRU ); pkru_val = pk ? pk->pkru :0 ; }__write_pkru (pkru_val);
arch/x86/kernel/process_32.c +2 -4
@@ -159,14 +159,12 @@ __switch_to(struct task_struct *prev_p, {struct thread_struct *prev = &prev_p->thread, *next = &next_p->thread; -struct fpu *prev_fpu = &prev->fpu; -struct fpu *next_fpu = &next->fpu;int cpu =smp_processor_id ();/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ if (!test_thread_flag (TIF_NEED_FPU_LOAD )) -switch_fpu_prepare (prev_fpu, cpu); +switch_fpu_prepare (prev_p, cpu);/* * Save away %gs. No need to save %fs, as it was saved on the
@@ -213,7 +211,7 @@ __switch_to(struct task_struct *prev_p,this_cpu_write (current_task, next_p); -switch_fpu_finish (next_fpu); +switch_fpu_finish (next_p);/* Load the Intel cache allocation PQR MSR. */ resctrl_sched_in ();
arch/x86/kernel/process_64.c +2 -4
@@ -535,15 +535,13 @@ __switch_to(struct task_struct *prev_p, {struct thread_struct *prev = &prev_p->thread;struct thread_struct *next = &next_p->thread; -struct fpu *prev_fpu = &prev->fpu; -struct fpu *next_fpu = &next->fpu;int cpu =smp_processor_id ();WARN_ON_ONCE (IS_ENABLED (CONFIG_DEBUG_ENTRY ) &&this_cpu_read (irq_count) !=-1 );if (!test_thread_flag (TIF_NEED_FPU_LOAD )) -switch_fpu_prepare (prev_fpu, cpu); +switch_fpu_prepare (prev_p, cpu);/* We must save %fs and %gs before load_TLS() because * %fs and %gs may be cleared by load_TLS().
@@ -595,7 +593,7 @@ __switch_to(struct task_struct *prev_p,this_cpu_write (current_task, next_p);this_cpu_write (cpu_current_top_of_stack,task_top_of_stack (next_p)); -switch_fpu_finish (next_fpu); +switch_fpu_finish (next_p);/* Reload sp0. */ update_task_stack (next_p);
Greg Kroah-Hartman
maintainerPATCH 17/80 tee: export teedev_open() and teedev_close_context()
In reply to Greg Kroah-HartmanFrom: Jens Wiklander <[email protected]>
commit 1e2c3ef0496e72ba9001da5fd1b7ed56ccb30597 upstream.
Exports the two functions teedev_open() and teedev_close_context() in order to make it easier to create a driver internal struct tee_context.
--- drivers/tee/tee_core.c | 6 ++++-- include/linux/tee_drv.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/tee/tee_core.c +4 -2
@@ -43,7 +43,7 @@ static DEFINE_SPINLOCK(driver_lock);static struct class *tee_class;static dev_t tee_devt; -static struct tee_context *teedev_open (struct tee_device *teedev) +struct tee_context *teedev_open (struct tee_device *teedev) {int rc;struct tee_context *ctx;
@@ -70,6 +70,7 @@ err:return ERR_PTR (rc); } +EXPORT_SYMBOL_GPL (teedev_open);void teedev_ctx_get (struct tee_context *ctx) {
@@ -96,13 +97,14 @@ void teedev_ctx_put(struct tee_context *kref_put (&ctx->refcount, teedev_ctx_release); } -static void teedev_close_context (struct tee_context *ctx) +void teedev_close_context (struct tee_context *ctx) {struct tee_device *teedev = ctx->teedev;teedev_ctx_put (ctx);tee_device_put (teedev); } +EXPORT_SYMBOL_GPL (teedev_close_context);static int tee_open (struct inode *inode,struct file *filp) {
include/linux/tee_drv.h +14 -0
@@ -582,4 +582,18 @@ struct tee_client_driver {#define to_tee_client_driver (d) \ container_of(d, struct tee_client_driver, driver) +/** +* teedev_open() - Open a struct tee_device +* @teedev: Device to open +* +* @return a pointer to struct tee_context on success or an ERR_PTR on failure. +*/ +struct tee_context *teedev_open (struct tee_device *teedev); + +/** +* teedev_close_context() - closes a struct tee_context +* @ctx: The struct tee_context to close +*/ +void teedev_close_context (struct tee_context *ctx); +#endif /*__TEE_DRV_H*/
Greg Kroah-Hartman
maintainerPATCH 18/80 optee: use driver internal tee_context for some rpc
In reply to Greg Kroah-HartmanFrom: Jens Wiklander <[email protected]>
commit aceeafefff736057e8f93f19bbfbef26abd94604 upstream.
Adds a driver private tee_context by moving the tee_context in struct optee_notif to struct optee. This tee_context was previously used when doing internal calls to secure world to deliver notification.
The new driver internal tee_context is now also when allocating driver private shared memory. This decouples the shared memory object from its original tee_context. This is needed when the life time of such a memory allocation outlives the client tee_context.
This patch fixes the problem described below:
The addition of a shutdown hook by commit f25889f93184 ("optee: fix tee out of memory failure seen during kexec reboot") introduced a kernel shutdown regression that can be triggered after running the OP-TEE xtest suites.
Once the shutdown hook is called it is not possible to communicate any more with the supplicant process because the system is not scheduling task any longer. Thus if the optee driver shutdown path receives a supplicant RPC request from the OP-TEE we will deadlock the kernel's shutdown.
--- drivers/tee/optee/core.c | 8 ++++++++ drivers/tee/optee/optee_private.h | 2 ++ drivers/tee/optee/rpc.c | 8 +++++--- 3 files changed, 15 insertions(+), 3 deletions(-)
drivers/tee/optee/core.c +8 -0
@@ -588,6 +588,7 @@ static int optee_remove(struct platform_/* Unregister OP-TEE specific client devices on TEE bus */ optee_unregister_devices (); +teedev_close_context (optee->ctx);/* * Ask OP-TEE to free all cached shared memory objects to decrease * reference counters and also avoid wild pointers in secure world
@@ -633,6 +634,7 @@ static int optee_probe(struct platform_dstruct optee *optee =NULL ;void *memremaped_shm =NULL ;struct tee_device *teedev; +struct tee_context *ctx;u32 sec_caps;int rc;
@@ -719,6 +721,12 @@ static int optee_probe(struct platform_doptee_supp_init (&optee->supp); optee->memremaped_shm = memremaped_shm; optee->pool = pool; + ctx =teedev_open (optee->teedev); +if (IS_ERR (ctx)) { + rc =PTR_ERR (ctx); + goto err; + } + optee->ctx = ctx;/* * Ensure that there are no pre-existing shm objects before enabling
drivers/tee/optee/optee_private.h +2 -0
@@ -70,6 +70,7 @@ struct optee_supp {* struct optee - main service struct * @supp_teedev: supplicant device * @teedev: client device +* @ctx: driver internal TEE context * @invoke_fn: function to issue smc or hvc * @call_queue: queue of threads waiting to call @invoke_fn * @wait_queue: queue of threads from secure world waiting for a
@@ -87,6 +88,7 @@ struct optee {struct tee_device *supp_teedev;struct tee_device *teedev;optee_invoke_fn *invoke_fn; +struct tee_context *ctx;struct optee_call_queue call_queue;struct optee_wait_queue wait_queue;struct optee_supp supp;
drivers/tee/optee/rpc.c +5 -3
@@ -284,6 +284,7 @@ static struct tee_shm *cmd_alloc_suppl(s }static void handle_rpc_func_cmd_shm_alloc (struct tee_context *ctx, +struct optee *optee,struct optee_msg_arg *arg,struct optee_call_ctx *call_ctx) {
@@ -313,7 +314,8 @@ static void handle_rpc_func_cmd_shm_allo shm =cmd_alloc_suppl (ctx, sz);break ;case OPTEE_MSG_RPC_SHM_TYPE_KERNEL : - shm =tee_shm_alloc (ctx, sz,TEE_SHM_MAPPED |TEE_SHM_PRIV ); + shm =tee_shm_alloc (optee->ctx, sz, +TEE_SHM_MAPPED |TEE_SHM_PRIV );break ;default : arg->ret =TEEC_ERROR_BAD_PARAMETERS ;
@@ -470,7 +472,7 @@ static void handle_rpc_func_cmd(struct tbreak ;case OPTEE_MSG_RPC_CMD_SHM_ALLOC :free_pages_list (call_ctx); -handle_rpc_func_cmd_shm_alloc (ctx, arg, call_ctx); +handle_rpc_func_cmd_shm_alloc (ctx, optee, arg, call_ctx);break ;case OPTEE_MSG_RPC_CMD_SHM_FREE :handle_rpc_func_cmd_shm_free (ctx, arg);
@@ -501,7 +503,7 @@ void optee_handle_rpc(struct tee_contextswitch (OPTEE_SMC_RETURN_GET_RPC_FUNC (param->a0)) {case OPTEE_SMC_RPC_FUNC_ALLOC : - shm =tee_shm_alloc (ctx, param->a1, + shm =tee_shm_alloc (optee->ctx, param->a1,TEE_SHM_MAPPED |TEE_SHM_PRIV );if (!IS_ERR (shm) && !tee_shm_get_pa (shm,0 , &pa)) {reg_pair_from_64 (¶m->a1, ¶m->a2, pa);
Greg Kroah-Hartman
maintainerPATCH 19/80 ping: remove pr_err from ping_lookup
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
commit cd33bdcbead882c2e58fdb4a54a7bd75b610a452 upstream.
As Jakub noticed, prints should be avoided on the datapath. Also, as packets would never come to the else branch in ping_lookup(), remove pr_err() from ping_lookup().
--- net/ipv4/ping.c | 1 - 1 file changed, 1 deletion(-)
net/ipv4/ping.c +0 -1
@@ -187,7 +187,6 @@ static struct sock *ping_lookup(struct n (int)ident, &ipv6_hdr(skb)->daddr, dif);#endif }else { -pr_err ("ping: protocol(%x) is not supported\n" ,ntohs (skb->protocol));return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 20/80 perf data: Fix double free in perf_session__delete()
In reply to Greg Kroah-HartmanFrom: Alexey Bayduraev <[email protected]>
commit 69560e366fc4d5fca7bebb0e44edbfafc8bcaf05 upstream.
When perf_data__create_dir() fails, it calls close_dir(), but perf_session__delete() also calls close_dir() and since dir.version and dir.nr were initialized by perf_data__create_dir(), a double free occurs.
This patch moves the initialization of dir.version and dir.nr after successful initialization of dir.files, that prevents double freeing. This behavior is already implemented in perf_data__open_dir().
--- tools/perf/util/data.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
tools/perf/util/data.c +3 -4
@@ -44,10 +44,6 @@ int perf_data__create_dir(struct perf_daif (!files)return -ENOMEM ; - data->dir.version =PERF_DIR_VERSION ; - data->dir.files = files; - data->dir.nr = nr; -for (i =0 ; i < nr; i++) {struct perf_data_file *file = &files[i];
@@ -62,6 +58,9 @@ int perf_data__create_dir(struct perf_da file->fd = ret; } + data->dir.version =PERF_DIR_VERSION ; + data->dir.files = files; + data->dir.nr = nr;return 0 ; out_err:
Greg Kroah-Hartman
maintainerPATCH 21/80 bnx2x: fix driver load from initrd
In reply to Greg Kroah-HartmanFrom: Manish Chopra <[email protected]>
commit e13ad1443684f7afaff24cf207e85e97885256bd upstream.
Commit b7a49f73059f ("bnx2x: Utilize firmware 7.13.21.0") added new firmware support in the driver with maintaining older firmware compatibility. However, older firmware was not added in MODULE_FIRMWARE() which caused missing firmware files in initrd image leading to driver load failure from initrd. This patch adds MODULE_FIRMWARE() for older firmware version to have firmware files included in initrd.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +3 -0
@@ -100,6 +100,9 @@ MODULE_LICENSE("GPL");MODULE_FIRMWARE (FW_FILE_NAME_E1 );MODULE_FIRMWARE (FW_FILE_NAME_E1H );MODULE_FIRMWARE (FW_FILE_NAME_E2 ); +MODULE_FIRMWARE (FW_FILE_NAME_E1_V15 ); +MODULE_FIRMWARE (FW_FILE_NAME_E1H_V15 ); +MODULE_FIRMWARE (FW_FILE_NAME_E2_V15 );int bnx2x_num_queues;module_param_named (num_queues, bnx2x_num_queues, int,0444 );
Greg Kroah-Hartman
maintainerPATCH 22/80 bnxt_en: Fix active FEC reporting to ethtool
In reply to Greg Kroah-HartmanFrom: Somnath Kotur <[email protected]>
commit 84d3c83e6ea7d46cf3de3a54578af73eb24a64f2 upstream.
ethtool --show-fec <interface> does not show anything when the Active FEC setting in the chip is set to None. Fix it to properly return ETHTOOL_FEC_OFF in that case.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +3 -0
@@ -1926,6 +1926,9 @@ static int bnxt_get_fecparam(struct net_case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE : fec->active_fec |=ETHTOOL_FEC_LLRS ;break ; +case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_NONE_ACTIVE : + fec->active_fec |=ETHTOOL_FEC_OFF ; +break ; }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 23/80 hwmon: Handle failure to register sensor with thermal zone correctly
In reply to Greg Kroah-HartmanFrom: Guenter Roeck <[email protected]>
commit 1b5f517cca36292076d9e38fa6e33a257703e62e upstream.
If an attempt is made to a sensor with a thermal zone and it fails, the call to devm_thermal_zone_of_sensor_register() may return -ENODEV. This may result in crashes similar to the following.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000003cd ... Internal error: Oops: 96000021 [#1] PREEMPT SMP ... pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mutex_lock+0x18/0x60 lr : thermal_zone_device_update+0x40/0x2e0
sp : ffff800014c4fc60
x29: ffff800014c4fc60 x28: ffff365ee3f6e000 x27: ffffdde218426790
x26: ffff365ee3f6e000 x25: 0000000000000000 x24: ffff365ee3f6e000
x23: ffffdde218426870 x22: ffff365ee3f6e000 x21: 00000000000003cd
x20: ffff365ee8bf3308 x19: ffffffffffffffed x18: 0000000000000000
x17: ffffdde21842689c x16: ffffdde1cb7a0b7c x15: 0000000000000040
x14: ffffdde21a4889a0 x13: 0000000000000228 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000001120000 x7 : 0000000000000001 x6 : 0000000000000000 x5 : 0068000878e20f07 x4 : 0000000000000000 x3 : 00000000000003cd x2 : ffff365ee3f6e000 x1 : 0000000000000000 x0 : 00000000000003cd
Call trace: mutex_lock+0x18/0x60 hwmon_notify_event+0xfc/0x110 0xffffdde1cb7a0a90 0xffffdde1cb7a0b7c irq_thread_fn+0x2c/0xa0 irq_thread+0x134/0x240 kthread+0x178/0x190 ret_from_fork+0x10/0x20 Code: d503201f d503201f d2800001 aa0103e4 (c8e47c02)
Jon Hunter reports that the exact call sequence is:
hwmon_notify_event()
--> hwmon_thermal_notify()
--> thermal_zone_device_update()
--> update_temperature()
--> mutex_lock()The hwmon core needs to handle all errors returned from calls to devm_thermal_zone_of_sensor_register(). If the call fails with -ENODEV, report that the sensor was not attached to a thermal zone but continue to register the hwmon device.
--- drivers/hwmon/hwmon.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/hwmon/hwmon.c +8 -6
@@ -178,12 +178,14 @@ static int hwmon_thermal_add_sensor(stru tzd =devm_thermal_zone_of_sensor_register (dev, index, tdata, &hwmon_thermal_ops); -/* -* If CONFIG_THERMAL_OF is disabled, this returns -ENODEV, -* so ignore that error but forward any other error. -*/ -if (IS_ERR (tzd) && (PTR_ERR (tzd) != -ENODEV )) -return PTR_ERR (tzd); +if (IS_ERR (tzd)) { +if (PTR_ERR (tzd) != -ENODEV ) +return PTR_ERR (tzd); +dev_info (dev,"temp%d_input not attached to any thermal zone\n" , + index +1 ); +devm_kfree (dev, tdata); +return 0 ; + } err =devm_add_action (dev, hwmon_thermal_remove_sensor, &tdata->node);if (err)
Greg Kroah-Hartman
maintainerPATCH 24/80 bpf: Do not try bpf_msg_push_data with len 0
In reply to Greg Kroah-HartmanFrom: Felix Maurer <[email protected]>
commit 4a11678f683814df82fca9018d964771e02d7e6d upstream.
If bpf_msg_push_data() is called with len 0 (as it happens during selftests/bpf/test_sockmap), we do not need to do anything and can return early.
Calling bpf_msg_push_data() with len 0 previously lead to a wrong ENOMEM
error: we later called get_order(copy + len); if len was 0, copy + len was also often 0 and get_order() returned some undefined value (at the moment 52). alloc_pages() caught that and failed, but then bpf_msg_push_data() returned ENOMEM. This was wrong because we are most probably not out of memory and actually do not need any additional memory.
--- net/core/filter.c | 3 +++ 1 file changed, 3 insertions(+)
net/core/filter.c +3 -0
@@ -2730,6 +2730,9 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_if (unlikely (flags))return -EINVAL ; +if (unlikely (len ==0 )) +return 0 ; +/* First find the starting scatterlist element */ i = msg->sg.start; do {
Greg Kroah-Hartman
maintainerPATCH 25/80 selftests: bpf: Check bpf_msg_push_data return value
In reply to Greg Kroah-HartmanFrom: Felix Maurer <[email protected]>
commit 61d06f01f9710b327a53492e5add9f972eb909b3 upstream.
bpf_msg_push_data may return a non-zero value to indicate an error. The return value should be checked to prevent undetected errors.
To indicate an error, the BPF programs now perform a different action than their intended one to make the userspace test program notice the error, i.e., the programs supposed to pass/redirect drop, the program supposed to drop passes.
--- tools/testing/selftests/bpf/progs/test_sockmap_kern.h | 26 ++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-)
tools/testing/selftests/bpf/progs/test_sockmap_kern.h +18 -8
@@ -235,7 +235,7 @@ SEC("sk_msg1")int bpf_prog4 (struct sk_msg_md *msg) {int *bytes, zero =0 , one =1 , two =2 , three =3 , four =4 , five =5 ; -int *start, *end, *start_push, *end_push, *start_pop, *pop; +int *start, *end, *start_push, *end_push, *start_pop, *pop, err =0 ; bytes =bpf_map_lookup_elem (&sock_apply_bytes, &zero);if (bytes)
@@ -249,8 +249,11 @@ int bpf_prog4(struct sk_msg_md *msg)bpf_msg_pull_data (msg, *start, *end,0 ); start_push =bpf_map_lookup_elem (&sock_bytes, &two); end_push =bpf_map_lookup_elem (&sock_bytes, &three); -if (start_push && end_push) -bpf_msg_push_data (msg, *start_push, *end_push,0 ); +if (start_push && end_push) { + err =bpf_msg_push_data (msg, *start_push, *end_push,0 ); +if (err) +return SK_DROP ; + } start_pop =bpf_map_lookup_elem (&sock_bytes, &four); pop =bpf_map_lookup_elem (&sock_bytes, &five);if (start_pop && pop)
@@ -263,6 +266,7 @@ int bpf_prog6(struct sk_msg_md *msg) {int zero =0 , one =1 , two =2 , three =3 , four =4 , five =5 , key =0 ;int *bytes, *start, *end, *start_push, *end_push, *start_pop, *pop, *f; +int err =0 ;__u64 flags =0 ; bytes =bpf_map_lookup_elem (&sock_apply_bytes, &zero);
@@ -279,8 +283,11 @@ int bpf_prog6(struct sk_msg_md *msg) start_push =bpf_map_lookup_elem (&sock_bytes, &two); end_push =bpf_map_lookup_elem (&sock_bytes, &three); -if (start_push && end_push) -bpf_msg_push_data (msg, *start_push, *end_push,0 ); +if (start_push && end_push) { + err =bpf_msg_push_data (msg, *start_push, *end_push,0 ); +if (err) +return SK_DROP ; + } start_pop =bpf_map_lookup_elem (&sock_bytes, &four); pop =bpf_map_lookup_elem (&sock_bytes, &five);
@@ -338,7 +345,7 @@ SEC("sk_msg5")int bpf_prog10 (struct sk_msg_md *msg) {int *bytes, *start, *end, *start_push, *end_push, *start_pop, *pop; -int zero =0 , one =1 , two =2 , three =3 , four =4 , five =5 ; +int zero =0 , one =1 , two =2 , three =3 , four =4 , five =5 , err =0 ; bytes =bpf_map_lookup_elem (&sock_apply_bytes, &zero);if (bytes)
@@ -352,8 +359,11 @@ int bpf_prog10(struct sk_msg_md *msg)bpf_msg_pull_data (msg, *start, *end,0 ); start_push =bpf_map_lookup_elem (&sock_bytes, &two); end_push =bpf_map_lookup_elem (&sock_bytes, &three); -if (start_push && end_push) -bpf_msg_push_data (msg, *start_push, *end_push,0 ); +if (start_push && end_push) { + err =bpf_msg_push_data (msg, *start_push, *end_push,0 ); +if (err) +return SK_PASS ; + } start_pop =bpf_map_lookup_elem (&sock_bytes, &four); pop =bpf_map_lookup_elem (&sock_bytes, &five);if (start_pop && pop)
Greg Kroah-Hartman
maintainerPATCH 26/80 bpf: Add schedule points in batch ops
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 75134f16e7dd0007aa474b281935c5f42e79f2c8 upstream.
syzbot reported various soft lockups caused by bpf batch operations.
INFO: task kworker/1:1:27 blocked for more than 140 seconds. INFO: task hung in rcu_barrier
Nothing prevents batch ops to process huge amount of data, we need to add schedule points in them.
Note that maybe_wait_bpf_programs(map) calls from generic_map_delete_batch() can be factorized by moving the call after the loop.
This will be done later in -next tree once we get this fix merged, unless there is strong opinion doing this optimization sooner.
--- kernel/bpf/syscall.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/bpf/syscall.c +3 -0
@@ -1308,6 +1308,7 @@ int generic_map_delete_batch(struct bpf_maybe_wait_bpf_programs (map);if (err)break ; +cond_resched (); }if (copy_to_user (&uattr->batch.count, &cp,sizeof (cp))) err = -EFAULT ;
@@ -1365,6 +1366,7 @@ int generic_map_update_batch(struct bpf_if (err)break ; +cond_resched (); }if (copy_to_user (&uattr->batch.count, &cp,sizeof (cp)))
@@ -1462,6 +1464,7 @@ int generic_map_lookup_batch(struct bpf_swap (prev_key, key); retry =MAP_LOOKUP_RETRIES ; cp++; +cond_resched (); }if (err == -EFAULT )
Greg Kroah-Hartman
maintainerPATCH 27/80 io_uring: add a schedule point in io_add_buffers()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit f240762f88b4b1b58561939ffd44837759756477 upstream.
Looping ~65535 times doing kmalloc() calls can trigger soft lockups, especially with DEBUG features (like KASAN).
[ 253.536212] watchdog: BUG: soft lockup - CPU#64 stuck for 26s! [b219417889:12575] [ 253.544433] Modules linked in: vfat fat i2c_mux_pca954x i2c_mux spidev cdc_acm xhci_pci xhci_hcd sha3_generic gq(O) [ 253.544451] CPU: 64 PID: 12575 Comm: b219417889 Tainted: G S O 5.17.0-smp-DEV #801 [ 253.544457] RIP: 0010:kernel_text_address (./include/asm-generic/sections.h:192 ./include/linux/kallsyms.h:29 kernel/extable.c:67 kernel/extable.c:98) [ 253.544464] Code: 0f 93 c0 48 c7 c1 e0 63 d7 a4 48 39 cb 0f 92 c1 20 c1 0f b6 c1 5b 5d c3 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 53 48 89 fb <48> c7 c0 00 00 80 a0 41 be 01 00 00 00 48 39 c7 72 0c 48 c7 c0 40 [ 253.544468] RSP: 0018:ffff8882d8baf4c0 EFLAGS: 00000246 [ 253.544471] RAX: 1ffff1105b175e00 RBX: ffffffffa13ef09a RCX: 00000000a13ef001 [ 253.544474] RDX: ffffffffa13ef09a RSI: ffff8882d8baf558 RDI: ffffffffa13ef09a [ 253.544476] RBP: ffff8882d8baf4d8 R08: ffff8882d8baf5e0 R09: 0000000000000004 [ 253.544479] R10: ffff8882d8baf5e8 R11: ffffffffa0d59a50 R12: ffff8882eab20380 [ 253.544481] R13: ffffffffa0d59a50 R14: dffffc0000000000 R15: 1ffff1105b175eb0 [ 253.544483] FS: 00000000016d3380(0000) GS:ffff88af48c00000(0000) knlGS:0000000000000000 [ 253.544486] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 253.544488] CR2: 00000000004af0f0 CR3: 00000002eabfa004 CR4: 00000000003706e0 [ 253.544491] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 253.544492] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 253.544494] Call Trace: [ 253.544496] <TASK> [ 253.544498] ? io_queue_sqe (fs/io_uring.c:7143) [ 253.544505] __kernel_text_address (kernel/extable.c:78) [ 253.544508] unwind_get_return_address (arch/x86/kernel/unwind_frame.c:19) [ 253.544514] arch_stack_walk (arch/x86/kernel/stacktrace.c:27) [ 253.544517] ? io_queue_sqe (fs/io_uring.c:7143) [ 253.544521] stack_trace_save (kernel/stacktrace.c:123) [ 253.544527] ____kasan_kmalloc (mm/kasan/common.c:39 mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:515) [ 253.544531] ? ____kasan_kmalloc (mm/kasan/common.c:39 mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:515) [ 253.544533] ? __kasan_kmalloc (mm/kasan/common.c:524) [ 253.544535] ? kmem_cache_alloc_trace (./include/linux/kasan.h:270 mm/slab.c:3567) [ 253.544541] ? io_issue_sqe (fs/io_uring.c:4556 fs/io_uring.c:4589 fs/io_uring.c:6828) [ 253.544544] ? __io_queue_sqe (fs/io_uring.c:?) [ 253.544551] __kasan_kmalloc (mm/kasan/common.c:524) [ 253.544553] kmem_cache_alloc_trace (./include/linux/kasan.h:270 mm/slab.c:3567) [ 253.544556] ? io_issue_sqe (fs/io_uring.c:4556 fs/io_uring.c:4589 fs/io_uring.c:6828) [ 253.544560] io_issue_sqe (fs/io_uring.c:4556 fs/io_uring.c:4589 fs/io_uring.c:6828) [ 253.544564] ? __kasan_slab_alloc (mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:469) [ 253.544567] ? __kasan_slab_alloc (mm/kasan/common.c:39 mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:469) [ 253.544569] ? kmem_cache_alloc_bulk (mm/slab.h:732 mm/slab.c:3546) [ 253.544573] ? __io_alloc_req_refill (fs/io_uring.c:2078) [ 253.544578] ? io_submit_sqes (fs/io_uring.c:7441) [ 253.544581] ? __se_sys_io_uring_enter (fs/io_uring.c:10154 fs/io_uring.c:10096) [ 253.544584] ? __x64_sys_io_uring_enter (fs/io_uring.c:10096) [ 253.544587] ? do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) [ 253.544590] ? entry_SYSCALL_64_after_hwframe (??:?) [ 253.544596] __io_queue_sqe (fs/io_uring.c:?) [ 253.544600] io_queue_sqe (fs/io_uring.c:7143) [ 253.544603] io_submit_sqe (fs/io_uring.c:?) [ 253.544608] io_submit_sqes (fs/io_uring.c:?) [ 253.544612] __se_sys_io_uring_enter (fs/io_uring.c:10154 fs/io_uring.c:10096) [ 253.544616] __x64_sys_io_uring_enter (fs/io_uring.c:10096) [ 253.544619] do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) [ 253.544623] entry_SYSCALL_64_after_hwframe (??:?)
--- fs/io_uring.c | 1 + 1 file changed, 1 insertion(+)
fs/io_uring.c +1 -0
@@ -4058,6 +4058,7 @@ static int io_add_buffers(struct io_prov }else {list_add_tail (&buf->list, &(*head)->list); } +cond_resched (); }return i ? i : -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 28/80 net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit ef527f968ae05c6717c39f49c8709a7e2c19183a upstream.
Whenever one of these functions pull all data from an skb in a frag_list, use consume_skb() instead of kfree_skb() to avoid polluting drop monitoring.
--- net/core/skbuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/skbuff.c +2 -2
@@ -2139,7 +2139,7 @@ void *__pskb_pull_tail(struct sk_buff *s/* Free pulled out fragments. */ while ((list =skb_shinfo (skb)->frag_list) != insp) {skb_shinfo (skb)->frag_list = list->next; -kfree_skb (list); +consume_skb (list); }/* And insert new clone at head. */ if (clone) {
@@ -6044,7 +6044,7 @@ static int pskb_carve_frag_list(struct s/* Free pulled out fragments. */ while ((list = shinfo->frag_list) != insp) { shinfo->frag_list = list->next; -kfree_skb (list); +consume_skb (list); }/* And insert new clone at head. */ if (clone) {
Greg Kroah-Hartman
maintainerPATCH 29/80 tipc: Fix end of loop tests for list_for_each_entry()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit a1f8fec4dac8bc7b172b2bdbd881e015261a6322 upstream.
These tests are supposed to check if the loop exited via a break or not. However the tests are wrong because if we did not exit via a break then "p" is not a valid pointer. In that case, it's the equivalent of "if (*(u32 *)sr == *last_key) {". That's going to work most of the time, but there is a potential for those to be equal.
--- net/tipc/name_table.c | 2 +- net/tipc/socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/tipc/name_table.c +1 -1
@@ -931,7 +931,7 @@ static int __tipc_nl_add_nametable_publ(list_for_each_entry (p, &sr->all_publ, all_publ)if (p->key == *last_key)break ; -if (p->key != *last_key) +if (list_entry_is_head (p, &sr->all_publ, all_publ))return -EPIPE ; }else { p = list_first_entry(&sr->all_publ,
net/tipc/socket.c +1 -1
@@ -3743,7 +3743,7 @@ static int __tipc_nl_list_sk_publ(structif (p->key == *last_publ)break ; } -if (p->key != *last_publ) { +if (list_entry_is_head (p, &tsk->publications, binding_sock)) {/* We never set seq or call nl_dump_check_consistent() * this means that setting prev_seq here will cause the * consistence check to fail in the netlink callback
Greg Kroah-Hartman
maintainerPATCH 30/80 gso: do not skip outer ip header in case of ipip and net_failover
In reply to Greg Kroah-HartmanFrom: Tao Liu <[email protected]>
commit cc20cced0598d9a5ff91ae4ab147b3b5e99ee819 upstream.
We encounter a tcp drop issue in our cloud environment. Packet GROed in host forwards to a VM virtio_net nic with net_failover enabled. VM acts as a IPVS LB with ipip encapsulation. The full path like:
host gro -> vm virtio_net rx -> net_failover rx -> ipvs fullnat
-> ipip encap -> net_failover tx -> virtio_net tx
When net_failover transmits a ipip pkt (gso_type = 0x0103, which means SKB_GSO_TCPV4, SKB_GSO_DODGY and SKB_GSO_IPXIP4), there is no gso did because it supports TSO and GSO_IPXIP4. But network_header points to inner ip header.
Call Trace: tcp4_gso_segment ------> return NULL inet_gso_segment ------> inner iph, network_header points to ipip_gso_segment inet_gso_segment ------> outer iph skb_mac_gso_segment
Afterwards virtio_net transmits the pkt, only inner ip header is modified. And the outer one just keeps unchanged. The pkt will be dropped in remote host.
Call Trace: inet_gso_segment ------> inner iph, outer iph is skipped skb_mac_gso_segment __skb_gso_segment validate_xmit_skb validate_xmit_skb_list sch_direct_xmit __qdisc_run __dev_queue_xmit ------> virtio_net dev_hard_start_xmit __dev_queue_xmit ------> net_failover ip_finish_output2 ip_output iptunnel_xmit ip_tunnel_xmit ipip_tunnel_xmit ------> ipip dev_hard_start_xmit __dev_queue_xmit ip_finish_output2 ip_output ip_forward ip_rcv __netif_receive_skb_one_core netif_receive_skb_internal napi_gro_receive receive_buf virtnet_poll net_rx_action
The root cause of this issue is specific with the rare combination of SKB_GSO_DODGY and a tunnel device that adds an SKB_GSO_ tunnel option. SKB_GSO_DODGY is set from external virtio_net. We need to reset network header when callbacks.gso_segment() returns NULL.
This patch also includes ipv6_gso_segment(), considering SIT, etc.
--- net/ipv4/af_inet.c | 5 ++++- net/ipv6/ip6_offload.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
net/ipv4/af_inet.c +4 -1
@@ -1374,8 +1374,11 @@ struct sk_buff *inet_gso_segment(struct } ops =rcu_dereference (inet_offloads[proto]); -if (likely (ops && ops->callbacks.gso_segment)) +if (likely (ops && ops->callbacks.gso_segment)) { segs = ops->callbacks.gso_segment (skb, features); +if (!segs) + skb->network_header =skb_mac_header (skb) + nhoff - skb->head; + }if (IS_ERR_OR_NULL (segs)) goto out;
net/ipv6/ip6_offload.c +2 -0
@@ -113,6 +113,8 @@ static struct sk_buff *ipv6_gso_segment(if (likely (ops && ops->callbacks.gso_segment)) {skb_reset_transport_header (skb); segs = ops->callbacks.gso_segment (skb, features); +if (!segs) + skb->network_header =skb_mac_header (skb) + nhoff - skb->head; }if (IS_ERR_OR_NULL (segs))
Greg Kroah-Hartman
maintainerPATCH 31/80 openvswitch: Fix setting ipv6 fields causing hw csum failure
In reply to Greg Kroah-HartmanFrom: Paul Blakey <[email protected]>
commit d9b5ae5c1b241b91480aa30408be12fe91af834a upstream.
Ipv6 ttl, label and tos fields are modified without first pulling/pushing the ipv6 header, which would have updated the hw csum (if available). This might cause csum validation when sending the packet to the stack, as can be seen in the trace below.
Fix this by updating skb->csum if available.
Trace resulted by ipv6 ttl dec and then sending packet to conntrack [actions: set(ipv6(hlimit=63)),ct(zone=99)]:
[295241.900063] s_pf0vf2: hw csum failure [295241.923191] Call Trace: [295241.925728] <IRQ> [295241.927836] dump_stack+0x5c/0x80 [295241.931240] __skb_checksum_complete+0xac/0xc0 [295241.935778] nf_conntrack_tcp_packet+0x398/0xba0 [nf_conntrack] [295241.953030] nf_conntrack_in+0x498/0x5e0 [nf_conntrack] [295241.958344] __ovs_ct_lookup+0xac/0x860 [openvswitch] [295241.968532] ovs_ct_execute+0x4a7/0x7c0 [openvswitch] [295241.979167] do_execute_actions+0x54a/0xaa0 [openvswitch] [295242.001482] ovs_execute_actions+0x48/0x100 [openvswitch] [295242.006966] ovs_dp_process_packet+0x96/0x1d0 [openvswitch] [295242.012626] ovs_vport_receive+0x6c/0xc0 [openvswitch] [295242.028763] netdev_frame_hook+0xc0/0x180 [openvswitch] [295242.034074] __netif_receive_skb_core+0x2ca/0xcb0 [295242.047498] netif_receive_skb_internal+0x3e/0xc0 [295242.052291] napi_gro_receive+0xba/0xe0 [295242.056231] mlx5e_handle_rx_cqe_mpwrq_rep+0x12b/0x250 [mlx5_core] [295242.062513] mlx5e_poll_rx_cq+0xa0f/0xa30 [mlx5_core] [295242.067669] mlx5e_napi_poll+0xe1/0x6b0 [mlx5_core] [295242.077958] net_rx_action+0x149/0x3b0 [295242.086762] __do_softirq+0xd7/0x2d6 [295242.090427] irq_exit+0xf7/0x100 [295242.093748] do_IRQ+0x7f/0xd0 [295242.096806] common_interrupt+0xf/0xf [295242.100559] </IRQ> [295242.102750] RIP: 0033:0x7f9022e88cbd [295242.125246] RSP: 002b:00007f9022282b20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffda [295242.132900] RAX: 0000000000000005 RBX: 0000000000000010 RCX: 0000000000000000 [295242.140120] RDX: 00007f9022282ba8 RSI: 00007f9022282a30 RDI: 00007f9014005c30 [295242.147337] RBP: 00007f9014014d60 R08: 0000000000000020 R09: 00007f90254a8340 [295242.154557] R10: 00007f9022282a28 R11: 0000000000000246 R12: 0000000000000000 [295242.161775] R13: 00007f902308c000 R14: 000000000000002b R15: 00007f9022b71f40
--- include/net/checksum.h | 5 +++++ net/openvswitch/actions.c | 46 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 8 deletions(-)
include/net/checksum.h +5 -0
@@ -139,6 +139,11 @@ static inline void csum_replace2(__sum16 *sum = ~csum16_add (csum16_sub (~(*sum), old), new); } +static inline void csum_replace (__wsum *csum,__wsum old,__wsum new) +{ + *csum =csum_add (csum_sub (*csum, old), new); +} +struct sk_buff ;void inet_proto_csum_replace4 (__sum16 *sum,struct sk_buff *skb,__be32 from,__be32 to,bool pseudohdr);
net/openvswitch/actions.c +38 -8
68 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 32/80 drm/edid: Always set RGB444
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
commit ecbd4912a693b862e25cba0a6990a8c95b00721e upstream.
In order to fill the drm_display_info structure each time an EDID is read, the code currently will call drm_add_display_info with the parsed EDID.
drm_add_display_info will then call drm_reset_display_info to reset all the fields to 0, and then set them to the proper value depending on the EDID.
In the color_formats case, we will thus report that we don't support any color format, and then fill it back with RGB444 plus the additional formats described in the EDID Feature Support byte.
However, since that byte only contains format-related bits since the 1.4 specification, this doesn't happen if the EDID is following an earlier specification. In turn, it means that for one of these EDID, we end up with color_formats set to 0.
The EDID 1.3 specification never really specifies what it means by RGB exactly, but since both HDMI and DVI will use RGB444, it's fairly safe to assume it's supposed to be RGB444.
Let's move the addition of RGB444 to color_formats earlier in drm_add_display_info() so that it's always set for a digital display.
--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_edid.c +1 -1
@@ -5132,6 +5132,7 @@ u32 drm_add_display_info(struct drm_connif (!(edid->input &DRM_EDID_INPUT_DIGITAL ))return quirks; + info->color_formats |=DRM_COLOR_FORMAT_RGB444 ;drm_parse_cea_ext (connector, edid);/*
@@ -5180,7 +5181,6 @@ u32 drm_add_display_info(struct drm_connDRM_DEBUG ("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n" , connector->name, info->bpc); - info->color_formats |=DRM_COLOR_FORMAT_RGB444 ;if (edid->features &DRM_EDID_FEATURE_RGB_YCRCB444 ) info->color_formats |=DRM_COLOR_FORMAT_YCRCB444 ;if (edid->features &DRM_EDID_FEATURE_RGB_YCRCB422 )
Greg Kroah-Hartman
maintainerPATCH 33/80 net/mlx5e: Fix wrong return value on ioctl EEPROM query failure
In reply to Greg Kroah-HartmanFrom: Gal Pressman <[email protected]>
commit 0b89429722353d112f8b8b29ca397e95fa994d27 upstream.
The ioctl EEPROM query wrongly returns success on read failures, fix that by returning the appropriate error code.
--- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +1 -1
@@ -1746,7 +1746,7 @@ static int mlx5e_get_module_eeprom(strucif (size_read <0 ) {netdev_err (priv->netdev,"%s: mlx5_query_eeprom failed:0x%x\n" , __func__, size_read); -return 0 ; +return size_read; } i += size_read;
Greg Kroah-Hartman
maintainerPATCH 34/80 net/sched: act_ct: Fix flow table lookup after ct clear or switching zones
In reply to Greg Kroah-HartmanFrom: Paul Blakey <[email protected]>
commit 2f131de361f6d0eaff17db26efdb844c178432f8 upstream.
Flow table lookup is skipped if packet either went through ct clear action (which set the IP_CT_UNTRACKED flag on the packet), or while switching zones and there is already a connection associated with the packet. This will result in no SW offload of the connection, and the and connection not being removed from flow table with TCP teardown (fin/rst packet).
To fix the above, remove these unneccary checks in flow table lookup.
--- net/sched/act_ct.c | 5 ----- 1 file changed, 5 deletions(-)
net/sched/act_ct.c +0 -5
@@ -514,11 +514,6 @@ static bool tcf_ct_flow_table_lookup(strstruct nf_conn *ct;u8 dir; -/* Previously seen or loopback */ - ct =nf_ct_get (skb, &ctinfo); -if ((ct && !nf_ct_is_template (ct)) || ctinfo ==IP_CT_UNTRACKED ) -return false; -switch (family) {case NFPROTO_IPV4 :if (!tcf_ct_flow_table_fill_tuple_ipv4 (skb, &tuple, &tcph))
Greg Kroah-Hartman
maintainerPATCH 35/80 net: ll_temac: check the return value of devm_kmalloc()
In reply to Greg Kroah-HartmanFrom: Xiaoke Wang <[email protected]>
commit b352c3465bb808ab700d03f5bac2f7a6f37c5350 upstream.
devm_kmalloc() returns a pointer to allocated memory on success, NULL on failure. While lp->indirect_lock is allocated by devm_kmalloc() without proper check. It is better to check the value of it to prevent potential wrong memory access.
--- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/xilinx/ll_temac_main.c +2 -0
@@ -1421,6 +1421,8 @@ static int temac_probe(struct platform_d lp->indirect_lock =devm_kmalloc (&pdev->dev,sizeof (*lp->indirect_lock),GFP_KERNEL ); +if (!lp->indirect_lock) +return -ENOMEM ;spin_lock_init (lp->indirect_lock); }
Greg Kroah-Hartman
maintainerPATCH 36/80 net: Force inlining of checksum functions in net/checksum.h
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 5486f5bf790b5c664913076c3194b8f916a5c7ad upstream.
All functions defined as static inline in net/checksum.h are meant to be inlined for performance reason.
But since commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") the compiler is allowed to uninline functions when it wants.
Fair enough in the general case, but for tiny performance critical checksum helpers that's counter-productive.
The problem mainly arises when selecting CONFIG_CC_OPTIMISE_FOR_SIZE, Those helpers being 'static inline' in header files you suddenly find them duplicated many times in the resulting vmlinux.
Here is a typical exemple when building powerpc pmac32_defconfig with CONFIG_CC_OPTIMISE_FOR_SIZE. csum_sub() appears 4 times:
c04a23cc <csum_sub>: c04a23cc: 7c 84 20 f8 not r4,r4 c04a23d0: 7c 63 20 14 addc r3,r3,r4 c04a23d4: 7c 63 01 94 addze r3,r3 c04a23d8: 4e 80 00 20 blr ... c04a2ce8: 4b ff f6 e5 bl c04a23cc <csum_sub> ... c04a2d2c: 4b ff f6 a1 bl c04a23cc <csum_sub> ... c04a2d54: 4b ff f6 79 bl c04a23cc <csum_sub> ... c04a754c <csum_sub>: c04a754c: 7c 84 20 f8 not r4,r4 c04a7550: 7c 63 20 14 addc r3,r3,r4 c04a7554: 7c 63 01 94 addze r3,r3 c04a7558: 4e 80 00 20 blr ... c04ac930: 4b ff ac 1d bl c04a754c <csum_sub> ... c04ad264: 4b ff a2 e9 bl c04a754c <csum_sub> ... c04e3b08 <csum_sub>: c04e3b08: 7c 84 20 f8 not r4,r4 c04e3b0c: 7c 63 20 14 addc r3,r3,r4 c04e3b10: 7c 63 01 94 addze r3,r3 c04e3b14: 4e 80 00 20 blr ... c04e5788: 4b ff e3 81 bl c04e3b08 <csum_sub> ... c04e65c8: 4b ff d5 41 bl c04e3b08 <csum_sub> ... c0512d34 <csum_sub>: c0512d34: 7c 84 20 f8 not r4,r4 c0512d38: 7c 63 20 14 addc r3,r3,r4 c0512d3c: 7c 63 01 94 addze r3,r3 c0512d40: 4e 80 00 20 blr ... c0512dfc: 4b ff ff 39 bl c0512d34 <csum_sub> ... c05138bc: 4b ff f4 79 bl c0512d34 <csum_sub> ...
Restore the expected behaviour by using __always_inline for all functions defined in net/checksum.h
vmlinux size is even reduced by 256 bytes with this patch:
text data bss dec hex filename 6980022 2515362 194384 9689768 93daa8 vmlinux.before 6979862 2515266 194384 9689512 93d9a8 vmlinux.now
--- include/net/checksum.h | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-)
include/net/checksum.h +22 -21
@@ -22,7 +22,7 @@#include <asm/checksum.h> #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER -static inline +static __always_inline __wsum csum_and_copy_from_user (const void __user *src, void *dst,int len) {
@@ -33,7 +33,7 @@ __wsum csum_and_copy_from_user (const vo#endif #ifndef HAVE_CSUM_COPY_USER -static __inline____wsum csum_and_copy_to_user +static __always_inline __wsum csum_and_copy_to_user (const void *src,void __user *dst,int len) {__wsum sum =csum_partial (src, len, ~0U );
@@ -45,7 +45,7 @@ static __inline__ __wsum csum_and_copy_t#endif #ifndef _HAVE_ARCH_CSUM_AND_COPY -static inline __wsum +static __always_inline __wsumcsum_partial_copy_nocheck (const void *src,void *dst,int len) {memcpy (dst, src, len);
@@ -54,7 +54,7 @@ csum_partial_copy_nocheck(const void *sr#endif #ifndef HAVE_ARCH_CSUM_ADD -static inline __wsum csum_add (__wsum csum,__wsum addend) +static __always_inline __wsum csum_add(__wsum csum, __wsum addend) {u32 res = (__force u32 )csum; res += (__force u32 )addend;
@@ -62,12 +62,12 @@ static inline __wsum csum_add(__wsum csu }#endif -static inline __wsum csum_sub (__wsum csum,__wsum addend) +static __always_inline __wsum csum_sub(__wsum csum, __wsum addend) {return csum_add (csum, ~addend); } -static inline __sum16 csum16_add (__sum16 csum,__be16 addend) +static __always_inline __sum16 csum16_add(__sum16 csum, __be16 addend) {u16 res = (__force u16 )csum;
@@ -75,12 +75,12 @@ static inline __sum16 csum16_add(__sum16return (__force __sum16)(res + (res < (__force u16 )addend)); } -static inline __sum16 csum16_sub (__sum16 csum,__be16 addend) +static __always_inline __sum16 csum16_sub(__sum16 csum, __be16 addend) {return csum16_add (csum, ~addend); } -static inline __wsum +static __always_inline __wsumcsum_block_add (__wsum csum,__wsum csum2,int offset) {u32 sum = (__force u32 )csum2;
@@ -92,36 +92,37 @@ csum_block_add(__wsum csum, __wsum csum2return csum_add (csum, (__force __wsum )sum); } -static inline __wsum +static __always_inline __wsumcsum_block_add_ext (__wsum csum,__wsum csum2,int offset,int len) {return csum_block_add (csum, csum2, offset); } -static inline __wsum +static __always_inline __wsumcsum_block_sub (__wsum csum,__wsum csum2,int offset) {return csum_block_add (csum, ~csum2, offset); } -static inline __wsum csum_unfold (__sum16 n) +static __always_inline __wsum csum_unfold(__sum16 n) {return (__force __wsum )n; } -static inline __wsum csum_partial_ext (const void *buff,int len,__wsum sum) +static __always_inline +__wsum csum_partial_ext(const void *buff, int len, __wsum sum) {return csum_partial (buff, len, sum); }#define CSUM_MANGLED_0 ((__force __sum16)0xffff) -static inline void csum_replace_by_diff (__sum16 *sum,__wsum diff) +static __always_inline void csum_replace_by_diff(__sum16 *sum, __wsum diff) { *sum =csum_fold (csum_add (diff, ~csum_unfold (*sum))); } -static inline void csum_replace4 (__sum16 *sum,__be32 from,__be32 to) +static __always_inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) {__wsum tmp =csum_sub (~csum_unfold (*sum), (__force __wsum )from);
@@ -134,7 +135,7 @@ static inline void csum_replace4(__sum16* m : old value of a 16bit field * m' : new value of a 16bit field */ -static inline void csum_replace2 (__sum16 *sum,__be16 old,__be16 new) +static __always_inline void csum_replace2(__sum16 *sum, __be16 old, __be16 new) { *sum = ~csum16_add (csum16_sub (~(*sum), old), new); }
@@ -153,16 +154,16 @@ void inet_proto_csum_replace16(__sum16 *void inet_proto_csum_replace_by_diff (__sum16 *sum,struct sk_buff *skb,__wsum diff,bool pseudohdr); -static inline void inet_proto_csum_replace2 (__sum16 *sum,struct sk_buff *skb, -__be16 from,__be16 to, -bool pseudohdr) +static __always_inline +void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, +__be16 from,__be16 to,bool pseudohdr) {inet_proto_csum_replace4 (sum, skb, (__force __be32 )from, (__force __be32 )to, pseudohdr); } -static inline __wsum remcsum_adjust (void *ptr,__wsum csum, -int start,int offset) +static __always_inline __wsum remcsum_adjust(void *ptr, __wsum csum, +int start,int offset) {__sum16 *psum = (__sum16 *)(ptr + offset);__wsum delta;
@@ -178,7 +179,7 @@ static inline __wsum remcsum_adjust(voidreturn delta; } -static inline void remcsum_unadjust (__sum16 *psum,__wsum delta) +static __always_inline void remcsum_unadjust(__sum16 *psum, __wsum delta) { *psum =csum_fold (csum_sub (delta, (__force __wsum)*psum)); }
Greg Kroah-Hartman
maintainerPATCH 37/80 nfp: flower: Fix a potential leak in nfp_tunnel_add_shared_mac()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 3a14d0888eb4b0045884126acc69abfb7b87814d upstream.
ida_simple_get() returns an id between min (0) and max (NFP_MAX_MAC_INDEX) inclusive.
So NFP_MAX_MAC_INDEX (0xff) is a valid id.
In order for the error handling path to work correctly, the 'invalid' value for 'ida_idx' should not be in the 0..NFP_MAX_MAC_INDEX range, inclusive.
So set it to -1.
--- drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +2 -2
@@ -922,8 +922,8 @@ nfp_tunnel_add_shared_mac(struct nfp_app int port, bool mod) {struct nfp_flower_priv *priv = app->priv; -int ida_idx =NFP_MAX_MAC_INDEX , err;struct nfp_tun_offloaded_mac *entry; +int ida_idx =-1 , err;u16 nfp_mac_idx =0 ; entry =nfp_tunnel_lookup_offloaded_macs (app, netdev->dev_addr);
@@ -997,7 +997,7 @@ err_remove_hash: err_free_entry:kfree (entry); err_free_ida: -if (ida_idx !=NFP_MAX_MAC_INDEX ) +if (ida_idx !=-1 )ida_simple_remove (&priv->tun.mac_off_ids, ida_idx);return err;
Greg Kroah-Hartman
maintainerPATCH 38/80 netfilter: nf_tables: fix memory leak during stateful obj update
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
commit dad3bdeef45f81a6e90204bcc85360bb76eccec7 upstream.
stateful objects can be updated from the control plane. The transaction logic allocates a temporary object for this purpose.
The ->init function was called for this object, so plain kfree() leaks resources. We must call ->destroy function of the object.
nft_obj_destroy does this, but it also decrements the module refcount, but the update path doesn't increment it.
To avoid special-casing the update object release, do module_get for the update case too and release it via nft_obj_destroy().
--- net/netfilter/nf_tables_api.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
net/netfilter/nf_tables_api.c +9 -4
@@ -5924,12 +5924,15 @@ static int nf_tables_updobj(const struct {struct nft_object *newobj;struct nft_trans *trans; -int err; +int err = -ENOMEM ; + +if (!try_module_get (type->owner)) +return -ENOENT ; trans =nft_trans_alloc (ctx,NFT_MSG_NEWOBJ ,sizeof (struct nft_trans_obj ));if (!trans) -return -ENOMEM ; + goto err_trans; newobj =nft_obj_init (ctx, type, attr);if (IS_ERR (newobj)) {
@@ -5946,6 +5949,8 @@ static int nf_tables_updobj(const struct err_free_trans:kfree (trans); +err_trans: +module_put (type->owner);return err; }
@@ -7555,7 +7560,7 @@ static void nft_obj_commit_update(structif (obj->ops->update) obj->ops->update (obj, newobj); -kfree (newobj); +nft_obj_destroy (&trans->ctx, newobj); }static void nft_commit_release (struct nft_trans *trans)
@@ -8202,7 +8207,7 @@ static int __nf_tables_abort(struct netbreak ;case NFT_MSG_NEWOBJ :if (nft_trans_obj_update (trans)) { -kfree (nft_trans_obj_newobj (trans)); +nft_obj_destroy (&trans->ctx,nft_trans_obj_newobj (trans));nft_trans_destroy (trans); }else { trans->ctx.table->use--;
Greg Kroah-Hartman
maintainerPATCH 39/80 net/smc: Use a mutex for locking "struct smc_pnettable"
In reply to Greg Kroah-HartmanFrom: Fabio M. De Francesco <[email protected]>
commit 7ff57e98fb78ad94edafbdc7435f2d745e9e6bb5 upstream.
smc_pnetid_by_table_ib() uses read_lock() and then it calls smc_pnet_apply_ib() which, in turn, calls mutex_lock(&smc_ib_devices.mutex).
read_lock() disables preemption. Therefore, the code acquires a mutex while in atomic context and it leads to a SAC bug.
Fix this bug by replacing the rwlock with a mutex.
--- net/smc/smc_pnet.c | 42 +++++++++++++++++++++--------------------- net/smc/smc_pnet.h | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-)
net/smc/smc_pnet.c +21 -21
@@ -112,7 +112,7 @@ static int smc_pnet_remove_by_pnetid(str pnettable = &sn->pnettable;/* remove table entry */ -write_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry_safe (pnetelem, tmp_pe, &pnettable->pnetlist, list) { if (!pnet_name ||
@@ -130,7 +130,7 @@ static int smc_pnet_remove_by_pnetid(str rc =0 ; } } -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);/* if this is not the initial namespace, stop here */ if (net != &init_net)
@@ -191,7 +191,7 @@ static int smc_pnet_add_by_ndev(struct n sn =net_generic (net, smc_net_id); pnettable = &sn->pnettable; -write_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry_safe (pnetelem, tmp_pe, &pnettable->pnetlist, list) {if (pnetelem->type ==SMC_PNET_ETH && !pnetelem->ndev && !strncmp (pnetelem->eth_name, ndev->name,IFNAMSIZ )) {
@@ -205,7 +205,7 @@ static int smc_pnet_add_by_ndev(struct nbreak ; } } -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);return rc; }
@@ -223,7 +223,7 @@ static int smc_pnet_remove_by_ndev(struc sn =net_generic (net, smc_net_id); pnettable = &sn->pnettable; -write_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry_safe (pnetelem, tmp_pe, &pnettable->pnetlist, list) {if (pnetelem->type ==SMC_PNET_ETH && pnetelem->ndev == ndev) {dev_put (pnetelem->ndev);
@@ -236,7 +236,7 @@ static int smc_pnet_remove_by_ndev(strucbreak ; } } -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);return rc; }
@@ -371,7 +371,7 @@ static int smc_pnet_add_eth(struct smc_p rc = -EEXIST ; new_netdev = true; -write_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry (tmp_pe, &pnettable->pnetlist, list) {if (tmp_pe->type ==SMC_PNET_ETH && !strncmp (tmp_pe->eth_name, eth_name,IFNAMSIZ )) {
@@ -381,9 +381,9 @@ static int smc_pnet_add_eth(struct smc_p }if (new_netdev) {list_add_tail (&new_pe->list, &pnettable->pnetlist); -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock); }else { -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);kfree (new_pe); goto out_put; }
@@ -445,7 +445,7 @@ static int smc_pnet_add_ib(struct smc_pn new_pe->ib_port = ib_port; new_ibdev = true; -write_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry (tmp_pe, &pnettable->pnetlist, list) {if (tmp_pe->type ==SMC_PNET_IB && !strncmp (tmp_pe->ib_name, ib_name,IB_DEVICE_NAME_MAX )) {
@@ -455,9 +455,9 @@ static int smc_pnet_add_ib(struct smc_pn }if (new_ibdev) {list_add_tail (&new_pe->list, &pnettable->pnetlist); -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock); }else { -write_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);kfree (new_pe); }return (new_ibdev) ?0 : -EEXIST ;
@@ -602,7 +602,7 @@ static int _smc_pnet_dump(struct net *ne pnettable = &sn->pnettable;/* dump pnettable entries */ -read_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry (pnetelem, &pnettable->pnetlist, list) {if (pnetid && !smc_pnet_match (pnetelem->pnet_name, pnetid))continue ;
@@ -617,7 +617,7 @@ static int _smc_pnet_dump(struct net *nebreak ; } } -read_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);return idx; }
@@ -859,7 +859,7 @@ int smc_pnet_net_init(struct net *net)struct smc_pnetids_ndev *pnetids_ndev = &sn->pnetids_ndev;INIT_LIST_HEAD (&pnettable->pnetlist); -rwlock_init (&pnettable->lock); +mutex_init (&pnettable->lock);INIT_LIST_HEAD (&pnetids_ndev->list);rwlock_init (&pnetids_ndev->lock);
@@ -939,7 +939,7 @@ static int smc_pnet_find_ndev_pnetid_by_ sn =net_generic (net, smc_net_id); pnettable = &sn->pnettable; -read_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry (pnetelem, &pnettable->pnetlist, list) {if (pnetelem->type ==SMC_PNET_ETH && ndev == pnetelem->ndev) {/* get pnetid of netdev device */
@@ -948,7 +948,7 @@ static int smc_pnet_find_ndev_pnetid_by_break ; } } -read_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);return rc; }
@@ -1129,7 +1129,7 @@ int smc_pnetid_by_table_ib(struct smc_ib sn =net_generic (&init_net, smc_net_id); pnettable = &sn->pnettable; -read_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry (tmp_pe, &pnettable->pnetlist, list) { if (tmp_pe->type == SMC_PNET_IB && !strncmp(tmp_pe->ib_name, ib_name, IB_DEVICE_NAME_MAX) &&
@@ -1139,7 +1139,7 @@ int smc_pnetid_by_table_ib(struct smc_ibbreak ; } } -read_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);return rc; }
@@ -1158,7 +1158,7 @@ int smc_pnetid_by_table_smcd(struct smcd sn =net_generic (&init_net, smc_net_id); pnettable = &sn->pnettable; -read_lock (&pnettable->lock); +mutex_lock (&pnettable->lock);list_for_each_entry (tmp_pe, &pnettable->pnetlist, list) {if (tmp_pe->type ==SMC_PNET_IB && !strncmp (tmp_pe->ib_name, ib_name,IB_DEVICE_NAME_MAX )) {
@@ -1167,7 +1167,7 @@ int smc_pnetid_by_table_smcd(struct smcdbreak ; } } -read_unlock (&pnettable->lock); +mutex_unlock (&pnettable->lock);return rc; }
net/smc/smc_pnet.h +1 -1
@@ -29,7 +29,7 @@ struct smc_link_group;* @pnetlist: List of PNETIDs */ struct smc_pnettable { -rwlock_t lock; +struct mutex lock;struct list_head pnetlist; };
Greg Kroah-Hartman
maintainerPATCH 40/80 surface: surface3_power: Fix battery readings on batteries without a serial number
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 21d90aaee8d5c2a097ef41f1430d97661233ecc6 upstream.
The battery on the 2nd hand Surface 3 which I recently bought appears to not have a serial number programmed in. This results in any I2C reads from the registers containing the serial number failing with an I2C NACK.
This was causing mshw0011_bix() to fail causing the battery readings to not work at all.
Ignore EREMOTEIO (I2C NACK) errors when retrieving the serial number and continue with an empty serial number to fix this.
--- drivers/platform/x86/surface3_power.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/platform/x86/surface3_power.c +10 -3
@@ -233,14 +233,21 @@ static int mshw0011_bix(struct mshw0011_ } bix->last_full_charg_capacity = ret; -/* get serial number */ +/* +* Get serial number, on some devices (with unofficial replacement +* battery?) reading any of the serial number range addresses gets +* nacked in this case just leave the serial number empty. +*/ ret =i2c_smbus_read_i2c_block_data (client,MSHW0011_BAT0_REG_SERIAL_NO ,sizeof (buf), buf); -if (ret !=sizeof (buf)) { +if (ret == -EREMOTEIO ) { +/* no serial number available */ + }else if (ret !=sizeof (buf)) {dev_err (&client->dev,"Error reading serial no: %d\n" , ret);return ret; + }else { +snprintf (bix->serial,ARRAY_SIZE (bix->serial),"%3pE%6pE" , buf +7 , buf); } -snprintf (bix->serial,ARRAY_SIZE (bix->serial),"%3pE%6pE" , buf +7 , buf);/* get cycle count */ ret =i2c_smbus_read_word_data (client,MSHW0011_BAT0_REG_CYCLE_CNT );
Greg Kroah-Hartman
maintainerPATCH 41/80 udp_tunnel: Fix end of loop test in udp_tunnel_nic_unregister()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit de7b2efacf4e83954aed3f029d347dfc0b7a4f49 upstream.
This test is checking if we exited the list via break or not. However if it did not exit via a break then "node" does not point to a valid udp_tunnel_nic_shared_node struct. It will work because of the way the structs are laid out it's the equivalent of
"if (info->shared->udp_tunnel_nic_info != dev)" which will always be true, but it's not the right way to test.
--- net/ipv4/udp_tunnel_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/udp_tunnel_nic.c +1 -1
@@ -846,7 +846,7 @@ udp_tunnel_nic_unregister(struct net_devlist_for_each_entry (node, &info->shared->devices, list)if (node->dev == dev)break ; -if (node->dev != dev) +if (list_entry_is_head (node, &info->shared->devices, list))return ;list_del (&node->list);
Greg Kroah-Hartman
maintainerPATCH 42/80 net/mlx5: Fix possible deadlock on rule deletion
In reply to Greg Kroah-HartmanFrom: Maor Gottlieb <[email protected]>
commit b645e57debca846f51b3209907546ea857ddd3f5 upstream.
Add missing call to up_write_ref_node() which releases the semaphore in case the FTE doesn't have destinations, such in drop rule case.
--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 -0
@@ -2034,6 +2034,8 @@ void mlx5_del_flow_rules(struct mlx5_flo fte->node.del_hw_func =NULL ;up_write_ref_node (&fte->node, false);tree_put_node (&fte->node, false); + }else { +up_write_ref_node (&fte->node, false); }kfree (handle); }
Greg Kroah-Hartman
maintainerPATCH 43/80 net/mlx5: Fix wrong limitation of metadata match on ecpf
In reply to Greg Kroah-HartmanFrom: Ariel Levkovich <[email protected]>
commit 07666c75ad17d7389b18ac0235c8cf41e1504ea8 upstream.
Match metadata support check returns false for ecpf device. However, this support does exist for ecpf and therefore this limitation should be removed to allow feature such as stacked devices and internal port offloaded to be supported.
--- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +0 -4
@@ -2037,10 +2037,6 @@ esw_check_vport_match_metadata_supportedif (!MLX5_CAP_ESW_FLOWTABLE (esw->dev, flow_source))return false; -if (mlx5_core_is_ecpf_esw_manager (esw->dev) || -mlx5_ecpf_vport_exists (esw->dev)) -return false; -return true; }
Greg Kroah-Hartman
maintainerPATCH 44/80 net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets
In reply to Greg Kroah-HartmanFrom: Tariq Toukan <[email protected]>
commit 7eaf1f37b8817c608c4e959d69986ef459d345cd upstream.
For RX TLS device-offloaded packets, the HW spec guarantees checksum validation for the offloaded packets, but does not define whether the CQE.checksum field matches the original packet (ciphertext) or the decrypted one (plaintext). This latitude allows architetctural improvements between generations of chips, resulting in different decisions regarding the value type of CQE.checksum.
Hence, for these packets, the device driver should not make use of this CQE field. Here we block CHECKSUM_COMPLETE usage for RX TLS device-offloaded packets, and use CHECKSUM_UNNECESSARY instead.
Value of the packet's tcp_hdr.csum is not modified by the HW, and it always matches the original ciphertext.
--- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +2 -1
@@ -985,7 +985,8 @@ static inline void mlx5e_handle_csum(str }/* True when explicitly set via priv flag, or XDP prog is loaded */ -if (test_bit (MLX5E_RQ_STATE_NO_CSUM_COMPLETE , &rq->state)) +if (test_bit (MLX5E_RQ_STATE_NO_CSUM_COMPLETE , &rq->state) || +get_cqe_tls_offload (cqe)) goto csum_unnecessary;/* CQE csum doesn't cover padding octets in short ethernet
Greg Kroah-Hartman
maintainerPATCH 45/80 spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op()
In reply to Greg Kroah-HartmanFrom: Zhou Qingyang <[email protected]>
[ Upstream commit ab3824427b848da10e9fe2727f035bbeecae6ff4 ]
In zynq_qspi_exec_mem_op(), kzalloc() is directly used in memset(), which could lead to a NULL pointer dereference on failure of kzalloc().
Fix this bug by adding a check of tmpbuf.
This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs.
Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug.
Builds with CONFIG_SPI_ZYNQ_QSPI=m show no new warnings, and our static analyzer no longer warns about this code.
--- drivers/spi/spi-zynq-qspi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/spi/spi-zynq-qspi.c +3 -0
@@ -570,6 +570,9 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem,if (op->dummy.nbytes) { tmpbuf =kzalloc (op->dummy.nbytes,GFP_KERNEL ); +if (!tmpbuf) +return -ENOMEM ; +memset (tmpbuf,0xff , op->dummy.nbytes);reinit_completion (&xqspi->data_completion); xqspi->txbuf = tmpbuf;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 46/80 regmap-irq: Update interrupt clear register for proper reset
In reply to Greg Kroah-HartmanFrom: Prasad Kumpatla <[email protected]>
[ Upstream commit d04ad245d67a3991dfea5e108e4c452c2ab39bac ]
With the existing logic where clear_ack is true (HW doesn’t support auto clear for ICR), interrupt clear register reset is not handled properly. Due to this only the first interrupts get processed properly and further interrupts are blocked due to not resetting interrupt clear register.
Example for issue case where Invert_ack is false and clear_ack is true:
Say Default ISR=0x00 & ICR=0x00 and ISR is triggered with 2
interrupts making ISR = 0x11.
Step 1: Say ISR is set 0x11 (store status_buff = ISR). ISR needs to
be cleared with the help of ICR once the Interrupt is processed.
Step 2: Write ICR = 0x11 (status_buff), this will clear the ISR to 0x00.
Step 3: Issue - In the existing code, ICR is written with ICR =
~(status_buff) i.e ICR = 0xEE -> This will block all the interrupts
from raising except for interrupts 0 and 4. So expectation here is to
reset ICR, which will unblock all the interrupts.
if (chip->clear_ack) {
if (chip->ack_invert && !ret)
........
else if (!ret)
ret = regmap_write(map, reg,
~data->status_buf[i]);So writing 0 and 0xff (when ack_invert is true) should have no effect, other than clearing the ACKs just set.
--- drivers/base/regmap/regmap-irq.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
drivers/base/regmap/regmap-irq.c +6 -14
@@ -170,11 +170,9 @@ static void regmap_irq_sync_unlock(struct irq_data *data) ret =regmap_write (map, reg, d->mask_buf[i]);if (d->chip->clear_ack) {if (d->chip->ack_invert && !ret) - ret =regmap_write (map, reg, - d->mask_buf[i]); + ret =regmap_write (map, reg,UINT_MAX );else if (!ret) - ret =regmap_write (map, reg, - ~d->mask_buf[i]); + ret =regmap_write (map, reg,0 ); }if (ret !=0 ) dev_err(d->map->dev, "Failed to ack 0x%x: %d\n",
@@ -509,11 +507,9 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) data->status_buf[i]);if (chip->clear_ack) {if (chip->ack_invert && !ret) - ret =regmap_write (map, reg, - data->status_buf[i]); + ret =regmap_write (map, reg,UINT_MAX );else if (!ret) - ret =regmap_write (map, reg, - ~data->status_buf[i]); + ret =regmap_write (map, reg,0 ); }if (ret !=0 ) dev_err(map->dev, "Failed to ack 0x%x: %d\n",
@@ -745,13 +741,9 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, d->status_buf[i] & d->mask_buf[i]);if (chip->clear_ack) {if (chip->ack_invert && !ret) - ret =regmap_write (map, reg, - (d->status_buf[i] & - d->mask_buf[i])); + ret =regmap_write (map, reg,UINT_MAX );else if (!ret) - ret =regmap_write (map, reg, - ~(d->status_buf[i] & - d->mask_buf[i])); + ret =regmap_write (map, reg,0 ); }if (ret !=0 ) { dev_err(map->dev, "Failed to ack 0x%x: %d\n",
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 47/80 RDMA/rtrs-clt: Fix possible double free in error case
In reply to Greg Kroah-HartmanFrom: Md Haris Iqbal <[email protected]>
[ Upstream commit 8700af2cc18c919b2a83e74e0479038fd113c15d ]
Callback function rtrs_clt_dev_release() for put_device() calls kfree(clt) to free memory. We shouldn't call kfree(clt) again, and we can't use the clt after kfree too.
Replace device_register() with device_initialize() and device_add() so that dev_set_name can() be used appropriately.
Move mutex_destroy() to the release function so it can be called in the alloc_clt err path.
--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 37 ++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +20 -17
@@ -2540,6 +2540,8 @@ static void rtrs_clt_dev_release(struct device *dev) { struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev); +mutex_destroy (&clt->paths_ev_mutex); +mutex_destroy (&clt->paths_mutex);kfree (clt); }
@@ -2571,6 +2573,8 @@ static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num,return ERR_PTR (-ENOMEM ); } + clt->dev.class = rtrs_clt_dev_class; + clt->dev.release = rtrs_clt_dev_release;uuid_gen (&clt->paths_uuid);INIT_LIST_HEAD_RCU (&clt->paths_list); clt->paths_num = paths_num;
@@ -2588,43 +2592,41 @@ static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num,init_waitqueue_head (&clt->permits_wait);mutex_init (&clt->paths_ev_mutex);mutex_init (&clt->paths_mutex); +device_initialize (&clt->dev); - clt->dev.class = rtrs_clt_dev_class; - clt->dev.release = rtrs_clt_dev_release; err =dev_set_name (&clt->dev,"%s" , sessname);if (err) - goto err; + goto err_put; +/* * Suppress user space notification until * sysfs files are created */ dev_set_uevent_suppress (&clt->dev, true); - err =device_register (&clt->dev); -if (err) { -put_device (&clt->dev); - goto err; - } + err =device_add (&clt->dev); +if (err) + goto err_put; clt->kobj_paths =kobject_create_and_add ("paths" , &clt->dev.kobj);if (!clt->kobj_paths) { err = -ENOMEM ; - goto err_dev; + goto err_del; } err =rtrs_clt_create_sysfs_root_files (clt);if (err) {kobject_del (clt->kobj_paths);kobject_put (clt->kobj_paths); - goto err_dev; + goto err_del; }dev_set_uevent_suppress (&clt->dev, false);kobject_uevent (&clt->dev.kobj,KOBJ_ADD );return clt; -err_dev: -device_unregister (&clt->dev); -err: +err_del: +device_del (&clt->dev); +err_put:free_percpu (clt->pcpu_path); -kfree (clt); +put_device (&clt->dev);return ERR_PTR (err); }
@@ -2643,9 +2645,10 @@ static void free_clt(struct rtrs_clt *clt)wait_for_inflight_permits (clt);free_permits (clt);free_percpu (clt->pcpu_path); -mutex_destroy (&clt->paths_ev_mutex); -mutex_destroy (&clt->paths_mutex); -/* release callback will free clt in last put */ + +/* +* release callback will free clt and destroy mutexes in last put +*/ device_unregister (&clt->dev); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 48/80 RDMA/rtrs-clt: Kill wait_for_inflight_permits
In reply to Greg Kroah-HartmanFrom: Guoqing Jiang <[email protected]>
[ Upstream commit 25a033f5a75873cfdd36eca3c702363b682afb42 ]
Let's wait the inflight permits before free it.
--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +6 -11
@@ -1328,6 +1328,12 @@ static int alloc_permits(struct rtrs_clt *clt)static void free_permits (struct rtrs_clt *clt) { +if (clt->permits_map) { +size_t sz = clt->queue_depth; + +wait_event (clt->permits_wait, +find_first_bit (clt->permits_map, sz) >= sz); + }kfree (clt->permits_map); clt->permits_map =NULL ;kfree (clt->permits);
@@ -2630,19 +2636,8 @@ static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num,return ERR_PTR (err); } -static void wait_for_inflight_permits (struct rtrs_clt *clt) -{ -if (clt->permits_map) { -size_t sz = clt->queue_depth; - -wait_event (clt->permits_wait, -find_first_bit (clt->permits_map, sz) >= sz); - } -} -static void free_clt (struct rtrs_clt *clt) { -wait_for_inflight_permits (clt);free_permits (clt);free_percpu (clt->pcpu_path);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 49/80 RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close
In reply to Greg Kroah-HartmanFrom: Md Haris Iqbal <[email protected]>
[ Upstream commit c46fa8911b17e3f808679061a8af8bee219f4602 ]
Error path of rtrs_clt_open() calls free_clt(), where free_permit is called. This is wrong since error path of rtrs_clt_open() does not need to call free_permit().
Also, moving free_permits() call to rtrs_clt_close(), makes it more aligned with the call to alloc_permit() in rtrs_clt_open().
--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +1 -1
@@ -2638,7 +2638,6 @@ static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num,static void free_clt (struct rtrs_clt *clt) { -free_permits (clt);free_percpu (clt->pcpu_path);/*
@@ -2759,6 +2758,7 @@ void rtrs_clt_close(struct rtrs_clt *clt)rtrs_clt_destroy_sess_files (sess,NULL );kobject_put (&sess->kobj); } +free_permits (clt);free_clt (clt); }EXPORT_SYMBOL (rtrs_clt_close);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 50/80 configfs: fix a race in configfs_{,un}register_subsystem()
In reply to Greg Kroah-HartmanFrom: ChenXiaoSong <[email protected]>
[ Upstream commit 84ec758fb2daa236026506868c8796b0500c047d ]
When configfs_register_subsystem() or configfs_unregister_subsystem() is executing link_group() or unlink_group(),
it is possible that two processes add or delete list concurrently. Some unfortunate interleavings of them can cause kernel panic.
One of cases is:
A --> B --> C --> D
A <-- B <-- C <-- D
delete list_head *B | delete list_head *C
--------------------------------|-----------------------------------
configfs_unregister_subsystem | configfs_unregister_subsystem
unlink_group | unlink_group
unlink_obj | unlink_obj
list_del_init | list_del_init
__list_del_entry | __list_del_entry
__list_del | __list_del
// next == C |
next->prev = prev |
| next->prev = prev
prev->next = next |
| // prev == B
| prev->next = nextFix this by adding mutex when calling link_group() or unlink_group(), but parent configfs_subsystem is NULL when config_item is root. So I create a mutex configfs_subsystem_mutex.
--- fs/configfs/dir.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
fs/configfs/dir.c +14 -0
@@ -36,6 +36,14 @@*/ DEFINE_SPINLOCK (configfs_dirent_lock); +/* +* All of link_obj/unlink_obj/link_group/unlink_group require that +* subsys->su_mutex is held. +* But parent configfs_subsystem is NULL when config_item is root. +* Use this mutex when config_item is root. +*/ +static DEFINE_MUTEX (configfs_subsystem_mutex); +static void configfs_d_iput (struct dentry * dentry,struct inode * inode) {
@@ -1884,7 +1892,9 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys) group->cg_item.ci_name = group->cg_item.ci_namebuf; sd = root->d_fsdata; +mutex_lock (&configfs_subsystem_mutex);link_group (to_config_group (sd->s_element), group); +mutex_unlock (&configfs_subsystem_mutex);inode_lock_nested (d_inode (root),I_MUTEX_PARENT );
@@ -1909,7 +1919,9 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)inode_unlock (d_inode (root));if (err) { +mutex_lock (&configfs_subsystem_mutex);unlink_group (group); +mutex_unlock (&configfs_subsystem_mutex);configfs_release_fs (); }put_fragment (frag);
@@ -1956,7 +1968,9 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)dput (dentry); +mutex_lock (&configfs_subsystem_mutex);unlink_group (group); +mutex_unlock (&configfs_subsystem_mutex);configfs_release_fs (); }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 51/80 RDMA/ib_srp: Fix a deadlock
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
[ Upstream commit 081bdc9fe05bb23248f5effb6f811da3da4b8252 ]
Remove the flush_workqueue(system_long_wq) call since flushing system_long_wq is deadlock-prone and since that call is redundant with a preceding cancel_work_sync()
--- drivers/infiniband/ulp/srp/ib_srp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +4 -2
@@ -4045,9 +4045,11 @@ static void srp_remove_one(struct ib_device *device, void *client_data)spin_unlock (&host->target_lock);/* -* Wait for tl_err and target port removal tasks. +* srp_queue_remove_work() queues a call to +* srp_remove_target(). The latter function cancels +* target->tl_err_work so waiting for the remove works to +* finish is sufficient. */ -flush_workqueue (system_long_wq);flush_workqueue (srp_remove_wq);kfree (host);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 52/80 tracing: Have traceon and traceoff trigger honor the instance
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 302e9edd54985f584cfc180098f3554774126969 upstream.
If a trigger is set on an event to disable or enable tracing within an instance, then tracing should be disabled or enabled in the instance and not at the top level, which is confusing to users.
--- kernel/trace/trace_events_trigger.c | 52 +++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-)
kernel/trace/trace_events_trigger.c +46 -6
@@ -940,6 +940,16 @@ static void traceon_trigger(struct event_trigger_data *data, void *rec, struct ring_buffer_event *event) { + struct trace_event_file *file = data->private_data; + +if (file) { +if (tracer_tracing_is_on (file->tr)) +return ; + +tracer_tracing_on (file->tr); +return ; + } +if (tracing_is_on ())return ;
@@ -950,8 +960,15 @@ static void traceon_count_trigger(struct event_trigger_data *data, void *rec, struct ring_buffer_event *event) { - if (tracing_is_on()) - return; + struct trace_event_file *file = data->private_data; + +if (file) { +if (tracer_tracing_is_on (file->tr)) +return ; + }else { +if (tracing_is_on ()) +return ; + }if (!data->count)return ;
@@ -959,13 +976,26 @@ traceon_count_trigger(struct event_triggif (data->count !=-1 ) (data->count)--; -tracing_on (); +if (file) +tracer_tracing_on (file->tr); +else +tracing_on (); }static void traceoff_trigger (struct event_trigger_data *data,void *rec,struct ring_buffer_event *event) { +struct trace_event_file *file = data->private_data; + +if (file) { +if (!tracer_tracing_is_on (file->tr)) +return ; + +tracer_tracing_off (file->tr); +return ; + } +if (!tracing_is_on ())return ;
@@ -976,8 +1006,15 @@ static void traceoff_count_trigger(struct event_trigger_data *data, void *rec, struct ring_buffer_event *event) { - if (!tracing_is_on()) - return; + struct trace_event_file *file = data->private_data; + +if (file) { +if (!tracer_tracing_is_on (file->tr)) +return ; + }else { +if (!tracing_is_on ()) +return ; + }if (!data->count)return ;
@@ -985,7 +1022,10 @@ traceoff_count_trigger(struct event_trigif (data->count !=-1 ) (data->count)--; -tracing_off (); +if (file) +tracer_tracing_off (file->tr); +else +tracing_off (); } static int
Greg Kroah-Hartman
maintainerPATCH 53/80 iio: adc: men_z188_adc: Fix a resource leak in an error handling path
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit e0a2e37f303828d030a83f33ffe14b36cb88d563 upstream.
If iio_device_register() fails, a previous ioremap() is left unbalanced.
Update the error handling path and add the missing iounmap() call, as already done in the remove function.
--- drivers/iio/adc/men_z188_adc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/adc/men_z188_adc.c +8 -1
@@ -103,6 +103,7 @@ static int men_z188_probe(struct mcb_devstruct z188_adc *adc;struct iio_dev *indio_dev;struct resource *mem; +int ret; indio_dev =devm_iio_device_alloc (&dev->dev,sizeof (struct z188_adc ));if (!indio_dev)
@@ -128,8 +129,14 @@ static int men_z188_probe(struct mcb_dev adc->mem = mem;mcb_set_drvdata (dev, indio_dev); -return iio_device_register (indio_dev); + ret =iio_device_register (indio_dev); +if (ret) + goto err_unmap; +return 0 ; + +err_unmap: +iounmap (adc->base); err:mcb_release_mem (mem);return -ENXIO ;
Greg Kroah-Hartman
maintainerPATCH 54/80 iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits
In reply to Greg Kroah-HartmanFrom: Cosmin Tanislav <[email protected]>
commit 0e33d15f1dce9e3a80a970ea7f0b27837168aeca upstream.
According to page 90 of the datasheet [1], AIN_BUFP is bit 6 and AIN_BUFM is bit 5 of the CONFIG_0 -> CONFIG_7 registers.
Fix the mask used for setting these bits.
[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7124-8.pdf
--- drivers/iio/adc/ad7124.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7124.c +1 -1
@@ -74,7 +74,7 @@#define AD7124_CONFIG_REF_SEL (x) FIELD_PREP(AD7124_CONFIG_REF_SEL_MSK, x)#define AD7124_CONFIG_PGA_MSK GENMASK(2, 0)#define AD7124_CONFIG_PGA (x) FIELD_PREP(AD7124_CONFIG_PGA_MSK, x) -#define AD7124_CONFIG_IN_BUFF_MSK GENMASK(7, 6) +#define AD7124_CONFIG_IN_BUFF_MSK GENMASK(6, 5)#define AD7124_CONFIG_IN_BUFF (x) FIELD_PREP(AD7124_CONFIG_IN_BUFF_MSK, x)/* AD7124_FILTER_X */
Greg Kroah-Hartman
maintainerPATCH 55/80 iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
commit ea85bf906466191b58532bb19f4fbb4591f0a77e upstream.
We need to wait for sensor settling time (~ 3/ODR) before reading data in st_lsm6dsx_read_oneshot routine in order to avoid corrupted samples.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +5 -1
@@ -1558,8 +1558,12 @@ static int st_lsm6dsx_read_oneshot(strucif (err <0 )return err; +/* +* we need to wait for sensor settling time before +* reading data in order to avoid corrupted samples +*/ delay =1000000000 / sensor->odr; -usleep_range (delay,2 * delay); +usleep_range (3 * delay,4 * delay); err =st_lsm6dsx_read_locked (hw, addr, &data,sizeof (data));if (err <0 )
Greg Kroah-Hartman
maintainerPATCH 56/80 iio: Fix error handling for PM
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
commit 632fe0bb8c5b9c06ec961f575ee42a6fff5eceeb upstream.
The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). In the PM Runtime docs:
Drivers in ->remove() callback should undo the runtime PM changes done
in ->probe(). Usually this means calling pm_runtime_disable(),
pm_runtime_dont_use_autosuspend() etc.We should do this in error handling.
Fix this problem for the following drivers: bmc150, bmg160, kmx61, kxcj-1013, mma9551, mma9553.
--- drivers/iio/accel/bmc150-accel-core.c | 5 ++++- drivers/iio/accel/kxcjk-1013.c | 5 ++++- drivers/iio/accel/mma9551.c | 5 ++++- drivers/iio/accel/mma9553.c | 5 ++++- drivers/iio/gyro/bmg160_core.c | 5 ++++- drivers/iio/imu/kmx61.c | 5 ++++- drivers/iio/magnetometer/bmc150_magn.c | 5 +++-- 7 files changed, 27 insertions(+), 8 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +4 -1
@@ -1648,11 +1648,14 @@ int bmc150_accel_core_probe(struct devic ret =iio_device_register (indio_dev);if (ret <0 ) {dev_err (dev,"Unable to register iio device\n" ); - goto err_trigger_unregister; + goto err_pm_cleanup; }return 0 ; +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (dev); +pm_runtime_disable (dev); err_trigger_unregister:bmc150_accel_unregister_triggers (data,BMC150_ACCEL_TRIGGERS -1 ); err_buffer_cleanup:
drivers/iio/accel/kxcjk-1013.c +4 -1
@@ -1429,11 +1429,14 @@ static int kxcjk1013_probe(struct i2c_cl ret =iio_device_register (indio_dev);if (ret <0 ) {dev_err (&client->dev,"unable to register iio device\n" ); - goto err_buffer_cleanup; + goto err_pm_cleanup; }return 0 ; +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (&client->dev); +pm_runtime_disable (&client->dev); err_buffer_cleanup:iio_triggered_buffer_cleanup (indio_dev); err_trigger_unregister:
drivers/iio/accel/mma9551.c +4 -1
@@ -495,11 +495,14 @@ static int mma9551_probe(struct i2c_clie ret =iio_device_register (indio_dev);if (ret <0 ) {dev_err (&client->dev,"unable to register iio device\n" ); - goto out_poweroff; + goto err_pm_cleanup; }return 0 ; +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (&client->dev); +pm_runtime_disable (&client->dev); out_poweroff:mma9551_set_device_state (client, false);
drivers/iio/accel/mma9553.c +4 -1
@@ -1134,12 +1134,15 @@ static int mma9553_probe(struct i2c_clie ret =iio_device_register (indio_dev);if (ret <0 ) {dev_err (&client->dev,"unable to register iio device\n" ); - goto out_poweroff; + goto err_pm_cleanup; }dev_dbg (&indio_dev->dev,"Registered device %s\n" , name);return 0 ; +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (&client->dev); +pm_runtime_disable (&client->dev); out_poweroff:mma9551_set_device_state (client, false);return ret;
drivers/iio/gyro/bmg160_core.c +4 -1
@@ -1170,11 +1170,14 @@ int bmg160_core_probe(struct device *dev ret =iio_device_register (indio_dev);if (ret <0 ) {dev_err (dev,"unable to register iio device\n" ); - goto err_buffer_cleanup; + goto err_pm_cleanup; }return 0 ; +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (dev); +pm_runtime_disable (dev); err_buffer_cleanup:iio_triggered_buffer_cleanup (indio_dev); err_trigger_unregister:
drivers/iio/imu/kmx61.c +4 -1
@@ -1392,7 +1392,7 @@ static int kmx61_probe(struct i2c_client ret =iio_device_register (data->acc_indio_dev);if (ret <0 ) {dev_err (&client->dev,"Failed to register acc iio device\n" ); - goto err_buffer_cleanup_mag; + goto err_pm_cleanup; } ret =iio_device_register (data->mag_indio_dev);
@@ -1405,6 +1405,9 @@ static int kmx61_probe(struct i2c_client err_iio_unregister_acc:iio_device_unregister (data->acc_indio_dev); +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (&client->dev); +pm_runtime_disable (&client->dev); err_buffer_cleanup_mag:if (client->irq >0 )iio_triggered_buffer_cleanup (data->mag_indio_dev);
drivers/iio/magnetometer/bmc150_magn.c +3 -2
@@ -941,13 +941,14 @@ int bmc150_magn_probe(struct device *dev ret =iio_device_register (indio_dev);if (ret <0 ) {dev_err (dev,"unable to register iio device\n" ); - goto err_disable_runtime_pm; + goto err_pm_cleanup; }dev_dbg (dev,"Registered device %s\n" , name);return 0 ; -err_disable_runtime_pm: +err_pm_cleanup: +pm_runtime_dont_use_autosuspend (dev);pm_runtime_disable (dev); err_buffer_cleanup:iio_triggered_buffer_cleanup (indio_dev);
Greg Kroah-Hartman
maintainerPATCH 57/80 sc16is7xx: Fix for incorrect data being transmitted
In reply to Greg Kroah-HartmanFrom: Phil Elwell <[email protected]>
commit eebb0f4e894f1e9577a56b337693d1051dd6ebfd upstream.
UART drivers are meant to use the port spinlock within certain methods, to protect against reentrancy. The sc16is7xx driver does very little locking, presumably because when added it triggers "scheduling while atomic" errors. This is due to the use of mutexes within the regmap abstraction layer, and the mutex implementation's habit of sleeping the current thread while waiting for access. Unfortunately this lack of interlocking can lead to corruption of outbound data, which occurs when the buffer used for I2C transmission is used simultaneously by two threads - a work queue thread running sc16is7xx_tx_proc, and an IRQ thread in sc16is7xx_port_irq, both of which can call sc16is7xx_handle_tx.
An earlier patch added efr_lock, a mutex that controls access to the EFR register. This mutex is already claimed in the IRQ handler, and all that is required is to claim the same mutex in sc16is7xx_tx_proc.
See: https://github.com/raspberrypi/linux/issues/4885
--- drivers/tty/serial/sc16is7xx.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/sc16is7xx.c +3 -0
@@ -734,12 +734,15 @@ static irqreturn_t sc16is7xx_irq(int irq, void *dev_id)static void sc16is7xx_tx_proc (struct kthread_work *ws) {struct uart_port *port = &(to_sc16is7xx_one (ws, tx_work)->port); +struct sc16is7xx_port *s =dev_get_drvdata (port->dev);if ((port->rs485.flags &SER_RS485_ENABLED ) && (port->rs485.delay_rts_before_send >0 ))msleep (port->rs485.delay_rts_before_send); +mutex_lock (&s->efr_lock);sc16is7xx_handle_tx (port); +mutex_unlock (&s->efr_lock); }static void sc16is7xx_reconf_rs485 (struct uart_port *port)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 58/80 ata: pata_hpt37x: disable primary channel on HPT371
In reply to Greg Kroah-HartmanFrom: Sergey Shtylyov <[email protected]>
commit 8d093e02e898b24c58788b0289e3202317a96d2a upstream.
The HPT371 chip physically has only one channel, the secondary one, however the primary channel registers do exist! Thus we have to manually disable the non-existing channel if the BIOS hasn't done this already. Similarly to the pata_hpt3x2n driver, always disable the primary channel.
--- drivers/ata/pata_hpt37x.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/ata/pata_hpt37x.c +14 -0
@@ -918,6 +918,20 @@ static int hpt37x_init_one(struct pci_depci_write_config_byte (dev,0x5a , irqmask);/* +* HPT371 chips physically have only one channel, the secondary one, +* but the primary channel registers do exist! Go figure... +* So, we manually disable the non-existing channel here +* (if the BIOS hasn't done this already). +*/ +if (dev->device ==PCI_DEVICE_ID_TTI_HPT371 ) { +u8 mcr1; + +pci_read_config_byte (dev,0x50 , &mcr1); + mcr1 &= ~0x04 ; +pci_write_config_byte (dev,0x50 , mcr1); + } + +/* * default to pci clock. make sure MA15/16 are set to output * to prevent drives having problems with 40-pin cables. Needed * for some drives such as IBM-DTLA which will not enter ready
Greg Kroah-Hartman
maintainerPATCH 59/80 Revert "USB: serial: ch341: add new Product ID for CH341A"
In reply to Greg Kroah-HartmanFrom: Dmytro Bagrii <[email protected]>
commit 198a7ebd5fa17b4d0be8cb70240ee1be885175c0 upstream.
This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63.
CH341 has Product ID 0x5512 in EPP/MEM mode which is used for I2C/SPI/GPIO interfaces. In asynchronous serial interface mode CH341 has PID 0x5523 which is already in the table.
Mode is selected by corresponding jumper setting.
--- drivers/usb/serial/ch341.c | 1 - 1 file changed, 1 deletion(-)
drivers/usb/serial/ch341.c +0 -1
@@ -81,7 +81,6 @@#define CH341_QUIRK_SIMULATE_BREAK BIT(1)static const struct usb_device_id id_table[] = { - {USB_DEVICE (0x1a86 ,0x5512 ) }, {USB_DEVICE (0x1a86 ,0x5523 ) }, {USB_DEVICE (0x1a86 ,0x7522 ) }, {USB_DEVICE (0x1a86 ,0x7523 ) },
Greg Kroah-Hartman
maintainerPATCH 60/80 usb: gadget: rndis: add spinlock for rndis response list
In reply to Greg Kroah-HartmanFrom: Daehwan Jung <[email protected]>
commit aaaba1c86d04dac8e49bf508b492f81506257da3 upstream.
There's no lock for rndis response list. It could cause list corruption if there're two different list_add at the same time like below. It's better to add in rndis_add_response / rndis_free_response / rndis_get_next_response to prevent any race condition on response list.
[ 361.894299] [1: irq/191-dwc3:16979] list_add corruption.
next->prev should be prev (ffffff80651764d0), but was ffffff883dc36f80. (next=ffffff80651764d0).
[ 361.904380] [1: irq/191-dwc3:16979] Call trace: [ 361.904391] [1: irq/191-dwc3:16979] __list_add_valid+0x74/0x90 [ 361.904401] [1: irq/191-dwc3:16979] rndis_msg_parser+0x168/0x8c0 [ 361.904409] [1: irq/191-dwc3:16979] rndis_command_complete+0x24/0x84 [ 361.904417] [1: irq/191-dwc3:16979] usb_gadget_giveback_request+0x20/0xe4 [ 361.904426] [1: irq/191-dwc3:16979] dwc3_gadget_giveback+0x44/0x60 [ 361.904434] [1: irq/191-dwc3:16979] dwc3_ep0_complete_data+0x1e8/0x3a0 [ 361.904442] [1: irq/191-dwc3:16979] dwc3_ep0_interrupt+0x29c/0x3dc [ 361.904450] [1: irq/191-dwc3:16979] dwc3_process_event_entry+0x78/0x6cc [ 361.904457] [1: irq/191-dwc3:16979] dwc3_process_event_buf+0xa0/0x1ec [ 361.904465] [1: irq/191-dwc3:16979] dwc3_thread_interrupt+0x34/0x5c
--- drivers/usb/gadget/function/rndis.c | 8 ++++++++ drivers/usb/gadget/function/rndis.h | 1 + 2 files changed, 9 insertions(+)
drivers/usb/gadget/function/rndis.c +8 -0
@@ -922,6 +922,7 @@ struct rndis_params *rndis_register(void params->resp_avail = resp_avail; params->v = v;INIT_LIST_HEAD (¶ms->resp_queue); +spin_lock_init (¶ms->resp_lock);pr_debug ("%s: configNr = %d\n" , __func__, i);return params;
@@ -1015,12 +1016,14 @@ void rndis_free_response(struct rndis_pa {rndis_resp_t *r, *n; +spin_lock (¶ms->resp_lock);list_for_each_entry_safe (r, n, ¶ms->resp_queue, list) {if (r->buf == buf) {list_del (&r->list);kfree (r); } } +spin_unlock (¶ms->resp_lock); }EXPORT_SYMBOL_GPL (rndis_free_response);
@@ -1030,14 +1033,17 @@ u8 *rndis_get_next_response(struct rndisif (!length)return NULL ; +spin_lock (¶ms->resp_lock);list_for_each_entry_safe (r, n, ¶ms->resp_queue, list) {if (!r->send) { r->send =1 ; *length = r->length; +spin_unlock (¶ms->resp_lock);return r->buf; } } +spin_unlock (¶ms->resp_lock);return NULL ; }EXPORT_SYMBOL_GPL (rndis_get_next_response);
@@ -1054,7 +1060,9 @@ static rndis_resp_t *rndis_add_response( r->length = length; r->send =0 ; +spin_lock (¶ms->resp_lock);list_add_tail (&r->list, ¶ms->resp_queue); +spin_unlock (¶ms->resp_lock);return r; }
drivers/usb/gadget/function/rndis.h +1 -0
@@ -174,6 +174,7 @@ typedef struct rndis_params {void (*resp_avail)(void *v);void *v;struct list_head resp_queue; +spinlock_t resp_lock; } rndis_params;/* RNDIS Message parser and other useless functions */
Greg Kroah-Hartman
maintainerPATCH 61/80 USB: gadget: validate endpoint index for xilinx udc
In reply to Greg Kroah-HartmanFrom: Szymon Heidrich <[email protected]>
commit 7f14c7227f342d9932f9b918893c8814f86d2a0d upstream.
Assure that host may not manipulate the index to point past endpoint array.
--- drivers/usb/gadget/udc/udc-xilinx.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/gadget/udc/udc-xilinx.c +6 -0
@@ -1612,6 +1612,8 @@ static void xudc_getstatus(struct xusb_ubreak ;case USB_RECIP_ENDPOINT : epnum = udc->setup.wIndex &USB_ENDPOINT_NUMBER_MASK ; +if (epnum >=XUSB_MAX_ENDPOINTS ) + goto stall; target_ep = &udc->ep[epnum]; epcfgreg = udc->read_fn (udc->addr + target_ep->offset); halt = epcfgreg &XUSB_EP_CFG_STALL_MASK ;
@@ -1679,6 +1681,10 @@ static void xudc_set_clear_feature(struccase USB_RECIP_ENDPOINT :if (!udc->setup.wValue) { endpoint = udc->setup.wIndex &USB_ENDPOINT_NUMBER_MASK ; +if (endpoint >=XUSB_MAX_ENDPOINTS ) { +xudc_ep0_stall (udc); +return ; + } target_ep = &udc->ep[endpoint]; outinbit = udc->setup.wIndex &USB_ENDPOINT_DIR_MASK ; outinbit = outinbit >>7 ;
Greg Kroah-Hartman
maintainerPATCH 62/80 tracefs: Set the group ownership in apply_options() not parse_options()
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 851e99ebeec3f4a672bb5010cf1ece095acee447 upstream.
Al Viro brought it to my attention that the dentries may not be filled when the parse_options() is called, causing the call to set_gid() to possibly crash. It should only be called if parse_options() succeeds totally anyway.
He suggested the logical place to do the update is in apply_options().
--- fs/tracefs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/tracefs/inode.c +3 -2
@@ -262,7 +262,6 @@ static int tracefs_parse_options(char *dif (!gid_valid (gid))return -EINVAL ; opts->gid = gid; -set_gid (tracefs_mount->mnt_root, gid);break ;case Opt_mode:if (match_octal (&args[0 ], &option))
@@ -289,7 +288,9 @@ static int tracefs_apply_options(struct inode->i_mode |= opts->mode; inode->i_uid = opts->uid; - inode->i_gid = opts->gid; + +/* Set all the group ids to the mount option */ +set_gid (sb->s_root, opts->gid);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 63/80 USB: serial: option: add support for DW5829e
In reply to Greg Kroah-HartmanFrom: Slark Xiao <[email protected]>
commit 6ecb3f0b18b320320460a42e40d6fb603f6ded96 upstream.
Dell DW5829e same as DW5821e except CAT level. DW5821e supports CAT16 but DW5829e supports CAT9. There are 2 types product of DW5829e: normal and eSIM. So we will add 2 PID for DW5829e.
And for each PID, it support MBIM or RMNET. Let's see test evidence as below:
DW5829e MBIM mode:
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 2 P: Vendor=413c ProdID=81e6 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
DW5829e RMNET mode:
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e6 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
DW5829e-eSIM MBIM mode:
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 6 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 2 P: Vendor=413c ProdID=81e4 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e-eSIM Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
DW5829e-eSIM RMNET mode:
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 7 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e4 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e-eSIM Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
BTW, the interface 0x6 of MBIM mode is GNSS port, which not same as NMEA port. So it's banned from serial option driver.
The remaining interfaces 0x2-0x5 are: MODEM, MODEM, NMEA, DIAG.
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -198,6 +198,8 @@ static void option_instat_callback(struc#define DELL_PRODUCT_5821E 0x81d7#define DELL_PRODUCT_5821E_ESIM 0x81e0 +#define DELL_PRODUCT_5829E_ESIM 0x81e4 +#define DELL_PRODUCT_5829E 0x81e6#define KYOCERA_VENDOR_ID 0x0c88#define KYOCERA_PRODUCT_KPC650 0x17da
@@ -1063,6 +1065,10 @@ static const struct usb_device_id option .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E_ESIM), .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E), + .driver_info = RSVD(0) | RSVD(6) }, + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E_ESIM), + .driver_info = RSVD(0) | RSVD(6) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
Greg Kroah-Hartman
maintainerPATCH 64/80 USB: serial: option: add Telit LE910R1 compositions
In reply to Greg Kroah-HartmanFrom: Daniele Palmas <[email protected]>
commit cfc4442c642d568014474b6718ccf65dc7ca6099 upstream.
Add support for the following Telit LE910R1 compositions:
0x701a: rndis, tty, tty, tty0x701b: ecm, tty, tty, tty0x9201: tty
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -1279,10 +1279,16 @@ static const struct usb_device_id option .driver_info = NCTRL(2) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x7011, 0xff), /* Telit LE910-S1 (ECM) */ .driver_info = NCTRL(2) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x701a, 0xff), /* Telit LE910R1 (RNDIS) */ + .driver_info = NCTRL(2) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x701b, 0xff), /* Telit LE910R1 (ECM) */ + .driver_info = NCTRL(2) }, { USB_DEVICE(TELIT_VENDOR_ID, 0x9010), /* Telit SBL FN980 flashing device */ .driver_info = NCTRL(0) | ZLP }, { USB_DEVICE(TELIT_VENDOR_ID, 0x9200), /* Telit LE910S1 flashing device */ .driver_info = NCTRL(0) | ZLP }, + { USB_DEVICE(TELIT_VENDOR_ID, 0x9201), /* Telit LE910R1 flashing device */ + .driver_info = NCTRL(0) | ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), .driver_info = RSVD(1) },
Greg Kroah-Hartman
maintainerPATCH 65/80 usb: dwc2: drd: fix soft connect when gadget is unconfigured
In reply to Greg Kroah-HartmanFrom: Fabrice Gasnier <[email protected]>
commit 32fde84362c40961726a5c91f35ad37355ccc0c6 upstream.
When the gadget driver hasn't been (yet) configured, and the cable is connected to a HOST, the SFTDISCON gets cleared unconditionally, so the HOST tries to enumerate it.
At the host side, this can result in a stuck USB port or worse. When getting lucky, some dmesg can be observed at the host side:
new high-speed USB device number ...
device descriptor read/64, error -110
Fix it in drd, by checking the enabled flag before calling dwc2_hsotg_core_connect(). It will be called later, once configured, by the normal flow:
- udc_bind_to_driver
- usb_gadget_connect
- dwc2_hsotg_pullup
- dwc2_hsotg_core_connect
--- drivers/usb/dwc2/core.h | 2 ++ drivers/usb/dwc2/drd.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/usb/dwc2/core.h +2 -0
@@ -1406,6 +1406,7 @@ void dwc2_hsotg_core_connect(struct dwc2void dwc2_hsotg_disconnect (struct dwc2_hsotg *dwc2);int dwc2_hsotg_set_test_mode (struct dwc2_hsotg *hsotg,int testmode);#define dwc2_is_device_connected (hsotg) (hsotg->connected) +#define dwc2_is_device_enabled (hsotg) (hsotg->enabled)int dwc2_backup_device_registers (struct dwc2_hsotg *hsotg);int dwc2_restore_device_registers (struct dwc2_hsotg *hsotg,int remote_wakeup);int dwc2_gadget_enter_hibernation (struct dwc2_hsotg *hsotg);
@@ -1434,6 +1435,7 @@ static inline int dwc2_hsotg_set_test_mo int testmode) {return 0 ; }#define dwc2_is_device_connected (hsotg) (0) +#define dwc2_is_device_enabled (hsotg) (0)static inline int dwc2_backup_device_registers (struct dwc2_hsotg *hsotg) {return 0 ; } static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg,
drivers/usb/dwc2/drd.c +4 -2
@@ -109,8 +109,10 @@ static int dwc2_drd_role_sw_set(struct u already =dwc2_ovr_avalid (hsotg, true); }else if (role ==USB_ROLE_DEVICE ) { already =dwc2_ovr_bvalid (hsotg, true); -/* This clear DCTL.SFTDISCON bit */ -dwc2_hsotg_core_connect (hsotg); +if (dwc2_is_device_enabled (hsotg)) { +/* This clear DCTL.SFTDISCON bit */ +dwc2_hsotg_core_connect (hsotg); + } }else {if (dwc2_is_device_mode (hsotg)) {if (!dwc2_ovr_bvalid (hsotg, false))
Greg Kroah-Hartman
maintainerPATCH 66/80 usb: dwc3: pci: Fix Bay Trail phy GPIO mappings
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 62e3f0afe246720f7646eb1b034a6897dac34405 upstream.
When the Bay Trail phy GPIO mappings where added cs and reset were swapped, this did not cause any issues sofar, because sofar they were always driven high/low at the same time.
Note the new mapping has been verified both in /sys/kernel/debug/gpio output on Android factory images on multiple devices, as well as in the schematics for some devices.
--- drivers/usb/dwc3/dwc3-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc3/dwc3-pci.c +2 -2
@@ -81,8 +81,8 @@ static const struct acpi_gpio_mapping acstatic struct gpiod_lookup_table platform_bytcr_gpios = { .dev_id ="0000:00:16.0" , .table = { -GPIO_LOOKUP ("INT33FC:00" ,54 ,"reset" ,GPIO_ACTIVE_HIGH ), -GPIO_LOOKUP ("INT33FC:02" ,14 ,"cs" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("INT33FC:00" ,54 ,"cs" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("INT33FC:02" ,14 ,"reset" ,GPIO_ACTIVE_HIGH ), {} }, };
Greg Kroah-Hartman
maintainerPATCH 67/80 usb: dwc3: gadget: Let the interrupt handler disable bottom halves.
In reply to Greg Kroah-HartmanFrom: Sebastian Andrzej Siewior <[email protected]>
commit 84918a89d6efaff075de570b55642b6f4ceeac6d upstream.
The interrupt service routine registered for the gadget is a primary handler which mask the interrupt source and a threaded handler which handles the source of the interrupt. Since the threaded handler is voluntary threaded, the IRQ-core does not disable bottom halves before invoke the handler like it does for the forced-threaded handler.
Due to changes in networking it became visible that a network gadget's completions handler may schedule a softirq which remains unprocessed. The gadget's completion handler is usually invoked either in hard-IRQ or soft-IRQ context. In this context it is enough to just raise the softirq because the softirq itself will be handled once that context is left. In the case of the voluntary threaded handler, there is nothing that will process pending softirqs. Which means it remain queued until another random interrupt (on this CPU) fires and handles it on its exit path or another thread locks and unlocks a lock with the bh suffix. Worst case is that the CPU goes idle and the NOHZ complains about unhandled softirqs.
Disable bottom halves before acquiring the lock (and disabling interrupts) and enable them after dropping the lock. This ensures that any pending softirqs will handled right away.
--- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/dwc3/gadget.c +2 -0
@@ -3775,9 +3775,11 @@ static irqreturn_t dwc3_thread_interruptunsigned long flags;irqreturn_t ret =IRQ_NONE ; +local_bh_disable ();spin_lock_irqsave (&dwc->lock, flags); ret =dwc3_process_event_buf (evt);spin_unlock_irqrestore (&dwc->lock, flags); +local_bh_enable ();return ret; }
Greg Kroah-Hartman
maintainerPATCH 68/80 xhci: re-initialize the HC during resume if HCE was set
In reply to Greg Kroah-HartmanFrom: Puma Hsu <[email protected]>
commit 8b328f8002bcf29ef517ee4bf234e09aabec4d2e upstream.
When HCE(Host Controller Error) is set, it means an internal error condition has been detected. Software needs to re-initialize the HC, so add this check in xhci resume.
--- drivers/usb/host/xhci.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/usb/host/xhci.c +13 -6
@@ -1091,6 +1091,7 @@ int xhci_resume(struct xhci_hcd *xhci, bint retval =0 ;bool comp_timer_running = false;bool pending_portevent = false; +bool reinit_xhc = false;if (!hcd->state)return 0 ;
@@ -1107,10 +1108,11 @@ int xhci_resume(struct xhci_hcd *xhci, bset_bit (HCD_FLAG_HW_ACCESSIBLE , &xhci->shared_hcd->flags);spin_lock_irq (&xhci->lock); -if ((xhci->quirks &XHCI_RESET_ON_RESUME ) || xhci->broken_suspend) - hibernated = true; -if (!hibernated) { +if (hibernated || xhci->quirks &XHCI_RESET_ON_RESUME || xhci->broken_suspend) + reinit_xhc = true; + +if (!reinit_xhc) {/* * Some controllers might lose power during suspend, so wait * for controller not ready bit to clear, just as in xHC init.
@@ -1143,12 +1145,17 @@ int xhci_resume(struct xhci_hcd *xhci, bspin_unlock_irq (&xhci->lock);return -ETIMEDOUT ; } - temp =readl (&xhci->op_regs->status); } -/* If restore operation fails, re-initialize the HC during resume */ -if ((temp &STS_SRE ) || hibernated) { + temp =readl (&xhci->op_regs->status); + +/* re-initialize the HC on Restore Error, or Host Controller Error */ +if (temp & (STS_SRE |STS_HCE )) { + reinit_xhc = true; +xhci_warn (xhci,"xHC error in resume, USBSTS 0x%x, Reinit\n" , temp); + } +if (reinit_xhc) {if ((xhci->quirks &XHCI_COMP_MODE_QUIRK ) && !(xhci_all_ports_seen_u0 (xhci))) {del_timer_sync (&xhci->comp_mode_recovery_timer);
Greg Kroah-Hartman
maintainerPATCH 69/80 xhci: Prevent futile URB re-submissions due to incorrect return value.
In reply to Greg Kroah-HartmanFrom: Hongyu Xie <[email protected]>
commit 243a1dd7ba48c120986dd9e66fee74bcb7751034 upstream.
The -ENODEV return value from xhci_check_args() is incorrectly changed to -EINVAL in a couple places before propagated further.
xhci_check_args() returns 4 types of value, -ENODEV, -EINVAL, 1 and 0. xhci_urb_enqueue and xhci_check_streams_endpoint return -EINVAL if the return value of xhci_check_args <= 0.
This causes problems for example r8152_submit_rx, calling usb_submit_urb in drivers/net/usb/r8152.c.r8152_submit_rx will never get -ENODEV after submiting an urb when xHC is halted because xhci_urb_enqueue returns -EINVAL in the very beginning.
[commit message and header edit -Mathias]
--- drivers/usb/host/xhci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/usb/host/xhci.c +6 -3
@@ -1487,9 +1487,12 @@ static int xhci_urb_enqueue(struct usb_hstruct urb_priv *urb_priv;int num_tds; -if (!urb ||xhci_check_args (hcd, urb->dev, urb->ep, - true, true, __func__) <=0 ) +if (!urb)return -EINVAL ; + ret =xhci_check_args (hcd, urb->dev, urb->ep, + true, true, __func__); +if (ret <=0 ) +return ret ? ret : -EINVAL ; slot_id = urb->dev->slot_id; ep_index =xhci_get_endpoint_index (&urb->ep->desc);
@@ -3289,7 +3292,7 @@ static int xhci_check_streams_endpoint(sreturn -EINVAL ; ret =xhci_check_args (xhci_to_hcd (xhci), udev, ep,1 , true, __func__);if (ret <=0 ) -return -EINVAL ; +return ret ? ret : -EINVAL ;if (usb_ss_max_streams (&ep->ss_ep_comp) ==0 ) { xhci_warn(xhci, "WARN: SuperSpeed Endpoint Companion" " descriptor for ep 0x%x does not support streams\n",
Greg Kroah-Hartman
maintainerPATCH 70/80 driver core: Free DMA range map when device is released
In reply to Greg Kroah-HartmanFrom: Mårten Lindahl <[email protected]>
commit d8f7a5484f2188e9af2d9e4e587587d724501b12 upstream.
When unbinding/binding a driver with DMA mapped memory, the DMA map is not freed before the driver is reloaded. This leads to a memory leak when the DMA map is overwritten when reprobing the driver.
This can be reproduced with a platform driver having a dma-range:
dummy {
...
#address-cells = <0x2>;
#size-cells = <0x2>;
ranges;
dma-ranges = <...>;
...
};and then unbinding/binding it:
~# echo soc:dummy >/sys/bus/platform/drivers/<driver>/unbind
DMA map object 0xffffff800b0ae540 still being held by &pdev->dev
~# echo soc:dummy >/sys/bus/platform/drivers/<driver>/bind ~# echo scan > /sys/kernel/debug/kmemleak
~# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffffff800b0ae540 (size 64):
comm "sh", pid 833, jiffies 4295174550 (age 2535.352s) hex dump (first 32 bytes):
00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00 ................
backtrace:
[<ffffffefd1694708>] create_object.isra.0+0x108/0x344
[<ffffffefd1d1a850>] kmemleak_alloc+0x8c/0xd0
[<ffffffefd167e2d0>] __kmalloc+0x440/0x6f0
[<ffffffefd1a960a4>] of_dma_get_range+0x124/0x220
[<ffffffefd1a8ce90>] of_dma_configure_id+0x40/0x2d0
[<ffffffefd198b68c>] platform_dma_configure+0x5c/0xa4
[<ffffffefd198846c>] really_probe+0x8c/0x514
[<ffffffefd1988990>] __driver_probe_device+0x9c/0x19c
[<ffffffefd1988cd8>] device_driver_attach+0x54/0xbc
[<ffffffefd1986634>] bind_store+0xc4/0x120
[<ffffffefd19856e0>] drv_attr_store+0x30/0x44
[<ffffffefd173c9b0>] sysfs_kf_write+0x50/0x60
[<ffffffefd173c1c4>] kernfs_fop_write_iter+0x124/0x1b4
[<ffffffefd16a013c>] new_sync_write+0xdc/0x160
[<ffffffefd16a256c>] vfs_write+0x23c/0x2a0
[<ffffffefd16a2758>] ksys_write+0x64/0xecTo prevent this we should free the dma_range_map when the device is released.
--- drivers/base/dd.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/base/dd.c +5 -0
@@ -592,6 +592,9 @@ re_probe: drv->remove (dev);devres_release_all (dev); +arch_teardown_dma_ops (dev); +kfree (dev->dma_range_map); + dev->dma_range_map =NULL ;driver_sysfs_remove (dev); dev->driver =NULL ;dev_set_drvdata (dev,NULL );
@@ -1168,6 +1171,8 @@ static void __device_release_driver(strudevres_release_all (dev);arch_teardown_dma_ops (dev); +kfree (dev->dma_range_map); + dev->dma_range_map =NULL ; dev->driver =NULL ;dev_set_drvdata (dev,NULL );if (dev->pm_domain && dev->pm_domain->dismiss)
Greg Kroah-Hartman
maintainerPATCH 71/80 RDMA/cma: Do not change route.addr.src_addr outside state checks
In reply to Greg Kroah-HartmanFrom: Jason Gunthorpe <[email protected]>
commit 22e9f71072fa605cbf033158db58e0790101928d upstream.
If the state is not idle then resolve_prepare_src() should immediately fail and no change to global state should happen. However, it unconditionally overwrites the src_addr trying to build a temporary any address.
For instance if the state is already RDMA_CM_LISTEN then this will corrupt the src_addr and would cause the test in cma_cancel_operation():
if (cma_any_addr(cma_src_addr(id_priv)) && !id_priv->cma_dev)
Which would manifest as this trace from syzkaller:
BUG: KASAN: use-after-free in __list_add_valid+0x93/0xa0 lib/list_debug.c:26 Read of size 8 at addr ffff8881546491e0 by task syz-executor.1/32204 CPU: 1 PID: 32204 Comm: syz-executor.1 Not tainted 5.12.0-rc8-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 __list_add_valid+0x93/0xa0 lib/list_debug.c:26 __list_add include/linux/list.h:67 [inline] list_add_tail include/linux/list.h:100 [inline] cma_listen_on_all drivers/infiniband/core/cma.c:2557 [inline] rdma_listen+0x787/0xe00 drivers/infiniband/core/cma.c:3751 ucma_listen+0x16a/0x210 drivers/infiniband/core/ucma.c:1102 ucma_write+0x259/0x350 drivers/infiniband/core/ucma.c:1732 vfs_write+0x28e/0xa30 fs/read_write.c:603 ksys_write+0x1ee/0x250 fs/read_write.c:658 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae
This is indicating that an rdma_id_private was destroyed without doing cma_cancel_listens().
Instead of trying to re-use the src_addr memory to indirectly create an any address derived from the dst build one explicitly on the stack and bind to that as any other normal flow would do. rdma_bind_addr() will copy it over the src_addr once it knows the state is valid.
This is similar to commit bc0bdc5afaa7 ("RDMA/cma: Do not change route.addr.src_addr.ss_family")
--- drivers/infiniband/core/cma.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-)
drivers/infiniband/core/cma.c +23 -15
@@ -3321,22 +3321,30 @@ err:static int cma_bind_addr (struct rdma_cm_id *id,struct sockaddr *src_addr,const struct sockaddr *dst_addr) { -if (!src_addr || !src_addr->sa_family) { - src_addr = (struct sockaddr *) &id->route.addr.src_addr; - src_addr->sa_family = dst_addr->sa_family; -if (IS_ENABLED (CONFIG_IPV6 ) && - dst_addr->sa_family ==AF_INET6 ) { -struct sockaddr_in6 *src_addr6 = (struct sockaddr_in6 *) src_addr; -struct sockaddr_in6 *dst_addr6 = (struct sockaddr_in6 *) dst_addr; - src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id; -if (ipv6_addr_type (&dst_addr6->sin6_addr) &IPV6_ADDR_LINKLOCAL ) - id->route.addr.dev_addr.bound_dev_if = dst_addr6->sin6_scope_id; - }else if (dst_addr->sa_family ==AF_IB ) { - ((struct sockaddr_ib *) src_addr)->sib_pkey = - ((struct sockaddr_ib *) dst_addr)->sib_pkey; - } +struct sockaddr_storage zero_sock = {}; + +if (src_addr && src_addr->sa_family) +return rdma_bind_addr (id, src_addr); + +/* +* When the src_addr is not specified, automatically supply an any addr +*/ + zero_sock.ss_family = dst_addr->sa_family; +if (IS_ENABLED (CONFIG_IPV6 ) && dst_addr->sa_family ==AF_INET6 ) { +struct sockaddr_in6 *src_addr6 = + (struct sockaddr_in6 *)&zero_sock; +struct sockaddr_in6 *dst_addr6 = + (struct sockaddr_in6 *)dst_addr; + + src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id; +if (ipv6_addr_type (&dst_addr6->sin6_addr) &IPV6_ADDR_LINKLOCAL ) + id->route.addr.dev_addr.bound_dev_if = + dst_addr6->sin6_scope_id; + }else if (dst_addr->sa_family ==AF_IB ) { + ((struct sockaddr_ib *)&zero_sock)->sib_pkey = + ((struct sockaddr_ib *)dst_addr)->sib_pkey; } -return rdma_bind_addr (id, src_addr); +return rdma_bind_addr (id, (struct sockaddr *)&zero_sock); }/*
Greg Kroah-Hartman
maintainerPATCH 72/80 thermal: int340x: fix memory leak in int3400_notify()
In reply to Greg Kroah-HartmanFrom: Chuansheng Liu <[email protected]>
commit 3abea10e6a8f0e7804ed4c124bea2d15aca977c8 upstream.
It is easy to hit the below memory leaks in my TigerLake platform:
unreferenced object 0xffff927c8b91dbc0 (size 32):
comm "kworker/0:2", pid 112, jiffies 4294893323 (age 83.604s) hex dump (first 32 bytes):
4e 41 4d 45 3d 49 4e 54 33 34 30 30 20 54 68 65 NAME=INT3400 The
72 6d 61 6c 00 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 rmal.kkkkkkkkkk.
backtrace:
[<ffffffff9c502c3e>] __kmalloc_track_caller+0x2fe/0x4a0
[<ffffffff9c7b7c15>] kvasprintf+0x65/0xd0
[<ffffffff9c7b7d6e>] kasprintf+0x4e/0x70
[<ffffffffc04cb662>] int3400_notify+0x82/0x120 [int3400_thermal]
[<ffffffff9c8b7358>] acpi_ev_notify_dispatch+0x54/0x71
[<ffffffff9c88f1a7>] acpi_os_execute_deferred+0x17/0x30
[<ffffffff9c2c2c0a>] process_one_work+0x21a/0x3f0
[<ffffffff9c2c2e2a>] worker_thread+0x4a/0x3b0
[<ffffffff9c2cb4dd>] kthread+0xfd/0x130
[<ffffffff9c201c1f>] ret_from_fork+0x1f/0x30Fix it by calling kfree() accordingly.
--- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +4 -0
@@ -402,6 +402,10 @@ static void int3400_notify(acpi_handle h thermal_prop[3 ] =kasprintf (GFP_KERNEL ,"EVENT=%d" , therm_event); thermal_prop[4 ] =NULL ;kobject_uevent_env (&priv->thermal->device.kobj,KOBJ_CHANGE , thermal_prop); +kfree (thermal_prop[0 ]); +kfree (thermal_prop[1 ]); +kfree (thermal_prop[2 ]); +kfree (thermal_prop[3 ]); } static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
Greg Kroah-Hartman
maintainerPATCH 73/80 riscv: fix oops caused by irqsoff latency tracer
In reply to Greg Kroah-HartmanFrom: Changbin Du <[email protected]>
commit 22e2100b1b07d6f5acc71cc1acb53f680c677d77 upstream.
The trace_hardirqs_{on,off}() require the caller to setup frame pointer properly. This because these two functions use macro 'CALLER_ADDR1' (aka. __builtin_return_address(1)) to acquire caller info. If the $fp is used for other purpose, the code generated this macro (as below) could trigger memory access fault.
0xffffffff8011510e <+80>: ld a1,-16(s0) 0xffffffff80115112 <+84>: ld s2,-8(a1) # <-- paging fault here
The oops message during booting if compiled with 'irqoff' tracer enabled:
[ 0.039615][ T0] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000f8 [ 0.041925][ T0] Oops [#1] [ 0.042063][ T0] Modules linked in: [ 0.042864][ T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.17.0-rc1-00233-g9a20c48d1ed2 #29 [ 0.043568][ T0] Hardware name: riscv-virtio,qemu (DT) [ 0.044343][ T0] epc : trace_hardirqs_on+0x56/0xe2 [ 0.044601][ T0] ra : restore_all+0x12/0x6e [ 0.044721][ T0] epc : ffffffff80126a5c ra : ffffffff80003b94 sp : ffffffff81403db0 [ 0.044801][ T0] gp : ffffffff8163acd8 tp : ffffffff81414880 t0 : 0000000000000020 [ 0.044882][ T0] t1 : 0098968000000000 t2 : 0000000000000000 s0 : ffffffff81403de0 [ 0.044967][ T0] s1 : 0000000000000000 a0 : 0000000000000001 a1 : 0000000000000100 [ 0.045046][ T0] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 0.045124][ T0] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000054494d45 [ 0.045210][ T0] s2 : ffffffff80003b94 s3 : ffffffff81a8f1b0 s4 : ffffffff80e27b50 [ 0.045289][ T0] s5 : ffffffff81414880 s6 : ffffffff8160fa00 s7 : 00000000800120e8 [ 0.045389][ T0] s8 : 0000000080013100 s9 : 000000000000007f s10: 0000000000000000 [ 0.045474][ T0] s11: 0000000000000000 t3 : 7fffffffffffffff t4 : 0000000000000000 [ 0.045548][ T0] t5 : 0000000000000000 t6 : ffffffff814aa368 [ 0.045620][ T0] status: 0000000200000100 badaddr: 00000000000000f8 cause: 000000000000000d [ 0.046402][ T0] [<ffffffff80003b94>] restore_all+0x12/0x6e
This because the $fp(aka. $s0) register is not used as frame pointer in the assembly entry code.
resume_kernel:
REG_L s0, TASK_TI_PREEMPT_COUNT(tp) bnez s0, restore_all
REG_L s0, TASK_TI_FLAGS(tp) andi s0, s0, _TIF_NEED_RESCHED beqz s0, restore_all
call preempt_schedule_irq
j restore_all
To fix above issue, here we add one extra level wrapper for function trace_hardirqs_{on,off}() so they can be safely called by low level entry code.
--- arch/riscv/kernel/Makefile | 2 ++ arch/riscv/kernel/entry.S | 10 +++++----- arch/riscv/kernel/trace_irq.c | 27 +++++++++++++++++++++++++++ arch/riscv/kernel/trace_irq.h | 11 +++++++++++ 4 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 arch/riscv/kernel/trace_irq.c create mode 100644 arch/riscv/kernel/trace_irq.h
arch/riscv/kernel/Makefile +2 -0
@@ -44,6 +44,8 @@ obj-$(CONFIG_MODULE_SECTIONS) += module- obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o +obj-$(CONFIG_TRACE_IRQFLAGS) += trace_irq.o + obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
arch/riscv/kernel/entry.S +5 -5
@@ -98,7 +98,7 @@ _save_context: .option pop #ifdef CONFIG_TRACE_IRQFLAGS - call trace_hardirqs_off + call __trace_hardirqs_off #endif #ifdef CONFIG_CONTEXT_TRACKING
@@ -131,7 +131,7 @@ skip_context_tracking: andi t0, s1, SR_PIE beqz t0, 1f #ifdef CONFIG_TRACE_IRQFLAGS - call trace_hardirqs_on + call __trace_hardirqs_on #endif csrs CSR_STATUS, SR_IE
@@ -222,7 +222,7 @@ ret_from_exception: REG_L s0, PT_STATUS(sp) csrc CSR_STATUS, SR_IE #ifdef CONFIG_TRACE_IRQFLAGS - call trace_hardirqs_off + call __trace_hardirqs_off #endif #ifdef CONFIG_RISCV_M_MODE /* the MPP value is too large to be used as an immediate arg for addi */
@@ -258,10 +258,10 @@ restore_all: REG_L s1, PT_STATUS(sp) andi t0, s1, SR_PIE beqz t0, 1f - call trace_hardirqs_on + call __trace_hardirqs_on j 2f 1: - call trace_hardirqs_off + call __trace_hardirqs_off 2: #endif REG_L a0, PT_STATUS(sp)
arch/riscv/kernel/trace_irq.c new file +27 -0
@@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2022 Changbin Du <[email protected]> +*/ + +#include <linux/irqflags.h> +#include <linux/kprobes.h> +#include "trace_irq.h" + +/* +* trace_hardirqs_on/off require the caller to setup frame pointer properly. +* Otherwise, CALLER_ADDR1 might trigger an pagging exception in kernel. +* Here we add one extra level so they can be safely called by low +* level entry code which $fp is used for other purpose. +*/ + +void __trace_hardirqs_on (void ) +{ +trace_hardirqs_on (); +} +NOKPROBE_SYMBOL (__trace_hardirqs_on); + +void __trace_hardirqs_off (void ) +{ +trace_hardirqs_off (); +} +NOKPROBE_SYMBOL (__trace_hardirqs_off);
arch/riscv/kernel/trace_irq.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2022 Changbin Du <[email protected]> +*/ +#ifndef __TRACE_IRQ_H +#define __TRACE_IRQ_H + +void __trace_hardirqs_on (void ); +void __trace_hardirqs_off (void ); + +#endif /* __TRACE_IRQ_H */
Greg Kroah-Hartman
maintainerPATCH 74/80 tty: n_gsm: fix encoding of control signal octet bit DV
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
commit 737b0ef3be6b319d6c1fd64193d1603311969326 upstream.
n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010.
See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516
The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to
the newer 27.010 here. Chapter 5.4.6.3.7 describes the encoding of the
control signal octet used by the MSC (modem status command). The same
encoding is also used in convergence layer type 2 as described in chapter
5.5.2. Table 7 and 24 both require the DV (data valid) bit to be set 1 for
outgoing control signal octets sent by the DTE (data terminal equipment),
i.e. for the initiator side.
Currently, the DV bit is only set if CD (carrier detect) is on, regardless
of the side.
This patch fixes this behavior by setting the DV bit on the initiator side unconditionally.
--- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/n_gsm.c +1 -1
@@ -434,7 +434,7 @@ static u8 gsm_encode_modem(const struct modembits |=MDM_RTR ;if (dlci->modem_tx &TIOCM_RI ) modembits |=MDM_IC ; -if (dlci->modem_tx &TIOCM_CD ) +if (dlci->modem_tx &TIOCM_CD || dlci->gsm->initiator) modembits |=MDM_DV ;return modembits; }
Greg Kroah-Hartman
maintainerPATCH 75/80 tty: n_gsm: fix proper link termination after failed open
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
commit e3b7468f082d106459e86e8dc6fb9bdd65553433 upstream.
Trying to open a DLCI by sending a SABM frame may fail with a timeout. The link is closed on the initiator side without informing the responder about this event. The responder assumes the link is open after sending a UA frame to answer the SABM frame. The link gets stuck in a half open state.
This patch fixes this by initiating the proper link termination procedure after link setup timeout instead of silently closing it down.
--- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/n_gsm.c +1 -1
@@ -1485,7 +1485,7 @@ static void gsm_dlci_t1(struct timer_lis dlci->mode =DLCI_MODE_ADM ;gsm_dlci_open (dlci); }else { -gsm_dlci_close (dlci); +gsm_dlci_begin_close (dlci);/* prevent half open link */ }break ;
Greg Kroah-Hartman
maintainerPATCH 76/80 tty: n_gsm: fix NULL pointer access due to DLCI release
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
commit 96b169f05cdcc844b400695184d77e42071d14f2 upstream.
The here fixed commit made the tty hangup asynchronous to avoid a circular locking warning. I could not reproduce this warning. Furthermore, due to the asynchronous hangup the function call now gets queued up while the underlying tty is being freed. Depending on the timing this results in a NULL pointer access in the global work queue scheduler. To be precise in process_one_work(). Therefore, the previous commit made the issue worse which it tried to fix.
This patch fixes this by falling back to the old behavior which uses a blocking tty hangup call before freeing up the associated tty.
--- drivers/tty/n_gsm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/tty/n_gsm.c +6 -1
@@ -1719,7 +1719,12 @@ static void gsm_dlci_release(struct gsm_gsm_destroy_network (dlci);mutex_unlock (&dlci->mutex); -tty_hangup (tty); +/* We cannot use tty_hangup() because in tty_kref_put() the tty +* driver assumes that the hangup queue is free and reuses it to +* queue release_one_tty() -> NULL pointer panic in +* process_one_work(). +*/ +tty_vhangup (tty);tty_port_tty_set (&dlci->port,NULL );tty_kref_put (tty);
Greg Kroah-Hartman
maintainerPATCH 77/80 tty: n_gsm: fix wrong tty control line for flow control
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
commit c19d93542a6081577e6da9bf5e887979c72e80c1 upstream.
tty flow control is handled via gsmtty_throttle() and gsmtty_unthrottle(). Both functions propagate the outgoing hardware flow control state to the remote side via MSC (modem status command) frames. The local state is taken from the RTS (ready to send) flag of the tty. However, RTS gets mapped to DTR (data terminal ready), which is wrong.
This patch corrects this by mapping RTS to RTS.
--- drivers/tty/n_gsm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/n_gsm.c +4 -4
@@ -3178,9 +3178,9 @@ static void gsmtty_throttle(struct tty_sif (dlci->state ==DLCI_CLOSED )return ;if (C_CRTSCTS (tty)) - dlci->modem_tx &= ~TIOCM_DTR ; + dlci->modem_tx &= ~TIOCM_RTS ; dlci->throttled = true; -/* Send an MSC with DTR cleared */ +/* Send an MSC with RTS cleared */ gsmtty_modem_update (dlci,0 ); }
@@ -3190,9 +3190,9 @@ static void gsmtty_unthrottle(struct ttyif (dlci->state ==DLCI_CLOSED )return ;if (C_CRTSCTS (tty)) - dlci->modem_tx |=TIOCM_DTR ; + dlci->modem_tx |=TIOCM_RTS ; dlci->throttled = false; -/* Send an MSC with DTR set */ +/* Send an MSC with RTS set */ gsmtty_modem_update (dlci,0 ); }
Greg Kroah-Hartman
maintainerPATCH 78/80 tty: n_gsm: fix deadlock in gsmtty_open()
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
commit a2ab75b8e76e455af7867e3835fd9cdf386b508f upstream.
In the current implementation the user may open a virtual tty which then could fail to establish the underlying DLCI. The function gsmtty_open() gets stuck in tty_port_block_til_ready() while waiting for a carrier rise. This happens if the remote side fails to acknowledge the link establishment request in time or completely. At some point gsm_dlci_close() is called to abort the link establishment attempt. The function tries to inform the associated virtual tty by performing a hangup. But the blocking loop within tty_port_block_til_ready() is not informed about this event. The patch proposed here fixes this by resetting the initialization state of the virtual tty to ensure the loop exits and triggering it to make tty_port_block_til_ready() return.
--- drivers/tty/n_gsm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/n_gsm.c +3 -0
@@ -1426,6 +1426,9 @@ static void gsm_dlci_close(struct gsm_dlif (dlci->addr !=0 ) {tty_port_tty_hangup (&dlci->port, false);kfifo_reset (&dlci->fifo); +/* Ensure that gsmtty_open() can return. */ +tty_port_set_initialized (&dlci->port,0 ); +wake_up_interruptible (&dlci->port.open_wait); }else dlci->gsm->dead = true;wake_up (&dlci->gsm->event);
Greg Kroah-Hartman
maintainerPATCH 79/80 gpio: tegra186: Fix chip_data type confusion
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit d1e972ace42390de739cde87d96043dcbe502286 upstream.
The tegra186 GPIO driver makes the assumption that the pointer returned by irq_data_get_irq_chip_data() is a pointer to a tegra_gpio structure. Unfortunately, it is actually a pointer to the inner gpio_chip structure, as mandated by the gpiolib infrastructure. Nice try.
The saving grace is that the gpio_chip is the first member of tegra_gpio, so the bug has gone undetected since... forever.
Fix it by performing a container_of() on the pointer. This results in no additional code, and makes it possible to understand how the whole thing works.
--- drivers/gpio/gpio-tegra186.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpio/gpio-tegra186.c +10 -4
@@ -337,9 +337,12 @@ static int tegra186_gpio_of_xlate(structreturn offset + pin; } +#define to_tegra_gpio (x) container_of((x), struct tegra_gpio, gpio) +static void tegra186_irq_ack (struct irq_data *data) { -struct tegra_gpio *gpio =irq_data_get_irq_chip_data (data); +struct gpio_chip *gc =irq_data_get_irq_chip_data (data); +struct tegra_gpio *gpio =to_tegra_gpio (gc);void __iomem *base; base =tegra186_gpio_get_base (gpio, data->hwirq);
@@ -351,7 +354,8 @@ static void tegra186_irq_ack(struct irq_static void tegra186_irq_mask (struct irq_data *data) { -struct tegra_gpio *gpio =irq_data_get_irq_chip_data (data); +struct gpio_chip *gc =irq_data_get_irq_chip_data (data); +struct tegra_gpio *gpio =to_tegra_gpio (gc);void __iomem *base;u32 value;
@@ -366,7 +370,8 @@ static void tegra186_irq_mask(struct irqstatic void tegra186_irq_unmask (struct irq_data *data) { -struct tegra_gpio *gpio =irq_data_get_irq_chip_data (data); +struct gpio_chip *gc =irq_data_get_irq_chip_data (data); +struct tegra_gpio *gpio =to_tegra_gpio (gc);void __iomem *base;u32 value;
@@ -381,7 +386,8 @@ static void tegra186_irq_unmask(struct istatic int tegra186_irq_set_type (struct irq_data *data,unsigned int type) { -struct tegra_gpio *gpio =irq_data_get_irq_chip_data (data); +struct gpio_chip *gc =irq_data_get_irq_chip_data (data); +struct tegra_gpio *gpio =to_tegra_gpio (gc);void __iomem *base;u32 value;
Greg Kroah-Hartman
maintainerPATCH 80/80 memblock: use kfree() to release kmalloced memblock regions
In reply to Greg Kroah-HartmanFrom: Miaohe Lin <[email protected]>
commit c94afc46cae7ad41b2ad6a99368147879f4b0e56 upstream.
memblock.{reserved,memory}.regions may be allocated using kmalloc() in memblock_double_array(). Use kfree() to release these kmalloced regions indicated by memblock_{reserved,memory}_in_slab.
--- mm/memblock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
mm/memblock.c +8 -2
@@ -366,14 +366,20 @@ void __init memblock_discard(void) addr =__pa (memblock.reserved.regions); size =PAGE_ALIGN (sizeof (struct memblock_region ) * memblock.reserved.max); -__memblock_free_late (addr, size); +if (memblock_reserved_in_slab) +kfree (memblock.reserved.regions); +else +__memblock_free_late (addr, size); }if (memblock.memory.regions != memblock_memory_init_regions) { addr =__pa (memblock.memory.regions); size =PAGE_ALIGN (sizeof (struct memblock_region ) * memblock.memory.max); -__memblock_free_late (addr, size); +if (memblock_memory_in_slab) +kfree (memblock.memory.regions); +else +__memblock_free_late (addr, size); } memblock_memory =NULL ;
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 5.10.103 release. There are 80 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.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.103-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.103-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTb using 32-bit and 64-bit ARM kernels:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.103-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.10:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
75 tests: 75 pass, 0 failLinux version: 5.10.103-rc1-g3a000049e6a1
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Successfully cross-compiled for arm64 (bcm2711_defconfig, gcc 10.2.0) and powerpc (ps3_defconfig, gcc 11.2.0).
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.103-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.10.103-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.10.y
* git commit: 3a000049e6a1d04d2e57cd3de7783075811d62e8
* git describe: v5.10.102-81-g3a000049e6a1
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.102-81-g3a000049e6a1
## Test Regressions (compared to v5.10.101-122-g6c935cea31db) No test regressions found.
## Metric Regressions (compared to v5.10.101-122-g6c935cea31db) No metric regressions found.
## Test Fixes (compared to v5.10.101-122-g6c935cea31db) No test fixes found.
## Metric Fixes (compared to v5.10.101-122-g6c935cea31db) No metric fixes found.
## Test result summary
total: 97503, pass: 84163, fail: 521, skip: 12008, xfail: 811
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 291 total, 291 passed, 0 failed
* arm64: 41 total, 39 passed, 2 failed
* dragonboard-410c: 1 total, 1 passed, 0 failed
* hi6220-hikey: 1 total, 1 passed, 0 failed
* i386: 40 total, 40 passed, 0 failed
* juno-r2: 1 total, 1 passed, 0 failed
* mips: 37 total, 37 passed, 0 failed
* parisc: 12 total, 12 passed, 0 failed
* powerpc: 24 total, 15 passed, 9 failed
* riscv: 27 total, 27 passed, 0 failed
* s390: 21 total, 21 passed, 0 failed
* sh: 24 total, 24 passed, 0 failed
* sparc: 12 total, 12 passed, 0 failed
* x15: 1 total, 1 passed, 0 failed
* x86: 1 total, 1 passed, 0 failed
* x86_64: 41 total, 41 passed, 0 failed
## Test suites summary
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-bpf
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* rcutorture
* ssuite
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
Build test:
mips (gcc version 11.2.1 20220213): 63 configs -> no failure arm (gcc version 11.2.1 20220213): 105 configs -> no new failure arm64 (gcc version 11.2.1 20220213): 3 configs -> no failure x86_64 (gcc version 11.2.1 20220213): 4 configs -> no failure
Boot test:x86_64: Booted on my test laptop. No regression.x86_64: Booted on qemu. No regression. [1]
arm64: Booted on rpi4b (4GB model). No regression. [2]
[1]. https://openqa.qa.codethink.co.uk/tests/823
[2]. https://openqa.qa.codethink.co.uk/tests/824
--
Regards
Sudip
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
Build results:
total: 161 pass: 161 fail: 0 Qemu test results: total: 477 pass: 477 fail: 0
Guenter
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.103 release. There are 80 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Mar 2022 17:20:16 +0000. Anything received after that time might be too late.
5.10.103-rc1 compiled and booted with no errors or regressions on my x86_64 test system.
Cheers,
Slade