No description
Find a file
Eric Dumazet b32774b527 tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge()
[ Upstream commit 1c4e97dd2d ]

inet_twsk_purge() uses rcu to find TIME_WAIT and NEW_SYN_RECV
objects to purge.

These objects use SLAB_TYPESAFE_BY_RCU semantic and need special
care. We need to use refcount_inc_not_zero(&sk->sk_refcnt).

Reuse the existing correct logic I wrote for TIME_WAIT,
because both structures have common locations for
sk_state, sk_family, and netns pointer.

If after the refcount_inc_not_zero() the object fields longer match
the keys, use sock_gen_put(sk) to release the refcount.

Then we can call inet_twsk_deschedule_put() for TIME_WAIT,
inet_csk_reqsk_queue_drop_and_put() for NEW_SYN_RECV sockets,
with BH disabled.

Then we need to restart the loop because we had drop rcu_read_lock().

Fixes: 740ea3c4a0 ("tcp: Clean up kernel listener's reqsk in inet_twsk_purge()")
Link: https://lore.kernel.org/netdev/CANn89iLvFuuihCtt9PME2uS1WJATnf5fKjDToa1WzVnRzHnPfg@mail.gmail.com/T/#u
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240308200122.64357-2-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:18:53 -04:00
arch x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:18:52 -04:00
block block: fix deadlock between bd_link_disk_holder and partition scan 2024-03-26 18:17:59 -04:00
certs This update includes the following changes: 2023-11-02 16:15:30 -10:00
crypto crypto: jitter - fix CRYPTO_JITTERENTROPY help text 2024-03-26 18:18:39 -04:00
Documentation dt-bindings: msm: qcom, mdss: Include ommited fam-b compatible 2024-03-26 18:18:33 -04:00
drivers nouveau: reset the bo resource bus info after an eviction 2024-03-26 18:18:53 -04:00
fs bcachefs: Fix BTREE_ITER_FILTER_SNAPSHOTS on inodes btree 2024-03-26 18:18:50 -04:00
include f2fs: fix to truncate meta inode pages forcely 2024-03-26 18:18:49 -04:00
init modules: wait do_free_init correctly 2024-03-26 18:18:42 -04:00
io_uring io_uring: don't save/restore iowait state 2024-03-26 18:18:52 -04:00
ipc Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
kernel modules: wait do_free_init correctly 2024-03-26 18:18:42 -04:00
lib net: blackhole_dev: fix build warning for ethh set but not used 2024-03-26 18:18:09 -04:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm quota: Properly annotate i_dquot arrays with __rcu 2024-03-26 18:18:32 -04:00
net tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge() 2024-03-26 18:18:53 -04:00
rust rust: Ignore preserve-most functions 2024-01-25 15:45:09 -08:00
samples work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:51:20 +01:00
scripts kconfig: fix infinite loop when expanding a macro at the end of file 2024-03-26 18:18:51 -04:00
security landlock: Fix asymmetric private inodes referring 2024-03-06 14:53:55 +00:00
sound ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates 2024-03-26 18:18:53 -04:00
tools perf pmu: Fix a potential memory leak in perf_pmu__lookup() 2024-03-26 18:18:39 -04:00
usr arch: Remove Itanium (IA-64) architecture 2023-09-11 08:13:17 +00:00
virt KVM/arm64 fixes for 6.7, part #2 2023-12-22 18:03:54 -05:00
.clang-format iommu: Add for_each_group_device() 2023-05-23 08:15:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/ 2023-10-03 20:49:09 +09:00
.mailmap 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING
CREDITS 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig
MAINTAINERS 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
Makefile Linux 6.7.10 2024-03-15 14:22:41 -04: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.