netfilter: nft_set_rbtree: fix null deref on element insertion
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c9e6978e2725a7d4b6cd23b2facd3f11422c0643 · < a337706c1fb35aac3f26b48aca80421bdbe1d33a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_set_rbtree: fix null deref on element insertion
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 [#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.
From the CVE record · Linux
The Linux kernel's netfilter nft_set_rbtree code can dereference a null pointer during element insertion. Its garbage-collection iteration also has a possible use-after-free. The input does not specify how an attacker could trigger these issues or whether access or user interaction is required.
Anyone running the Linux kernel should check whether their version is affected; affected versions are not specified.