Thread (6 messages) 6 messages, 5 authors, 2020-08-03

Re: [PATCH net] net/bpfilter: initialize pos in __bpfilter_process_sockopt

From: Alexei Starovoitov <hidden>
Date: 2020-08-01 19:48:50
Also in: bpf

On Fri, Jul 31, 2020 at 02:07:42AM +0200, Daniel Borkmann wrote:
On 7/30/20 6:13 PM, Christian Brauner wrote:
quoted
On Thu, Jul 30, 2020 at 06:09:00PM +0200, Christoph Hellwig wrote:
quoted
__bpfilter_process_sockopt never initialized the pos variable passed to
the pipe write.  This has been mostly harmless in the past as pipes
ignore the offset, but the switch to kernel_write no verified the
s/no/now/
quoted
position, which can lead to a failure depending on the exact stack
initialization patter.  Initialize the variable to zero to make
s/patter/pattern/
quoted
rw_verify_area happy.

Fixes: 6955a76fbcd5 ("bpfilter: switch to kernel_write")
Reported-by: Christian Brauner <redacted>
Reported-by: Rodrigo Madera <redacted>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Rodrigo Madera <redacted>
---
Thanks for tracking this down, Christoph! This fixes the logging issue
for me.
Tested-by: Christian Brauner <redacted>
Reviewed-by: Christian Brauner <redacted>
Applied to bpf & fixed up the typos in the commit msg, thanks everyone!
Daniel,
why is it necessary in bpf tree?

I fixed it already in bpf-next in commit a4fa458950b4 ("bpfilter: Initialize pos variable")
two weeks ago...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help