netfilter: ebtables: must null-terminate name
Subsystems (3)
Florian Westphal
maintainerPATCH 1/1 netfilter: ebtables: must null-terminate name
sashiko says:
hlp struct is copied from userspace without forcing null-termination of hlp.name [..} is passed to request_module().
Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by Florian Westphal <[email protected]>
---
Many more reported issues, will go through this next week.
net/bridge/netfilter/ebtables.c | 4 ++++ 1 file changed, 4 insertions(+)
net/bridge/netfilter/ebtables.c +4 -0
@@ -1440,6 +1440,8 @@ static int update_counters(struct net *net, sockptr_t arg, unsigned int len)if (len !=sizeof (hlp) + hlp.num_counters *sizeof (struct ebt_counter ))return -EINVAL ; + hlp.name[sizeof (hlp.name) -1 ] =0 ; +return do_update_counters (net, hlp.name, hlp.counters, hlp.num_counters, len); }
@@ -2401,6 +2403,8 @@ static int compat_update_counters(struct net *net, sockptr_t arg,if (len !=sizeof (hlp) + hlp.num_counters *sizeof (struct ebt_counter ))return update_counters (net, arg, len); + hlp.name[sizeof (hlp.name) -1 ] =0 ; +return do_update_counters (net, hlp.name,compat_ptr (hlp.counters), hlp.num_counters, len); }
Signature · 1 line
2.55.0