Re: [PATCH net] netfilter: check for out-of-bounds while copying compat entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
> Currently, when coping ebt compat entries, no checks are in place
> for the offsets provided by user space, so that syzbot was able to
> trigger the following splat:
> ---
>  net/bridge/netfilter/ebtables.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
> index 02c4b409d317..54ceaff701fb 100644
> --- a/net/bridge/netfilter/ebtables.c
> +++ b/net/bridge/netfilter/ebtables.c
> @@ -2114,7 +2114,7 @@ static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base,
>  		unsigned int size;
>  		char *buf = buf_start + offsets[i];
>  
> -		if (offsets[i] > offsets[j])
> +		if (offsets[i] > offsets[j] || offsets[j] > *total)
>  			return -EINVAL;

I thought i fixed this via b71812168571fa55e44cdd0254471331b9c4c4c6,
and, after looking at it again I still don't see why that doesn't cover
this :-(
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux