Skip to content

Conversation

@pvts-mat
Copy link
Contributor

@pvts-mat pvts-mat commented Nov 4, 2025

[LTS 9.2]

Fixed:
CVE-2022-48641 VULN-34024
CVE-2022-49917 VULN-66461
CVE-2022-49918 VULN-66488
CVE-2023-3777 VULN-6585
CVE-2023-4015 VULN-6613
CVE-2023-4244 VULN-430
CVE-2023-5197 VULN-34732
CVE-2023-52620 VULN-645
CVE-2023-52923 VULN-158865
CVE-2023-52924 VULN-158864
CVE-2023-53549 VULN-157585
CVE-2023-53635 VULN-158282
CVE-2023-7192 VULN-6817

Introduced:
CVE-2024-27012
CVE-2024-27017
CVE-2024-42109

Introduced & fixed:
CVE-2023-42756 VULN-34700
CVE-2023-52433 VULN-158866
CVE-2023-52581 VULN-598
CVE-2023-52925 VULN-158863
CVE-2023-53304 VULN-155012
CVE-2023-53566 VULN-157645
CVE-2023-6111
CVE-2024-0193 VULN-6825
CVE-2024-26581 VULN-8184
CVE-2024-26643 VULN-836
CVE-2024-26925 VULN-4906

Background

This PR was driven by CVE-2023-4244. The official upstream fix is given in the merge commit a2dd023. The merged branch of 5 commits had to be ported in whole. Although they fixed the CVE-2023-4244 problem they introduced multiple more. Additionally, the LTS 9.2 netfilter codebase was not suited for the backport.

The CVE-2023-4244 bug was already addressed in LTS 9.4 as part of the CentOS 9 "netlink api rebase" merge request. It was decided to port it in whole as it already dealt with similar unsuitability of the fix to the netfilter codebase of CentOS 9 at that time, and with the subsequent fixes. Some of the involved commits required prerequisites contained in other, similar branches, ported in whole as well. Coupled with a few "loose" bugfixes the solution grew to almost 100 commits, although without any custom adaptations (clean cherry-picks).

The ported commits validated the CVE-2024-26581 which was put on hold before due to the modified code missing from the ciqlts9_2 codebase. The fix for CVE-2024-26581 was therefore included in this PR as well. All other CVEs were solved as a byproduct of backporting the CentOS 9 branches and some of their loose bugfixes.

Solution strategy

Backporting strategy

Strategy for backporting CVE fixes, their prerequisites, and their bug fixes:

  • Following the solution in LTS 9.4: The backport of CVE fixes in this PR relied heavily on the solutions existing in LTS 9.4. Multiple commits were cherry-picked directly from the ciqlts9_4 branch. For all commits obtained that way the kernel-mainline SHA was nevertheless used in the commit property and the upstream-diff comment was included with reference to the ciqlts9_4 SHA actually used for the backport. The picks from 9.4 were only used if the picks from mainline generated conflicts. One commit (d2fd2e4) didn't even have an upstream equivalent.
  • Backporting full branches: Instead of backporting singular commits as CVE fixes or prerequisites the whole branches merged into CentOS 9 containing them were backported, to eliminate the risk of breaking nontrivial, branch-internal dependencies. The list of all branches used or considered can be found in Branches.
  • Minimizing the size of the PR: The full solution for CVE-2023-4244 introduced a bunch of issues which require fixing as well. Some of them have CVEs assigned, some not. Backporting them all, coupled with the "full branches" rule would increase the size of the PR considerably. As a result the PR may be failing the "check for fixes" test. Nevertheless all the fixes required are identified and listed, with a plan to be incorporated into ciqlts9_2 in next PRs.

There were some exceptions to these rules, each of them addressed briefly in the Comment column of the Commits table, which see.

Tagging policy

Because of the "full branches" rule many commits incorporated in the PR contain fixes to bugs which don't have any specific CVE assigned. While some of them might have been identified as bugfixes for commits which do have specific CVE assigned (easy), or as their prerequisites (difficult), it was decided to not dwelve into these details and simplify the tagging.

  1. Every commit officially identified as a fix for some CVE is described accordingly with the cve and jira properties.
  2. All other commits are identified as:
    • cve-pre CVE-2023-4244: if they appear before the commit netfilter: nf_tables: GC transaction API to avoid race with control plane (official CVE-2023-4244 fix), or
    • cve CVE-2023-4244: for all the commits after, as long as they still belong to the branch 1 (see Branches), or
    • cve-bf CVE-2023-4244: for all the commits after branch 1 if they fix any of the commits in branches 1, 2, 3.

Conflicts

With the help of LTS 9.4 backports the solution for LTS 9.2 was obtained without any meaningful conflicts. The only ones occured when backporting 9dad402 and 2413893 and it stemmed from the 5d4bb57 fix present in ciqlts9_2, which disturbed the chronology of changes. The conflicts might have been avoided entirely if it was reverted before the commits in this PR and then re-applied after, but that would result in an odd history. The conflicts were solved manually instead, preserving the meaning of the changes.

Solution details

Tables

The internal structure of the solution can best be described by the Commits table. It's augmented with the CVEs, Branches and Commit titles tables providing some details about the entities referenced in the Commits table.

The Commits and CVEs tables were aimed to be fully enclosing the PR, which means:

  • Commits contains all commits from the PR (but not only them),
  • Commits contains all "Fixes" commits of every commit in the PR,
  • Commits contains all "Fixed by" commits of every commit in the PR,
  • CVEs contains all CVEs associated with every commit in the PR,
  • Commits contains all commits associated with each CVE from the CVEs table (which may fall outside of PR).

In this way a full picture of all solved and introduced problems can be painted.

Fields

Some cell values have universal meaning in all tables:

  • -: The value was considered / checked and it either doesn't apply or the value is missing, or the associated list is empty, depending on column context.
  • (empty cell): The value was not explored (because there was no need to).

Commits

Columns:

  • Id: Short numerical identifier of the commit
  • mainline: Commit hash in the kernel-mainline branch
  • 9.4: Commit hash in the ciqlts9_4 branch
  • 9.2: Commit hash in the ciqlts9_2 branch
  • Fixes: All commits listed under the "Fixes" tag, specified by Id from the previous column.
  • B: The branch identifier
    • 1, 2, …, 7: CentOS 9 merge branches. For more information see the Branches table. Branches 1, 2, 3 are shown in full (all their commits included), others - not necessarily.
    • 0: The commit is part of CentOS 9 history but isn't a part of any merged branch.
    • -: The commit is not even present in 9.4 history, so talking about "CentOS 9" branch is meaningless.
    • H: Special "branch" id to identify commits belonging to ciqlts9_2 history.
  • PR: Whether the commit was included in the PR, and how.
    • -: Commit not part of the PR.
    • Clean ch-p mainline: The commit was cherry-picked cleanly directly from the kernel-mainline branch.
    • Clean ch-p 9.4: The commit was cherry-picked cleanly from the ciqlts9_4 backported version.
    • Conflict mainline: The cherry pick of the kernel-mainline commit resulted in conflicts and likewise the ciqlts9_4 version. See Conflicts for details about these cases.
  • Comment: Justification of why the commit was / wasn't included in the PR.
  • CVE: List of associated commits
    • (F): Fixing.
    • (I): Introducing.
    • (?): Not established whether the commit was fixing or introducing this CVE.

The sequence preserves ordering of commits in this PR, and of commits in branches 1, 2, 3 (from the most recent). Within the B:- and B:H groups the commits are ordered by the commit date of the kernel-mainline version (from the most recent).

Id mainline 9.4 9.2 Fixes B PR Comment CVE
1 ea77c39 - - 4 - - Not following the CVE-2023-4244 fix CVE-2025-38120 (F)
2 4c5c6aa - - 140 - - Not following the CVE-2023-4244 fix CVE-2025-38162 (F)
3 7ffc748 - - 56 - - Not backported to 9.4 CVE-2024-54031 (I)
4 791a615 - - 140 - - Not following the CVE-2023-4244 fix CVE-2024-57947 (F), CVE-2025-38120 (I)
5 9f6958b - - 46 - - Not applicable because we don't have the e169285 in history (see its commit msg) CVE-2024-42109 (F)
6 e79b47a - - 72 - - Not backported to 9.4, conflicts CVE-2024-27012 (F)
7 3cfc9ec - - 140 - - Not following the CVE-2023-4244 fix CVE-2024-26924 (F)
8 29b359c - - 74 - - Not backported to 9.4, conflicts CVE-2024-27017 (F)
9 ab0beaf - - 28 - - Not backported to 9.4 -
10 6b1ca88 - - 59 - - Not backported to 9.4 -
11 08e4c8c 121604f - 59 4 - Associated branch is long -
12 ffb40fb 5df20fe - 56 4 - Associated branch is long -
13 7315dc1 d51e691 - 59 4 - Associated branch is long CVE-2024-0193 (F)
14 a7d5a95 3f8af15 - 80 4 - Associated branch is long -
15 4c90bba abe4ffe - 78 4 - Associated branch is long -
16 ebd032f - - 76 - - Not backported to 9.4 -
17 ea078ae 8d34a7a - 82 5 - Associated branch is long -
18 7e9be11 4052bb3 - 78 5 - Associated branch is long -
19 f18e712 - - 100, 156 - - Not backported to 9.4 -
20 0d459e2 - - 45 - Clean ch-p mainline Included as an exception because CVE-2024-26925 is overdue CVE-2024-26925 (F)
21 a45e688 - - 132 - Clean ch-p mainline Included as prerequisite for 20 -
22 552705a 4e5f985 - 59 0 Clean ch-p mainline Included because not part of any branch, clean cherry-pick, CVE CVE-2024-26643 (F)
23 60c0c23 6cb02fd - 58 0 Clean ch-p mainline Included because not part of any branch, clean cherry-pick, CVE CVE-2024-26581 (F)
24 7433b6d 5579e1e - 84 7 Clean ch-p mainline Included because the branch is just 1 commit long CVE-2023-42756 (F)
25 837723b 8a3ba5c - 101 6 Clean ch-p mainline Included because simple, clean cherry-pick, associated branch won't be fully backported anyway -
26 8837ba3 45aad05 - 27 1 Clean ch-p 9.4 Part of fully backported branch 1 -
27 93995bf 54e39cc - 39 1 Clean ch-p 9.4 Part of fully backported branch 1 CVE-2023-6111 (F)
28 9dad402 71f4dce - - 1 Conflict mainline Part of fully backported branch 1 -
29 6509a2e b04945d - - 1 Clean ch-p mainline Part of fully backported branch 1 -
30 26cec9d 8d1189c - - 1 Clean ch-p mainline Part of fully backported branch 1 -
31 - d2fd2e4 - 24 1 Clean ch-p 9.4 Part of fully backported branch 1 -
32 0873882 c46c169 - 106 1 Clean ch-p mainline Part of fully backported branch 1 -
33 cf5000a 0cb54fa - 59 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-52581 (F)
34 c9bd265 30de344 - 129 1 Clean ch-p mainline Part of fully backported branch 1 -
35 23a3bfd 59ae9e4 - 162 1 Clean ch-p mainline Part of fully backported branch 1 -
36 b079155 465bbb2 - 56 1 Clean ch-p mainline Part of fully backported branch 1 -
37 6d365ea a28769d - 59 1 Clean ch-p mainline Part of fully backported branch 1 -
38 96b3330 d1e4596 - 56 1 Clean ch-p mainline Part of fully backported branch 1 -
39 4a9e12e bee501c - 59, 56 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-6111 (I)
40 f15f29f 29530d2 - 134 1 Clean ch-p 9.4 Part of fully backported branch 1 CVE-2023-5197 (F)
41 2ee52ae e33bf66 - 56 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-52433 (F)
42 8e51830 ef5cec9 - 56 1 Clean ch-p mainline Part of fully backported branch 1 -
43 5e1be4c 69cb8d9 - 140 1 Clean ch-p mainline Part of fully backported branch 1 -
44 8357bc9 f678a58 - 59 1 Clean ch-p mainline Part of fully backported branch 1 -
45 7203443 4afe09a - 59 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2024-26925 (I)
46 2c9f029 318076c - 121 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2024-42109 (I)
47 23185c6 925e3d3 - 151 1 Clean ch-p mainline Part of fully backported branch 1 -
48 02c6c24 727722d - 59 1 Clean ch-p mainline Part of fully backported branch 1 -
49 6a33d8b 58e5f04 - 59 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-4244 (F)
50 7845914 5911169 - 60 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-52925 (F)
51 90e5b34 94d514d - 130 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-4569 (F)
52 08713cb bd94f35 - 59, 56 1 Clean ch-p mainline Part of fully backported branch 1 -
53 b9f052d ad6241e - 76 1 Clean ch-p mainline Part of fully backported branch 1 -
54 a2dd023 37e26ec - - 1 Clean ch-p mainline Part of fully backported branch 1 -
55 c92db30 65afc3d - 60 1 Clean ch-p mainline Part of fully backported branch 1 -
56 f6c383b bb3c6b5 - 158, 147, 140 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-52923 (F), CVE-2023-52433 (I)
57 0a771f7 7e1fc03 - 119 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-4015 (F)
58 f718863 5c00ebd - 106 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-53304 (F), CVE-2024-26581 (I)
59 5f68718 bf6d3e9 - 159 1 Clean ch-p 9.4 Part of fully backported branch 1 CVE-2023-4244 (F), CVE-2023-52581 (I), CVE-2024-0193 (I), CVE-2024-26643 (I)
60 2413893 49f8fb9 - 158, 147, 140 1 Conflict mainline Part of fully backported branch 1 CVE-2023-4563 (F), CVE-2023-52924 (F), CVE-2023-52925 (I)
61 6eaf41e f5739eb ae5e128 134 1 - Already in history backported as ae5e128 CVE-2023-3777 (F)
62 751d460 8ca0cc6 - 134 1 Clean ch-p mainline Part of fully backported branch 1 -
63 ddbd8be 4427002 - 152 1 Clean ch-p mainline Part of fully backported branch 1 -
64 1689f25 854ec83 - 162 1 Clean ch-p 9.4 Part of fully backported branch 1 -
65 b389139 12f4f55 - 71, 72 1 Clean ch-p mainline Part of fully backported branch 1 -
66 e26d300 0a49baa - - 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2023-52620 (F)
67 b770283 ec166b7 - 120 1 Clean ch-p mainline Part of fully backported branch 1 -
68 62e1e94 51f6ae5 - 134 1 Clean ch-p mainline Part of fully backported branch 1 -
69 938154b 5a63039 - 162 1 Clean ch-p mainline Part of fully backported branch 1 -
70 c88c535 46d60b5 - 162 1 Clean ch-p mainline Part of fully backported branch 1 -
71 d6b4786 3965620 - - 1 Clean ch-p mainline Part of fully backported branch 1 -
72 628bd3e e564400 - 149 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2024-27012 (I)
73 34aae2c f74ccdb - - 1 Clean ch-p 9.4 Part of fully backported branch 1 -
74 2b84e21 5d9bf13 - 140 1 Clean ch-p mainline Part of fully backported branch 1 CVE-2024-27017 (I)
75 a4878ee 3d294f8 - - 1 Clean ch-p mainline Part of fully backported branch 1 -
76 212ed75 9e21c09 - 140 1 Clean ch-p mainline Part of fully backported branch 1 -
77 341b694 2313c52 - - 1 Clean ch-p 9.4 Part of fully backported branch 1 -
78 079cd63 7c45d32 - - 2 Clean ch-p mainline Part of fully backported branch 2 -
79 1fb7696 6f6e9c9 - 80 2 Clean ch-p mainline Part of fully backported branch 2 -
80 f80a612 f6dad62 - - 2 Clean ch-p mainline Prerequisite for 64 -
81 b53c116 fbc09cf - - 2 Clean ch-p mainline Part of fully backported branch 2 -
82 8daa8fd ce1ee31 - - 2 Clean ch-p 9.4 Part of fully backported branch 2 -
83 7d34aa3 55895d0 - - 2 Clean ch-p 9.4 Part of fully backported branch 2 -
84 24e2278 ce29c51 - 164 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2023-42756 (I)
85 61ae320 6bdf948 - 106 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2023-53566 (F)
86 dc1c9fd 7ef0f95 - 126 3 Clean ch-p mainline Part of fully backported branch 3 -
87 a1a64a1 9fd6dee - 160 3 Clean ch-p mainline Part of fully backported branch 3 -
88 bd05876 04580de - 141 3 Clean ch-p 9.4 Part of fully backported branch 3 -
89 e1f543d cf89456 - 136 3 Clean ch-p mainline Part of fully backported branch 3 -
90 e3c361b a1fc1a6 - 150 3 Clean ch-p mainline Part of fully backported branch 3 -
91 9a32e98 c4fdaba - 146 3 Clean ch-p mainline Part of fully backported branch 3 -
92 73db1b8 05445b5 - 155 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2023-53635 (F)
93 d4eb7e3 d17406d - 130 3 Clean ch-p mainline Part of fully backported branch 3 -
94 d46fc89 39bf804 492891d 130 3 - Already in history backported as 492891d -
95 4939245 2b6d20b - 143 3 Clean ch-p mainline Part of fully backported branch 3 -
96 1f617b6 fa487d6 - 157 3 Clean ch-p mainline Part of fully backported branch 3 -
97 ec2c591 ccbff46 - 154 3 Clean ch-p mainline Part of fully backported branch 3 -
98 068d82e f920dc0 - 157 3 Clean ch-p mainline Part of fully backported branch 3 -
99 c77737b eef5069 - 127 3 Clean ch-p mainline Part of fully backported branch 3 -
100 fdf6491 9f8f92b - 123 3 - Commit causes kABI breakage -
101 2cdaa3e a9985ec - 102 3 Clean ch-p mainline Part of fully backported branch 3 -
102 e6d57e9 5c92dbf - 124 3 Clean ch-p mainline Part of fully backported branch 3 -
103 ac48939 e9d8ea1 - 163 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2023-7192 (F)
104 92f3e96 f60201c - 131 3 Clean ch-p mainline Part of fully backported branch 3 -
105 5d235d6 aebf798 - 147 3 Clean ch-p mainline Part of fully backported branch 3 -
106 c9e6978 97220e3 - 138 3 Clean ch-p mainline Prerequisite for 58 CVE-2023-53304 (I), CVE-2023-53566 (I)
107 33c7aba c085531 - 139, 147 3 Clean ch-p 9.4 Part of fully backported branch 3 -
108 4a02426 344967d - 145 3 Clean ch-p mainline Part of fully backported branch 3 -
109 62ce44c a3248b4 - 122 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2022-48641 (F)
110 e58a171 eaddfeb - 161 3 Clean ch-p mainline Part of fully backported branch 3 -
111 94623f5 637c557 - 112 3 Clean ch-p mainline Part of fully backported branch 3 -
112 2b272bb 52691f7 - 144 3 Clean ch-p mainline Part of fully backported branch 3 -
113 5e29dc3 be67665 - 128 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2023-53549 (F)
114 5663ed6 d05f7f6 - 166 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2022-49917 (F)
115 3d00c6a b332e00 - 165 3 Clean ch-p mainline Part of fully backported branch 3 CVE-2022-49918 (F)
116 317eb96 f16e21d 5d4bb57 140 H - - CVE-2023-6817 (?)
117 e7c8899 e287383 3578ca7 134 H - -  
118 87b5a5c fb82489 eabcf73 140 H - - CVE-2023-4004 (F)
119 4bedf9e 3aa75fd 0ce53ab   H - - CVE-2023-3610 (I), CVE-2023-4015 (I)
120 123b996 e358654 e358654   H - - -
121 d4bc827 8313c48 8313c48   H - - CVE-2022-49920 (?)
122 7997eff a36f9c2 a36f9c2   H - - CVE-2022-48641 (I)
123 90d1daa 44ad5e5 44ad5e5   H - - -
124 c56716c a48c260 a48c260   H - - CVE-2022-48974 (?)
125 babc3dc e68e7ee e68e7ee 138, 148 H - - -
126 68a3765 4c1f351 4c1f351   H - - CVE-2021-47452 (?)
127 c9c3b68 cb1c10e cb1c10e   H - - -
128 5f7b51b 5f7b51b 5f7b51b   H - - CVE-2023-53549 (I)
129 179d9ba 179d9ba 179d9ba   H - - CVE-2024-26835 (?), CVE-2024-27065 (?), CVE-2024-35897 (?), CVE-2024-35900 (?)
130 aaa3104 aaa3104 aaa3104   H - - CVE-2021-47106 (?), CVE-2023-4569 (I), CVE-2024-1085 (?)
131 6001a93 6001a93 6001a93   H - - CVE-2021-47394 (?), CVE-2022-49920 (?)
132 c0391b6 c0391b6 c0391b6   H - - -
133 226a88d 226a88d 226a88d 138 H - - -
134 d0e2c7d d0e2c7d d0e2c7d   H - - CVE-2022-39190 (?), CVE-2023-3610 (I), CVE-2023-3777 (I), CVE-2023-4147 (?), CVE-2023-5197 (I)
135 33d0779 33d0779 33d0779 147, 138 H - - -
136 ee04805 ee04805 ee04805   H - - -
137 72239f2 72239f2 72239f2 138 H - - -
138 7c84d41 7c84d41 7c84d41 - H - - -
139 6503842 6503842 6503842   H - - CVE-2021-46283 (?)
140 3c4287f 3c4287f 3c4287f - H - - CVE-2023-4004 (I), CVE-2023-4563 (I), CVE-2023-52923 (I), CVE-2023-52924 (I), CVE-2023-6817 (?), CVE-2024-26924 (I), CVE-2024-57947 (I), CVE-2025-38162 (I)
141 d54725c d54725c d54725c   H - - CVE-2022-48691 (?), CVE-2024-36005 (?)
142 d0a8d87 d0a8d87 d0a8d87 - H - - -
143 63ce394 63ce394 63ce394   H - - -
144 c4b0e77 c4b0e77 c4b0e77   H - - -
145 4ed8eb6 4ed8eb6 4ed8eb6   H - - CVE-2022-50001 (?)
146 f102d66 f102d66 f102d66   H - - -
147 8d8540c 8d8540c 8d8540c - H - - CVE-2023-4563 (I), CVE-2023-52923 (I), CVE-2023-52924 (I)
148 d2df92e d2df92e d2df92e 153 H - - -
149 5910544 5910544 5910544   H - - CVE-2024-27011 (?)
150 1a94e38 1a94e38 1a94e38   H - - -
151 8aeff92 8aeff92 8aeff92   H - - -
152 c016c7e c016c7e c016c7e   H - - -
153 e701001 e701001 e701001 - H - - -
154 8a6bf5d 8a6bf5d 8a6bf5d   H - - -
155 a4b4766 a4b4766 a4b4766   H - - CVE-2023-53635 (I)
156 0ebc106 e7c8899 e7c8899 - H - -  
157 d07db98 d07db98 d07db98   H - - -
158 9d09829 9d09829 9d09829 - H - - CVE-2023-4563 (I), CVE-2023-52923 (I), CVE-2023-52924 (I)
159 cfed7e1 cfed7e1 cfed7e1 - H - - CVE-2023-4244 (I)
160 cbb8125 cbb8125 cbb8125   H - - -
161 c58dd2d c58dd2d c58dd2d   H - - -
162 9651851 9651851 9651851   H - - CVE-2022-1016 (?), CVE-2022-49293 (?), CVE-2023-35001 (?), CVE-2024-42070 (?)
163 7d367e0 7d367e0 7d367e0   H - - CVE-2023-7192 (I)
164 a7b4f98 a7b4f98 a7b4f98   H - - CVE-2024-56637 (?)
165 61b1ab4 61b1ab4 61b1ab4   H - - CVE-2022-49918 (I), CVE-2025-40018 (?)
166 457c4cb 457c4cb 457c4cb   H - - CVE-2022-49917 (I)

Commit titles

The following table provides the link between Id column in the Commits table and the commit's title for identification purposes.

Id Title
1 `netfilter: nf_set_pipapo_avx2: fix initial map fill`
2 `netfilter: nft_set_pipapo: prevent overflow in lookup table allocation`
3 `netfilter: nft_set_hash: skip duplicated elements pending gc run`
4 `netfilter: nf_set_pipapo: fix initial map fill`
5 `netfilter: nf_tables: unconditionally flush pending work before notifier`
6 `netfilter: nf_tables: restore set elements when delete set fails`
7 `netfilter: nft_set_pipapo: do not free live element`
8 `netfilter: nft_set_pipapo: walk over current view on netlink dump`
9 `netfilter: nft_set_pipapo: remove static in nft_pipapo_get()`
10 `netfilter: nf_tables: skip dead set elements in netlink dump`
11 `netfilter: nf_tables: mark newset as dead on transaction abort`
12 `netfilter: nft_set_pipapo: prefer gfp_kernel allocation`
13 `netfilter: nf_tables: skip set commit for deleted/destroyed sets`
14 `netfilter: nf_tables: bogus ENOENT when destroying element which does not exist`
15 `netfilter: nf_tables: do not refresh timeout when resetting element`
16 `netfilter: nf_tables: do not remove elements if set backend implements .abort`
17 `netfilter: nf_tables: Audit log rule reset`
18 `netfilter: nf_tables: Audit log setelem reset`
19 `linux/netfilter.h: fix kernel-doc warnings`
20 `netfilter: nf_tables: release mutex after nft_gc_seq_end from abort path`
21 `netfilter: nf_tables: release batch on table validation from abort path`
22 `netfilter: nf_tables: mark set as dead when unbinding anonymous set with timeout`
23 `netfilter: nft_set_rbtree: skip end interval element from gc`
24 `netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP`
25 `netfilter, bpf: Adjust timeouts of non-confirmed CTs in bpf_ct_insert_entry()`
26 `netfilter: nf_tables: split async and sync catchall in two functions`
27 `netfilter: nf_tables: remove catchall element in GC sync path`
28 `netfilter: nf_tables: expose opaque set element as struct nft_elem_priv`
29 `netfilter: nf_tables: set backend .flush always succeeds`
30 `netfilter: nft_set_pipapo: no need to call pipapo_deactivate() from flush`
31 `netfilter: nf_tables: work around newrule after chain binding`
32 `netfilter: nf_tables: nft_set_rbtree: fix spurious insertion failure`
33 `netfilter: nf_tables: fix memleak when more than 255 elements expired`
34 `netfilter: nf_tables: disable toggling dormant table state more than once`
35 `netfilter: nf_tables: disallow element removal on anonymous sets`
36 `netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration`
37 `netfilter: nft_set_pipapo: stop GC iteration if GC transaction allocation fails`
38 `netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention`
39 `netfilter: nft_set_pipapo: call nft_trans_gc_queue_sync() in catchall GC`
40 `netfilter: nf_tables: disallow rule removal from chain binding`
41 `netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction`
42 `netfilter: nf_tables: defer gc run if previous batch is still pending`
43 `netfilter: nf_tables: fix out of memory error handling`
44 `netfilter: nf_tables: use correct lock to protect gc_list`
45 `netfilter: nf_tables: GC transaction race with abort path`
46 `netfilter: nf_tables: flush pending destroy work before netlink notifier`
47 `netfilter: nft_dynset: disallow object maps`
48 `netfilter: nf_tables: GC transaction race with netns dismantle`
49 `netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path`
50 `netfilter: nf_tables: don't fail inserts if duplicate has expired`
51 `netfilter: nf_tables: deactivate catchall elements in next generation`
52 `netfilter: nf_tables: fix kdoc warnings after gc rework`
53 `netfilter: nf_tables: fix false-positive lockdep splat`
54 `netfilter: nf_tables: remove busy mark and gc batch API`
55 `netfilter: nft_set_hash: mark set element as dead when deleting from packet path`
56 `netfilter: nf_tables: adapt set backend to use GC transaction API`
57 `netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR`
58 `netfilter: nft_set_rbtree: fix overlap expiration walk`
59 `netfilter: nf_tables: GC transaction API to avoid race with control plane`
60 `netfilter: nf_tables: don't skip expired elements during walk`
61 `netfilter: nf_tables: skip bound chain on rule flush`
62 `netfilter: nf_tables: skip bound chain in netns release path`
63 `netfilter: nf_tables: fix spurious set element insertion failure`
64 `netfilter: nf_tables: report use refcount overflow`
65 `netfilter: nf_tables: fix underflow in chain reference counter`
66 `netfilter: nf_tables: disallow timeout for anonymous sets`
67 `netfilter: nf_tables: disallow updates of anonymous sets`
68 `netfilter: nf_tables: reject unbound chain set before commit phase`
69 `netfilter: nf_tables: reject unbound anonymous set before commit phase`
70 `netfilter: nf_tables: disallow element updates of bound anonymous sets`
71 `netfilter: nf_tables: fix underflow in object reference counter`
72 `netfilter: nf_tables: drop map element references from preparation phase`
73 `netfilter: nf_tables: validate variable length element extension`
74 `netfilter: nft_set_pipapo: .walk does not deal with generations`
75 `netfilter: nf_tables: relax set/map validation checks`
76 `netfilter: nf_tables: integrate pipapo into commit protocol`
77 `netfilter: nf_tables: upfront validation of data via nft_data_init()`
78 `netfilter: nf_tables: Introduce NFT_MSG_GETSETELEM_RESET`
79 `netfilter: nf_tables: fix wrong pointer passed to PTR_ERR()`
80 `netfilter: nf_tables: add support to destroy operation`
81 `netfilter: nf_tables: set element extended ACK reporting support`
82 `netfilter: nf_tables: Introduce NFT_MSG_GETRULE_RESET`
83 `netfilter: nf_tables: Extend nft_expr_ops::dump callback parameters`
84 `netfilter: ipset: Add schedule point in call_ad().`
85 `netfilter: nft_set_rbtree: fix null deref on element insertion`
86 `netfilter: nf_tables: always release netdev hooks from notifier`
87 `netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM`
88 `netfilter: nf_tables: Add null check for nla_nest_start_noflag() in nft_dump_basechain_hook()`
89 `netfilter: conntrack: fix NULL pointer dereference in nf_confirm_cthelper`
90 `netfilter: nf_tables: fix nft_trans type confusion`
91 `netfilter: nf_tables: don't write table validation state without mutex`
92 `netfilter: conntrack: fix wrong ct->timeout value`
93 `netfilter: nf_tables: tighten netlink attribute requirements for catch-all elements`
94 `netfilter: nf_tables: validate catch-all set elements`
95 `` netfilter: nft_redir: correct value of inet type `.maxattrs` ``
96 `netfilter: nft_redir: correct length for loading protocol registers`
97 `netfilter: nft_masq: correct length for loading protocol registers`
98 `netfilter: nft_nat: correct length for loading protocol registers`
99 `netfilter: conntrack: adopt safer max chain length`
100 `netfilter: ctnetlink: make event listener tracking global`
101 `netfilter: conntrack: restore IPS_CONFIRMED out of nf_conntrack_hash_check_insert()`
102 `netfilter: conntrack: fix rmmod double-free race`
103 `netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()`
104 `netfilter: nf_tables: allow to fetch set elements when table has an owner`
105 `netfilter: nft_set_rbtree: skip elements in transaction from garbage collection`
106 `netfilter: nft_set_rbtree: Switch to node list walk for overlap detection`
107 `netfilter: nf_tables: do not set up extensions for end interval`
108 `netfilter: tproxy: fix deadlock due to missing BH disable`
109 `netfilter: ebtables: fix memory leak when blob is malformed`
110 `netfilter: ebtables: fix table blob use-after-free`
111 `netfilter: br_netfilter: fix recent physdev match breakage`
112 `netfilter: br_netfilter: disable sabotage_in hook after first suppression`
113 `netfilter: ipset: Rework long task execution when adding/deleting entries`
114 `ipvs: fix WARNING in ip_vs_app_net_cleanup()`
115 `ipvs: fix WARNING in __ip_vs_cleanup_batch()`
116 `netfilter: nft_set_pipapo: skip inactive elements during set walk`
117 `netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID`
118 `netfilter: nft_set_pipapo: fix improper element removal`
119 `netfilter: nf_tables: fix chain binding transaction logic`
120 `netfilter: nf_tables: honor set timeout and garbage collection updates`
121 `netfilter: nf_tables: netlink notifier might race to release objects`
122 `netfilter: ebtables: reject blobs that don't provide all entry points`
123 `netfilter: conntrack: add nf_conntrack_events autodetect mode`
124 `netfilter: extensions: introduce extension genid count`
125 `netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion`
126 `netfilter: nf_tables: skip netdev events generated on netns removal`
127 `netfilter: conntrack: make max chain length random`
128 `netfilter: ipset: Limit the maximal range of consecutive elements to add/delete`
129 `netfilter: nf_tables: fix table flag updates`
130 `netfilter: nftables: add catch-all set element support`
131 `netfilter: nftables: introduce table ownership`
132 `netfilter: nf_tables: missing validation from the abort path`
133 `netfilter: nft_set_rbtree: Handle outcomes of tree rotations in overlap detection`
134 `netfilter: nf_tables: add NFT_CHAIN_BINDING`
135 `netfilter: nft_set_rbtree: Don't account for expired elements on insertion`
136 `netfilter: conntrack: make conntrack userspace helpers work again`
137 `netfilter: nft_set_rbtree: Drop spurious condition for overlap detection on insertion`
138 `netfilter: nft_set_rbtree: Detect partial overlaps on insertion`
139 `netfilter: nf_tables: allow to specify stateful expression in set definition`
140 `nf_tables: Add set type for arbitrary concatenation of ranges`
141 `netfilter: nf_tables: support for multiple devices per netdev hook`
142 `netfilter: nft_dynset: support for element deletion`
143 `netfilter: nft_redir: add inet support`
144 `netfilter: avoid using skb->nf_bridge directly`
145 `netfilter: nf_tables: Add native tproxy support`
146 `netfilter: nf_tables: use dedicated mutex to guard transactions`
147 `netfilter: nft_set_rbtree: add timeout support`
148 `netfilter: nft_set_rbtree: handle element re-addition after deletion`
149 `netfilter: nf_tables: revisit chain/object refcounting from elements`
150 `netfilter: nf_tables: add NFTA_RULE_ID attribute`
151 `netfilter: nf_tables: add stateful object reference to set elements`
152 `netfilter: nf_tables: honor NLM_F_EXCL flag in set element insertion`
153 `netfilter: nft_rbtree: allow adjacent intervals with dynamic updates`
154 `netfilter: nft_masq: support port range`
155 `netfilter: nfnetlink_queue: rename related to nfqueue attaching conntrack info`
156 `netfilter: move tee_active to core`
157 `netfilter: nf_tables: introduce nft_validate_register_load()`
158 `netfilter: nft_hash: add support for timeouts`
159 `netfilter: nf_tables: add set garbage collection helpers`
160 `netfilter: nfnetlink: deliver netlink errors on batch completion`
161 `netfilter: Can't fail and free after table replacement`
162 `netfilter: add nftables`
163 `netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)`
164 `netfilter: ipset: IP set core support`
165 `IPVS: netns, add basic init per netns.`
166 `[NET]: Make /proc/net per network namespace`

CVEs

Columns:

  • CVE, VULN, CVSS: Self explanatory
  • Status: Relation of CVE and the patch contained in this PR.
    • F: Fixed by the patch
    • I: Introduced by the patch
    • -: None of the above
CVE VULN CVSS Status
CVE-2021-46283     -
CVE-2021-47106     -
CVE-2021-47394     -
CVE-2021-47452     -
CVE-2022-1016     -
CVE-2022-39190     -
CVE-2022-48641 VULN-34024 4.4 F
CVE-2022-48691     -
CVE-2022-48974     -
CVE-2022-49293     -
CVE-2022-49917 VULN-66461 1.9 F
CVE-2022-49918 VULN-66488 4.4 F
CVE-2022-49920     -
CVE-2022-50001     -
CVE-2023-35001     -
CVE-2023-3610     -
CVE-2023-3777 VULN-6585 7.8 F
CVE-2023-4004   7.8 -
CVE-2023-4015 VULN-6613 7.8 F
CVE-2023-4147     -
CVE-2023-4244 VULN-430 7 F
CVE-2023-42756 VULN-34700 4.4 I, F
CVE-2023-4563 ? rejected F
CVE-2023-4569 - 5.5 F
CVE-2023-5197 VULN-34732 6.6 F
CVE-2023-52433 VULN-158866 - I, F
CVE-2023-52581 VULN-598 7 I, F
CVE-2023-52620 VULN-645 2.5 F
CVE-2023-52923 VULN-158865 5.5 F
CVE-2023-52924 VULN-158864 5.5 F
CVE-2023-52925 VULN-158863 5.5 I, F
CVE-2023-53304 VULN-155012 5.5 I, F
CVE-2023-53549 VULN-157585 5.5 F
CVE-2023-53566 VULN-157645 6.4 I, F
CVE-2023-53635 VULN-158282 5.5 F
CVE-2023-6111 - 7.8 I, F
CVE-2023-6817   7.8 -
CVE-2023-7192 VULN-6817 5.5 F
CVE-2024-0193 VULN-6825 7.8 I, F
CVE-2024-1085     -
CVE-2024-26581 VULN-8184 6.4 I, F
CVE-2024-26643 VULN-836 4.7 I, F
CVE-2024-26835     -
CVE-2024-26924   5.5 -
CVE-2024-26925 VULN-4906 7 I, F
CVE-2024-27011     -
CVE-2024-27012 ? 5.5 I
CVE-2024-27017 ? 5.5 I
CVE-2024-27065     -
CVE-2024-35897     -
CVE-2024-35900     -
CVE-2024-36005     -
CVE-2024-42109 ? 5.5 I
CVE-2024-54031     -
CVE-2024-56637     -
CVE-2024-57947   7.1 -
CVE-2025-38120   5.5 -
CVE-2025-38162   7 -
CVE-2025-40018     -

Branches

Columns:

  • B: Same as B in the Commits table
  • Length: Size of the branch, in commits, from fork to merge.
  • Full: Whether the branch is presented fully in the Commits table.
  • Merge commit, Merge name, Comment: Self explanatory
B Merge commit Merge name Length Full Comment
1 cfd9694 `netfilter: nf_tables: netlink api rebase on net.git` 53 yes  
2 c05955e `netfilter: nf_tables: Support resetting state in rules and set elements` 7 yes  
3 e4726e3 `9.3 backports from upstream` 33 yes  
4 f875124 `netfilter: nf_tables: backports from upstream` 16 no  
5 3e3b830 `audit: backport kernel audit enhancements and fixes up to upstream v6.6` 16 no  
6 0ca27d7 `bpf: update to 6.4` 434 no Not specifically a netfilter merge
7 a40a6f6 `netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP` 1 yes  

kABI check: passed

DEBUG=1 CVE=CVE-batch-10 ./ninja.sh _kabi_check_kernel__x86_64--test--ciqlts9_2-CVE-batch-10

[0/1] kabi_check_kernel	Check ABI of kernel [ciqlts9_2-CVE-batch-10]	_kabi_check_kernel__x86_64--test--ciqlts9_2-CVE-batch-10
++ uname -m
+ python3 /data/src/ctrliq-github-haskell/kernel-dist-git-el-9.2/SOURCES/check-kabi -k /data/src/ctrliq-github-haskell/kernel-dist-git-el-9.2/SOURCES/Module.kabi_x86_64 -s vms/x86_64--build--ciqlts9_2/build_files/kernel-src-tree-ciqlts9_2-CVE-batch-10/Module.symvers
kABI check passed
+ touch state/kernels/ciqlts9_2-CVE-batch-10/x86_64/kabi_checked

Boot test: passed

boot-test.log

jira VULN-66488
cve CVE-2022-49918
commit-author Zhengchao Shao <[email protected]>
commit 3d00c6a

During the initialization of ip_vs_conn_net_init(), if file ip_vs_conn
or ip_vs_conn_sync fails to be created, the initialization is successful
by default. Therefore, the ip_vs_conn or ip_vs_conn_sync file doesn't
be found during the remove.

The following is the stack information:
name 'ip_vs_conn_sync'
WARNING: CPU: 3 PID: 9 at fs/proc/generic.c:712
remove_proc_entry+0x389/0x460
Modules linked in:
Workqueue: netns cleanup_net
RIP: 0010:remove_proc_entry+0x389/0x460
Call Trace:
<TASK>
__ip_vs_cleanup_batch+0x7d/0x120
ops_exit_list+0x125/0x170
cleanup_net+0x4ea/0xb00
process_one_work+0x9bf/0x1710
worker_thread+0x665/0x1080
kthread+0x2e4/0x3a0
ret_from_fork+0x1f/0x30
</TASK>

Fixes: 61b1ab4 ("IPVS: netns, add basic init per netns.")
	Signed-off-by: Zhengchao Shao <[email protected]>
	Acked-by: Julian Anastasov <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 3d00c6a)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-66461
cve CVE-2022-49917
commit-author Zhengchao Shao <[email protected]>
commit 5663ed6

During the initialization of ip_vs_app_net_init(), if file ip_vs_app
fails to be created, the initialization is successful by default.
Therefore, the ip_vs_app file doesn't be found during the remove in
ip_vs_app_net_cleanup(). It will cause WRNING.

The following is the stack information:
name 'ip_vs_app'
WARNING: CPU: 1 PID: 9 at fs/proc/generic.c:712 remove_proc_entry+0x389/0x460
Modules linked in:
Workqueue: netns cleanup_net
RIP: 0010:remove_proc_entry+0x389/0x460
Call Trace:
<TASK>
ops_exit_list+0x125/0x170
cleanup_net+0x4ea/0xb00
process_one_work+0x9bf/0x1710
worker_thread+0x665/0x1080
kthread+0x2e4/0x3a0
ret_from_fork+0x1f/0x30
</TASK>

Fixes: 457c4cb ("[NET]: Make /proc/net per network namespace")
	Signed-off-by: Zhengchao Shao <[email protected]>
	Acked-by: Julian Anastasov <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 5663ed6)
	Signed-off-by: Marcin Wcisło <[email protected]>
…ries

jira VULN-157585
cve CVE-2023-53549
commit-author Jozsef Kadlecsik <[email protected]>
commit 5e29dc3

When adding/deleting large number of elements in one step in ipset, it can
take a reasonable amount of time and can result in soft lockup errors. The
patch 5f7b51b ("netfilter: ipset: Limit the maximal range of
consecutive elements to add/delete") tried to fix it by limiting the max
elements to process at all. However it was not enough, it is still possible
that we get hung tasks. Lowering the limit is not reasonable, so the
approach in this patch is as follows: rely on the method used at resizing
sets and save the state when we reach a smaller internal batch limit,
unlock/lock and proceed from the saved state. Thus we can avoid long
continuous tasks and at the same time removed the limit to add/delete large
number of elements in one step.

The nfnl mutex is held during the whole operation which prevents one to
issue other ipset commands in parallel.

Fixes: 5f7b51b ("netfilter: ipset: Limit the maximal range of consecutive elements to add/delete")
	Reported-by: [email protected]
	Signed-off-by: Jozsef Kadlecsik <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 5e29dc3)
	Signed-off-by: Marcin Wcisło <[email protected]>
…sion

jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit 2b272bb

When using a xfrm interface in a bridged setup (the outgoing device is
bridged), the incoming packets in the xfrm interface are only tracked
in the outgoing direction.

$ brctl show
bridge name     interfaces
br_eth1         eth1

$ conntrack -L
tcp 115 SYN_SENT src=192... dst=192... [UNREPLIED] ...

If br_netfilter is enabled, the first (encrypted) packet is received onR
eth1, conntrack hooks are called from br_netfilter emulation which
allocates nf_bridge info for this skb.

If the packet is for local machine, skb gets passed up the ip stack.
The skb passes through ip prerouting a second time. br_netfilter
ip_sabotage_in supresses the re-invocation of the hooks.

After this, skb gets decrypted in xfrm layer and appears in
network stack a second time (after decryption).

Then, ip_sabotage_in is called again and suppresses netfilter
hook invocation, even though the bridge layer never called them
for the plaintext incarnation of the packet.

Free the bridge info after the first suppression to avoid this.

I was unable to figure out where the regression comes from, as far as i
can see br_netfilter always had this problem; i did not expect that skb
is looped again with different headers.

Fixes: c4b0e77 ("netfilter: avoid using skb->nf_bridge directly")
Reported-and-tested-by: Wolfgang Nothdurft <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 2b272bb)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit 94623f5

Recent attempt to ensure PREROUTING hook is executed again when a
decrypted ipsec packet received on a bridge passes through the network
stack a second time broke the physdev match in INPUT hook.

We can't discard the nf_bridge info strct from sabotage_in hook, as
this is needed by the physdev match.

Keep the struct around and handle this with another conditional instead.

Fixes: 2b272bb ("netfilter: br_netfilter: disable sabotage_in hook after first suppression")
Reported-and-tested-by: Farid BENAMROUCHE <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 94623f5)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit e58a171

We are not allowed to return an error at this point.
Looking at the code it looks like ret is always 0 at this
point, but its not.

t = find_table_lock(net, repl->name, &ret, &ebt_mutex);

... this can return a valid table, with ret != 0.

This bug causes update of table->private with the new
blob, but then frees the blob right away in the caller.

Syzbot report:

BUG: KASAN: vmalloc-out-of-bounds in __ebt_unregister_table+0xc00/0xcd0 net/bridge/netfilter/ebtables.c:1168
Read of size 4 at addr ffffc90005425000 by task kworker/u4:4/74
Workqueue: netns cleanup_net
Call Trace:
 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517
 __ebt_unregister_table+0xc00/0xcd0 net/bridge/netfilter/ebtables.c:1168
 ebt_unregister_table+0x35/0x40 net/bridge/netfilter/ebtables.c:1372
 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169
 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:613
...

ip(6)tables appears to be ok (ret should be 0 at this point) but make
this more obvious.

Fixes: c58dd2d ("netfilter: Can't fail and free after table replacement")
	Reported-by: [email protected]
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit e58a171)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-34024
cve CVE-2022-48641
commit-author Florian Westphal <[email protected]>
commit 62ce44c

The bug fix was incomplete, it "replaced" crash with a memory leak.
The old code had an assignment to "ret" embedded into the conditional,
restore this.

Fixes: 7997eff ("netfilter: ebtables: reject blobs that don't provide all entry points")
Reported-and-tested-by: [email protected]
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit 62ce44c)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit 4a02426

The xtables packet traverser performs an unconditional local_bh_disable(),
but the nf_tables evaluation loop does not.

Functions that are called from either xtables or nftables must assume
that they can be called in process context.

inet_twsk_deschedule_put() assumes that no softirq interrupt can occur.
If tproxy is used from nf_tables its possible that we'll deadlock
trying to aquire a lock already held in process context.

Add a small helper that takes care of this and use it.

Link: https://lore.kernel.org/netfilter-devel/[email protected]/
Fixes: 4ed8eb6 ("netfilter: nf_tables: Add native tproxy support")
Reported-and-tested-by: Major Dávid <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 4a02426)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 33c7aba
upstream-diff Actually picked the 9.4 backport
  c085531 which applies cleanly without
  context conflicts

Elements with an end interval flag set on do not store extensions. The
global set definition is currently setting on the timeout and stateful
expression for end interval elements.

This leads to skipping end interval elements from the set->ops->walk()
path as the expired check bogusly reports true.

Moreover, do not set up stateful expressions for elements with end
interval flag set on since this is never used.

Fixes: 6503842 ("netfilter: nf_tables: allow to specify stateful expression in set definition")
Fixes: 8d8540c ("netfilter: nft_set_rbtree: add timeout support")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 33c7aba)
	Signed-off-by: Marcin Wcisło <[email protected]>
…tion

jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit c9e6978

...instead of a tree descent, which became overly complicated in an
attempt to cover cases where expired or inactive elements would affect
comparisons with the new element being inserted.

Further, it turned out that it's probably impossible to cover all those
cases, as inactive nodes might entirely hide subtrees consisting of a
complete interval plus a node that makes the current insertion not
overlap.

To speed up the overlap check, descent the tree to find a greater
element that is closer to the key value to insert. Then walk down the
node list for overlap detection. Starting the overlap check from
rb_first() unconditionally is slow, it takes 10 times longer due to the
full linear traversal of the list.

Moreover, perform garbage collection of expired elements when walking
down the node list to avoid bogus overlap reports.

For the insertion operation itself, this essentially reverts back to the
implementation before commit 7c84d41 ("netfilter: nft_set_rbtree:
Detect partial overlaps on insertion"), except that cases of complete
overlap are already handled in the overlap detection phase itself, which
slightly simplifies the loop to find the insertion point.

Based on initial patch from Stefano Brivio, including text from the
original patch description too.

Fixes: 7c84d41 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion")
	Reviewed-by: Stefano Brivio <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit c9e6978)
	Signed-off-by: Marcin Wcisło <[email protected]>
…collection

jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 5d235d6

Skip interference with an ongoing transaction, do not perform garbage
collection on inactive elements. Reset annotated previous end interval
if the expired element is marked as busy (control plane removed the
element right before expiration).

Fixes: 8d8540c ("netfilter: nft_set_rbtree: add timeout support")
	Reviewed-by: Stefano Brivio <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 5d235d6)
	Signed-off-by: Marcin Wcisło <[email protected]>
…wner

jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 92f3e96

NFT_MSG_GETSETELEM returns -EPERM when fetching set elements that belong
to table that has an owner. This results in empty set/map listing from
userspace.

Fixes: 6001a93 ("netfilter: nftables: introduce table ownership")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 92f3e96)
	Signed-off-by: Marcin Wcisło <[email protected]>
…conntrack()

jira VULN-6817
cve CVE-2023-7192
commit-author Hangyu Hua <[email protected]>
commit ac48939

nf_ct_put() needs to be called to put the refcount got by
nf_conntrack_find_get() to avoid refcount leak when
nf_conntrack_hash_check_insert() fails.

Fixes: 7d367e0 ("netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)")
	Signed-off-by: Hangyu Hua <[email protected]>
	Acked-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit ac48939)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit e6d57e9

nf_conntrack_hash_check_insert() callers free the ct entry directly, via
nf_conntrack_free.

This isn't safe anymore because
nf_conntrack_hash_check_insert() might place the entry into the conntrack
table and then delteted the entry again because it found that a conntrack
extension has been removed at the same time.

In this case, the just-added entry is removed again and an error is
returned to the caller.

Problem is that another cpu might have picked up this entry and
incremented its reference count.

This results in a use-after-free/double-free, once by the other cpu and
once by the caller of nf_conntrack_hash_check_insert().

Fix this by making nf_conntrack_hash_check_insert() not fail anymore
after the insertion, just like before the 'Fixes' commit.

This is safe because a racing nf_ct_iterate() has to wait for us
to release the conntrack hash spinlocks.

While at it, make the function return -EAGAIN in the rmmod (genid
changed) case, this makes nfnetlink replay the command (suggested
by Pablo Neira).

Fixes: c56716c ("netfilter: extensions: introduce extension genid count")
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit e6d57e9)
	Signed-off-by: Marcin Wcisło <[email protected]>
…check_insert()

jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 2cdaa3e

e6d57e9 ("netfilter: conntrack: fix rmmod double-free race")
consolidates IPS_CONFIRMED bit set in nf_conntrack_hash_check_insert().
However, this breaks ctnetlink:

 # conntrack -I -p tcp --timeout 123 --src 1.2.3.4 --dst 5.6.7.8 --state ESTABLISHED --sport 1 --dport 4 -u SEEN_REPLY
 conntrack v1.4.6 (conntrack-tools): Operation failed: Device or resource busy

This is a partial revert of the aforementioned commit to restore
IPS_CONFIRMED.

Fixes: e6d57e9 ("netfilter: conntrack: fix rmmod double-free race")
	Reported-by: Stéphane Graber <[email protected]>
	Tested-by: Stéphane Graber <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 2cdaa3e)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Eric Dumazet <[email protected]>
commit c77737b

Customers using GKE 1.25 and 1.26 are facing conntrack issues
root caused to commit c9c3b68 ("netfilter: conntrack: make
max chain length random").

Even if we assume Uniform Hashing, a bucket often reachs 8 chained
items while the load factor of the hash table is smaller than 0.5

With a limit of 16, we reach load factors of 3.
With a limit of 32, we reach load factors of 11.
With a limit of 40, we reach load factors of 15.
With a limit of 50, we reach load factors of 24.

This patch changes MIN_CHAINLEN to 50, to minimize risks.

Ideally, we could in the future add a cushion based on expected
load factor (2 * nf_conntrack_max / nf_conntrack_buckets),
because some setups might expect unusual values.

Fixes: c9c3b68 ("netfilter: conntrack: make max chain length random")
	Signed-off-by: Eric Dumazet <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit c77737b)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Jeremy Sowden <[email protected]>
commit 068d82e

The values in the protocol registers are two bytes wide.  However, when
parsing the register loads, the code currently uses the larger 16-byte
size of a `union nf_inet_addr`.  Change it to use the (correct) size of
a `union nf_conntrack_man_proto` instead.

Fixes: d07db98 ("netfilter: nf_tables: introduce nft_validate_register_load()")
	Signed-off-by: Jeremy Sowden <[email protected]>
	Reviewed-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 068d82e)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Jeremy Sowden <[email protected]>
commit ec2c591

The values in the protocol registers are two bytes wide.  However, when
parsing the register loads, the code currently uses the larger 16-byte
size of a `union nf_inet_addr`.  Change it to use the (correct) size of
a `union nf_conntrack_man_proto` instead.

Fixes: 8a6bf5d ("netfilter: nft_masq: support port range")
	Signed-off-by: Jeremy Sowden <[email protected]>
	Reviewed-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit ec2c591)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Jeremy Sowden <[email protected]>
commit 1f617b6

The values in the protocol registers are two bytes wide.  However, when
parsing the register loads, the code currently uses the larger 16-byte
size of a `union nf_inet_addr`.  Change it to use the (correct) size of
a `union nf_conntrack_man_proto` instead.

Fixes: d07db98 ("netfilter: nf_tables: introduce nft_validate_register_load()")
	Signed-off-by: Jeremy Sowden <[email protected]>
	Reviewed-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 1f617b6)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Jeremy Sowden <[email protected]>
commit 4939245

`nft_redir_inet_type.maxattrs` was being set, presumably because of a
cut-and-paste error, to `NFTA_MASQ_MAX`, instead of `NFTA_REDIR_MAX`.

Fixes: 63ce394 ("netfilter: nft_redir: add inet support")
	Signed-off-by: Jeremy Sowden <[email protected]>
	Reviewed-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 4939245)
	Signed-off-by: Marcin Wcisło <[email protected]>
…h-all elements

jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit d4eb7e3

If NFT_SET_ELEM_CATCHALL is set on, then userspace provides no set element
key. Otherwise, bail out with -EINVAL.

Fixes: aaa3104 ("netfilter: nftables: add catch-all set element support")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit d4eb7e3)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-158282
cve CVE-2023-53635
commit-author Tzung-Bi Shih <[email protected]>
commit 73db1b8

(struct nf_conn)->timeout is an interval before the conntrack
confirmed.  After confirmed, it becomes a timestamp.

It is observed that timeout of an unconfirmed conntrack:
- Set by calling ctnetlink_change_timeout(). As a result,
  `nfct_time_stamp` was wrongly added to `ct->timeout` twice.
- Get by calling ctnetlink_dump_timeout(). As a result,
  `nfct_time_stamp` was wrongly subtracted.

Call Trace:
 <TASK>
 dump_stack_lvl
 ctnetlink_dump_timeout
 __ctnetlink_glue_build
 ctnetlink_glue_build
 __nfqnl_enqueue_packet
 nf_queue
 nf_hook_slow
 ip_mc_output
 ? __pfx_ip_finish_output
 ip_send_skb
 ? __pfx_dst_output
 udp_send_skb
 udp_sendmsg
 ? __pfx_ip_generic_getfrag
 sock_sendmsg

Separate the 2 cases in:
- Setting `ct->timeout` in __nf_ct_set_timeout().
- Getting `ct->timeout` in ctnetlink_dump_timeout().

Pablo appends:

Update ctnetlink to set up the timeout _after_ the IPS_CONFIRMED flag is
set on, otherwise conntrack creation via ctnetlink breaks.

Note that the problem described in this patch occurs since the
introduction of the nfnetlink_queue conntrack support, select a
sufficiently old Fixes: tag for -stable kernel to pick up this fix.

Fixes: a4b4766 ("netfilter: nfnetlink_queue: rename related to nfqueue attaching conntrack info")
	Signed-off-by: Tzung-Bi Shih <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 73db1b8)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit 9a32e98

The ->cleanup callback needs to be removed, this doesn't work anymore as
the transaction mutex is already released in the ->abort function.

Just do it after a successful validation pass, this either happens
from commit or abort phases where transaction mutex is held.

Fixes: f102d66 ("netfilter: nf_tables: use dedicated mutex to guard transactions")
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 9a32e98)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit e3c361b

nft_trans_FOO objects all share a common nft_trans base structure, but
trailing fields depend on the real object size. Access is only safe after
trans->msg_type check.

Check for rule type first.  Found by code inspection.

Fixes: 1a94e38 ("netfilter: nf_tables: add NFTA_RULE_ID attribute")
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit e3c361b)
	Signed-off-by: Marcin Wcisło <[email protected]>
…lper

jira VULN-430
cve-pre CVE-2023-4244
commit-author Tijs Van Buggenhout <[email protected]>
commit e1f543d

An nf_conntrack_helper from nf_conn_help may become NULL after DNAT.

Observed when TCP port 1720 (Q931_PORT), associated with h323 conntrack
helper, is DNAT'ed to another destination port (e.g. 1730), while
nfqueue is being used for final acceptance (e.g. snort).

This happenned after transition from kernel 4.14 to 5.10.161.

Workarounds:
 * keep the same port (1720) in DNAT
 * disable nfqueue
 * disable/unload h323 NAT helper

$ linux-5.10/scripts/decode_stacktrace.sh vmlinux < /tmp/kernel.log
BUG: kernel NULL pointer dereference, address: 0000000000000084
[..]
RIP: 0010:nf_conntrack_update (net/netfilter/nf_conntrack_core.c:2080 net/netfilter/nf_conntrack_core.c:2134) nf_conntrack
[..]
nfqnl_reinject (net/netfilter/nfnetlink_queue.c:237) nfnetlink_queue
nfqnl_recv_verdict (net/netfilter/nfnetlink_queue.c:1230) nfnetlink_queue
nfnetlink_rcv_msg (net/netfilter/nfnetlink.c:241) nfnetlink
[..]

Fixes: ee04805 ("netfilter: conntrack: make conntrack userspace helpers work again")
	Signed-off-by: Tijs Van Buggenhout <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit e1f543d)
	Signed-off-by: Marcin Wcisło <[email protected]>
…ft_dump_basechain_hook()

jira VULN-430
cve-pre CVE-2023-4244
commit-author Gavrilov Ilia <[email protected]>
commit bd05876
upstream-diff Used the cleanly applying 9.4 backport
  04580de

The nla_nest_start_noflag() function may fail and return NULL;
the return value needs to be checked.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: d54725c ("netfilter: nf_tables: support for multiple devices per netdev hook")
	Signed-off-by: Gavrilov Ilia <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit bd05876)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit a1a64a1

If caller reports ENOMEM, then stop iterating over the batch and send a
single netlink message to userspace to report OOM.

Fixes: cbb8125 ("netfilter: nfnetlink: deliver netlink errors on batch completion")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit a1a64a1)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit dc1c9fd

This reverts "netfilter: nf_tables: skip netdev events generated on netns removal".

The problem is that when a veth device is released, the veth release
callback will also queue the peer netns device for removal.

Its possible that the peer netns is also slated for removal.  In this
case, the device memory is already released before the pre_exit hook of
the peer netns runs:

BUG: KASAN: slab-use-after-free in nf_hook_entry_head+0x1b8/0x1d0
Read of size 8 at addr ffff88812c0124f0 by task kworker/u8:1/45
Workqueue: netns cleanup_net
Call Trace:
 nf_hook_entry_head+0x1b8/0x1d0
 __nf_unregister_net_hook+0x76/0x510
 nft_netdev_unregister_hooks+0xa0/0x220
 __nft_release_hook+0x184/0x490
 nf_tables_pre_exit_net+0x12f/0x1b0
 ..

Order is:
1. First netns is released, veth_dellink() queues peer netns device
   for removal
2. peer netns is queued for removal
3. peer netns device is released, unreg event is triggered
4. unreg event is ignored because netns is going down
5. pre_exit hook calls nft_netdev_unregister_hooks but device memory
   might be free'd already.

Fixes: 68a3765 ("netfilter: nf_tables: skip netdev events generated on netns removal")
	Signed-off-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit dc1c9fd)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-157645
cve CVE-2023-53566
commit-author Florian Westphal <[email protected]>
commit 61ae320

There is no guarantee that rb_prev() will not return NULL in nft_rbtree_gc_elem():

general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [ctrliq#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
 nft_add_set_elem+0x14b0/0x2990
  nf_tables_newsetelem+0x528/0xb30

Furthermore, there is a possible use-after-free while iterating,
'node' can be free'd so we need to cache the next value to use.

Fixes: c9e6978 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection")
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit 61ae320)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve-pre CVE-2023-4244
commit-author Kuniyuki Iwashima <[email protected]>
commit 24e2278

syzkaller found a repro that causes Hung Task [0] with ipset.  The repro
first creates an ipset and then tries to delete a large number of IPs
from the ipset concurrently:

  IPSET_ATTR_IPADDR_IPV4 : 172.20.20.187
  IPSET_ATTR_CIDR        : 2

The first deleting thread hogs a CPU with nfnl_lock(NFNL_SUBSYS_IPSET)
held, and other threads wait for it to be released.

Previously, the same issue existed in set->variant->uadt() that could run
so long under ip_set_lock(set).  Commit 5e29dc3 ("netfilter: ipset:
Rework long task execution when adding/deleting entries") tried to fix it,
but the issue still exists in the caller with another mutex.

While adding/deleting many IPs, we should release the CPU periodically to
prevent someone from abusing ipset to hang the system.

Note we need to increment the ipset's refcnt to prevent the ipset from
being destroyed while rescheduling.

[0]:
INFO: task syz-executor174:268 blocked for more than 143 seconds.
      Not tainted 6.4.0-rc1-00145-gba79e9a73284 ctrliq#1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor174 state:D stack:0     pid:268   ppid:260    flags:0x0000000d
Call trace:
 __switch_to+0x308/0x714 arch/arm64/kernel/process.c:556
 context_switch kernel/sched/core.c:5343 [inline]
 __schedule+0xd84/0x1648 kernel/sched/core.c:6669
 schedule+0xf0/0x214 kernel/sched/core.c:6745
 schedule_preempt_disabled+0x58/0xf0 kernel/sched/core.c:6804
 __mutex_lock_common kernel/locking/mutex.c:679 [inline]
 __mutex_lock+0x6fc/0xdb0 kernel/locking/mutex.c:747
 __mutex_lock_slowpath+0x14/0x20 kernel/locking/mutex.c:1035
 mutex_lock+0x98/0xf0 kernel/locking/mutex.c:286
 nfnl_lock net/netfilter/nfnetlink.c:98 [inline]
 nfnetlink_rcv_msg+0x480/0x70c net/netfilter/nfnetlink.c:295
 netlink_rcv_skb+0x1c0/0x350 net/netlink/af_netlink.c:2546
 nfnetlink_rcv+0x18c/0x199c net/netfilter/nfnetlink.c:658
 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
 netlink_unicast+0x664/0x8cc net/netlink/af_netlink.c:1365
 netlink_sendmsg+0x6d0/0xa4c net/netlink/af_netlink.c:1913
 sock_sendmsg_nosec net/socket.c:724 [inline]
 sock_sendmsg net/socket.c:747 [inline]
 ____sys_sendmsg+0x4b8/0x810 net/socket.c:2503
 ___sys_sendmsg net/socket.c:2557 [inline]
 __sys_sendmsg+0x1f8/0x2a4 net/socket.c:2586
 __do_sys_sendmsg net/socket.c:2595 [inline]
 __se_sys_sendmsg net/socket.c:2593 [inline]
 __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2593
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x84/0x270 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x134/0x24c arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193
 el0_svc+0x2c/0x7c arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591

	Reported-by: syzkaller <[email protected]>
Fixes: a7b4f98 ("netfilter: ipset: IP set core support")
	Signed-off-by: Kuniyuki Iwashima <[email protected]>
	Acked-by: Jozsef Kadlecsik <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 24e2278)
	Signed-off-by: Marcin Wcisło <[email protected]>
pvts-mat and others added 20 commits November 4, 2025 21:48
jira VULN-430
cve CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit 8e51830

Don't queue more gc work, else we may queue the same elements multiple
times.

If an element is flagged as dead, this can mean that either the previous
gc request was invalidated/discarded by a transaction or that the previous
request is still pending in the system work queue.

The latter will happen if the gc interval is set to a very low value,
e.g. 1ms, and system work queue is backlogged.

The sets refcount is 1 if no previous gc requeusts are queued, so add
a helper for this and skip gc run if old requests are pending.

Add a helper for this and skip the gc run in this case.

Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Signed-off-by: Florian Westphal <[email protected]>
	Reviewed-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 8e51830)
	Signed-off-by: Marcin Wcisło <[email protected]>
…saction

jira VULN-158866
cve CVE-2023-52433
commit-author Pablo Neira Ayuso <[email protected]>
commit 2ee52ae

New elements in this transaction might expired before such transaction
ends. Skip sync GC for such elements otherwise commit path might walk
over an already released object. Once transaction is finished, async GC
will collect such expired element.

Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit 2ee52ae)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-34732
cve CVE-2023-5197
commit-author Pablo Neira Ayuso <[email protected]>
commit f15f29f
upstream-diff Used the cleanly applying 9.4 backport
  29530d2

Chain binding only requires the rule addition/insertion command within
the same transaction. Removal of rules from chain bindings within the
same transaction makes no sense, userspace does not utilize this
feature. Replace nft_chain_is_bound() check to nft_chain_binding() in
rule deletion commands. Replace command implies a rule deletion, reject
this command too.

Rule flush command can also safely rely on this nft_chain_binding()
check because unbound chains are not allowed since 62e1e94
("netfilter: nf_tables: reject unbound chain set before commit phase").

Fixes: d0e2c7d ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
	Reported-by: Kevin Rich <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit f15f29f)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 4a9e12e

pipapo needs to enqueue GC transactions for catchall elements through
nft_trans_gc_queue_sync(). Add nft_trans_gc_catchall_sync() and
nft_trans_gc_catchall_async() to handle GC transaction queueing
accordingly.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 4a9e12e)
	Signed-off-by: Marcin Wcisło <[email protected]>
…tion

jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 96b3330

rbtree GC does not modify the datastructure, instead it collects expired
elements and it enqueues a GC transaction. Use a read spinlock instead
to avoid data contention while GC worker is running.

Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 96b3330)
	Signed-off-by: Marcin Wcisło <[email protected]>
…tion fails

jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 6d365ea

nft_trans_gc_queue_sync() enqueues the GC transaction and it allocates a
new one. If this allocation fails, then stop this GC sync run and retry
later.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 6d365ea)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit b079155

Skip GC run if iterator rewinds to the beginning with EAGAIN, otherwise GC
might collect the same element more than once.

Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit b079155)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 23a3bfd

Anonymous sets need to be populated once at creation and then they are
bound to rule since 938154b ("netfilter: nf_tables: reject unbound
anonymous set before commit phase"), otherwise transaction reports
EINVAL.

Userspace does not need to delete elements of anonymous sets that are
not yet bound, reject this with EOPNOTSUPP.

From flush command path, skip anonymous sets, they are expected to be
bound already. Otherwise, EINVAL is hit at the end of this transaction
for unbound sets.

Fixes: 9651851 ("netfilter: add nftables")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 23a3bfd)
	Signed-off-by: Marcin Wcisło <[email protected]>
…once

jira VULN-430
cve CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit c9bd265

nft -f -<<EOF
add table ip t
add table ip t { flags dormant; }
add chain ip t c { type filter hook input priority 0; }
add table ip t
EOF

Triggers a splat from nf core on next table delete because we lose
track of right hook register state:

WARNING: CPU: 2 PID: 1597 at net/netfilter/core.c:501 __nf_unregister_net_hook
RIP: 0010:__nf_unregister_net_hook+0x41b/0x570
 nf_unregister_net_hook+0xb4/0xf0
 __nf_tables_unregister_hook+0x160/0x1d0
[..]

The above should have table in *active* state, but in fact no
hooks were registered.

Reject on/off/on games rather than attempting to fix this.

Fixes: 179d9ba ("netfilter: nf_tables: fix table flag updates")
	Reported-by: "Lee, Cherie-Anne" <[email protected]>
	Cc: Bing-Jhong Billy Jheng <[email protected]>
	Cc: [email protected]
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit c9bd265)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-598
cve CVE-2023-52581
commit-author Florian Westphal <[email protected]>
commit cf5000a

When more than 255 elements expired we're supposed to switch to a new gc
container structure.

This never happens: u8 type will wrap before reaching the boundary
and nft_trans_gc_space() always returns true.

This means we recycle the initial gc container structure and
lose track of the elements that came before.

While at it, don't deref 'gc' after we've passed it to call_rcu.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
	Reported-by: Pablo Neira Ayuso <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit cf5000a)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit 0873882

nft_rbtree_gc_elem() walks back and removes the end interval element that
comes before the expired element.

There is a small chance that we've cached this element as 'rbe_ge'.
If this happens, we hold and test a pointer that has been queued for
freeing.

It also causes spurious insertion failures:

$ cat test-testcases-sets-0044interval_overlap_0.1/testout.log
Error: Could not process rule: File exists
add element t s {  0 -  2 }
                   ^^^^^^
Failed to insert  0 -  2 given:
table ip t {
        set s {
                type inet_service
                flags interval,timeout
                timeout 2s
                gc-interval 2s
        }
}

The set (rbtree) is empty. The 'failure' doesn't happen on next attempt.

Reason is that when we try to insert, the tree may hold an expired
element that collides with the range we're adding.
While we do evict/erase this element, we can trip over this check:

if (rbe_ge && nft_rbtree_interval_end(rbe_ge) && nft_rbtree_interval_end(new))
      return -ENOTEMPTY;

rbe_ge was erased by the synchronous gc, we should not have done this
check.  Next attempt won't find it, so retry results in successful
insertion.

Restart in-kernel to avoid such spurious errors.

Such restart are rare, unless userspace intentionally adds very large
numbers of elements with very short timeouts while setting a huge
gc interval.

Even in this case, this cannot loop forever, on each retry an existing
element has been removed.

As the caller is holding the transaction mutex, its impossible
for a second entity to add more expiring elements to the tree.

After this it also becomes feasible to remove the async gc worker
and perform all garbage collection from the commit path.

Fixes: c9e6978 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection")
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit 0873882)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Florian Westphal <[email protected]>
commit d2fd2e4
upstream-diff There is no upstream commit to diff with. Picked directly
  from RH's branch. See message below for details.

JIRA: https://issues.redhat.com/browse/RHEL-1720
JIRA: https://issues.redhat.com/browse/RHEL-1721
Upstream Status: RHEL only

RHEL only.  Proposed upstream but was rejected.
I don't think we can force a rebase of nftables userland
in RHEL <= 9.4.  Even if we can do this, we would still need
this change for z-stream.

This change SHOULD NOT be forwarded into versions later than
RHEL 9.4. For those releases nftables userspace should be updated
to release 1.0.7 or later instead.

nftables versions prior to
commit 3975430b12d9 ("src: expand table command before evaluation"), i.e.
1.0.6 and earlier, will handle the following snippet in the wrong order:

table ip t {
	chain c {
		jump { counter; }
	}
}

1. create the table, chain,c and an anon chain.
2. append a rule to chain c to jump to the anon chain.
3. append the rule(s) (here: "counter") to the anon chain.

(step 3 should be before 2).

With below commit, this is now rejected by the kernel.

Reason is that the 'jump {' rule added to chain c adds an explicit binding
(dependency), i.e. the kernel will automatically remove the anon chain when
userspace later asks to delete the 'jump {' rule from chain c.

This caused crashes in the kernel in case of a errors further down
in the same transaction.

The abort part has to unroll all pending changes, including the request to
add the rule 'jump {'.  As its already bound, all the rules added to it
get deleted as well.

Because we tolerated late-add-after-bind, the transaction log also contains
the NEWRULE requests (here "counter"), so those were deleted again.

Instead of rejecting newrule-to-bound-chain, allow it iff the anon chain
is new in this transaction and we are appending.

Mark the newrule transaction as already_bound so abort path skips them.

Fixes: 0ebc106 ("netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID")
	Reported-by: Timo Sigurdsson <[email protected]>
Closes: https://lore.kernel.org/netfilter-devel/[email protected]/
	Signed-off-by: Florian Westphal <[email protected]>

	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit d2fd2e4)
	Signed-off-by: Marcin Wcisło <[email protected]>
…lush

jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 26cec9d

Use the element object that is already offered instead.

	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 26cec9d)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 6509a2e

.flush is always successful since this results from iterating over the
set elements to toggle mark the element as inactive in the next
generation.

	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 6509a2e)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 9dad402
upstream-diff Context conflict with the cve fix
  5d4bb57 (wrong application order).

Add placeholder structure and place it at the beginning of each struct
nft_*_elem for each existing set backend, instead of exposing elements
as void type to the frontend which defeats compiler type checks. Use
this pointer to this new type to replace void *.

This patch updates the following set backend API to use this new struct
nft_elem_priv placeholder structure:

- update
- deactivate
- flush
- get

as well as the following helper functions:

- nft_set_elem_ext()
- nft_set_elem_init()
- nft_set_elem_destroy()
- nf_tables_set_elem_destroy()

This patch adds nft_elem_priv_cast() to cast struct nft_elem_priv to
native element representation from the corresponding set backend.
BUILD_BUG_ON() makes sure this .priv placeholder is always at the top
of the opaque set element representation.

	Suggested-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 9dad402)
	Signed-off-by: Marcin Wcisło <[email protected]>
cve CVE-2023-6111
commit-author Pablo Neira Ayuso <[email protected]>
commit 93995bf

The expired catchall element is not deactivated and removed from GC sync
path. This path holds mutex so just call nft_setelem_data_deactivate()
and nft_setelem_catchall_remove() before queueing the GC work.

Fixes: 4a9e12e ("netfilter: nft_set_pipapo: call nft_trans_gc_queue_sync() in catchall GC")
	Reported-by: lonial con <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 93995bf)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-430
cve CVE-2023-4244
commit-author Pablo Neira Ayuso <[email protected]>
commit 8837ba3

list_for_each_entry_safe() does not work for the async case which runs
under RCU, therefore, split GC logic for catchall in two functions
instead, one for each of the sync and async GC variants.

The catchall sync GC variant never sees a _DEAD bit set on ever, thus,
this handling is removed in such case, moreover, allocate GC sync batch
via GFP_KERNEL.

Fixes: 93995bf ("netfilter: nf_tables: remove catchall element in GC sync path")
	Reported-by: Florian Westphal <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 8837ba3)
	Signed-off-by: Marcin Wcisło <[email protected]>
…_entry()

jira VULN-430
cve-bf CVE-2023-4244
commit-author Ilya Leoshkevich <[email protected]>
commit 837723b

bpf_nf testcase fails on s390x: bpf_skb_ct_lookup() cannot find the entry
that was added by bpf_ct_insert_entry() within the same BPF function.

The reason is that this entry is deleted by nf_ct_gc_expired().

The CT timeout starts ticking after the CT confirmation; therefore
nf_conn.timeout is initially set to the timeout value, and
__nf_conntrack_confirm() sets it to the deadline value.

bpf_ct_insert_entry() sets IPS_CONFIRMED_BIT, but does not adjust the
timeout, making its value meaningless and causing false positives.

Fix the problem by making bpf_ct_insert_entry() adjust the timeout,
like __nf_conntrack_confirm().

Fixes: 2cdaa3e ("netfilter: conntrack: restore IPS_CONFIRMED out of nf_conntrack_hash_check_insert()")
	Signed-off-by: Ilya Leoshkevich <[email protected]>
	Signed-off-by: Daniel Borkmann <[email protected]>
	Cc: Florian Westphal <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
	Signed-off-by: Alexei Starovoitov <[email protected]>
(cherry picked from commit 837723b)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-34700
cve CVE-2023-42756
commit-author Jozsef Kadlecsik <[email protected]>
commit 7433b6d

Kyle Zeng reported that there is a race between IPSET_CMD_ADD and IPSET_CMD_SWAP
in netfilter/ip_set, which can lead to the invocation of `__ip_set_put` on a
wrong `set`, triggering the `BUG_ON(set->ref == 0);` check in it.

The race is caused by using the wrong reference counter, i.e. the ref counter instead
of ref_netlink.

Fixes: 24e2278 ("netfilter: ipset: Add schedule point in call_ad().")
	Reported-by: Kyle Zeng <[email protected]>
Closes: https://lore.kernel.org/netfilter-devel/ZPZqetxOmH+w%2Fmyc@westworld/#r
	Tested-by: Kyle Zeng <[email protected]>
	Signed-off-by: Jozsef Kadlecsik <[email protected]>
	Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit 7433b6d)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-8184
cve CVE-2024-26581
commit-author Pablo Neira Ayuso <[email protected]>
commit 60c0c23

rbtree lazy gc on insert might collect an end interval element that has
been just added in this transactions, skip end interval elements that
are not yet active.

Fixes: f718863 ("netfilter: nft_set_rbtree: fix overlap expiration walk")
	Cc: [email protected]
	Reported-by: lonial con <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 60c0c23)
	Signed-off-by: Marcin Wcisło <[email protected]>
@bmastbergen
Copy link
Collaborator

@pvts-mat I know this is still in draft, but wanted to upload the output from our upstream bug and cve checker script. Most of the CVE-NOTFOUND can be ignored because our script only looks for CVEs in the kernel's vulns database, so CVE prior to that will show up as not found. I think that applies to a lot of the CVE in this PR. There is one CVE-MISMATCH that you might want to double-check. There is one NOTFOUND which means the script couldn't find the backported sha in the mainline kernel. And there are a handful of FIXES where there are upstream bugfixes for the backported commit that we may want to take a look at. Thanks for the work on this. I know it wasn't straightforward!

um ~/ciq/kernel-src-tree-tools
 % python ./check_kernel_commits.py --repo ~/ciq/kernel-src-tree --pr_branch pvts-mat/ciqlts9_2-CVE-batch-10 --base_branch origin/ciqlts9_2 --check-cves
[CVE-NOTFOUND] PR commit 709f6c7b4aca (netfilter: ctnetlink: fix possible
               refcount leak in ctnetlink_create_conntrack()) references
               CVE-2023-7192 but upstream commit ac4893980bbe has no CVE
               assigned

[FIXES] PR commit 0787373ebc4d (netfilter: conntrack: fix wrong ct->timeout
        value) references upstream commit 73db1b8f2bb6, which has Fixes tags:

    8d1c91850d06 selftests: netfilter: Ignore tainted kernels in interface stress test (Phil Sutter)
    6da5f1b4b4a0 selftests: netfilter: Fix skip of wildcard interface test (Phil Sutter)

[FIXES] PR commit 6ae8fd31e0a9 (netfilter: nf_tables: Introduce
        NFT_MSG_GETRULE_RESET) references upstream commit 8daa8fde3fc3, which
        has Fixes tags:

    ea078ae9108e netfilter: nf_tables: Audit log rule reset (Phil Sutter)

[FIXES] PR commit a4771f950250 (netfilter: nf_tables: add support to destroy
        operation) references upstream commit f80a612dd77c, which has Fixes
        tags:

    a7d5a955bfa8 netfilter: nf_tables: bogus ENOENT when destroying element which does not exist (Pablo Neira Ayuso)

[FIXES] PR commit b39b3ba76ed5 (netfilter: nf_tables: Introduce
        NFT_MSG_GETSETELEM_RESET) references upstream commit 079cd633219d, which
        has Fixes tags:

    4c90bba60c26 netfilter: nf_tables: do not refresh timeout when resetting element (Pablo Neira Ayuso)
    7e9be1124dbe netfilter: nf_tables: Audit log setelem reset (Phil Sutter)

[FIXES] PR commit dfc61266e1a1 (netfilter: nf_tables: integrate pipapo into
        commit protocol) references upstream commit 212ed75dc5fb, which has
        Fixes tags:

    ebd032fa8818 netfilter: nf_tables: do not remove elements if set backend implements .abort (Pablo Neira Ayuso)

[FIXES] PR commit ba24727bdd7b (netfilter: nft_set_pipapo: .walk does not deal
        with generations) references upstream commit 2b84e215f874, which has
        Fixes tags:

    29b359cf6d95 netfilter: nft_set_pipapo: walk over current view on netlink dump (Pablo Neira Ayuso) (CVE-2024-27017)

[FIXES] PR commit 70c31adf2efe (netfilter: nf_tables: drop map element
        references from preparation phase) references upstream commit
        628bd3e49cba, which has Fixes tags:

    e79b47a8615d netfilter: nf_tables: restore set elements when delete set fails (Pablo Neira Ayuso) (CVE-2024-27012)

[FIXES] PR commit 66663eb40599 (netfilter: nf_tables: GC transaction API to
        avoid race with control plane) references upstream commit 5f68718b34a5,
        which has Fixes tags:

    6b1ca88e4bb6 netfilter: nf_tables: skip dead set elements in netlink dump (Pablo Neira Ayuso)
    08e4c8c5919f netfilter: nf_tables: mark newset as dead on transaction abort (Florian Westphal)
    7315dc1e122c netfilter: nf_tables: skip set commit for deleted/destroyed sets (Pablo Neira Ayuso)

[CVE-NOTFOUND] PR commit 66663eb40599 (netfilter: nf_tables: GC transaction API
               to avoid race with control plane) references CVE-2023-4244 but
               upstream commit 5f68718b34a5 has no CVE assigned

[CVE-NOTFOUND] PR commit 37541a7ea34a (netfilter: nf_tables: skip immediate
               deactivate in _PREPARE_ERROR) references CVE-2023-4015 but
               upstream commit 0a771f7b266b has no CVE assigned

[FIXES] PR commit 893218018f7d (netfilter: nf_tables: adapt set backend to use
        GC transaction API) references upstream commit f6c383b8c31a, which has
        Fixes tags:

    7ffc7481153b netfilter: nft_set_hash: skip duplicated elements pending gc run (Pablo Neira Ayuso)
    ffb40fba4045 netfilter: nft_set_pipapo: prefer gfp_kernel allocation (Florian Westphal)

[CVE-NOTFOUND] PR commit 5176fe9324d3 (netfilter: nft_set_hash: mark set element
               as dead when deleting from packet path) references CVE-2023-4244
               but upstream commit c92db3030492 has no CVE assigned

[CVE-NOTFOUND] PR commit ca6e9cf81866 (netfilter: nf_tables: remove busy mark
               and gc batch API) references CVE-2023-4244 but upstream commit
               a2dd0233cbc4 has no CVE assigned

[CVE-NOTFOUND] PR commit a0a91f71d3ea (netfilter: nf_tables: fix false-positive
               lockdep splat) references CVE-2023-4244 but upstream commit
               b9f052dc68f6 has no CVE assigned

[CVE-NOTFOUND] PR commit fa956eac85fe (netfilter: nf_tables: fix kdoc warnings
               after gc rework) references CVE-2023-4244 but upstream commit
               08713cb006b6 has no CVE assigned

[CVE-NOTFOUND] PR commit 136a919f3426 (netfilter: nf_tables: deactivate catchall
               elements in next generation) references CVE-2023-4569 but
               upstream commit 90e5b3462efa has no CVE assigned

[CVE-NOTFOUND] PR commit ca02f6eceafa (netfilter: nf_tables: fix GC transaction
               races with netns and netlink event exit path) references
               CVE-2023-4244 but upstream commit 6a33d8b73dfa has no CVE
               assigned

[CVE-NOTFOUND] PR commit 819d0ed978bd (netfilter: nf_tables: GC transaction race
               with netns dismantle) references CVE-2023-4244 but upstream
               commit 02c6c24402bf has no CVE assigned

[CVE-NOTFOUND] PR commit f6014c33da88 (netfilter: nft_dynset: disallow object
               maps) references CVE-2023-4244 but upstream commit 23185c6aed1f
               has no CVE assigned

[FIXES] PR commit 63df5313037e (netfilter: nf_tables: flush pending destroy work
        before netlink notifier) references upstream commit 2c9f0293280e, which
        has Fixes tags:

    9f6958ba2e90 netfilter: nf_tables: unconditionally flush pending work before notifier (Florian Westphal) (CVE-2024-42109)

[CVE-NOTFOUND] PR commit 63df5313037e (netfilter: nf_tables: flush pending
               destroy work before netlink notifier) references CVE-2023-4244
               but upstream commit 2c9f0293280e has no CVE assigned

[CVE-NOTFOUND] PR commit 9ef4dc2d09ef (netfilter: nf_tables: GC transaction race
               with abort path) references CVE-2023-4244 but upstream commit
               720344340fb9 has no CVE assigned

[CVE-NOTFOUND] PR commit 4572356c3106 (netfilter: nf_tables: use correct lock to
               protect gc_list) references CVE-2023-4244 but upstream commit
               8357bc946a2a has no CVE assigned

[CVE-NOTFOUND] PR commit 3313a980222c (netfilter: nf_tables: fix out of memory
               error handling) references CVE-2023-4244 but upstream commit
               5e1be4cdc98c has no CVE assigned

[CVE-NOTFOUND] PR commit 9744f3c822e0 (netfilter: nf_tables: defer gc run if
               previous batch is still pending) references CVE-2023-4244 but
               upstream commit 8e51830e29e1 has no CVE assigned

[CVE-NOTFOUND] PR commit 89d6ab215ddc (netfilter: nf_tables: disallow rule
               removal from chain binding) references CVE-2023-5197 but upstream
               commit f15f29fd4779 has no CVE assigned

[CVE-NOTFOUND] PR commit e7ebc3994570 (netfilter: nft_set_pipapo: call
               nft_trans_gc_queue_sync() in catchall GC) references
               CVE-2023-4244 but upstream commit 4a9e12ea7e70 has no CVE
               assigned

[CVE-NOTFOUND] PR commit fd09e77c27ef (netfilter: nft_set_rbtree: use read
               spinlock to avoid datapath contention) references CVE-2023-4244
               but upstream commit 96b33300fba8 has no CVE assigned

[CVE-NOTFOUND] PR commit 7bb17203c3ed (netfilter: nft_set_pipapo: stop GC
               iteration if GC transaction allocation fails) references
               CVE-2023-4244 but upstream commit 6d365eabce3c has no CVE
               assigned

[CVE-NOTFOUND] PR commit b5c6baaa7eff (netfilter: nft_set_hash: try later when
               GC hits EAGAIN on iteration) references CVE-2023-4244 but
               upstream commit b079155faae9 has no CVE assigned

[CVE-NOTFOUND] PR commit 80b94426191a (netfilter: nf_tables: disallow element
               removal on anonymous sets) references CVE-2023-4244 but upstream
               commit 23a3bfd4ba7a has no CVE assigned

[CVE-NOTFOUND] PR commit 29b8b9a29b52 (netfilter: nf_tables: disable toggling
               dormant table state more than once) references CVE-2023-4244 but
               upstream commit c9bd26513b3a has no CVE assigned

[CVE-NOTFOUND] PR commit 66a1d3cb56fd (netfilter: nf_tables: nft_set_rbtree: fix
               spurious insertion failure) references CVE-2023-4244 but upstream
               commit 087388278e0f has no CVE assigned

[NOTFOUND] PR commit 172173807588 (netfilter: nf_tables: work around newrule
           after chain binding) references upstream commit d2fd2e46cb93, which
           does not exist in kernel-mainline.

[CVE-NOTFOUND] PR commit 7c0a2d993e49 (netfilter: nft_set_pipapo: no need to
               call pipapo_deactivate() from flush) references CVE-2023-4244 but
               upstream commit 26cec9d4144e has no CVE assigned

[CVE-NOTFOUND] PR commit f21727c8efaf (netfilter: nf_tables: set backend .flush
               always succeeds) references CVE-2023-4244 but upstream commit
               6509a2e410c3 has no CVE assigned

[FIXES] PR commit a35dbfa4febc (netfilter: nf_tables: expose opaque set element
        as struct nft_elem_priv) references upstream commit 9dad402b89e8, which
        has Fixes tags:

    ab0beafd52b9 netfilter: nft_set_pipapo: remove static in nft_pipapo_get() (Pablo Neira Ayuso)

[CVE-NOTFOUND] PR commit a35dbfa4febc (netfilter: nf_tables: expose opaque set
               element as struct nft_elem_priv) references CVE-2023-4244 but
               upstream commit 9dad402b89e8 has no CVE assigned

[CVE-NOTFOUND] PR commit 1b3a51cda6b2 (netfilter: nf_tables: remove catchall
               element in GC sync path) references CVE-2023-6111 but upstream
               commit 93995bf4af2c has no CVE assigned

[CVE-NOTFOUND] PR commit e774e891da6d (netfilter: nf_tables: split async and
               sync catchall in two functions) references CVE-2023-4244 but
               upstream commit 8837ba3e58ea has no CVE assigned

[CVE-NOTFOUND] PR commit b301e6dcf14d (netfilter: ipset: Fix race between
               IPSET_CMD_CREATE and IPSET_CMD_SWAP) references CVE-2023-42756
               but upstream commit 7433b6d2afd5 has no CVE assigned

[CVE-MISMATCH] PR commit ba0c0487c82b (netfilter: nf_tables: mark set as dead
               when unbinding anonymous set with timeout) references
               CVE-2024-26581 but upstream commit 552705a3650b is associated
               with CVE-2024-26643


@bmastbergen
Copy link
Collaborator

As you mentioned in the PR summary and we've discussed in slack, for the moment this PR seems large enough and pulling in the bugfixes above would only make it bigger. I'm ok with kicking the bugfixes down the road to a future PR.

@bmastbergen
Copy link
Collaborator

1721738

This commit is the 'NOTFOUND' and you've made that clear in the commit message. But I wonder if we even want to reference the commit sha at all since it isn't an upstream commit. Right @PlaidCat ?

@pvts-mat
Copy link
Contributor Author

pvts-mat commented Nov 6, 2025

@pvts-mat I know this is still in draft, but wanted to upload the output from our upstream bug and cve checker script.

Thanks, that's exactly why I put it out there instead of drafting it locally, there's a lot to look into here, I wanted to have the discussion rolling.

Let me address the logs, I'll start with [CVE-NOTFOUND]:

  • Almost 3/4 of the messages refer to CVE-2023-4244 being slapped on commits which aren't formally associated with that CVE but were marked as such simply for the lack of better idea how to describe commits which don't address CVE-2023-4244 directly, but are nevertheless part of its solution. And not all of them could be cve-pre <cve> or cve-bf <cve> for some <cve>. It's a direct consequence of the tagging policy (see the "Tagging policy" section in the PR) - that's why I asked about it on slack. Personally I think what would make most logical sense would be to have them without any cve BUT with the CVE-2023-4244-associated jira VULN-430 property in place. I don't know what makes the most sense from the repo maintanance perspective though.
  • Other two instances of CVE-2023-4244 complaining may be due to the fact that the often cited commit associated with CVE-2023-4244 is 3e91b0e, which is a merge commit for an upstream branch addressing this fix. The whole branch was backported, but not the merge branch commit itself, obviously.
  • For the rest of CVEs I checked also other sources than https://kernel.dance/ which I used primarily for finding the associations and confirmed that the associated commits are correct.

Here's the detailed breakdown:

PR cve upstream Reason for tagging A bit deeper dive
709f6c7 CVE-2023-7192 ac48939 Assigned, according to https://kernel.dance/#ac4893980bbe https://access.redhat.com/security/cve/cve-2023-7192: "https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=ac4893980bbe79ce383daf9a0885666a30fe4c83"
66663eb CVE-2023-4244 5f68718 Assigned, according to https://kernel.dance/#5f68718b34a5 Merge commit 3e91b0e?
37541a7 CVE-2023-4015 0a771f7 Assigned, according to https://kernel.dance/#0a771f7b266b https://www.cve.org/CVERecord?id=CVE-2023-4015: "We recommend upgrading past commit 0a771f7"
5176fe9 CVE-2023-4244 c92db30 Tagging policy -
ca6e9cf CVE-2023-4244 a2dd023 Tagging policy -
a0a91f7 CVE-2023-4244 b9f052d Tagging policy -
fa956ea CVE-2023-4244 08713cb Tagging policy -
136a919 CVE-2023-4569 90e5b34 Assigned, according to https://kernel.dance/#90e5b3462efa https://www.cve.org/CVERecord?id=CVE-2023-4569: "https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/"
ca02f6e CVE-2023-4244 6a33d8b Assigned, according to https://kernel.dance/#6a33d8b73dfa Merge commit 3e91b0e?
819d0ed CVE-2023-4244 02c6c24 Tagging policy -
f6014c3 CVE-2023-4244 23185c6 Tagging policy -
63df531 CVE-2023-4244 2c9f029 Tagging policy -
9ef4dc2 CVE-2023-4244 7203443 Tagging policy -
4572356 CVE-2023-4244 8357bc9 Tagging policy -
3313a98 CVE-2023-4244 5e1be4c Tagging policy -
9744f3c CVE-2023-4244 8e51830 Tagging policy -
89d6ab2 CVE-2023-5197 f15f29f Assigned, according to https://kernel.dance/#f15f29fd4779 https://www.cve.org/CVERecord?id=CVE-2023-5197: "We recommend upgrading past commit f15f29f."
e7ebc39 CVE-2023-4244 4a9e12e Tagging policy -
fd09e77 CVE-2023-4244 96b3330 Tagging policy -
7bb1720 CVE-2023-4244 6d365ea Tagging policy -
b5c6baa CVE-2023-4244 b079155 Tagging policy -
80b9442 CVE-2023-4244 23a3bfd Tagging policy -
29b8b9a CVE-2023-4244 c9bd265 Tagging policy -
66a1d3c CVE-2023-4244 0873882 Tagging policy -
7c0a2d9 CVE-2023-4244 26cec9d Tagging policy -
f21727c CVE-2023-4244 6509a2e Tagging policy -
a35dbfa CVE-2023-4244 9dad402 Tagging policy -
1b3a51c CVE-2023-6111 93995bf Assigned, according to https://kernel.dance/#93995bf4af2c https://www.cve.org/CVERecord?id=CVE-2023-6111: "We recommend upgrading past commit 93995bf."
e774e89 CVE-2023-4244 8837ba3 Tagging policy -
b301e6d CVE-2023-42756 7433b6d Assigned, according to https://kernel.dance/#7433b6d2afd5 https://bugzilla.redhat.com/show_bug.cgi?id=2239848 "Upstream fix: torvalds/linux@7433b6d"

@pvts-mat
Copy link
Contributor Author

pvts-mat commented Nov 6, 2025

[CVE-MISMATCH]:

[CVE-MISMATCH] PR commit ba0c0487c82b (netfilter: nf_tables: mark set as dead
               when unbinding anonymous set with timeout) references
               CVE-2024-26581 but upstream commit 552705a3650b is associated
               with CVE-2024-26643

Yep, that one is wrong in the commit, and I have it correct in the PR so it must have been a cherry-picking mistake.
👍

…ith timeout

jira VULN-836
cve CVE-2024-26643
commit-author Pablo Neira Ayuso <[email protected]>
commit 552705a

While the rhashtable set gc runs asynchronously, a race allows it to
collect elements from anonymous sets with timeouts while it is being
released from the commit path.

Mingi Cho originally reported this issue in a different path in 6.1.x
with a pipapo set with low timeouts which is not possible upstream since
7395dfa ("netfilter: nf_tables: use timestamp to check for set
element timeout").

Fix this by setting on the dead flag for anonymous sets to skip async gc
in this case.

According to 08e4c8c ("netfilter: nf_tables: mark newset as dead on
transaction abort"), Florian plans to accelerate abort path by releasing
objects via workqueue, therefore, this sets on the dead flag for abort
path too.

	Cc: [email protected]
Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
	Reported-by: Mingi Cho <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 552705a)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-4906
cve-pre CVE-2024-26925
commit-author Pablo Neira Ayuso <[email protected]>
commit a45e688

Unlike early commit path stage which triggers a call to abort, an
explicit release of the batch is required on abort, otherwise mutex is
released and commit_list remains in place.

Add WARN_ON_ONCE to ensure commit_list is empty from the abort path
before releasing the mutex.

After this patch, commit_list is always assumed to be empty before
grabbing the mutex, therefore

  03c1f1e ("netfilter: Cleanup nft_net->module_list from nf_tables_exit_net()")

only needs to release the pending modules for registration.

	Cc: [email protected]
Fixes: c0391b6 ("netfilter: nf_tables: missing validation from the abort path")
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit a45e688)
	Signed-off-by: Marcin Wcisło <[email protected]>
jira VULN-4906
cve CVE-2024-26925
commit-author Pablo Neira Ayuso <[email protected]>
commit 0d459e2

The commit mutex should not be released during the critical section
between nft_gc_seq_begin() and nft_gc_seq_end(), otherwise, async GC
worker could collect expired objects and get the released commit lock
within the same GC sequence.

nf_tables_module_autoload() temporarily releases the mutex to load
module dependencies, then it goes back to replay the transaction again.
Move it at the end of the abort phase after nft_gc_seq_end() is called.

	Cc: [email protected]
Fixes: 7203443 ("netfilter: nf_tables: GC transaction race with abort path")
	Reported-by: Kuan-Ting Chen <[email protected]>
	Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit 0d459e2)
	Signed-off-by: Marcin Wcisło <[email protected]>
@pvts-mat pvts-mat force-pushed the ciqlts9_2-CVE-batch-10 branch from 2919917 to 520390b Compare November 6, 2025 20:34
@pvts-mat
Copy link
Contributor Author

pvts-mat commented Nov 6, 2025

[FIXES]

All the fixes reported are addressed in the Commits table in the PR. The Id number in the following table corresponds to the Id number there

Id Log
  PR commit 6ae8fd3 (…) references upstream commit 8daa8fd, which has Fixes tags:
17 ea078ae `netfilter: nf_tables: Audit log rule reset (Phil Sutter)`
  PR commit a4771f9 (…) references upstream commit f80a612, which has Fixes tags:
14 a7d5a95 `netfilter: nf_tables: bogus ENOENT when destroying element which does not exist (Pablo Neira Ayuso)`
  PR commit b39b3ba (…) references upstream commit 079cd63, which has Fixes tags:
15 4c90bba `netfilter: nf_tables: do not refresh timeout when resetting element (Pablo Neira Ayuso)`
18 7e9be11 `netfilter: nf_tables: Audit log setelem reset (Phil Sutter)`
  PR commit dfc6126 (…) references upstream commit 212ed75, which has Fixes tags:
16 ebd032f `netfilter: nf_tables: do not remove elements if set backend implements .abort (Pablo Neira Ayuso)`
  PR commit ba24727 (…) references upstream commit 2b84e21, which has Fixes tags:
8 29b359c `netfilter: nft_set_pipapo: walk over current view on netlink dump (Pablo Neira Ayuso) (CVE-2024-27017)`
  PR commit 70c31ad (…) references upstream commit 628bd3e, which has Fixes tags:
6 e79b47a `netfilter: nf_tables: restore set elements when delete set fails (Pablo Neira Ayuso) (CVE-2024-27012)`
  PR commit 66663eb (…) references upstream commit 5f68718, which has Fixes tags:
10 6b1ca88 `netfilter: nf_tables: skip dead set elements in netlink dump (Pablo Neira Ayuso)`
11 08e4c8c `netfilter: nf_tables: mark newset as dead on transaction abort (Florian Westphal)`
13 7315dc1 `nf_tables: skip set commit for deleted/destroyed sets (Pablo Neira Ayuso)`
  PR commit 8932180 (…) references upstream commit f6c383b, which has Fixes tags:
3 7ffc748 `netfilter: nft_set_hash: skip duplicated elements pending gc run (Pablo Neira Ayuso)`
12 ffb40fb `netfilter: nft_set_pipapo: prefer gfp_kernel allocation (Florian Westphal)`
  PR commit 63df531 (…) references upstream commit 2c9f029, which has Fixes tags:
5 9f6958b `netfilter: nf_tables: unconditionally flush pending work before notifier (Florian Westphal) (CVE-2024-42109)`
  PR commit a35dbfa (…) references upstream commit 9dad402, which has Fixes tags:
9 ab0beaf `netfilter: nft_set_pipapo: remove static in nft_pipapo_get() (Pablo Neira Ayuso)`

I'll explain the Commits table a bit more in case it's confusing.

Rows 1-19 list commits which are not in the PR, and neither they are in ciqlts9_2 history. They were included there specifically to show what needs to be done yet, but wasn't, for the reasons provided in the Comment column. Those fall roughly into two groups:

  • Not backported to 9.4: (9f6958b, 7ffc748, ab0beaf, 6b1ca88, ebd032f, e79b47a, 29b359c) Backporting them would go against the first guidance of this PR (see "Backporting strategy" section). It's not that they cannot or should not be backported just because they weren't for 9.4, but I wanted to focus first on what was backported to 9.4 to have this very useful point of reference untainted. If I mixed in some commits from outside of 9.4 I could get unnecessary conflicts in backporting other 9.4 branches in the future, which leads to the next point.

  • Associated branch is long: (08e4c8c, ffb40fb, 7315dc1, a7d5a95, 4c90bba, ea078ae, 7e9be11) This means that the fixing commits were part of a bigger patching efforts in 9.4, similarly to how the CVE-2023-4244 fixing commit 5f68718 was, and that it could make sense to backport them in whole as well (not necessarily, but possibly). At the same time those branches were relatively long and even analyzing them would not be a good idea given how much time this PR already took, let alone backporting them. The branches for each commit are identified in the B column, with details given in the Branches table. For the fixing commits in question there are two of them:

    1. f875124 netfilter: nf_tables: backports from upstream (16 commits, including 5 fixes for this PR)
    2. 3e3b830 audit: backport kernel audit enhancements and fixes up to upstream v6.6 (16 commits, including 2 fixes for this PR)

    I was planning to address them in the next PR, with the first branch being backported in full most probably, and the second one to be evaluated yet. They may also require some prerequisites and their own bugfixes, so they're worthy of a separate PR.

Then there are the 6da5f1b and 8d1c918 fixes for 73db1b8 mentioned in the script's log. I guess the SHA codes are truncated to less than 7 characters in the searches, because the "Fixes" commit referenced there isn't 73db1b8 actually, but 73db1b5. Funnily enough it's also netfilter. Well, almost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants