LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Michael Holzheu <holzheu@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] bpf: rcu lock must not be held when calling copy_to_user()
Date: Fri, 23 Jan 2015 11:15:53 +0100	[thread overview]
Message-ID: <54C21F59.3000100@redhat.com> (raw)
In-Reply-To: <1421975469-13035-2-git-send-email-ast@plumgrid.com>

On 01/23/2015 02:11 AM, Alexei Starovoitov wrote:
> BUG: sleeping function called from invalid context at mm/memory.c:3732
> in_atomic(): 0, irqs_disabled(): 0, pid: 671, name: test_maps
> 1 lock held by test_maps/671:
>   #0:  (rcu_read_lock){......}, at: [<0000000000264190>] map_lookup_elem+0xe8/0x260
> Call Trace:
> ([<0000000000115b7e>] show_trace+0x12e/0x150)
>   [<0000000000115c40>] show_stack+0xa0/0x100
>   [<00000000009b163c>] dump_stack+0x74/0xc8
>   [<000000000017424a>] ___might_sleep+0x23a/0x248
>   [<00000000002b58e8>] might_fault+0x70/0xe8
>   [<0000000000264230>] map_lookup_elem+0x188/0x260
>   [<0000000000264716>] SyS_bpf+0x20e/0x840
>
> Fix it by allocating temporary buffer to store map element value.
>
> Fixes: db20fd2b0108 ("bpf: add lookup/update/delete/iterate methods to BPF maps")
> Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>

Looks good to me.

Acked-by: Daniel Borkmann <dborkman@redhat.com>

  reply	other threads:[~2015-01-23 10:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  1:11 [PATCH net 0/2] bpf: fix two bugs Alexei Starovoitov
2015-01-23  1:11 ` [PATCH net 1/2] bpf: rcu lock must not be held when calling copy_to_user() Alexei Starovoitov
2015-01-23 10:15   ` Daniel Borkmann [this message]
2015-01-23  1:11 ` [PATCH net 2/2] samples: bpf: relax test_maps check Alexei Starovoitov
2015-01-23 10:58   ` Daniel Borkmann
2015-01-27  1:21 ` [PATCH net 0/2] bpf: fix two bugs David Miller

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=54C21F59.3000100@redhat.com \
    --to=dborkman@redhat.com \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --subject='Re: [PATCH net 1/2] bpf: rcu lock must not be held when calling copy_to_user()' \
    /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

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).