[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140913.170506.851550533823976026.davem@davemloft.net>
Date: Sat, 13 Sep 2014 17:05:06 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: dborkman@...hat.com
Cc: eric.dumazet@...il.com, ast@...mgrid.com, netdev@...r.kernel.org,
xemul@...allels.com
Subject: Re: [PATCH net-next v4 2/9] net: filter: keep original BPF program
around
From: Daniel Borkmann <dborkman@...hat.com>
Date: Fri, 12 Sep 2014 08:09:31 +0200
>> [PATCH] net: filter: fix possible use after free
>>
>> If kmemdup() fails, we free fp->orig_prog and return -ENOMEM
>>
>> sk_attach_filter()
>> -> sk_filter_uncharge(sk, fp)
>> -> sk_filter_release(fp)
>> -> call_rcu(&fp->rcu, sk_filter_release_rcu)
>> -> sk_filter_release_rcu()
>> -> sk_release_orig_filter()
>> fprog = fp->orig_prog; // not NULL, but points to freed memory
>> kfree(fprog->filter); // use after free, potential corruption
>> kfree(fprog); // double free or corruption
>>
>> Note: This was fixed in 3.17+ with commit 278571baca2a
>> ("net: filter: simplify socket charging")
>>
>> Found by AddressSanitizer
>>
>> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>> Fixes: a3ea269b8bcdb ("net: filter: keep original BPF program around")
>
> Thanks Eric!
>
> Acked-by: Daniel Borkmann <dborkman@...hat.com>
Queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists