From 1e6b87855ed863cfb2e5aa6f2228edf8844d99fd Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: May 13 2023 09:25:41 +0000 Subject: sctp: fix erroneous inc of snmp SctpFragUsrMsgs (git-fixes). --- diff --git a/patches.suse/sctp-fix-erroneous-inc-of-snmp-SctpFragUsrMsgs.patch b/patches.suse/sctp-fix-erroneous-inc-of-snmp-SctpFragUsrMsgs.patch new file mode 100644 index 0000000..b95b414 --- /dev/null +++ b/patches.suse/sctp-fix-erroneous-inc-of-snmp-SctpFragUsrMsgs.patch @@ -0,0 +1,41 @@ +From 483a69f6fad664c76148afbd0c454cd03c813abb Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Wed, 20 Jun 2018 12:47:52 -0300 +Subject: [PATCH 2/2] sctp: fix erroneous inc of snmp SctpFragUsrMsgs +References: git-fixes +Patch-mainline: v4.18-rc3 +Git-commit: fedb1bd3d274b33c432cb83c80c6b3cf54d509c8 + +Currently it is incrementing SctpFragUsrMsgs when the user message size +is of the exactly same size as the maximum fragment size, which is wrong. + +The fix is to increment it only when user message is bigger than the +maximum fragment size. + +Fixes: bfd2e4b8734d ("sctp: refactor sctp_datamsg_from_user") +Signed-off-by: Marcelo Ricardo Leitner +Acked-by: Neil Horman +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + net/sctp/chunk.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c +index 697721a7a3f1..f9d93f9b6814 100644 +--- a/net/sctp/chunk.c ++++ b/net/sctp/chunk.c +@@ -230,7 +230,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, + /* Account for a different sized first fragment */ + if (msg_len >= first_len) { + msg->can_delay = 0; +- SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS); ++ if (msg_len > first_len) ++ SCTP_INC_STATS(sock_net(asoc->base.sk), ++ SCTP_MIB_FRAGUSRMSGS); + } else { + /* Which may be the only one... */ + first_len = msg_len; +-- +2.16.4 + diff --git a/series.conf b/series.conf index 4e50df7..854da7f 100644 --- a/series.conf +++ b/series.conf @@ -35382,6 +35382,7 @@ patches.suse/x86-cpu-amd-fix-llc-id-bit-shift-calculation patches.suse/uprobes-x86-Remove-incorrect-WARN_ON-in-uprobe_init_.patch patches.suse/bpf-enforce-correct-alignment-for-instructions.patch + patches.suse/sctp-fix-erroneous-inc-of-snmp-SctpFragUsrMsgs.patch patches.suse/ipvlan-fix-IFLA_MTU-ignored-on-NEWLINK.patch patches.suse/net-packet-fix-use-after-free.patch patches.suse/cls_flower-fix-use-after-free-in-flower-S-W-path.patch