Netdev List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	"David S . Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v2 bpf-next 2/2] bpf: sockmap: initialize sg table entries properly
Date: Thu, 29 Mar 2018 20:37:18 -0700	[thread overview]
Message-ID: <5d47187a-d17d-3ed9-55bb-7d961b48f9ee@gmail.com> (raw)
In-Reply-To: <20180330002100.5724-3-bhole_prashant_q7@lab.ntt.co.jp>

On 03/29/2018 05:21 PM, Prashant Bhole wrote:
> When CONFIG_DEBUG_SG is set, sg->sg_magic is initialized in
> sg_init_table() and it is verified in sg api while navigating. We hit
> BUG_ON when magic check is failed.
> 
> In functions sg_tcp_sendpage and sg_tcp_sendmsg, the struct containing
> the scatterlist is already zeroed out. So to avoid extra memset, we
> use sg_init_marker() to initialize sg_magic.
> 
> Fixed following things:
> - In bpf_tcp_sendpage: initialize sg using sg_init_marker
> - In bpf_tcp_sendmsg: Replace sg_init_table with sg_init_marker
> - In bpf_tcp_push: Replace memset with sg_init_table where consumed
>   sg entry needs to be re-initialized.
> 
> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> ---
>  kernel/bpf/sockmap.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2018-03-30  3:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  0:20 [PATCH v2 bpf-next 0/2] sockmap: fix sg api usage Prashant Bhole
2018-03-30  0:20 ` [PATCH v2 bpf-next 1/2] lib/scatterlist: add sg_init_marker() helper Prashant Bhole
2018-03-30  3:38   ` John Fastabend
2018-03-30  0:21 ` [PATCH v2 bpf-next 2/2] bpf: sockmap: initialize sg table entries properly Prashant Bhole
2018-03-30  3:37   ` John Fastabend [this message]
2018-03-30  3:39 ` [PATCH v2 bpf-next 0/2] sockmap: fix sg api usage John Fastabend
2018-03-30 20:52   ` Daniel Borkmann

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=5d47187a-d17d-3ed9-55bb-7d961b48f9ee@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=ast@kernel.org \
    --cc=bhole_prashant_q7@lab.ntt.co.jp \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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