No description
Find a file
Moshe Shemesh 1a4017926e net/mlx5: Fix a race on command flush flow
[ Upstream commit 063bd35559 ]

Fix a refcount use after free warning due to a race on command entry.
Such race occurs when one of the commands releases its last refcount and
frees its index and entry while another process running command flush
flow takes refcount to this command entry. The process which handles
commands flush may see this command as needed to be flushed if the other
process released its refcount but didn't release the index yet. Fix it
by adding the needed spin lock.

It fixes the following warning trace:

refcount_t: addition on 0; use-after-free.
WARNING: CPU: 11 PID: 540311 at lib/refcount.c:25 refcount_warn_saturate+0x80/0xe0
...
RIP: 0010:refcount_warn_saturate+0x80/0xe0
...
Call Trace:
 <TASK>
 mlx5_cmd_trigger_completions+0x293/0x340 [mlx5_core]
 mlx5_cmd_flush+0x3a/0xf0 [mlx5_core]
 enter_error_state+0x44/0x80 [mlx5_core]
 mlx5_fw_fatal_reporter_err_work+0x37/0xe0 [mlx5_core]
 process_one_work+0x1be/0x390
 worker_thread+0x4d/0x3d0
 ? rescuer_thread+0x350/0x350
 kthread+0x141/0x160
 ? set_kthread_struct+0x40/0x40
 ret_from_fork+0x1f/0x30
 </TASK>

Fixes: 50b2412b7e ("net/mlx5: Avoid possible free of command entry while timeout comp handler")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Eran Ben Elisha <eranbe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-16 13:21:46 +01:00
arch ARM: dts: aspeed: Fix AST2600 quad spi group 2022-03-16 13:21:45 +01:00
block block: Fix fsync always failed if once failed 2022-03-08 19:07:47 +01:00
certs certs: Trigger creation of RSA module signing key if it's not an RSA key 2021-09-15 09:47:29 +02:00
crypto crypto: pcrypt - Delay write to padata->info 2021-11-17 09:48:40 +01:00
Documentation x86/speculation: Update link to AMD speculation whitepaper 2022-03-11 11:22:37 +01:00
drivers net/mlx5: Fix a race on command flush flow 2022-03-16 13:21:46 +01:00
fs btrfs: add missing run of delayed items after unlink during log replay 2022-03-08 19:07:50 +01:00
include net/mlx5: Fix size field in bufferx_reg struct 2022-03-16 13:21:46 +01:00
init bpf: Add kconfig knob for disabling unpriv bpf by default 2022-02-16 12:52:49 +01:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-12-01 09:23:35 +01:00
kernel x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting 2022-03-11 11:22:37 +01:00
lib lib/iov_iter: initialize "flags" in new pipe_buffer 2022-02-23 11:59:59 +01:00
LICENSES
mm memfd: fix F_SEAL_WRITE after shmem huge page allocated 2022-03-08 19:07:49 +01:00
net ax25: Fix NULL pointer dereference in ax25_kill_by_device 2022-03-16 13:21:45 +01:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-17 09:48:39 +01:00
scripts kconfig: fix failing to generate auto.conf 2022-02-23 12:00:01 +01:00
security ima: Do not print policy rule with inactive LSM labels 2022-02-16 12:52:47 +01:00
sound ASoC: cs4265: Fix the duplicated control name 2022-03-08 19:07:49 +01:00
tools x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE 2022-03-11 11:22:37 +01:00
usr initramfs: restore default compression behavior 2020-04-08 09:08:38 +02:00
virt KVM: do not shrink halt_poll_ns below grow_start 2021-10-09 14:39:50 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap ARM: SoC fixes 2019-11-10 13:41:59 -08:00
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2020-08-26 10:40:46 +02:00
Makefile Linux 5.4.184 2022-03-11 11:22:39 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.