netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Christian Brauner <christian.brauner@ubuntu.com>,
	Christoph Hellwig <hch@lst.de>
Cc: davem@davemloft.net, kuba@kernel.org, ast@kernel.org,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	Rodrigo Madera <rodrigo.madera@gmail.com>
Subject: Re: [PATCH net] net/bpfilter: initialize pos in __bpfilter_process_sockopt
Date: Fri, 31 Jul 2020 02:07:42 +0200	[thread overview]
Message-ID: <03954b8f-0db7-427b-cfd6-7146da9b5466@iogearbox.net> (raw)
In-Reply-To: <20200730161303.erzgrhqsgc77d4ny@wittgenstein>

On 7/30/20 6:13 PM, Christian Brauner wrote:
> On Thu, Jul 30, 2020 at 06:09:00PM +0200, Christoph Hellwig wrote:
>> __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/
> 
>> position, which can lead to a failure depending on the exact stack
>> initialization patter.  Initialize the variable to zero to make
> 
> s/patter/pattern/
> 
>> rw_verify_area happy.
>>
>> Fixes: 6955a76fbcd5 ("bpfilter: switch to kernel_write")
>> Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
>> Reported-by: Rodrigo Madera <rodrigo.madera@gmail.com>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> Tested-by: Rodrigo Madera <rodrigo.madera@gmail.com>
>> ---
> 
> Thanks for tracking this down, Christoph! This fixes the logging issue
> for me.
> Tested-by: Christian Brauner <christian.brauner@ubuntu.com>
> Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>

Applied to bpf & fixed up the typos in the commit msg, thanks everyone!

  reply	other threads:[~2020-07-31  0:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 16:09 [PATCH net] net/bpfilter: initialize pos in __bpfilter_process_sockopt Christoph Hellwig
2020-07-30 16:13 ` Christian Brauner
2020-07-31  0:07   ` Daniel Borkmann [this message]
2020-08-01 19:48     ` Alexei Starovoitov
2020-08-03 14:56       ` Daniel Borkmann
2020-08-03 15:36         ` Rodrigo Madera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03954b8f-0db7-427b-cfd6-7146da9b5466@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=davem@davemloft.net \
    --cc=hch@lst.de \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rodrigo.madera@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).