Davide Ornaghi
ab185e0c4f
netfilter: nft_fib: fix stale stack leak via the OIFNAME register
...
For NFT_FIB_RESULT_OIFNAME the destination register is declared with
len = IFNAMSIZ (four 32-bit registers), but on the lookup-fail,
RTN_LOCAL and oif-mismatch paths nft_fib{4,6}_eval() only writes one
register via "*dest = 0". The remaining three registers are left as
whatever was on the stack in nft_do_chain()'s struct nft_regs, and a
downstream expression that loads the register span can leak that
uninitialised kernel stack to userspace.
The NFTA_FIB_F_PRESENT existence check has the same shape: it is only
meaningful for NFT_FIB_RESULT_OIF, yet it was accepted for any result type
while the eval stores a single byte via nft_reg_store8(), leaving the rest
of the declared span stale.
Fix both:
- replace the bare "*dest = 0" in the eval with nft_fib_store_result(),
which strscpy_pad()s the whole IFNAMSIZ for OIFNAME (and is already
used on the other early-return path), and
- restrict NFTA_FIB_F_PRESENT to NFT_FIB_RESULT_OIF and declare its
destination as a single u8, so the marked span matches the one byte
the eval writes.
Fixes: f6d0cbcf09 ("netfilter: nf_tables: add fib expression")
Suggested-by: Florian Westphal <fw@strlen.de >
Cc: stable@vger.kernel.org
Signed-off-by: Davide Ornaghi <d.ornaghi97@gmail.com >
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org >
2026-06-10 18:00:19 +02:00
..
2026-05-16 13:21:42 +02:00
2026-06-01 13:43:52 +02:00
2026-03-29 11:21:24 -07:00
2026-04-10 12:16:26 +02:00
2025-11-27 23:59:43 +00:00
2026-03-19 10:26:31 +01:00
2026-02-21 17:09:51 -08:00
2026-04-08 07:51:26 +02:00
2026-02-11 19:31:52 -08:00
2026-05-08 01:30:17 +02:00
2026-05-22 12:28:46 +02:00
2026-03-26 13:18:32 +01:00
2026-05-08 01:30:17 +02:00
2023-09-13 21:57:50 +02:00
2026-04-08 07:51:26 +02:00
2026-04-08 07:51:31 +02:00
2026-05-08 01:30:17 +02:00
2026-06-10 17:58:39 +02:00
2026-06-01 13:43:53 +02:00
2023-10-24 13:16:30 +02:00
2026-05-08 01:30:17 +02:00
2026-02-06 20:50:03 -08:00
2026-05-22 12:28:46 +02:00
2026-01-20 16:23:37 +01:00
2026-05-22 12:28:46 +02:00
2026-01-20 16:23:37 +01:00
2026-01-20 16:23:37 +01:00
2026-04-28 17:52:19 -07:00
2026-05-22 12:27:55 +02:00
2026-04-10 12:16:26 +02:00
2026-04-10 12:16:26 +02:00
2022-08-11 16:50:25 +02:00
2026-05-08 01:30:17 +02:00
2026-04-08 07:51:26 +02:00
2026-04-10 12:16:26 +02:00
2026-04-08 07:51:26 +02:00
2026-06-10 17:58:29 +02:00
2026-01-02 12:04:28 -08:00
2026-05-01 01:24:01 +02:00
2024-09-12 15:41:03 +02:00
2026-05-01 12:39:23 +02:00
2026-04-02 11:03:13 -07:00
2026-05-01 01:24:01 +02:00
2026-02-21 01:02:28 -08:00
2024-07-24 20:59:29 +02:00
2024-06-19 18:41:59 +02:00
2026-06-10 18:00:01 +02:00
2026-02-21 01:02:28 -08:00
2026-04-20 23:27:46 +02:00
2026-01-02 12:04:28 -08:00
2026-06-10 17:58:39 +02:00
2022-09-07 16:46:04 +02:00
2022-11-18 02:15:15 +01:00
2022-09-07 16:46:04 +02:00
2026-03-29 11:21:24 -07:00
2026-01-20 16:23:37 +01:00
2026-04-10 12:16:26 +02:00
2023-11-08 16:40:30 +01:00
2026-06-10 17:58:39 +02:00
2026-05-16 13:23:01 +02:00
2026-06-01 13:43:53 +02:00
2026-04-30 08:03:22 +02:00
2026-04-30 17:59:01 +02:00
2026-02-21 17:09:51 -08:00
2025-07-14 15:22:35 +02:00
2026-04-08 07:51:30 +02:00
2026-04-08 07:51:30 +02:00
2026-04-10 12:16:26 +02:00
2026-04-08 07:51:30 +02:00
2026-06-10 17:58:20 +02:00
2026-04-20 23:45:44 +02:00
2026-06-10 17:58:20 +02:00
2026-03-09 18:32:45 -07:00
2026-05-22 12:28:46 +02:00
2026-06-01 13:43:53 +02:00
2026-03-12 12:53:34 -07:00
2023-11-08 13:52:32 +01:00
2026-04-08 07:51:31 +02:00
2026-04-30 08:03:22 +02:00
2026-04-08 07:51:30 +02:00
2026-02-25 19:36:26 -08:00
2026-06-01 13:43:53 +02:00
2026-06-01 13:43:53 +02:00
2026-02-25 19:36:26 -08:00
2026-04-08 07:51:30 +02:00
2026-06-10 18:00:12 +02:00
2026-02-25 19:36:26 -08:00
2026-02-25 19:36:26 -08:00
2026-06-10 18:00:19 +02:00
2026-02-25 19:36:26 -08:00
2026-04-30 00:57:42 +02:00
2026-04-08 07:51:31 +02:00
2026-04-08 07:51:31 +02:00
2026-05-16 13:21:41 +02:00
2026-02-26 10:23:00 -08:00
2026-04-08 07:51:30 +02:00
2026-04-08 07:51:30 +02:00
2026-04-08 07:51:31 +02:00
2026-02-25 19:36:26 -08:00
2026-04-08 07:51:31 +02:00
2026-02-25 19:36:26 -08:00
2026-04-08 07:51:31 +02:00
2026-04-08 07:51:31 +02:00
2026-04-30 17:59:01 +02:00
2026-05-22 12:28:46 +02:00
2026-04-08 07:51:30 +02:00
2026-04-08 07:51:30 +02:00
2026-04-08 07:51:31 +02:00
2026-02-25 19:36:26 -08:00
2026-02-25 19:36:26 -08:00
2026-02-25 19:36:26 -08:00
2024-09-03 10:47:17 +02:00
2026-04-08 07:51:31 +02:00
2025-09-10 20:28:24 +02:00
2026-03-05 13:22:37 +01:00
2026-04-08 07:51:31 +02:00
2025-08-20 13:52:37 +02:00
2026-04-08 07:51:31 +02:00
2026-04-08 07:51:31 +02:00
2026-03-26 12:09:57 -07:00
2026-04-08 07:51:31 +02:00
2026-04-08 07:51:30 +02:00
2026-04-30 17:59:01 +02:00
2026-06-01 13:43:53 +02:00
2026-04-08 07:51:31 +02:00
2026-03-29 11:21:24 -07:00
2026-05-08 01:30:16 +02:00
2026-04-30 08:03:22 +02:00
2025-12-16 11:04:14 -05:00
2026-04-01 11:55:29 +02:00
2024-10-09 23:20:46 +02:00
2024-10-09 23:20:46 +02:00
2024-10-09 23:20:46 +02:00
2026-03-09 18:32:45 -07:00
2026-03-09 18:32:45 -07:00
2024-10-09 23:20:46 +02:00
2024-10-09 23:20:46 +02:00
2026-05-22 12:28:46 +02:00
2026-04-30 08:03:22 +02:00
2026-04-08 07:51:27 +02:00
2026-04-30 08:03:22 +02:00
2026-04-30 17:59:01 +02:00
2026-04-30 17:59:01 +02:00
2026-04-10 12:16:26 +02:00
2026-03-10 14:10:43 +01:00
2026-02-21 17:09:51 -08:00
2023-02-22 21:25:23 -08:00
2026-02-21 17:09:51 -08:00
2026-04-20 23:27:52 +02:00
2025-05-22 17:16:02 +02:00
2026-04-08 13:33:38 +02:00
2025-07-25 18:40:43 +02:00
2024-10-21 11:31:26 +02:00
2026-06-01 13:43:52 +02:00
2026-04-30 17:59:01 +02:00
2026-04-20 23:27:52 +02:00
2026-04-30 08:03:22 +02:00
2026-04-30 08:03:22 +02:00
2026-02-21 17:09:51 -08:00
2026-04-01 11:55:29 +02:00
2026-02-21 17:09:51 -08:00
2026-04-20 23:27:52 +02:00
2026-02-21 17:09:51 -08:00
2023-03-22 21:48:59 +01:00
2025-03-23 10:53:47 +01:00
2023-08-30 17:34:01 +02:00
2024-10-09 23:20:46 +02:00
2026-04-30 08:03:22 +02:00
2026-04-10 12:16:26 +02:00
2026-02-21 17:09:51 -08:00
2026-04-30 17:59:01 +02:00
2026-04-30 08:03:22 +02:00
2025-05-22 17:16:02 +02:00
2026-03-10 14:10:42 +01:00
2026-02-21 17:09:51 -08:00
2026-03-19 14:16:00 -07:00
2026-04-30 17:59:01 +02:00
2024-10-21 11:31:26 +02:00
2023-08-30 17:34:01 +02:00