net: ppp: Don't call bpf_prog_create() in ppp_lock
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Nov 2014 10:50:21 +0000 (11:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Nov 2014 20:15:03 +0000 (15:15 -0500)
commit5748eb8f8e989a9da1ac7c96dc73d68cbdedf7df
treec2543dfacb1d0904ef6f81898dbf05834d4a79aa
parentf4a1edd56120249198073aa4a373b77e3700ac8f
net: ppp: Don't call bpf_prog_create() in ppp_lock

In ppp_ioctl(), bpf_prog_create() is called inside ppp_lock, which
eventually calls vmalloc() and hits BUG_ON() in vmalloc.c.  This patch
works around the problem by moving the allocation outside the lock.

The bug was revealed by the recent change in net/core/filter.c, as it
allocates via vmalloc() instead of kmalloc() now.

Reported-and-tested-by: Stefan Seyfried <stefan.seyfried@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/ppp_generic.c