Eric Dumazet
2ea2f62c8b
net: fix crash in build_skb()
When I added pfmemalloc support in build_skb(), I forgot netlink
was using build_skb() with a vmalloc() area.
In this patch I introduce __build_skb() for netlink use,
and build_skb() is a wrapper handling both skb->head_frag and
skb->pfmemalloc
This means netlink no longer has to hack skb->head_frag
[ 1567.700067] kernel BUG at arch/x86/mm/physaddr.c:26!
[ 1567.700067] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
[ 1567.700067] Dumping ftrace buffer:
[ 1567.700067] (ftrace buffer empty)
[ 1567.700067] Modules linked in:
[ 1567.700067] CPU: 9 PID: 16186 Comm: trinity-c182 Not tainted 4.0.0-next-20150424-sasha-00037-g4796e21 #2167
[ 1567.700067] task: ffff880127efb000 ti: ffff880246770000 task.ti: ffff880246770000
[ 1567.700067] RIP: __phys_addr (arch/x86/mm/physaddr.c:26 (discriminator 3))
[ 1567.700067] RSP: 0018:ffff8802467779d8 EFLAGS: 00010202
[ 1567.700067] RAX: 000041000ed8e000 RBX: ffffc9008ed8e000 RCX: 000000000000002c
[ 1567.700067] RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffffb3fd6049
[ 1567.700067] RBP: ffff8802467779f8 R08: 0000000000000019 R09: ffff8801d0168000
[ 1567.700067] R10: ffff8801d01680c7 R11: ffffed003a02d019 R12: ffffc9000ed8e000
[ 1567.700067] R13: 0000000000000f40 R14: 0000000000001180 R15: ffffc9000ed8e000
[ 1567.700067] FS: 00007f2a7da3f700(0000) GS:ffff8801d1000000(0000) knlGS:0000000000000000
[ 1567.700067] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1567.700067] CR2: 0000000000738308 CR3: 000000022e329000 CR4: 00000000000007e0
[ 1567.700067] Stack:
[ 1567.700067] ffffc9000ed8e000 ffff8801d0168000 ffffc9000ed8e000 ffff8801d0168000
[ 1567.700067] ffff880246777a28 ffffffffad7c0a21 0000000000001080 ffff880246777c08
[ 1567.700067] ffff88060d302e68 ffff880246777b58 ffff880246777b88 ffffffffad9a6821
[ 1567.700067] Call Trace:
[ 1567.700067] build_skb (include/linux/mm.h:508 net/core/skbuff.c:316)
[ 1567.700067] netlink_sendmsg (net/netlink/af_netlink.c:1633 net/netlink/af_netlink.c:2329)
[ 1567.774369] ? sched_clock_cpu (kernel/sched/clock.c:311)
[ 1567.774369] ? netlink_unicast (net/netlink/af_netlink.c:2273)
[ 1567.774369] ? netlink_unicast (net/netlink/af_netlink.c:2273)
[ 1567.774369] sock_sendmsg (net/socket.c:614 net/socket.c:623)
[ 1567.774369] sock_write_iter (net/socket.c:823)
[ 1567.774369] ? sock_sendmsg (net/socket.c:806)
[ 1567.774369] __vfs_write (fs/read_write.c:479 fs/read_write.c:491)
[ 1567.774369] ? get_lock_stats (kernel/locking/lockdep.c:249)
[ 1567.774369] ? default_llseek (fs/read_write.c:487)
[ 1567.774369] ? vtime_account_user (kernel/sched/cputime.c:701)
[ 1567.774369] ? rw_verify_area (fs/read_write.c:406 (discriminator 4))
[ 1567.774369] vfs_write (fs/read_write.c:539)
[ 1567.774369] SyS_write (fs/read_write.c:586 fs/read_write.c:577)
[ 1567.774369] ? SyS_read (fs/read_write.c:577)
[ 1567.774369] ? __this_cpu_preempt_check (lib/smp_processor_id.c:63)
[ 1567.774369] ? trace_hardirqs_on_caller (kernel/locking/lockdep.c:2594 kernel/locking/lockdep.c:2636)
[ 1567.774369] ? trace_hardirqs_on_thunk (arch/x86/lib/thunk_64.S:42)
[ 1567.774369] system_call_fastpath (arch/x86/kernel/entry_64.S:261)
Fixes: 79930f5892e ("net: do not deplete pfmemalloc reserve")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-25 15:49:49 -04:00
..
2015-02-14 23:08:44 +01:00
2015-04-18 17:45:30 -04:00
2015-03-02 16:43:41 -05:00
2015-04-02 14:05:00 -04:00
2015-03-03 17:01:37 -05:00
2015-04-15 09:00:47 -07:00
2015-03-05 13:17:39 -05:00
2015-04-02 14:04:59 -04:00
2015-04-18 11:01:08 -04:00
2015-04-13 17:17:29 +02:00
2015-03-20 18:51:09 -04:00
2015-04-01 11:28:22 +02:00
2015-04-07 19:08:35 +03:00
2015-04-25 15:49:49 -04:00
2015-03-06 21:50:02 -05:00
2015-04-24 11:39:15 -04:00
2015-04-07 15:25:55 -04:00
2014-10-01 00:44:04 +10:00
2015-04-17 15:58:37 -04:00
2015-03-03 17:01:38 -05:00
2015-03-01 13:40:23 -05:00
2015-03-14 17:11:31 +01:00
2015-04-24 11:39:15 -04:00
2015-04-24 11:39:15 -04:00
2015-03-02 13:06:31 -05:00
2015-03-09 23:38:02 -04:00
2015-04-02 16:16:53 -04:00
2015-03-31 13:58:35 -04:00
2015-04-06 22:34:15 -04:00
2014-10-24 15:51:42 -04:00
2015-03-02 13:06:31 -05:00
2015-04-15 09:00:47 -07:00
2015-03-27 19:18:50 +01:00
2015-04-22 14:24:54 -04:00
2015-04-14 18:51:19 -04:00
2015-03-31 13:58:35 -04:00
2015-04-25 15:49:49 -04:00
2015-03-02 16:43:41 -05:00
2015-04-13 16:35:16 -04:00
2015-04-15 09:00:47 -07:00
2015-03-23 22:01:28 -04:00
2015-03-02 13:06:31 -05:00
2015-04-14 15:44:14 -04:00
2015-02-04 14:57:45 -08:00
2015-03-02 16:43:41 -05:00
2015-04-11 15:53:35 -04:00
2015-04-17 13:29:28 -04:00
2015-03-25 11:40:16 -04:00
2015-04-15 16:35:24 -07:00
2015-03-23 16:44:56 -04:00
2015-04-23 11:50:34 -04:00
2015-04-23 13:15:20 -04:00
2015-03-02 13:06:31 -05:00
2014-10-07 20:28:44 -04:00
2015-04-08 09:19:29 +02:00
2015-03-02 13:06:31 -05:00
2015-04-14 15:44:14 -04:00
2015-04-09 00:02:26 -04:00
2015-01-07 13:08:04 +01:00
2015-03-04 00:26:06 -05:00
2015-04-11 22:29:40 -04:00