Xiang Mei (Microsoft) and Pablo Neira Ayuso
39e88f28fb
netfilter: nft_payload: fix mask build for partial field offload
...
nft_payload_offload_mask() builds the offload match mask for a payload
expression that covers only part of a header field. For a partial IPv6
address match (field_len = 16, priv_len = 1) that shift is 1 << 120, which
is undefined on the 32-bit int operand. It also trims only one word, so
the remaining words stay 0xffffffff (and when priv_len is a multiple of 4
the trim is skipped entirely), leaving the mask covering more bytes than
the rule matches.
UBSAN: shift-out-of-bounds in net/netfilter/nft_payload.c:278:20
shift exponent 120 is too large for 32-bit type 'int'
...
The match is byte-granular and struct nft_data is zero-initialised, so the
correct mask is simply the first priv_len bytes set to 0xff. Set those
bytes directly and drop the word/shift trimming; this removes the undefined
shift and no longer over-masks the trailing bytes.
Fixes: a5d45bc0dc ("netfilter: nftables_offload: build mask based from the matching bytes")
Reported-by: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu >
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org >
2026-07-23 18:17:55 +02:00
..
2026-07-23 17:58:46 +02:00
2026-07-23 18:17:19 +02:00
2026-03-29 11:21:24 -07:00
2026-06-23 13:10:34 +02:00
2026-05-24 22:55:47 +02:00
2026-03-19 10:26:31 +01:00
2026-07-10 16:28:47 +02:00
2026-06-05 13:25:18 +02:00
2026-06-22 16:04:34 -07:00
2026-06-23 13:10:34 +02:00
2026-06-21 00:18:27 +02:00
2026-07-10 16:28:47 +02:00
2026-07-22 20:34:28 +02:00
2026-06-05 16:16:44 +02:00
2026-06-14 12:51:55 +02:00
2026-04-08 07:51:31 +02:00
2026-06-21 00:18:27 +02:00
2026-06-23 13:10:48 +02:00
2026-06-23 13:10:34 +02:00
2026-06-05 13:25:18 +02:00
2026-06-30 05:31:11 +02:00
2026-06-05 16:16:44 +02:00
2026-06-23 13:10:34 +02:00
2026-01-20 16:23:37 +01:00
2026-06-14 12:51:55 +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-06-07 11:13:47 +02:00
2026-04-10 12:16:26 +02:00
2026-06-05 16:16:44 +02:00
2026-06-14 12:51:55 +02:00
2026-06-14 12:51:55 +02:00
2026-07-22 19:47:17 +02:00
2026-06-05 13:25:18 +02:00
2026-04-10 12:16:26 +02:00
2026-06-05 13:25:18 +02:00
2026-06-05 13:11:55 +02:00
2026-06-15 14:09:57 -07:00
2026-01-02 12:04:28 -08:00
2026-07-10 16:28:47 +02:00
2026-07-08 15:33:44 +02:00
2026-07-08 15:33:44 +02:00
2026-06-21 00:18:27 +02:00
2026-02-21 01:02:28 -08: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-23 08:11:21 +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
2026-07-22 20:34:28 +02:00
2026-06-19 12:19:58 +02:00
2026-06-05 13:11:55 +02:00
2026-07-23 17:59:30 +02:00
2026-06-14 12:50:01 +02:00
2026-06-14 12:50:01 +02:00
2026-06-14 12:50:01 +02:00
2026-04-08 07:51:30 +02:00
2026-07-03 14:45:21 +02:00
2026-06-05 13:11:55 +02:00
2026-04-08 07:51:30 +02:00
2026-07-08 15:33:44 +02:00
2026-06-05 13:11:54 +02:00
2026-07-08 15:33:44 +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
2026-04-08 07:51:31 +02:00
2026-06-23 08:11:22 +02:00
2026-04-08 07:51:30 +02:00
2026-02-25 19:36:26 -08:00
2026-06-14 12:50:01 +02:00
2026-06-23 13:10:47 +02:00
2026-02-25 19:36:26 -08:00
2026-04-08 07:51:30 +02:00
2026-06-15 14:09:57 -07:00
2026-02-25 19:36:26 -08:00
2026-06-30 06:37:12 +02:00
2026-06-30 06:37:12 +02:00
2026-02-25 19:36:26 -08:00
2026-06-14 13:07:03 +02:00
2026-04-08 07:51:31 +02:00
2026-04-08 07:51:31 +02:00
2026-06-14 12:50:01 +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-07-08 15:33:37 +02:00
2026-06-14 12:50:01 +02:00
2026-06-21 00:18:26 +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-07-23 18:17:55 +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-06-14 12:50:01 +02:00
2026-02-25 19:36:26 -08:00
2026-02-25 19:36:26 -08:00
2026-06-14 12:50:01 +02:00
2026-06-14 12:50:01 +02:00
2026-06-14 12:50:01 +02:00
2026-05-24 22:55:48 +02:00
2026-06-30 06:37:07 +02:00
2026-06-30 06:37:07 +02:00
2026-07-03 14:45:21 +02:00
2026-06-14 12:50:01 +02:00
2026-06-23 08:11:22 +02:00
2026-04-30 17:59:01 +02:00
2026-06-14 12:50:01 +02:00
2026-06-14 12:50:01 +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
2026-06-19 12:22:14 +02:00
2026-03-09 18:32:45 -07:00
2026-03-09 18:32:45 -07:00
2026-07-03 14:45:21 +02:00
2026-05-22 12:28:46 +02:00
2026-06-05 16:16:44 +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-07-23 18:01:25 +02:00
2026-04-10 12:16:26 +02:00
2026-05-01 21:36:14 +02:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-20 23:27:52 +02:00
2026-04-08 13:33:38 +02:00
2026-07-10 16:28:47 +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-07-10 16:28:47 +02:00
2026-04-30 08:03:22 +02:00
2026-02-21 17:09:51 -08:00
2026-07-03 14:45:21 +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
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
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
2026-07-08 15:33:44 +02:00