Kernel sources for Moto G9 (Play) (Guamp)
Find a file
Tariq Toukan 52d3c2e629 net/tls: Fix race in TLS device down flow
[ Upstream commit f08d8c1bb97c48f24a82afaa2fd8c140f8d3da8b ]

Socket destruction flow and tls_device_down function sync against each
other using tls_device_lock and the context refcount, to guarantee the
device resources are freed via tls_dev_del() by the end of
tls_device_down.

In the following unfortunate flow, this won't happen:
- refcount is decreased to zero in tls_device_sk_destruct.
- tls_device_down starts, skips the context as refcount is zero, going
  all the way until it flushes the gc work, and returns without freeing
  the device resources.
- only then, tls_device_queue_ctx_destruction is called, queues the gc
  work and frees the context's device resources.

Solve it by decreasing the refcount in the socket's destruction flow
under the tls_device_lock, for perfect synchronization.  This does not
slow down the common likely destructor flow, in which both the refcount
is decreased and the spinlock is acquired, anyway.

Fixes: e8f6979981 ("net/tls: Add generic NIC offload infrastructure")
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-07-29 17:10:32 +02:00
arch riscv: add as-options for modules with assembly compontents 2022-07-29 17:10:30 +02:00
block blk-iolatency: Fix inflight count imbalances and IO hangs on offline 2022-06-14 16:59:30 +02:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-25 11:49:16 +02:00
crypto crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-06-25 11:49:13 +02:00
Documentation ipv4: Fix data-races around sysctl_ip_dynaddr. 2022-07-21 21:09:29 +02:00
drivers net: stmmac: fix dma queue left shift overflow issue 2022-07-29 17:10:32 +02:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:21:29 +01:00
fs nilfs2: fix incorrect masking of permission flags for symlinks 2022-07-21 21:09:26 +02:00
include tcp/dccp: Fix a data-race around sysctl_tcp_fwmark_accept. 2022-07-29 17:10:31 +02:00
init random: handle latent entropy and command line from random_init() 2022-06-25 11:49:11 +02:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-12-08 08:50:11 +01:00
kernel perf/core: Fix data race between perf_event_set_output() and perf_mmap_close() 2022-07-29 17:10:31 +02:00
lib ida: don't use BUG_ON() for debugging 2022-07-12 16:29:03 +02:00
LICENSES
mm mm/slub: add missing TID updates on slab deactivation 2022-07-12 16:29:00 +02:00
net net/tls: Fix race in TLS device down flow 2022-07-29 17:10:32 +02:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-26 11:36:11 +01:00
scripts modpost: fix section mismatch check for exported init/exit sections 2022-07-02 16:27:38 +02:00
security Fix incorrect type in assignment of ipv6 port for audit 2022-04-15 14:14:54 +02:00
sound ASoC: wm5110: Fix DRE control 2022-07-21 21:09:31 +02:00
tools selftests: forwarding: fix error message in learning_test 2022-07-12 16:29:03 +02:00
usr initramfs: restore default compression behavior 2020-04-13 10:44:59 +02:00
virt KVM: Prevent module exit until all VMs are freed 2022-04-15 14:14:57 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: co-maintain random.c 2022-06-25 11:49:01 +02:00
Makefile Linux 4.19.253 2022-07-21 21:09:34 +02: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.
See Documentation/00-INDEX for a list of what is contained in each file.

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.