Skip to content

[ciqlts8_6] Multiple patches tested (14 commits)#1393

Merged
bmastbergen merged 15 commits into
ciqlts8_6from
{rnicolescu}_ciqlts8_6
Jun 29, 2026
Merged

[ciqlts8_6] Multiple patches tested (14 commits)#1393
bmastbergen merged 15 commits into
ciqlts8_6from
{rnicolescu}_ciqlts8_6

Conversation

@ciq-kernel-automation

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

net/sched: act_pedit: really ensure the skb is writable

jira LE-1907
Rebuild_History Non-Buildable kernel-4.18.0-448.el8
commit-author Paolo Abeni <pabeni@redhat.com>
commit 8b796475fd7882663a870456466a4fb315cc1bd6
net/sched: act_pedit: sanitize shift argument before usage

jira LE-1907
Rebuild_History Non-Buildable kernel-4.18.0-448.el8
commit-author Paolo Abeni <pabeni@redhat.com>
commit 4d42d54a7d6aa6d29221d3fd4f2ae9503e94f011
net/sched: act_pedit: use NLA_POLICY for parsing 'ex' keys

Transform two checks in the 'ex' key parsing into netlink policies
removing extra if checks.
net_sched: refactor TC action init API

TC action ->init() API has 10 parameters, it becomes harder
to read. Some of them are just boolean and can be replaced
by flags. Similarly for the internal API tcf_action_init()
and tcf_exts_validate().
flow_offload: fill flags to action structure

Fill flags to action structure to allow user control if
the action should be offloaded to hardware or not.
net/sched: transition act_pedit to rcu and percpu stats

The software pedit action didn't get the same love as some of the
other actions and it's still using spinlocks and shared stats in the
datapath.
Transition the action to rcu and percpu stats as this improves the
action's performance dramatically on multiple cpu deployments.
net/sched: simplify tcf_pedit_act

Remove the check for a negative number of keys as
this cannot ever happen
net/sched: act_pedit: remove extra check for key type

The netlink parsing already validates the key 'htype'.
Remove the datapath check as it's redundant.
net/sched: act_pedit: check static offsets a priori

jira VULN-188480
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit e1201bc781c28766720e78a5e099ffa568be4d74
net/sched: act_pedit: rate limit datapath messages

jira VULN-188480
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit e3c9673e2f6e1b3aa4bb87c570336e10f364c28a
net/sched: act_pedit: Parse L3 Header for L4 offset

jira VULN-188480
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 6c02568fd1ae53099b4ab86365c5be1ff15f586b
net/sched: act_pedit: free pedit keys on bail from offset check

jira VULN-188480
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 1b483d9f5805c7e3d628d4995e97f4311fcb82eb
net/sched: act_pedit: fix action bind logic

The TC architecture allows filters and actions to be created independently.
In filters the user can reference action objects using:
tc action add action pedit ... index 1
tc filter add ... action pedit index 1
net/sched: fix pedit partial COW leading to page cache corruption

jira VULN-188480
cve CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 899ee91156e57784090c5565e4f31bd7dbffbc5a
upstream-diff |
	rename include file from linux/unaligned.h to asm/unaligned.h

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 25m 15s 26m 10s
aarch64 9m 29s 10m 12s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 108 31 ciqlts8_6 ⚠️ No baseline available
aarch64 66 21 ciqlts8_6 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1456 13 ciqlts8_6 ✅ No regressions
aarch64 1423 16 ciqlts8_6 ❌ 3 regressions

x86_64 newly passing:

  • fs_perms04 (PASS)
  • fs_perms05 (PASS)
  • fs_perms06 (PASS)
  • fs_perms07 (PASS)
  • fs_perms08 (PASS)
  • fs_perms09 (PASS)
  • fs_perms10 (PASS)
  • fs_perms11 (PASS)
  • fs_perms12 (PASS)
  • fs_perms13 (PASS)
  • fs_perms14 (PASS)
  • fs_perms15 (PASS)
  • fs_perms16 (PASS)
  • fs_perms17 (PASS)
  • fs_perms18 (PASS)
    aarch64 regressions:
  • af_alg04 (PASS -> FAIL)
  • mmap16 (PASS -> FAIL)
  • starvation (PASS -> FAIL)

🤖 This PR was automatically generated by GitHub Actions
Run ID: 28382708212

PlaidCat and others added 4 commits June 29, 2026 18:03
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Paolo Abeni <pabeni@redhat.com>
commit 8b79647

Currently pedit tries to ensure that the accessed skb offset
is writable via skb_unclone(). The action potentially allows
touching any skb bytes, so it may end-up modifying shared data.

The above causes some sporadic MPTCP self-test failures, due to
this code:

	tc -n $ns2 filter add dev ns2eth$i egress \
		protocol ip prio 1000 \
		handle 42 fw \
		action pedit munge offset 148 u8 invert \
		pipe csum tcp \
		index 100

The above modifies a data byte outside the skb head and the skb is
a cloned one, carrying a TCP output packet.

This change addresses the issue by keeping track of a rough
over-estimate highest skb offset accessed by the action and ensuring
such offset is really writable.

Note that this may cause performance regressions in some scenarios,
but hopefully pedit is not in the critical path.

Fixes: db2c241 ("act_pedit: access skb->data safely")
	Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
	Tested-by: Geliang Tang <geliang.tang@suse.com>
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
	Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/1fcf78e6679d0a287dd61bb0f04730ce33b3255d.1652194627.git.pabeni@redhat.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 8b79647)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Paolo Abeni <pabeni@redhat.com>
commit 4d42d54

syzbot was able to trigger an Out-of-Bound on the pedit action:

UBSAN: shift-out-of-bounds in net/sched/act_pedit.c:238:43
shift exponent 1400735974 is too large for 32-bit type 'unsigned int'
CPU: 0 PID: 3606 Comm: syz-executor151 Not tainted 5.18.0-rc5-syzkaller-00165-g810c2f0a3f86 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 ubsan_epilogue+0xb/0x50 lib/ubsan.c:151
 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x187 lib/ubsan.c:322
 tcf_pedit_init.cold+0x1a/0x1f net/sched/act_pedit.c:238
 tcf_action_init_1+0x414/0x690 net/sched/act_api.c:1367
 tcf_action_init+0x530/0x8d0 net/sched/act_api.c:1432
 tcf_action_add+0xf9/0x480 net/sched/act_api.c:1956
 tc_ctl_action+0x346/0x470 net/sched/act_api.c:2015
 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5993
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:725
 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fe36e9e1b59
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffef796fe88 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe36e9e1b59
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 00007fe36e9a5d00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe36e9a5d90
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

The 'shift' field is not validated, and any value above 31 will
trigger out-of-bounds. The issue predates the git history, but
syzbot was able to trigger it only after the commit mentioned in
the fixes tag, and this change only applies on top of such commit.

Address the issue bounding the 'shift' value to the maximum allowed
by the relevant operator.

Reported-and-tested-by: syzbot+8ed8fc4c57e9dcf23ca6@syzkaller.appspotmail.com
Fixes: 8b79647 ("net/sched: act_pedit: really ensure the skb is writable")
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4d42d54)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 5036034

Transform two checks in the 'ex' key parsing into netlink policies
removing extra if checks.

	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5036034)
    	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 695176b

TC action ->init() API has 10 parameters, it becomes harder
to read. Some of them are just boolean and can be replaced
by flags. Similarly for the internal API tcf_action_init()
and tcf_exts_validate().

This patch converts them to flags and fold them into
the upper 16 bits of "flags", whose lower 16 bits are still
reserved for user-space. More specifically, the following
kernel flags are introduced:

TCA_ACT_FLAGS_POLICE replace 'name' in a few contexts, to
distinguish whether it is compatible with policer.

TCA_ACT_FLAGS_BIND replaces 'bind', to indicate whether
this action is bound to a filter.

TCA_ACT_FLAGS_REPLACE  replaces 'ovr' in most contexts,
means we are replacing an existing action.

TCA_ACT_FLAGS_NO_RTNL replaces 'rtnl_held' but has the
opposite meaning, because we still hold RTNL in most
cases.

The only user-space flag TCA_ACT_FLAGS_NO_PERCPU_STATS is
untouched and still stored as before.

I have tested this patch with tdc and I do not see any
failure related to this patch.

	Tested-by: Vlad Buslov <vladbu@nvidia.com>
	Acked-by: Jamal Hadi Salim<jhs@mojatatu.com>
	Cc: Jiri Pirko <jiri@resnulli.us>
	Signed-off-by: Cong Wang <cong.wang@bytedance.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 695176b)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Jun 29, 2026
@bmastbergen bmastbergen requested a review from a team June 29, 2026 20:22
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28400798334

@github-actions

Copy link
Copy Markdown

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) references upstream commit
    695176bfe5de which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    a5397d68b2db net/sched: cls_api, reset flags on replay (Mark Bloch)

This is an automated message from the kernel commit checker workflow.

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) → upstream 695176bfe5de
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -709,7 +709,7 @@
 			 struct nlattr *est, bool ovr,
 			 struct netlink_ext_ack *extack)
 {
-	int err, ifindex = -1;
+	int err;
 
 	err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr, true, extack);
 	if (err < 0)
@@ -906,4 +898,4 @@
 				    tca[TCA_RATE], ovr, extack);
 
 		if (err) {
-			__u32_destroy_key(new);
+			u32_destroy_key(new, false);
  • ⚠️ PR commit fe2b510ddd98 (net/sched: transition act_pedit to rcu and percpu stats) → upstream 52cf89f78c01
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -138,5 +139,5 @@
 {
-	struct tc_action_net *tn = net_generic(net, pedit_net_id);
+	struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id);
 	bool bind = flags & TCA_ACT_FLAGS_BIND;
 	struct nlattr *tb[TCA_PEDIT_MAX + 1];
 	struct tcf_chain *goto_ch = NULL;
@@ -320,4 +321,4 @@
-			 struct tcf_result *res)
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	u32 max_offset;
  • ⚠️ PR commit 148ab624cefd (net/sched: simplify tcf_pedit_act) → upstream 95b069382351
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,5 +341,5 @@
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
-			 struct tcf_result *res)
+				    const struct tc_action *a,
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	struct tcf_pedit_parms *parms;
  • ⚠️ PR commit ea69b9e5413e (net/sched: act_pedit: remove extra check for key type) → upstream 577140180ba2
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,4 +358,4 @@
 	return ret;
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit 568c4d7f4ddb (net/sched: act_pedit: Parse L3 Header for L4 offset) → upstream 6c02568fd1ae
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -340,4 +351,4 @@
 	}
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit c9637db5dfbe (net/sched: fix pedit partial COW leading to page cache corruption) → upstream 899ee91156e5
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -21,7 +21,7 @@
 #include <linux/ipv6.h>
 #include <linux/slab.h>
 #include <linux/overflow.h>
-#include <asm/unaligned.h>
+#include <linux/unaligned.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -15,7 +15,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
 	int action;
-	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;
 	struct rcu_head rcu;

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -12,5 +11,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
+	int action;
 	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

JIRA PR Check Results

14 commit(s) with issues found:

Commit c9637db5dfbe

Summary: net/sched: fix pedit partial COW leading to page cache corruption

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit b0f6966c310e

Summary: net/sched: act_pedit: fix action bind logic

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 0b41da7b331e

Summary: net/sched: act_pedit: free pedit keys on bail from offset check

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 568c4d7f4ddb

Summary: net/sched: act_pedit: Parse L3 Header for L4 offset

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 40a56591fe78

Summary: net/sched: act_pedit: rate limit datapath messages

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 7dbe633721e3

Summary: net/sched: act_pedit: check static offsets a priori

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit ea69b9e5413e

Summary: net/sched: act_pedit: remove extra check for key type

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 148ab624cefd

Summary: net/sched: simplify tcf_pedit_act

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit fe2b510ddd98

Summary: net/sched: transition act_pedit to rcu and percpu stats

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit fcaa63045f77

Summary: flow_offload: fill flags to action structure

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 8a378b28172f

Summary: net_sched: refactor TC action init API

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 03f607529e93

Summary: net/sched: act_pedit: use NLA_POLICY for parsing 'ex' keys

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 9b28bb75b4a8

Summary: net/sched: act_pedit: sanitize shift argument before usage

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Commit 2fb456484e6e

Summary: net/sched: act_pedit: really ensure the skb is writable

❌ Errors:

  • VULN-188478: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-188478: No time logged - please log time manually

Summary: Checked 14 commit(s) total.

@github-actions

Copy link
Copy Markdown

Validation checks completed with issues View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28400798334

PlaidCat
PlaidCat previously approved these changes Jun 29, 2026

@PlaidCat PlaidCat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@PlaidCat PlaidCat requested a review from a team June 29, 2026 20:38
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28401802652

@github-actions

Copy link
Copy Markdown

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) references upstream commit
    695176bfe5de which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    a5397d68b2db net/sched: cls_api, reset flags on replay (Mark Bloch)

This is an automated message from the kernel commit checker workflow.

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) → upstream 695176bfe5de
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -709,7 +709,7 @@
 			 struct nlattr *est, bool ovr,
 			 struct netlink_ext_ack *extack)
 {
-	int err, ifindex = -1;
+	int err;
 
 	err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr, true, extack);
 	if (err < 0)
@@ -906,4 +898,4 @@
 				    tca[TCA_RATE], ovr, extack);
 
 		if (err) {
-			__u32_destroy_key(new);
+			u32_destroy_key(new, false);
  • ⚠️ PR commit fe2b510ddd98 (net/sched: transition act_pedit to rcu and percpu stats) → upstream 52cf89f78c01
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -138,5 +139,5 @@
 {
-	struct tc_action_net *tn = net_generic(net, pedit_net_id);
+	struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id);
 	bool bind = flags & TCA_ACT_FLAGS_BIND;
 	struct nlattr *tb[TCA_PEDIT_MAX + 1];
 	struct tcf_chain *goto_ch = NULL;
@@ -320,4 +321,4 @@
-			 struct tcf_result *res)
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	u32 max_offset;
  • ⚠️ PR commit 148ab624cefd (net/sched: simplify tcf_pedit_act) → upstream 95b069382351
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,5 +341,5 @@
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
-			 struct tcf_result *res)
+				    const struct tc_action *a,
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	struct tcf_pedit_parms *parms;
  • ⚠️ PR commit ea69b9e5413e (net/sched: act_pedit: remove extra check for key type) → upstream 577140180ba2
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,4 +358,4 @@
 	return ret;
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit 568c4d7f4ddb (net/sched: act_pedit: Parse L3 Header for L4 offset) → upstream 6c02568fd1ae
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -340,4 +351,4 @@
 	}
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit c9637db5dfbe (net/sched: fix pedit partial COW leading to page cache corruption) → upstream 899ee91156e5
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -21,7 +21,7 @@
 #include <linux/ipv6.h>
 #include <linux/slab.h>
 #include <linux/overflow.h>
-#include <asm/unaligned.h>
+#include <linux/unaligned.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -15,7 +15,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
 	int action;
-	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;
 	struct rcu_head rcu;

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -12,5 +11,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
+	int action;
 	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28401802652

bmastbergen
bmastbergen previously approved these changes Jun 29, 2026

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@bmastbergen bmastbergen dismissed stale reviews from PlaidCat and themself via 05888da June 29, 2026 21:02
@bmastbergen bmastbergen force-pushed the {rnicolescu}_ciqlts8_6 branch from c9637db to 05888da Compare June 29, 2026 21:02
@bmastbergen

Copy link
Copy Markdown
Collaborator

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) references upstream commit
    695176bfe5de which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    a5397d68b2db net/sched: cls_api, reset flags on replay (Mark Bloch)

This is an automated message from the kernel commit checker workflow.

Added.

@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28403209678

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) → upstream 695176bfe5de
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -709,7 +709,7 @@
 			 struct nlattr *est, bool ovr,
 			 struct netlink_ext_ack *extack)
 {
-	int err, ifindex = -1;
+	int err;
 
 	err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr, true, extack);
 	if (err < 0)
@@ -906,4 +898,4 @@
 				    tca[TCA_RATE], ovr, extack);
 
 		if (err) {
-			__u32_destroy_key(new);
+			u32_destroy_key(new, false);
  • ⚠️ PR commit 7a36a1ef493e (net/sched: cls_api, reset flags on replay) → upstream a5397d68b2db
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1970,6 +1970,7 @@
 	tp = NULL;
 	cl = 0;
 	block = NULL;
+	flags = 0;
 
 	if (prio == 0) {
 		/* If no priority is provided by the user,

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1983,6 +1969,4 @@
 	block = NULL;
-	q = NULL;
-	chain = NULL;
 
 	if (prio == 0) {
 		/* If no priority is provided by the user,
  • ⚠️ PR commit d5562d8ac6fe (net/sched: transition act_pedit to rcu and percpu stats) → upstream 52cf89f78c01
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -138,5 +139,5 @@
 {
-	struct tc_action_net *tn = net_generic(net, pedit_net_id);
+	struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id);
 	bool bind = flags & TCA_ACT_FLAGS_BIND;
 	struct nlattr *tb[TCA_PEDIT_MAX + 1];
 	struct tcf_chain *goto_ch = NULL;
@@ -320,4 +321,4 @@
-			 struct tcf_result *res)
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	u32 max_offset;
  • ⚠️ PR commit d570d08cd169 (net/sched: simplify tcf_pedit_act) → upstream 95b069382351
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,5 +341,5 @@
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
-			 struct tcf_result *res)
+				    const struct tc_action *a,
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	struct tcf_pedit_parms *parms;
  • ⚠️ PR commit f9cb6aa34058 (net/sched: act_pedit: remove extra check for key type) → upstream 577140180ba2
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,4 +358,4 @@
 	return ret;
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit 2962ab972be7 (net/sched: act_pedit: Parse L3 Header for L4 offset) → upstream 6c02568fd1ae
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -340,4 +351,4 @@
 	}
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit 05888da7a77f (net/sched: fix pedit partial COW leading to page cache corruption) → upstream 899ee91156e5
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -21,7 +21,7 @@
 #include <linux/ipv6.h>
 #include <linux/slab.h>
 #include <linux/overflow.h>
-#include <asm/unaligned.h>
+#include <linux/unaligned.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -15,7 +15,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
 	int action;
-	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;
 	struct rcu_head rcu;

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -12,5 +11,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
+	int action;
 	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

JIRA PR Check Results

1 commit(s) with issues found:

Commit 7a36a1ef493e

Summary: net/sched: cls_api, reset flags on replay

❌ Errors:

  • VULN-188480: Status is 'Publish CSAF', expected 'In Progress'
  • VULN-188480: LTS product 'lts-9.2' expects branch 'ciqlts9_2', but merge target is 'ciqlts8_6'

Summary: Checked 15 commit(s) total.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This PR contains VULN tickets that do not match the target LTS product. Please review the JIRA ticket assignments and ensure they match the merge target branch.

@github-actions

Copy link
Copy Markdown

Validation checks completed with issues View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28403209678

jira VULN-188478
cve-pre CVE-2026-46331
commit-author Mark Bloch <mbloch@nvidia.com>
commit a5397d6

tc_new_tfilter() can replay a request if it got EAGAIN. The cited commit
didn't account for this when it converted TC action ->init() API
to use flags instead of parameters. This can lead to passing stale flags
down the call chain which results in trying to lock rtnl when it's
already locked, deadlocking the entire system.

Fix by making sure to reset flags on each replay.

============================================
WARNING: possible recursive locking detected
5.14.0-rc3-custom-49011-g3d2bbb4f104d #447 Not tainted
--------------------------------------------
tc/37605 is trying to acquire lock:
ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_setup_cb_add+0x14b/0x4d0

but task is already holding lock:
ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_new_tfilter+0xb12/0x22e0

other info that might help us debug this:
 Possible unsafe locking scenario:
       CPU0
       ----
  lock(rtnl_mutex);
  lock(rtnl_mutex);

 *** DEADLOCK ***
 May be due to missing lock nesting notation
1 lock held by tc/37605:
 #0: ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_new_tfilter+0xb12/0x22e0

stack backtrace:
CPU: 0 PID: 37605 Comm: tc Not tainted 5.14.0-rc3-custom-49011-g3d2bbb4f104d #447
Hardware name: Mellanox Technologies Ltd. MSN2010/SA002610, BIOS 5.6.5 08/24/2017
Call Trace:
 dump_stack_lvl+0x8b/0xb3
 __lock_acquire.cold+0x175/0x3cb
 lock_acquire+0x1a4/0x4f0
 __mutex_lock+0x136/0x10d0
 fl_hw_replace_filter+0x458/0x630 [cls_flower]
 fl_change+0x25f2/0x4a64 [cls_flower]
 tc_new_tfilter+0xa65/0x22e0
 rtnetlink_rcv_msg+0x86c/0xc60
 netlink_rcv_skb+0x14d/0x430
 netlink_unicast+0x539/0x7e0
 netlink_sendmsg+0x84d/0xd80
 ____sys_sendmsg+0x7ff/0x970
 ___sys_sendmsg+0xf8/0x170
 __sys_sendmsg+0xea/0x1b0
 do_syscall_64+0x35/0x80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f7b93b6c0a7
Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48>
RSP: 002b:00007ffe365b3818 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7b93b6c0a7
RDX: 0000000000000000 RSI: 00007ffe365b3880 RDI: 0000000000000003
RBP: 00000000610a75f6 R08: 0000000000000001 R09: 0000000000000000
R10: fffffffffffff3a9 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 00007ffe365b7b58 R15: 00000000004822c0

Fixes: 695176b ("net_sched: refactor TC action init API")
	Signed-off-by: Mark Bloch <mbloch@nvidia.com>
	Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
	Reviewed-by: Ido Schimmel <idosch@nvidia.com>
	Tested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20210810034305.63997-1-mbloch@nvidia.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit a5397d6)
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
zhengbaowen and others added 10 commits June 29, 2026 17:28
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 40bd094

Fill flags to action structure to allow user control if
the action should be offloaded to hardware or not.

	Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
	Signed-off-by: Louis Peens <louis.peens@corigine.com>
	Signed-off-by: Simon Horman <simon.horman@corigine.com>
	Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 40bd094)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 52cf89f

The software pedit action didn't get the same love as some of the
other actions and it's still using spinlocks and shared stats in the
datapath.
Transition the action to rcu and percpu stats as this improves the
action's performance dramatically on multiple cpu deployments.

	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 52cf89f)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 95b0693

Remove the check for a negative number of keys as
this cannot ever happen

	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 95b0693)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 5771401

The netlink parsing already validates the key 'htype'.
Remove the datapath check as it's redundant.

	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5771401)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit e1201bc

Static key offsets should always be on 32 bit boundaries. Validate them on
create/update time for static offsets and move the datapath validation
for runtime offsets only.

iproute2 already errors out if a given offset and data size cannot be
packed to a 32 bit boundary. This change will make sure users which
create/update pedit instances directly via netlink also error out,
instead of finding out when packets are traversing.

	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e1201bc)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit e3c9673

Unbounded info messages in the pedit datapath can flood the printk
ring buffer quite easily depending on the action created.
As these messages are informational, usually printing some, not all,
is enough to bring attention to the real issue.

	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e3c9673)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 6c02568

Instead of relying on skb->transport_header being set correctly, opt
instead to parse the L3 header length out of the L3 headers for both
IPv4/IPv6 when the Extended Layer Op for tcp/udp is used. This fixes a
bug if GRO is disabled, when GRO is disabled skb->transport_header is
set by __netif_receive_skb_core() to point to the L3 header, it's later
fixed by the upper protocol layers, but act_pedit will receive the SKB
before the fixups are completed. The existing behavior causes the
following to edit the L3 header if GRO is disabled instead of the UDP
header:

    tc filter add dev eth0 ingress protocol ip flower ip_proto udp \
 dst_ip 192.168.1.3 action pedit ex munge udp set dport 18053

Also re-introduce a rate-limited warning if we were unable to extract
the header offset when using the 'ex' interface.

Fixes: 71d0ed7 ("net/act_pedit: Support using offset relative to
the conventional network headers")
	Signed-off-by: Max Tottenham <mtottenh@akamai.com>
	Reviewed-by: Josh Hunt <johunt@akamai.com>
	Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305261541.N165u9TZ-lkp@intel.com/
	Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6c02568)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 1b483d9

Ido Schimmel reports a memleak on a syzkaller instance:
   BUG: memory leak
   unreferenced object 0xffff88803d45e400 (size 1024):
     comm "syz-executor292", pid 563, jiffies 4295025223 (age 51.781s)
     hex dump (first 32 bytes):
       28 bd 70 00 fb db df 25 02 00 14 1f ff 02 00 02  (.p....%........
       00 32 00 00 1f 00 00 00 ac 14 14 3e 08 00 07 00  .2.........>....
     backtrace:
       [<ffffffff81bd0f2c>] kmemleak_alloc_recursive include/linux/kmemleak.h:42 [inline]
       [<ffffffff81bd0f2c>] slab_post_alloc_hook mm/slab.h:772 [inline]
       [<ffffffff81bd0f2c>] slab_alloc_node mm/slub.c:3452 [inline]
       [<ffffffff81bd0f2c>] __kmem_cache_alloc_node+0x25c/0x320 mm/slub.c:3491
       [<ffffffff81a865d9>] __do_kmalloc_node mm/slab_common.c:966 [inline]
       [<ffffffff81a865d9>] __kmalloc+0x59/0x1a0 mm/slab_common.c:980
       [<ffffffff83aa85c3>] kmalloc include/linux/slab.h:584 [inline]
       [<ffffffff83aa85c3>] tcf_pedit_init+0x793/0x1ae0 net/sched/act_pedit.c:245
       [<ffffffff83a90623>] tcf_action_init_1+0x453/0x6e0 net/sched/act_api.c:1394
       [<ffffffff83a90e58>] tcf_action_init+0x5a8/0x950 net/sched/act_api.c:1459
       [<ffffffff83a96258>] tcf_action_add+0x118/0x4e0 net/sched/act_api.c:1985
       [<ffffffff83a96997>] tc_ctl_action+0x377/0x490 net/sched/act_api.c:2044
       [<ffffffff83920a8d>] rtnetlink_rcv_msg+0x46d/0xd70 net/core/rtnetlink.c:6395
       [<ffffffff83b24305>] netlink_rcv_skb+0x185/0x490 net/netlink/af_netlink.c:2575
       [<ffffffff83901806>] rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6413
       [<ffffffff83b21cae>] netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
       [<ffffffff83b21cae>] netlink_unicast+0x5be/0x8a0 net/netlink/af_netlink.c:1365
       [<ffffffff83b2293f>] netlink_sendmsg+0x9af/0xed0 net/netlink/af_netlink.c:1942
       [<ffffffff8380c39f>] sock_sendmsg_nosec net/socket.c:724 [inline]
       [<ffffffff8380c39f>] sock_sendmsg net/socket.c:747 [inline]
       [<ffffffff8380c39f>] ____sys_sendmsg+0x3ef/0xaa0 net/socket.c:2503
       [<ffffffff838156d2>] ___sys_sendmsg+0x122/0x1c0 net/socket.c:2557
       [<ffffffff8381594f>] __sys_sendmsg+0x11f/0x200 net/socket.c:2586
       [<ffffffff83815ab0>] __do_sys_sendmsg net/socket.c:2595 [inline]
       [<ffffffff83815ab0>] __se_sys_sendmsg net/socket.c:2593 [inline]
       [<ffffffff83815ab0>] __x64_sys_sendmsg+0x80/0xc0 net/socket.c:2593

The recently added static offset check missed a free to the key buffer when
bailing out on error.

Fixes: e1201bc ("net/sched: act_pedit: check static offsets a priori")
	Reported-by: Ido Schimmel <idosch@idosch.org>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Reviewed-by: Ido Schimmel <idosch@nvidia.com>
	Tested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20230425144725.669262-1-pctammela@mojatatu.com
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 1b483d9)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve-pre CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit e9e4229

The TC architecture allows filters and actions to be created independently.
In filters the user can reference action objects using:
tc action add action pedit ... index 1
tc filter add ... action pedit index 1

In the current code for act_pedit this is broken as it checks netlink
attributes for create/update before actually checking if we are binding to an
existing action.

tdc results:
1..69
ok 1 319a - Add pedit action that mangles IP TTL
ok 2 7e67 - Replace pedit action with invalid goto chain
ok 3 377e - Add pedit action with RAW_OP offset u32
ok 4 a0ca - Add pedit action with RAW_OP offset u32 (INVALID)
ok 5 dd8a - Add pedit action with RAW_OP offset u16 u16
ok 6 53db - Add pedit action with RAW_OP offset u16 (INVALID)
ok 7 5c7e - Add pedit action with RAW_OP offset u8 add value
ok 8 2893 - Add pedit action with RAW_OP offset u8 quad
ok 9 3a07 - Add pedit action with RAW_OP offset u8-u16-u8
ok 10 ab0f - Add pedit action with RAW_OP offset u16-u8-u8
ok 11 9d12 - Add pedit action with RAW_OP offset u32 set u16 clear u8 invert
ok 12 ebfa - Add pedit action with RAW_OP offset overflow u32 (INVALID)
ok 13 f512 - Add pedit action with RAW_OP offset u16 at offmask shift set
ok 14 c2cb - Add pedit action with RAW_OP offset u32 retain value
ok 15 1762 - Add pedit action with RAW_OP offset u8 clear value
ok 16 bcee - Add pedit action with RAW_OP offset u8 retain value
ok 17 e89f - Add pedit action with RAW_OP offset u16 retain value
ok 18 c282 - Add pedit action with RAW_OP offset u32 clear value
ok 19 c422 - Add pedit action with RAW_OP offset u16 invert value
ok 20 d3d3 - Add pedit action with RAW_OP offset u32 invert value
ok 21 57e5 - Add pedit action with RAW_OP offset u8 preserve value
ok 22 99e0 - Add pedit action with RAW_OP offset u16 preserve value
ok 23 1892 - Add pedit action with RAW_OP offset u32 preserve value
ok 24 4b60 - Add pedit action with RAW_OP negative offset u16/u32 set value
ok 25 a5a7 - Add pedit action with LAYERED_OP eth set src
ok 26 86d4 - Add pedit action with LAYERED_OP eth set src & dst
ok 27 f8a9 - Add pedit action with LAYERED_OP eth set dst
ok 28 c715 - Add pedit action with LAYERED_OP eth set src (INVALID)
ok 29 8131 - Add pedit action with LAYERED_OP eth set dst (INVALID)
ok 30 ba22 - Add pedit action with LAYERED_OP eth type set/clear sequence
ok 31 dec4 - Add pedit action with LAYERED_OP eth set type (INVALID)
ok 32 ab06 - Add pedit action with LAYERED_OP eth add type
ok 33 918d - Add pedit action with LAYERED_OP eth invert src
ok 34 a8d4 - Add pedit action with LAYERED_OP eth invert dst
ok 35 ee13 - Add pedit action with LAYERED_OP eth invert type
ok 36 7588 - Add pedit action with LAYERED_OP ip set src
ok 37 0fa7 - Add pedit action with LAYERED_OP ip set dst
ok 38 5810 - Add pedit action with LAYERED_OP ip set src & dst
ok 39 1092 - Add pedit action with LAYERED_OP ip set ihl & dsfield
ok 40 02d8 - Add pedit action with LAYERED_OP ip set ttl & protocol
ok 41 3e2d - Add pedit action with LAYERED_OP ip set ttl (INVALID)
ok 42 31ae - Add pedit action with LAYERED_OP ip ttl clear/set
ok 43 486f - Add pedit action with LAYERED_OP ip set duplicate fields
ok 44 e790 - Add pedit action with LAYERED_OP ip set ce, df, mf, firstfrag, nofrag fields
ok 45 cc8a - Add pedit action with LAYERED_OP ip set tos
ok 46 7a17 - Add pedit action with LAYERED_OP ip set precedence
ok 47 c3b6 - Add pedit action with LAYERED_OP ip add tos
ok 48 43d3 - Add pedit action with LAYERED_OP ip add precedence
ok 49 438e - Add pedit action with LAYERED_OP ip clear tos
ok 50 6b1b - Add pedit action with LAYERED_OP ip clear precedence
ok 51 824a - Add pedit action with LAYERED_OP ip invert tos
ok 52 106f - Add pedit action with LAYERED_OP ip invert precedence
ok 53 6829 - Add pedit action with LAYERED_OP beyond ip set dport & sport
ok 54 afd8 - Add pedit action with LAYERED_OP beyond ip set icmp_type & icmp_code
ok 55 3143 - Add pedit action with LAYERED_OP beyond ip set dport (INVALID)
ok 56 815c - Add pedit action with LAYERED_OP ip6 set src
ok 57 4dae - Add pedit action with LAYERED_OP ip6 set dst
ok 58 fc1f - Add pedit action with LAYERED_OP ip6 set src & dst
ok 59 6d34 - Add pedit action with LAYERED_OP ip6 dst retain value (INVALID)
ok 60 94bb - Add pedit action with LAYERED_OP ip6 traffic_class
ok 61 6f5e - Add pedit action with LAYERED_OP ip6 flow_lbl
ok 62 6795 - Add pedit action with LAYERED_OP ip6 set payload_len, nexthdr, hoplimit
ok 63 1442 - Add pedit action with LAYERED_OP tcp set dport & sport
ok 64 b7ac - Add pedit action with LAYERED_OP tcp sport set (INVALID)
ok 65 cfcc - Add pedit action with LAYERED_OP tcp flags set
ok 66 3bc4 - Add pedit action with LAYERED_OP tcp set dport, sport & flags fields
ok 67 f1c8 - Add pedit action with LAYERED_OP udp set dport & sport
ok 68 d784 - Add pedit action with mixed RAW/LAYERED_OP #1
ok 69 70ca - Add pedit action with mixed RAW/LAYERED_OP #2

Fixes: 71d0ed7 ("net/act_pedit: Support using offset relative to the conventional network headers")
Fixes: f67169f ("net/sched: act_pedit: fix WARN() in the traffic path")
	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
	Reviewed-by: Simon Horman <simon.horman@corigine.com>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e9e4229)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-188478
cve CVE-2026-46331
commit-author Rajat Gupta <rajat.gupta@oss.qualcomm.com>
commit 899ee91
upstream-diff |
	rename include file from linux/unaligned.h to asm/unaligned.h

tcf_pedit_act() computes the COW range for skb_ensure_writable()
once before the key loop using tcfp_off_max_hint, but the hint does
not account for the runtime header offset added by typed keys. This
can leave part of the write region un-COW'd.

Fix by moving skb_ensure_writable() inside the per-key loop where
the actual write offset is known, and add overflow checking on the
offset arithmetic. For negative offsets (e.g. Ethernet header edits
at ingress), use skb_cow() to COW the headroom instead. Guard
offset_valid() against INT_MIN, where negation is undefined.

Fixes: 8b79647 ("net/sched: act_pedit: really ensure the skb is writable")
	Reported-by: Yiming Qian <yimingqian591@gmail.com>
	Reported-by: Keenan Dong <keenanat2000@gmail.com>
	Reported-by: Han Guidong <2045gemini@gmail.com>
	Reported-by: Zhang Cen <rollkingzzc@gmail.com>
	Reviewed-by: Han Guidong <2045gemini@gmail.com>
	Tested-by: Han Guidong <2045gemini@gmail.com>
	Reviewed-by: Davide Caratti <dcaratti@redhat.com>
	Tested-by: Davide Caratti <dcaratti@redhat.com>
	Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
	Tested-by: Toke Høiland-Jørgensen <toke@redhat.com>
	Reviewed-by: Victor Nogueira <victor@mojatatu.com>
	Tested-by: Victor Nogueira <victor@mojatatu.com>
	Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Signed-off-by: Rajat Gupta <rajat.gupta@oss.qualcomm.com>
Link: https://patch.msgid.link/20260531123221.48732-1-jhs@mojatatu.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 899ee91)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@bmastbergen bmastbergen force-pushed the {rnicolescu}_ciqlts8_6 branch from 05888da to cb3bdd8 Compare June 29, 2026 21:28
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28404454903

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 8a378b28172f (net_sched: refactor TC action init API) → upstream 695176bfe5de
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -709,7 +709,7 @@
 			 struct nlattr *est, bool ovr,
 			 struct netlink_ext_ack *extack)
 {
-	int err, ifindex = -1;
+	int err;
 
 	err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr, true, extack);
 	if (err < 0)
@@ -906,4 +898,4 @@
 				    tca[TCA_RATE], ovr, extack);
 
 		if (err) {
-			__u32_destroy_key(new);
+			u32_destroy_key(new, false);
  • ⚠️ PR commit 220219617e3c (net/sched: cls_api, reset flags on replay) → upstream a5397d68b2db
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1970,6 +1970,7 @@
 	tp = NULL;
 	cl = 0;
 	block = NULL;
+	flags = 0;
 
 	if (prio == 0) {
 		/* If no priority is provided by the user,

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1983,6 +1969,4 @@
 	block = NULL;
-	q = NULL;
-	chain = NULL;
 
 	if (prio == 0) {
 		/* If no priority is provided by the user,
  • ⚠️ PR commit 6b576fdc0b75 (net/sched: transition act_pedit to rcu and percpu stats) → upstream 52cf89f78c01
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -138,5 +139,5 @@
 {
-	struct tc_action_net *tn = net_generic(net, pedit_net_id);
+	struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id);
 	bool bind = flags & TCA_ACT_FLAGS_BIND;
 	struct nlattr *tb[TCA_PEDIT_MAX + 1];
 	struct tcf_chain *goto_ch = NULL;
@@ -320,4 +321,4 @@
-			 struct tcf_result *res)
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	u32 max_offset;
  • ⚠️ PR commit 9cf06cb13b60 (net/sched: simplify tcf_pedit_act) → upstream 95b069382351
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,5 +341,5 @@
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
-			 struct tcf_result *res)
+				    const struct tc_action *a,
+				    struct tcf_result *res)
 {
 	struct tcf_pedit *p = to_pedit(a);
 	struct tcf_pedit_parms *parms;
  • ⚠️ PR commit 272083c07309 (net/sched: act_pedit: remove extra check for key type) → upstream 577140180ba2
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -341,4 +358,4 @@
 	return ret;
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit 7be7fb20c469 (net/sched: act_pedit: Parse L3 Header for L4 offset) → upstream 6c02568fd1ae
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -340,4 +351,4 @@
 	}
 }
 
-static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
+TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
  • ⚠️ PR commit cb3bdd8fc274 (net/sched: fix pedit partial COW leading to page cache corruption) → upstream 899ee91156e5
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -21,7 +21,7 @@
 #include <linux/ipv6.h>
 #include <linux/slab.h>
 #include <linux/overflow.h>
-#include <asm/unaligned.h>
+#include <linux/unaligned.h>
 #include <net/ipv6.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -15,7 +15,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
 	int action;
-	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;
 	struct rcu_head rcu;

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/net/tc_act/tc_pedit.h
+++ b/include/net/tc_act/tc_pedit.h
@@ -12,5 +11,6 @@
 	struct tc_pedit_key	*tcfp_keys;
 	struct tcf_pedit_key_ex	*tcfp_keys_ex;
+	int action;
 	u32 tcfp_off_max_hint;
 	unsigned char tcfp_nkeys;
 	unsigned char tcfp_flags;

This is an automated interdiff check for backported commits.

@github-actions github-actions Bot dismissed their stale review June 29, 2026 21:41

All validation checks now pass. Issues have been resolved.

@github-actions

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28404454903

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@PlaidCat PlaidCat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@bmastbergen bmastbergen merged commit cbbe7c6 into ciqlts8_6 Jun 29, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

5 participants