Commit 4675fc2
committed
netfilter: nf_tables: use timestamp to check for set element timeout
jira VULN-7047
cve CVE-2024-27397
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 7395dfa
upstream-diff Significant code drift, fuzz, conflicts and every
other dumb thing cherry-pick can do while pulling something new
into something ancient. Tried to stay true to the
resf_kernel-4.18.0-553.8.1.el8_10 tagged code.
Add a timestamp field at the beginning of the transaction, store it
in the nftables per-netns area.
Update set backend .insert, .deactivate and sync gc path to use the
timestamp, this avoids that an element expires while control plane
transaction is still unfinished.
.lookup and .update, which are used from packet path, still use the
current time to check if the element has expired. And .get path and dump
also since this runs lockless under rcu read size lock. Then, there is
async gc which also needs to check the current time since it runs
asynchronously from a workqueue.
Fixes: c3e1b00 ("netfilter: nf_tables: add set element timeout support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 7395dfa)
Signed-off-by: Greg Rose <g.v.rose@ciq.com>
Conflicts:
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_set_pipapo.c
net/netfilter/nft_set_rbtree.c1 parent bfd71d8 commit 4675fc2
File tree
5 files changed
+47
-18
lines changed- include/net/netfilter
- net/netfilter
5 files changed
+47
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | | - | |
| 719 | + | |
| 720 | + | |
720 | 721 | | |
721 | 722 | | |
722 | | - | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
723 | 729 | | |
724 | 730 | | |
725 | 731 | | |
| |||
1534 | 1540 | | |
1535 | 1541 | | |
1536 | 1542 | | |
| 1543 | + | |
1537 | 1544 | | |
1538 | 1545 | | |
1539 | 1546 | | |
| |||
1544 | 1551 | | |
1545 | 1552 | | |
1546 | 1553 | | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1547 | 1559 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8643 | 8643 | | |
8644 | 8644 | | |
8645 | 8645 | | |
| 8646 | + | |
8646 | 8647 | | |
8647 | 8648 | | |
8648 | 8649 | | |
| 8650 | + | |
8649 | 8651 | | |
8650 | 8652 | | |
8651 | 8653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| |||
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
| 220 | + | |
215 | 221 | | |
216 | 222 | | |
217 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| 638 | + | |
638 | 639 | | |
639 | 640 | | |
640 | 641 | | |
| |||
644 | 645 | | |
645 | 646 | | |
646 | 647 | | |
647 | | - | |
| 648 | + | |
| 649 | + | |
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
| |||
704 | 706 | | |
705 | 707 | | |
706 | 708 | | |
707 | | - | |
| 709 | + | |
708 | 710 | | |
709 | 711 | | |
710 | 712 | | |
| |||
741 | 743 | | |
742 | 744 | | |
743 | 745 | | |
744 | | - | |
| 746 | + | |
745 | 747 | | |
746 | 748 | | |
747 | 749 | | |
| |||
1100 | 1102 | | |
1101 | 1103 | | |
1102 | 1104 | | |
| 1105 | + | |
1103 | 1106 | | |
1104 | 1107 | | |
1105 | 1108 | | |
1106 | | - | |
| 1109 | + | |
1107 | 1110 | | |
1108 | 1111 | | |
1109 | 1112 | | |
1110 | | - | |
| 1113 | + | |
1111 | 1114 | | |
1112 | 1115 | | |
1113 | 1116 | | |
| |||
1457 | 1460 | | |
1458 | 1461 | | |
1459 | 1462 | | |
| 1463 | + | |
1460 | 1464 | | |
1461 | 1465 | | |
1462 | 1466 | | |
| |||
1491 | 1495 | | |
1492 | 1496 | | |
1493 | 1497 | | |
1494 | | - | |
| 1498 | + | |
1495 | 1499 | | |
1496 | 1500 | | |
1497 | 1501 | | |
| |||
1662 | 1666 | | |
1663 | 1667 | | |
1664 | 1668 | | |
1665 | | - | |
| 1669 | + | |
1666 | 1670 | | |
1667 | 1671 | | |
1668 | 1672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
290 | | - | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
296 | | - | |
| 297 | + | |
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| |||
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
305 | | - | |
| 306 | + | |
306 | 307 | | |
307 | | - | |
| 308 | + | |
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
316 | | - | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
322 | 323 | | |
323 | | - | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
326 | | - | |
| 327 | + | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| |||
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
| |||
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
| 425 | + | |
| 426 | + | |
423 | 427 | | |
424 | 428 | | |
425 | 429 | | |
| |||
472 | 476 | | |
473 | 477 | | |
474 | 478 | | |
| 479 | + | |
475 | 480 | | |
476 | 481 | | |
477 | 482 | | |
| |||
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
513 | | - | |
| 518 | + | |
514 | 519 | | |
515 | 520 | | |
516 | 521 | | |
| |||
0 commit comments