This is the start of the stable review cycle for the 4.19.308 release.
There are 52 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu, 29 Feb 2024 13:15:36 +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/v4.x/stable-review/patch-4.19.308-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.308-rc1
Andrii Nakryiko <andriin(a)fb.com>
scripts/bpf: Fix xdp_md forward declaration typo
Bart Van Assche <bvanassche(a)acm.org>
fs/aio: Restrict kiocb_set_cancel_fn() to I/O submitted via libaio
Oliver Upton <oliver.upton(a)linux.dev>
KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler
Oliver Upton <oliver.upton(a)linux.dev>
KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()
Vidya Sagar <vidyas(a)nvidia.com>
PCI/MSI: Prevent MSI hardware interrupt number truncation
Jason Gunthorpe <jgg(a)nvidia.com>
s390: use the correct count for __iowrite64_copy()
Wolfram Sang <wsa+renesas(a)sang-engineering.com>
packet: move from strlcpy with unused retval to strscpy
Vasiliy Kovalev <kovalev(a)altlinux.org>
ipv6: sr: fix possible use-after-free and null-ptr-deref
Arnd Bergmann <arnd(a)arndb.de>
nouveau: fix function cast warnings
Randy Dunlap <rdunlap(a)infradead.org>
scsi: jazz_esp: Only build if SCSI core is builtin
Gianmarco Lusvardi <glusvardi(a)posteo.net>
bpf, scripts: Correct GPL license name
Andrii Nakryiko <andriin(a)fb.com>
scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions
Arnd Bergmann <arnd(a)arndb.de>
RDMA/srpt: fix function pointer cast warnings
Bart Van Assche <bvanassche(a)acm.org>
RDMA/srpt: Make debug output more detailed
Jason Gunthorpe <jgg(a)ziepe.ca>
RDMA/ulp: Use dev_name instead of ibdev->name
Bart Van Assche <bvanassche(a)acm.org>
RDMA/srpt: Support specifying the srpt_service_guid parameter
Kalesh AP <kalesh-anakkur.purayil(a)broadcom.com>
RDMA/bnxt_re: Return error for SRQ resize
Zhipeng Lu <alexious(a)zju.edu.cn>
IB/hfi1: Fix a memleak in init_credit_return
Xu Yang <xu.yang_2(a)nxp.com>
usb: roles: don't get/set_role() when usb_role_switch is unregistered
Krishna Kurapati <quic_kriskura(a)quicinc.com>
usb: gadget: ncm: Avoid dropping datagrams of properly parsed NTBs
Nikita Shubin <nikita.shubin(a)maquefel.me>
ARM: ep93xx: Add terminator to gpiod_lookup_table
Tom Parkin <tparkin(a)katalix.com>
l2tp: pass correct message length to ip6_append_data
Vasiliy Kovalev <kovalev(a)altlinux.org>
gtp: fix use-after-free and null-ptr-deref in gtp_genl_dump_pdp()
Mikulas Patocka <mpatocka(a)redhat.com>
dm-crypt: don't modify the data when using authenticated encryption
Roman Gushchin <guro(a)fb.com>
mm: memcontrol: switch to rcu protection in drain_all_stock()
Daniel Vacek <neelx(a)redhat.com>
IB/hfi1: Fix sdma.h tx->num_descs off-by-one error
Geert Uytterhoeven <geert+renesas(a)glider.be>
pmdomain: renesas: r8a77980-sysc: CR7 must be always on
Alexandra Winter <wintera(a)linux.ibm.com>
s390/qeth: Fix potential loss of L3-IP@ in case of network issues
Yi Sun <yi.sun(a)unisoc.com>
virtio-blk: Ensure no requests in virtqueues before deleting vqs.
Takashi Sakamoto <o-takashi(a)sakamocchi.jp>
firewire: core: send bus reset promptly on gap count error
Zhang Rui <rui.zhang(a)intel.com>
hwmon: (coretemp) Enlarge per package core count limit
Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
regulator: pwm-regulator: Add validity checks in continuous .get_voltage
Baokun Li <libaokun1(a)huawei.com>
ext4: avoid allocating blocks from corrupted group in ext4_mb_find_by_goal()
Baokun Li <libaokun1(a)huawei.com>
ext4: avoid allocating blocks from corrupted group in ext4_mb_try_best_found()
Conrad Kostecki <conikost(a)gentoo.org>
ahci: asm1166: correct count of reported ports
Fullway Wang <fullwaywang(a)outlook.com>
fbdev: sis: Error out if pixclock equals zero
Fullway Wang <fullwaywang(a)outlook.com>
fbdev: savage: Error out if pixclock equals zero
Felix Fietkau <nbd(a)nbd.name>
wifi: mac80211: fix race condition on enabling fast-xmit
Michal Kazior <michal(a)plume.com>
wifi: cfg80211: fix missing interfaces when dumping
Vinod Koul <vkoul(a)kernel.org>
dmaengine: shdma: increase size of 'dev_id'
Dmitry Bogdanov <d.bogdanov(a)yadro.com>
scsi: target: core: Add TMF to tmr_list handling
Cyril Hrubis <chrubis(a)suse.cz>
sched/rt: Disallow writing invalid values to sched_rt_period_us
Cyril Hrubis <chrubis(a)suse.cz>
sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset
Cyril Hrubis <chrubis(a)suse.cz>
sched/rt: Fix sysctl_sched_rr_timeslice intial value
Lokesh Gidra <lokeshgidra(a)google.com>
userfaultfd: fix mmap_changing checking in mfill_atomic_hugetlb
Ryusuke Konishi <konishi.ryusuke(a)gmail.com>
nilfs2: replace WARN_ONs for invalid DAT metadata block requests
GONG, Ruiqi <gongruiqi1(a)huawei.com>
memcg: add refcnt for pcpu stock to avoid UAF problem in drain_all_stock()
Aaro Koskinen <aaro.koskinen(a)nokia.com>
net: stmmac: fix notifier registration
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
stmmac: no need to check return value of debugfs_create functions
Jamal Hadi Salim <jhs(a)mojatatu.com>
net/sched: Retire dsmark qdisc
Jamal Hadi Salim <jhs(a)mojatatu.com>
net/sched: Retire ATM qdisc
Jamal Hadi Salim <jhs(a)mojatatu.com>
net/sched: Retire CBQ qdisc
-------------
Diffstat:
Makefile | 4 +-
arch/arm/mach-ep93xx/core.c | 1 +
arch/s390/pci/pci.c | 2 +-
drivers/ata/ahci.c | 5 +
drivers/block/virtio_blk.c | 7 +-
drivers/dma/sh/shdma.h | 2 +-
drivers/firewire/core-card.c | 18 +-
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 8 +-
drivers/hwmon/coretemp.c | 2 +-
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 5 +-
drivers/infiniband/hw/hfi1/pio.c | 6 +-
drivers/infiniband/hw/hfi1/sdma.c | 2 +-
drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 2 +-
drivers/infiniband/ulp/iser/iser_verbs.c | 9 +-
drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 3 +-
drivers/infiniband/ulp/srp/ib_srp.c | 10 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 52 +-
drivers/md/dm-crypt.c | 6 +
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 -
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 65 +-
drivers/net/gtp.c | 10 +-
drivers/pci/msi.c | 2 +-
drivers/regulator/pwm-regulator.c | 3 +
drivers/s390/net/qeth_l3_main.c | 9 +-
drivers/scsi/Kconfig | 2 +-
drivers/soc/renesas/r8a77980-sysc.c | 3 +-
drivers/target/target_core_device.c | 5 -
drivers/target/target_core_transport.c | 4 +
drivers/usb/gadget/function/f_ncm.c | 10 +-
drivers/usb/roles/class.c | 12 +-
drivers/video/fbdev/savage/savagefb_driver.c | 3 +
drivers/video/fbdev/sis/sis_main.c | 2 +
fs/aio.c | 9 +-
fs/ext4/mballoc.c | 13 +-
fs/nilfs2/dat.c | 27 +-
include/linux/fs.h | 2 +
include/rdma/rdma_vt.h | 2 +-
kernel/sched/rt.c | 10 +-
kernel/sysctl.c | 5 +
mm/memcontrol.c | 23 +-
mm/userfaultfd.c | 14 +-
net/ipv6/seg6.c | 20 +-
net/l2tp/l2tp_ip6.c | 2 +-
net/mac80211/sta_info.c | 2 +
net/mac80211/tx.c | 2 +-
net/packet/af_packet.c | 4 +-
net/sched/Kconfig | 42 -
net/sched/Makefile | 3 -
net/sched/sch_atm.c | 708 --------
net/sched/sch_cbq.c | 1823 ---------------------
net/sched/sch_dsmark.c | 519 ------
net/wireless/nl80211.c | 1 +
scripts/bpf_helpers_doc.py | 157 +-
virt/kvm/arm/vgic/vgic-its.c | 5 +
55 files changed, 412 insertions(+), 3259 deletions(-)
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 045e9d812868a2d80b7a57b224ce8009444b7bbc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2024022602-extended-buffer-5cf7@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
045e9d812868 ("mptcp: fix duplicate subflow creation")
b9d69db87fb7 ("mptcp: let the in-kernel PM use mixed IPv4 and IPv6 addresses")
bedee0b56113 ("mptcp: address lookup improvements")
4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs")
c682bf536cf4 ("mptcp: add pm_nl_pernet helpers")
4cf86ae84c71 ("mptcp: strict local address ID selection")
d045b9eb95a9 ("mptcp: introduce implicit endpoints")
aaa25a2fa796 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 045e9d812868a2d80b7a57b224ce8009444b7bbc Mon Sep 17 00:00:00 2001
From: Paolo Abeni <pabeni(a)redhat.com>
Date: Thu, 15 Feb 2024 19:25:33 +0100
Subject: [PATCH] mptcp: fix duplicate subflow creation
Fullmesh endpoints could end-up unexpectedly generating duplicate
subflows - same local and remote addresses - when multiple incoming
ADD_ADDR are processed before the PM creates the subflow for the local
endpoints.
Address the issue explicitly checking for duplicates at subflow
creation time.
To avoid a quadratic computational complexity, track the unavailable
remote address ids in a temporary bitmap and initialize such bitmap
with the remote ids of all the existing subflows matching the local
address currently processed.
The above allows additionally replacing the existing code checking
for duplicate entry in the current set with a simple bit test
operation.
Fixes: 2843ff6f36db ("mptcp: remote addresses fullmesh")
Cc: stable(a)vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/435
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
Reviewed-by: Mat Martineau <martineau(a)kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index ed6983af1ab2..58d17d9604e7 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -396,19 +396,6 @@ void mptcp_pm_free_anno_list(struct mptcp_sock *msk)
}
}
-static bool lookup_address_in_vec(const struct mptcp_addr_info *addrs, unsigned int nr,
- const struct mptcp_addr_info *addr)
-{
- int i;
-
- for (i = 0; i < nr; i++) {
- if (addrs[i].id == addr->id)
- return true;
- }
-
- return false;
-}
-
/* Fill all the remote addresses into the array addrs[],
* and return the array size.
*/
@@ -440,6 +427,16 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk,
msk->pm.subflows++;
addrs[i++] = remote;
} else {
+ DECLARE_BITMAP(unavail_id, MPTCP_PM_MAX_ADDR_ID + 1);
+
+ /* Forbid creation of new subflows matching existing
+ * ones, possibly already created by incoming ADD_ADDR
+ */
+ bitmap_zero(unavail_id, MPTCP_PM_MAX_ADDR_ID + 1);
+ mptcp_for_each_subflow(msk, subflow)
+ if (READ_ONCE(subflow->local_id) == local->id)
+ __set_bit(subflow->remote_id, unavail_id);
+
mptcp_for_each_subflow(msk, subflow) {
ssk = mptcp_subflow_tcp_sock(subflow);
remote_address((struct sock_common *)ssk, &addrs[i]);
@@ -447,11 +444,17 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk,
if (deny_id0 && !addrs[i].id)
continue;
+ if (test_bit(addrs[i].id, unavail_id))
+ continue;
+
if (!mptcp_pm_addr_families_match(sk, local, &addrs[i]))
continue;
- if (!lookup_address_in_vec(addrs, i, &addrs[i]) &&
- msk->pm.subflows < subflows_max) {
+ if (msk->pm.subflows < subflows_max) {
+ /* forbid creating multiple address towards
+ * this id
+ */
+ __set_bit(addrs[i].id, unavail_id);
msk->pm.subflows++;
i++;
}
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 8c86fad2cecdc6bf7283ecd298b4d0555bd8b8aa
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2024021943-wriggle-repair-49dd@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
8c86fad2cecd ("selftests: mptcp: add missing kconfig for NF Filter in v6")
b6e074e171bc ("selftests: mptcp: add infinite map testcase")
39aab88242a8 ("selftests: mptcp: join: list failure at the end")
c7d49c033de0 ("selftests: mptcp: join: alt. to exec specific tests")
ae7bd9ccecc3 ("selftests: mptcp: join: option to execute specific tests")
e59300ce3ff8 ("selftests: mptcp: join: reset failing links")
3afd0280e7d3 ("selftests: mptcp: join: define tests groups once")
3c082695e78b ("selftests: mptcp: drop msg argument of chk_csum_nr")
69c6ce7b6eca ("selftests: mptcp: add implicit endpoint test case")
d045b9eb95a9 ("mptcp: introduce implicit endpoints")
6fa0174a7c86 ("mptcp: more careful RM_ADDR generation")
f98c2bca7b2b ("selftests: mptcp: Rename wait function")
826d7bdca833 ("selftests: mptcp: join: allow running -cCi")
7d9bf018f907 ("selftests: mptcp: update output info of chk_rm_nr")
26516e10c433 ("selftests: mptcp: add more arguments for chk_join_nr")
8117dac3e7c3 ("selftests: mptcp: add invert check in check_transfer")
01542c9bf9ab ("selftests: mptcp: add fastclose testcase")
cbfafac4cf8f ("selftests: mptcp: add extra_args in do_transfer")
922fd2b39e5a ("selftests: mptcp: add the MP_RST mibs check")
e8e947ef50f6 ("selftests: mptcp: add the MP_FASTCLOSE mibs check")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 8c86fad2cecdc6bf7283ecd298b4d0555bd8b8aa Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <matttbe(a)kernel.org>
Date: Wed, 31 Jan 2024 22:49:48 +0100
Subject: [PATCH] selftests: mptcp: add missing kconfig for NF Filter in v6
Since the commit mentioned below, 'mptcp_join' selftests is using
IPTables to add rules to the Filter table for IPv6.
It is then required to have IP6_NF_FILTER KConfig.
This KConfig is usually enabled by default in many defconfig, but we
recently noticed that some CI were running our selftests without them
enabled.
Fixes: 523514ed0a99 ("selftests: mptcp: add ADD_ADDR IPv6 test cases")
Cc: stable(a)vger.kernel.org
Reviewed-by: Geliang Tang <geliang(a)kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
Link: https://lore.kernel.org/r/20240131-upstream-net-20240131-mptcp-ci-issues-v1…
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/tools/testing/selftests/net/mptcp/config b/tools/testing/selftests/net/mptcp/config
index 2a00bf4acdfa..26fe466f803d 100644
--- a/tools/testing/selftests/net/mptcp/config
+++ b/tools/testing/selftests/net/mptcp/config
@@ -25,6 +25,7 @@ CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IP6_NF_FILTER=m
CONFIG_NET_ACT_CSUM=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_CLS_ACT=y
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 3645c844902bd4e173d6704fc2a37e8746904d67
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2024021925-lyricism-unshackle-b3ca@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
3645c844902b ("selftests: mptcp: add missing kconfig for NF Filter")
46e967d187ed ("selftests: mptcp: add tests for subflow creation failure")
5fb62e9cd3ad ("selftests: mptcp: add tproxy test case")
b6ab64b074f2 ("selftests: mptcp: more stable simult_flows tests")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3645c844902bd4e173d6704fc2a37e8746904d67 Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <matttbe(a)kernel.org>
Date: Wed, 31 Jan 2024 22:49:47 +0100
Subject: [PATCH] selftests: mptcp: add missing kconfig for NF Filter
Since the commit mentioned below, 'mptcp_join' selftests is using
IPTables to add rules to the Filter table.
It is then required to have IP_NF_FILTER KConfig.
This KConfig is usually enabled by default in many defconfig, but we
recently noticed that some CI were running our selftests without them
enabled.
Fixes: 8d014eaa9254 ("selftests: mptcp: add ADD_ADDR timeout test case")
Cc: stable(a)vger.kernel.org
Reviewed-by: Geliang Tang <geliang(a)kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/tools/testing/selftests/net/mptcp/config b/tools/testing/selftests/net/mptcp/config
index e317c2e44dae..2a00bf4acdfa 100644
--- a/tools/testing/selftests/net/mptcp/config
+++ b/tools/testing/selftests/net/mptcp/config
@@ -22,6 +22,7 @@ CONFIG_NFT_TPROXY=m
CONFIG_NFT_SOCKET=m
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_NET_ACT_CSUM=m
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 9f1a98813b4b686482e5ef3c9d998581cace0ba6
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023100447-durable-snowiness-8b36@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 9f1a98813b4b686482e5ef3c9d998581cace0ba6 Mon Sep 17 00:00:00 2001
From: Paolo Abeni <pabeni(a)redhat.com>
Date: Sat, 16 Sep 2023 12:52:47 +0200
Subject: [PATCH] mptcp: process pending subflow error on close
On incoming TCP reset, subflow closing could happen before error
propagation. That in turn could cause the socket error being ignored,
and a missing socket state transition, as reported by Daire-Byrne.
Address the issues explicitly checking for subflow socket error at
close time. To avoid code duplication, factor-out of __mptcp_error_report()
a new helper implementing the relevant bits.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/429
Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk")
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
Reviewed-by: Mat Martineau <martineau(a)kernel.org>
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 915860027b1a..1c96b8da71df 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -770,40 +770,44 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk)
return moved;
}
+static bool __mptcp_subflow_error_report(struct sock *sk, struct sock *ssk)
+{
+ int err = sock_error(ssk);
+ int ssk_state;
+
+ if (!err)
+ return false;
+
+ /* only propagate errors on fallen-back sockets or
+ * on MPC connect
+ */
+ if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(mptcp_sk(sk)))
+ return false;
+
+ /* We need to propagate only transition to CLOSE state.
+ * Orphaned socket will see such state change via
+ * subflow_sched_work_if_closed() and that path will properly
+ * destroy the msk as needed.
+ */
+ ssk_state = inet_sk_state_load(ssk);
+ if (ssk_state == TCP_CLOSE && !sock_flag(sk, SOCK_DEAD))
+ inet_sk_state_store(sk, ssk_state);
+ WRITE_ONCE(sk->sk_err, -err);
+
+ /* This barrier is coupled with smp_rmb() in mptcp_poll() */
+ smp_wmb();
+ sk_error_report(sk);
+ return true;
+}
+
void __mptcp_error_report(struct sock *sk)
{
struct mptcp_subflow_context *subflow;
struct mptcp_sock *msk = mptcp_sk(sk);
- mptcp_for_each_subflow(msk, subflow) {
- struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
- int err = sock_error(ssk);
- int ssk_state;
-
- if (!err)
- continue;
-
- /* only propagate errors on fallen-back sockets or
- * on MPC connect
- */
- if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(msk))
- continue;
-
- /* We need to propagate only transition to CLOSE state.
- * Orphaned socket will see such state change via
- * subflow_sched_work_if_closed() and that path will properly
- * destroy the msk as needed.
- */
- ssk_state = inet_sk_state_load(ssk);
- if (ssk_state == TCP_CLOSE && !sock_flag(sk, SOCK_DEAD))
- inet_sk_state_store(sk, ssk_state);
- WRITE_ONCE(sk->sk_err, -err);
-
- /* This barrier is coupled with smp_rmb() in mptcp_poll() */
- smp_wmb();
- sk_error_report(sk);
- break;
- }
+ mptcp_for_each_subflow(msk, subflow)
+ if (__mptcp_subflow_error_report(sk, mptcp_subflow_tcp_sock(subflow)))
+ break;
}
/* In most cases we will be able to lock the mptcp socket. If its already
@@ -2428,6 +2432,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
}
out_release:
+ __mptcp_subflow_error_report(sk, ssk);
release_sock(ssk);
sock_put(ssk);
Commit 8238b4579866 ("wait_on_bit: add an acquire memory barrier") added
a new bitop, test_bit_acquire(), with proper wrapping in order to try to
optimize it at compile-time, but missed the list of bitops used for
checking their prototypes a bit below.
The functions added have consistent prototypes, so that no more changes
are required and no functional changes take place.
Fixes: 8238b4579866 ("wait_on_bit: add an acquire memory barrier")
Cc: stable(a)vger.kernel.org # 6.0+
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel(a)intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin(a)intel.com>
---
include/linux/bitops.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 2ba557e067fe..f7f5a783da2a 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -80,6 +80,7 @@ __check_bitop_pr(__test_and_set_bit);
__check_bitop_pr(__test_and_clear_bit);
__check_bitop_pr(__test_and_change_bit);
__check_bitop_pr(test_bit);
+__check_bitop_pr(test_bit_acquire);
#undef __check_bitop_pr
--
2.43.0