|
|
dd9019 |
From 889eaaeaa5aa88308347b90f53e1bd2301a50dec Mon Sep 17 00:00:00 2001
|
|
|
dd9019 |
From: Ryan Sullivan <rysulliv@redhat.com>
|
|
|
dd9019 |
Date: Mon, 25 Sep 2023 10:50:48 -0400
|
|
|
dd9019 |
Subject: [KPATCH CVE-2023-3609] kpatch fixes for CVE-2023-3609
|
|
|
dd9019 |
|
|
|
dd9019 |
Kernels:
|
|
|
dd9019 |
3.10.0-1160.88.1.el7
|
|
|
dd9019 |
3.10.0-1160.90.1.el7
|
|
|
dd9019 |
3.10.0-1160.92.1.el7
|
|
|
dd9019 |
3.10.0-1160.95.1.el7
|
|
|
dd9019 |
3.10.0-1160.99.1.el7
|
|
|
dd9019 |
|
|
|
dd9019 |
|
|
|
dd9019 |
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-7/-/merge_requests/59
|
|
|
dd9019 |
Approved-by: Yannick Cote (@ycote1)
|
|
|
dd9019 |
Changes since last build:
|
|
|
dd9019 |
[x86_64]:
|
|
|
dd9019 |
cls_u32.o: changed function: u32_set_parms.isra.21
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_delsetelem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_newsetelem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_set_lookup
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_set_lookup_byid
|
|
|
dd9019 |
nf_tables_api.o: changed function: nft_validate_register_store
|
|
|
dd9019 |
nft_byteorder.o: changed function: nft_byteorder_eval
|
|
|
dd9019 |
nft_dynset.o: changed function: nft_dynset_init
|
|
|
dd9019 |
nft_lookup.o: changed function: nft_lookup_init
|
|
|
dd9019 |
|
|
|
dd9019 |
[ppc64le]:
|
|
|
dd9019 |
cls_u32.o: changed function: u32_set_parms.isra.21
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_bind_check_setelem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_delset
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_delsetelem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_dump_set
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_getset
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_getsetelem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_newset
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_newsetelem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_set_lookup
|
|
|
dd9019 |
nf_tables_api.o: changed function: nf_tables_set_lookup_byid
|
|
|
dd9019 |
nf_tables_api.o: changed function: nft_add_set_elem
|
|
|
dd9019 |
nf_tables_api.o: changed function: nft_validate_register_store
|
|
|
dd9019 |
nft_byteorder.o: changed function: nft_byteorder_eval
|
|
|
dd9019 |
nft_dynset.o: changed function: nft_dynset_init
|
|
|
dd9019 |
nft_lookup.o: changed function: nft_lookup_init
|
|
|
dd9019 |
|
|
|
dd9019 |
---------------------------
|
|
|
dd9019 |
|
|
|
dd9019 |
Modifications: none
|
|
|
dd9019 |
|
|
|
dd9019 |
commit 867fb59af8011c735d38c08d6e6ecef67265cb4e
|
|
|
dd9019 |
Author: Davide Caratti <dcaratti@redhat.com>
|
|
|
dd9019 |
Date: Tue Aug 8 11:18:31 2023 +0200
|
|
|
dd9019 |
|
|
|
dd9019 |
net/sched: cls_u32: Fix reference counter leak leading to overflow
|
|
|
dd9019 |
|
|
|
dd9019 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2225486
|
|
|
dd9019 |
CVE: CVE-2023-3609
|
|
|
dd9019 |
Upstream Status: net.git commit 04c55383fa56
|
|
|
dd9019 |
Conflicts:
|
|
|
dd9019 |
- net/sched/cls_u32.c: we still have CONFIG_NET_CLS_IND in rhel7,
|
|
|
dd9019 |
because of missing upstream commit a51486266c3b ("net: sched: remove
|
|
|
dd9019 |
NET_CLS_IND config option"), so the patch has been manually reworked
|
|
|
dd9019 |
to preserve use of #ifdef CONFIG_NET_CLS_IND
|
|
|
dd9019 |
- we also don't have extacks because of missing backport of upstream
|
|
|
dd9019 |
commit 4b981dbc2272 ("net: sched: cls_u32: add extack support"), so
|
|
|
dd9019 |
the call to tcf_change_indev() has no 'extack' parameter
|
|
|
dd9019 |
|
|
|
dd9019 |
commit 04c55383fa5689357bcdd2c8036725a55ed632bc
|
|
|
dd9019 |
Author: Lee Jones <lee@kernel.org>
|
|
|
dd9019 |
Date: Thu Jun 8 08:29:03 2023 +0100
|
|
|
dd9019 |
|
|
|
dd9019 |
net/sched: cls_u32: Fix reference counter leak leading to overflow
|
|
|
dd9019 |
|
|
|
dd9019 |
In the event of a failure in tcf_change_indev(), u32_set_parms() will
|
|
|
dd9019 |
immediately return without decrementing the recently incremented
|
|
|
dd9019 |
reference counter. If this happens enough times, the counter will
|
|
|
dd9019 |
rollover and the reference freed, leading to a double free which can be
|
|
|
dd9019 |
used to do 'bad things'.
|
|
|
dd9019 |
|
|
|
dd9019 |
In order to prevent this, move the point of possible failure above the
|
|
|
dd9019 |
point where the reference counter is incremented. Also save any
|
|
|
dd9019 |
meaningful return values to be applied to the return data at the
|
|
|
dd9019 |
appropriate point in time.
|
|
|
dd9019 |
|
|
|
dd9019 |
This issue was caught with KASAN.
|
|
|
dd9019 |
|
|
|
dd9019 |
Fixes: 705c7091262d ("net: sched: cls_u32: no need to call tcf_exts_change for newly allocated struct")
|
|
|
dd9019 |
Suggested-by: Eric Dumazet <edumazet@google.com>
|
|
|
dd9019 |
Signed-off-by: Lee Jones <lee@kernel.org>
|
|
|
dd9019 |
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
|
|
dd9019 |
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
|
|
|
dd9019 |
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
dd9019 |
|
|
|
dd9019 |
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
|
|
|
dd9019 |
|
|
|
dd9019 |
Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
|
|
|
dd9019 |
---
|
|
|
dd9019 |
net/sched/cls_u32.c | 21 ++++++++++++++-------
|
|
|
dd9019 |
1 file changed, 14 insertions(+), 7 deletions(-)
|
|
|
dd9019 |
|
|
|
dd9019 |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
|
|
|
dd9019 |
index 269dcb08fed5..cc9398e10451 100644
|
|
|
dd9019 |
--- a/net/sched/cls_u32.c
|
|
|
dd9019 |
+++ b/net/sched/cls_u32.c
|
|
|
dd9019 |
@@ -768,11 +768,22 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp,
|
|
|
dd9019 |
struct nlattr *est, bool ovr)
|
|
|
dd9019 |
{
|
|
|
dd9019 |
int err;
|
|
|
dd9019 |
+#ifdef CONFIG_NET_CLS_IND
|
|
|
dd9019 |
+ int ifindex = -1;
|
|
|
dd9019 |
+#endif
|
|
|
dd9019 |
|
|
|
dd9019 |
err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr);
|
|
|
dd9019 |
if (err < 0)
|
|
|
dd9019 |
return err;
|
|
|
dd9019 |
|
|
|
dd9019 |
+#ifdef CONFIG_NET_CLS_IND
|
|
|
dd9019 |
+ if (tb[TCA_U32_INDEV]) {
|
|
|
dd9019 |
+ ifindex = tcf_change_indev(net, tb[TCA_U32_INDEV]);
|
|
|
dd9019 |
+ if (ifindex < 0)
|
|
|
dd9019 |
+ return -EINVAL;
|
|
|
dd9019 |
+ }
|
|
|
dd9019 |
+#endif
|
|
|
dd9019 |
+
|
|
|
dd9019 |
if (tb[TCA_U32_LINK]) {
|
|
|
dd9019 |
u32 handle = nla_get_u32(tb[TCA_U32_LINK]);
|
|
|
dd9019 |
struct tc_u_hnode *ht_down = NULL, *ht_old;
|
|
|
dd9019 |
@@ -800,14 +811,10 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp,
|
|
|
dd9019 |
}
|
|
|
dd9019 |
|
|
|
dd9019 |
#ifdef CONFIG_NET_CLS_IND
|
|
|
dd9019 |
- if (tb[TCA_U32_INDEV]) {
|
|
|
dd9019 |
- int ret;
|
|
|
dd9019 |
- ret = tcf_change_indev(net, tb[TCA_U32_INDEV]);
|
|
|
dd9019 |
- if (ret < 0)
|
|
|
dd9019 |
- return -EINVAL;
|
|
|
dd9019 |
- n->ifindex = ret;
|
|
|
dd9019 |
- }
|
|
|
dd9019 |
+ if (ifindex >= 0)
|
|
|
dd9019 |
+ n->ifindex = ifindex;
|
|
|
dd9019 |
#endif
|
|
|
dd9019 |
+
|
|
|
dd9019 |
return 0;
|
|
|
dd9019 |
}
|
|
|
dd9019 |
|
|
|
dd9019 |
--
|
|
|
dd9019 |
2.40.1
|
|
|
dd9019 |
|
|
|
dd9019 |
|