Eric Dumazet 65acf6e050 netfilter: complete validation of user input
In my recent commit, I missed that do_replace() handlers
use copy_from_sockptr() (which I fixed), followed
by unsafe copy_from_sockptr_offset() calls.

In all functions, we can perform the @optlen validation
before even calling xt_alloc_table_info() with the following
check:

if ((u64)optlen < (u64)tmp.size + sizeof(tmp))
        return -EINVAL;

Fixes: 0c83842df40f ("netfilter: validate user input for expected length")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://lore.kernel.org/r/20240409120741.3538135-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-04-10 19:42:56 -07:00
..
2024-03-07 21:12:43 -08:00
2024-02-20 10:50:19 +01:00
2024-02-28 19:36:39 -08:00
2024-01-23 15:13:55 +01:00
2024-01-04 10:23:10 -08:00
2023-10-16 21:05:33 -07:00
2024-02-28 19:36:39 -08:00
2022-12-20 03:13:45 +01:00
2023-09-14 16:16:36 +02:00
2023-08-29 17:39:15 -07:00