From 3c5f72a18836dfdaef518a56b6ee4094e58c51a2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Jul 2023 07:38:24 +0200 Subject: [PATCH] drop a broken networking patch and fix up another one for 6.1 --- ...t-add-sanity-checks-on-skb-before-ca.patch | 17 +- ...indirect-act-functions-on-retpoline-.patch | 543 ------------------ queue-6.1/series | 1 - 3 files changed, 6 insertions(+), 555 deletions(-) delete mode 100644 queue-6.1/net-sched-avoid-indirect-act-functions-on-retpoline-.patch diff --git a/queue-6.1/net-sched-act_ipt-add-sanity-checks-on-skb-before-ca.patch b/queue-6.1/net-sched-act_ipt-add-sanity-checks-on-skb-before-ca.patch index 635d5fcddce..77331482197 100644 --- a/queue-6.1/net-sched-act_ipt-add-sanity-checks-on-skb-before-ca.patch +++ b/queue-6.1/net-sched-act_ipt-add-sanity-checks-on-skb-before-ca.patch @@ -29,14 +29,12 @@ Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- - net/sched/act_ipt.c | 33 +++++++++++++++++++++++++++++++++ + net/sched/act_ipt.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c -index ea7f151e7dd29..a6b522b512dc3 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c -@@ -230,6 +230,26 @@ static int tcf_xt_init(struct net *net, struct nlattr *nla, +@@ -229,6 +229,26 @@ static int tcf_xt_init(struct net *net, a, &act_xt_ops, tp, flags); } @@ -60,10 +58,10 @@ index ea7f151e7dd29..a6b522b512dc3 100644 + return pskb_may_pull(skb, iph->ihl * 4u); +} + - TC_INDIRECT_SCOPE int tcf_ipt_act(struct sk_buff *skb, - const struct tc_action *a, - struct tcf_result *res) -@@ -244,9 +264,22 @@ TC_INDIRECT_SCOPE int tcf_ipt_act(struct sk_buff *skb, + static int tcf_ipt_act(struct sk_buff *skb, const struct tc_action *a, + struct tcf_result *res) + { +@@ -242,9 +262,22 @@ static int tcf_ipt_act(struct sk_buff *s .pf = NFPROTO_IPV4, }; @@ -86,6 +84,3 @@ index ea7f151e7dd29..a6b522b512dc3 100644 spin_lock(&ipt->tcf_lock); tcf_lastuse_update(&ipt->tcf_tm); --- -2.39.2 - diff --git a/queue-6.1/net-sched-avoid-indirect-act-functions-on-retpoline-.patch b/queue-6.1/net-sched-avoid-indirect-act-functions-on-retpoline-.patch deleted file mode 100644 index e76826b3f71..00000000000 --- a/queue-6.1/net-sched-avoid-indirect-act-functions-on-retpoline-.patch +++ /dev/null @@ -1,543 +0,0 @@ -From 122945ba62d821b786b51bd84aa4ca23619737fc Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 6 Dec 2022 10:55:12 -0300 -Subject: net/sched: avoid indirect act functions on retpoline kernels - -From: Pedro Tammela - -[ Upstream commit 871cf386dd16705b1e08942efd02c58801293d01 ] - -Expose the necessary tc act functions and wire up act_api to use -direct calls in retpoline kernels. - -Signed-off-by: Pedro Tammela -Reviewed-by: Jamal Hadi Salim -Reviewed-by: Victor Nogueira -Signed-off-by: David S. Miller -Stable-dep-of: b2dc32dcba08 ("net/sched: act_ipt: add sanity checks on skb before calling target") -Signed-off-by: Sasha Levin ---- - net/sched/act_api.c | 3 ++- - net/sched/act_bpf.c | 6 ++++-- - net/sched/act_connmark.c | 6 ++++-- - net/sched/act_csum.c | 6 ++++-- - net/sched/act_ct.c | 5 +++-- - net/sched/act_ctinfo.c | 6 ++++-- - net/sched/act_gact.c | 6 ++++-- - net/sched/act_gate.c | 6 ++++-- - net/sched/act_ife.c | 6 ++++-- - net/sched/act_ipt.c | 6 ++++-- - net/sched/act_mirred.c | 6 ++++-- - net/sched/act_mpls.c | 6 ++++-- - net/sched/act_nat.c | 7 ++++--- - net/sched/act_pedit.c | 6 ++++-- - net/sched/act_police.c | 6 ++++-- - net/sched/act_sample.c | 6 ++++-- - net/sched/act_simple.c | 6 ++++-- - net/sched/act_skbedit.c | 6 ++++-- - net/sched/act_skbmod.c | 6 ++++-- - net/sched/act_tunnel_key.c | 6 ++++-- - net/sched/act_vlan.c | 6 ++++-- - 21 files changed, 81 insertions(+), 42 deletions(-) - -diff --git a/net/sched/act_api.c b/net/sched/act_api.c -index b33f88e50aa90..60338a4ed0df3 100644 ---- a/net/sched/act_api.c -+++ b/net/sched/act_api.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - #ifdef CONFIG_INET - DEFINE_STATIC_KEY_FALSE(tcf_frag_xmit_count); -@@ -1080,7 +1081,7 @@ int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions, - - repeat_ttl = 32; - repeat: -- ret = a->ops->act(skb, a, res); -+ ret = tc_act(skb, a, res); - if (unlikely(ret == TC_ACT_REPEAT)) { - if (--repeat_ttl != 0) - goto repeat; -diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c -index b79eee44e24eb..b0455fda7d0ba 100644 ---- a/net/sched/act_bpf.c -+++ b/net/sched/act_bpf.c -@@ -18,6 +18,7 @@ - - #include - #include -+#include - - #define ACT_BPF_NAME_LEN 256 - -@@ -31,8 +32,9 @@ struct tcf_bpf_cfg { - - static struct tc_action_ops act_bpf_ops; - --static int tcf_bpf_act(struct sk_buff *skb, const struct tc_action *act, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_bpf_act(struct sk_buff *skb, -+ const struct tc_action *act, -+ struct tcf_result *res) - { - bool at_ingress = skb_at_tc_ingress(skb); - struct tcf_bpf *prog = to_bpf(act); -diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c -index d41002e4613ff..7e63ff7e3ed7a 100644 ---- a/net/sched/act_connmark.c -+++ b/net/sched/act_connmark.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -27,8 +28,9 @@ - - static struct tc_action_ops act_connmark_ops; - --static int tcf_connmark_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_connmark_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - const struct nf_conntrack_tuple_hash *thash; - struct nf_conntrack_tuple tuple; -diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c -index 1366adf9b9091..95e9304024b7d 100644 ---- a/net/sched/act_csum.c -+++ b/net/sched/act_csum.c -@@ -32,6 +32,7 @@ - - #include - #include -+#include - - static const struct nla_policy csum_policy[TCA_CSUM_MAX + 1] = { - [TCA_CSUM_PARMS] = { .len = sizeof(struct tc_csum), }, -@@ -563,8 +564,9 @@ static int tcf_csum_ipv6(struct sk_buff *skb, u32 update_flags) - return 0; - } - --static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_csum_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_csum *p = to_tcf_csum(a); - bool orig_vlan_tag_present = false; -diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c -index 4c7f7861ea967..bb1911071d9de 100644 ---- a/net/sched/act_ct.c -+++ b/net/sched/act_ct.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -1019,8 +1020,8 @@ static int tcf_ct_act_nat(struct sk_buff *skb, - #endif - } - --static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a, -+ struct tcf_result *res) - { - struct net *net = dev_net(skb->dev); - bool cached, commit, clear, force; -diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c -index 7275ad869f8ea..4d15b6a6169c4 100644 ---- a/net/sched/act_ctinfo.c -+++ b/net/sched/act_ctinfo.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -75,8 +76,9 @@ static void tcf_ctinfo_cpmark_set(struct nf_conn *ct, struct tcf_ctinfo *ca, - skb->mark = READ_ONCE(ct->mark) & cp->cpmarkmask; - } - --static int tcf_ctinfo_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_ctinfo_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - const struct nf_conntrack_tuple_hash *thash = NULL; - struct tcf_ctinfo *ca = to_ctinfo(a); -diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c -index 62d682b96b885..54f1b13b2360b 100644 ---- a/net/sched/act_gact.c -+++ b/net/sched/act_gact.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - static struct tc_action_ops act_gact_ops; - -@@ -145,8 +146,9 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla, - return err; - } - --static int tcf_gact_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_gact_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_gact *gact = to_gact(a); - int action = READ_ONCE(gact->tcf_action); -diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c -index 3049878e73153..9b8def0be41e9 100644 ---- a/net/sched/act_gate.c -+++ b/net/sched/act_gate.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - static struct tc_action_ops act_gate_ops; - -@@ -113,8 +114,9 @@ static enum hrtimer_restart gate_timer_func(struct hrtimer *timer) - return HRTIMER_RESTART; - } - --static int tcf_gate_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_gate_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_gate *gact = to_gate(a); - -diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c -index 41d63b33461dc..bc7611b0744c4 100644 ---- a/net/sched/act_ife.c -+++ b/net/sched/act_ife.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - static int max_metacnt = IFE_META_MAX + 1; - static struct tc_action_ops act_ife_ops; -@@ -861,8 +862,9 @@ static int tcf_ife_encode(struct sk_buff *skb, const struct tc_action *a, - return action; - } - --static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_ife_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_ife_info *ife = to_ife(a); - struct tcf_ife_params *p; -diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c -index dc92975a9374f..ea7f151e7dd29 100644 ---- a/net/sched/act_ipt.c -+++ b/net/sched/act_ipt.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - #include - -@@ -229,8 +230,9 @@ static int tcf_xt_init(struct net *net, struct nlattr *nla, - a, &act_xt_ops, tp, flags); - } - --static int tcf_ipt_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_ipt_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - int ret = 0, result = 0; - struct tcf_ipt *ipt = to_ipt(a); -diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c -index 36395e5db3b40..a61482c5edbe7 100644 ---- a/net/sched/act_mirred.c -+++ b/net/sched/act_mirred.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - static LIST_HEAD(mirred_list); - static DEFINE_SPINLOCK(mirred_list_lock); -@@ -224,8 +225,9 @@ static int tcf_mirred_forward(bool want_ingress, struct sk_buff *skb) - return err; - } - --static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_mirred_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_mirred *m = to_mirred(a); - struct sk_buff *skb2 = skb; -diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c -index f24f997a7aaf9..809f7928a1be6 100644 ---- a/net/sched/act_mpls.c -+++ b/net/sched/act_mpls.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - static struct tc_action_ops act_mpls_ops; - -@@ -49,8 +50,9 @@ static __be32 tcf_mpls_get_lse(struct mpls_shim_hdr *lse, - return cpu_to_be32(new_lse); - } - --static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_mpls_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_mpls *m = to_mpls(a); - struct tcf_mpls_params *p; -diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c -index 9265145f10404..74c74be330484 100644 ---- a/net/sched/act_nat.c -+++ b/net/sched/act_nat.c -@@ -24,7 +24,7 @@ - #include - #include - #include -- -+#include - - static struct tc_action_ops act_nat_ops; - -@@ -98,8 +98,9 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, - return err; - } - --static int tcf_nat_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_nat_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_nat *p = to_tcf_nat(a); - struct iphdr *iph; -diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c -index 180669aa9d097..613a1d777d5a6 100644 ---- a/net/sched/act_pedit.c -+++ b/net/sched/act_pedit.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - static struct tc_action_ops act_pedit_ops; - -@@ -369,8 +370,9 @@ static int pedit_skb_hdr_offset(struct sk_buff *skb, - return ret; - } - --static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - enum pedit_header_type htype = TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK; - enum pedit_cmd cmd = TCA_PEDIT_KEY_EX_CMD_SET; -diff --git a/net/sched/act_police.c b/net/sched/act_police.c -index 94be21378e7ca..2e9dce03d1ecc 100644 ---- a/net/sched/act_police.c -+++ b/net/sched/act_police.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - - /* Each policer is serialized by its individual spinlock */ - -@@ -242,8 +243,9 @@ static bool tcf_police_mtu_check(struct sk_buff *skb, u32 limit) - return len <= limit; - } - --static int tcf_police_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_police_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_police *police = to_police(a); - s64 now, toks, ppstoks = 0, ptoks = 0; -diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c -index 09735a33e57e2..d5c745fbb1328 100644 ---- a/net/sched/act_sample.c -+++ b/net/sched/act_sample.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - #include - -@@ -160,8 +161,9 @@ static bool tcf_sample_dev_ok_push(struct net_device *dev) - } - } - --static int tcf_sample_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_sample_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_sample *s = to_sample(a); - struct psample_group *psample_group; -diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c -index 18d3761354611..4b84514534f39 100644 ---- a/net/sched/act_simple.c -+++ b/net/sched/act_simple.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -21,8 +22,9 @@ - static struct tc_action_ops act_simp_ops; - - #define SIMP_MAX_DATA 32 --static int tcf_simp_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_simp_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_defact *d = to_defact(a); - -diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c -index 7f598784fd305..fd7d0d3eae3e7 100644 ---- a/net/sched/act_skbedit.c -+++ b/net/sched/act_skbedit.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -36,8 +37,9 @@ static u16 tcf_skbedit_hash(struct tcf_skbedit_params *params, - return netdev_cap_txqueue(skb->dev, queue_mapping); - } - --static int tcf_skbedit_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_skbedit_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_skbedit *d = to_skbedit(a); - struct tcf_skbedit_params *params; -diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c -index d98758a639340..dffa990a9629f 100644 ---- a/net/sched/act_skbmod.c -+++ b/net/sched/act_skbmod.c -@@ -15,14 +15,16 @@ - #include - #include - #include -+#include - - #include - #include - - static struct tc_action_ops act_skbmod_ops; - --static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_skbmod_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_skbmod *d = to_skbmod(a); - int action, max_edit_len, err; -diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c -index 2691a3d8e4511..2d12d26264153 100644 ---- a/net/sched/act_tunnel_key.c -+++ b/net/sched/act_tunnel_key.c -@@ -16,14 +16,16 @@ - #include - #include - #include -+#include - - #include - #include - - static struct tc_action_ops act_tunnel_key_ops; - --static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tunnel_key_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_tunnel_key *t = to_tunnel_key(a); - struct tcf_tunnel_key_params *params; -diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c -index 7b24e898a3e6b..0251442f5f29d 100644 ---- a/net/sched/act_vlan.c -+++ b/net/sched/act_vlan.c -@@ -12,14 +12,16 @@ - #include - #include - #include -+#include - - #include - #include - - static struct tc_action_ops act_vlan_ops; - --static int tcf_vlan_act(struct sk_buff *skb, const struct tc_action *a, -- struct tcf_result *res) -+TC_INDIRECT_SCOPE int tcf_vlan_act(struct sk_buff *skb, -+ const struct tc_action *a, -+ struct tcf_result *res) - { - struct tcf_vlan *v = to_vlan(a); - struct tcf_vlan_params *p; --- -2.39.2 - diff --git a/queue-6.1/series b/queue-6.1/series index 51ae3aefb74..fd85a240995 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -483,7 +483,6 @@ f2fs-check-return-value-of-freeze_super.patch media-cec-i2c-ch7322-also-select-regmap.patch sctp-fix-potential-deadlock-on-net-sctp.addr_wq_lock.patch net-sched-act_ipt-add-sanity-checks-on-table-name-an.patch -net-sched-avoid-indirect-act-functions-on-retpoline-.patch net-add-a-couple-of-helpers-for-iph-tot_len.patch net-sched-act_ipt-add-sanity-checks-on-skb-before-ca.patch net-sched-act_ipt-zero-skb-cb-before-calling-target.patch -- 2.47.3