diff options
| author | Florian Westphal <fw@strlen.de> | 2018-03-10 01:15:45 +0100 |
|---|---|---|
| committer | Sasha Levin <alexander.levin@microsoft.com> | 2018-05-22 21:33:57 -0400 |
| commit | 14ea4a4ca9d8d52a73a8dcb69b0b04e614a8675d (patch) | |
| tree | eb3fbf18901467b7aa86c7ff97c56d4076bf6f11 /include | |
| parent | 85fabfddebb4d10c847c29210752dd68d72d4bf2 (diff) | |
netfilter: x_tables: add and use xt_check_proc_name
[ Upstream commit b1d0a5d0cba4597c0394997b2d5fced3e3841b4e ]
recent and hashlimit both create /proc files, but only check that
name is 0 terminated.
This can trigger WARN() from procfs when name is "" or "/".
Add helper for this and then use it for both.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: <syzbot+0502b00edac2a0680b61@syzkaller.appspotmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netfilter/x_tables.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index cc615e273f80..b95f00cb6219 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -247,6 +247,8 @@ unsigned int *xt_alloc_entry_offsets(unsigned int size); bool xt_find_jump_offset(const unsigned int *offsets, unsigned int target, unsigned int size); +int xt_check_proc_name(const char *name, unsigned int size); + int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int8_t proto, bool inv_proto); int xt_check_target(struct xt_tgchk_param *, unsigned int size, u_int8_t proto, |
