netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kmalloc with locks held in xfrm.
@ 2014-02-27 15:19 Dave Jones
  2014-02-27 16:17 ` Possible fix Nikolay Aleksandrov
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Dave Jones @ 2014-02-27 15:19 UTC (permalink / raw)
  To: netdev

Hit this trace this morning on rc4.

	Dave

BUG: sleeping function called from invalid context at mm/slub.c:965
in_atomic(): 0, irqs_disabled(): 0, pid: 28692, name: trinity-main
2 locks held by trinity-main/28692:
 #0:  (sk_lock-AF_INET){......}, at: [<ffffffff83660cd3>] do_ip_setsockopt.isra.12+0x63/0xe10
 #1:  (rcu_read_lock){......}, at: [<ffffffff836bf138>] xfrm_user_policy+0xa8/0x1c0
CPU: 0 PID: 28692 Comm: trinity-main Not tainted 3.14.0-rc4+ #125 
 ffffffff83a428e7 00000000707766bf ffff88008c749c50 ffffffff8372e248
 ffff8800075c45c0 ffff88008c749c80 ffffffff8309c525 00000000000000d0
 00000000000000d0 0000000000000008 ffff880244c04240 ffff88008c749cd8
Call Trace:
 [<ffffffff8372e248>] dump_stack+0x4e/0x7a
 [<ffffffff8309c525>] __might_sleep+0x125/0x180
 [<ffffffff831acd6a>] __kmalloc+0x7a/0x2a0
 [<ffffffffc05978d8>] ? pfkey_compile_policy+0x1a8/0x270 [af_key]
 [<ffffffffc05978d8>] pfkey_compile_policy+0x1a8/0x270 [af_key]
 [<ffffffff836bf1b7>] xfrm_user_policy+0x127/0x1c0
 [<ffffffff836bf138>] ? xfrm_user_policy+0xa8/0x1c0
 [<ffffffff83071907>] ? __local_bh_enable_ip+0x67/0xe0
 [<ffffffff8366173e>] do_ip_setsockopt.isra.12+0xace/0xe10
 [<ffffffff831c1e7c>] ? get_empty_filp+0x5c/0x240
 [<ffffffff830bcab5>] ? cpuacct_account_field+0x5/0xc0
 [<ffffffff8310ff8e>] ? __acct_update_integrals+0x8e/0x120
 [<ffffffff830a388d>] ? get_parent_ip+0xd/0x50
 [<ffffffff8373d42b>] ? preempt_count_sub+0x6b/0xf0
 [<ffffffff83661ab0>] ip_setsockopt+0x30/0xa0
 [<ffffffff836872eb>] udp_setsockopt+0x1b/0x40
 [<ffffffff83600dc4>] sock_common_setsockopt+0x14/0x20
 [<ffffffff835ffa30>] SyS_setsockopt+0x80/0xf0
 [<ffffffff83741e6a>] tracesys+0xd4/0xd9

^ permalink raw reply	[flat|nested] 27+ messages in thread
* pull request (net): ipsec 2014-03-18
@ 2014-03-18  7:43 Steffen Klassert
  2014-03-18  7:43 ` [PATCH 2/2] selinux: add gfp argument to security_xfrm_policy_alloc and fix callers Steffen Klassert
  0 siblings, 1 reply; 27+ messages in thread
From: Steffen Klassert @ 2014-03-18  7:43 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev

1) Fix a sleep in atomic when pfkey_sadb2xfrm_user_sec_ctx()
   is called from pfkey_compile_policy().
   Fix from Nikolay Aleksandrov.

2) security_xfrm_policy_alloc() can be called in process and atomic
   context. Add an argument to let the callers choose the appropriate
   way. Fix from Nikolay Aleksandrov.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit a8d9bc2e9f5d1c5a25e33cec096d2a1652d3fd52:

  bnx2: Fix shutdown sequence (2014-03-09 19:02:27 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git master

for you to fetch changes up to 52a4c6404f91f2d2c5592ee6365a8418c4565f53:

  selinux: add gfp argument to security_xfrm_policy_alloc and fix callers (2014-03-10 08:30:02 +0100)

----------------------------------------------------------------
Nikolay Aleksandrov (2):
      net: af_key: fix sleeping under rcu
      selinux: add gfp argument to security_xfrm_policy_alloc and fix callers

 include/linux/security.h            |   10 +++++++---
 net/key/af_key.c                    |   19 ++++++++++---------
 net/xfrm/xfrm_user.c                |    6 +++---
 security/capability.c               |    3 ++-
 security/security.c                 |    6 ++++--
 security/selinux/hooks.c            |   13 +++++++------
 security/selinux/include/security.h |    2 +-
 security/selinux/include/xfrm.h     |    3 ++-
 security/selinux/selinuxfs.c        |   28 ++++++++++++++++++----------
 security/selinux/ss/services.c      |    6 ++++--
 security/selinux/xfrm.c             |   14 ++++++++------
 11 files changed, 66 insertions(+), 44 deletions(-)

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-03-18  7:43 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-27 15:19 kmalloc with locks held in xfrm Dave Jones
2014-02-27 16:17 ` Possible fix Nikolay Aleksandrov
2014-02-27 16:24   ` Nikolay Aleksandrov
2014-02-27 17:05     ` Nikolay Aleksandrov
2014-02-28  7:23   ` Steffen Klassert
2014-02-28 10:10     ` Nikolay Aleksandrov
2014-02-28 22:10       ` Paul Moore
2014-03-02 16:26         ` Nikolay Aleksandrov
2014-03-05 12:20         ` Steffen Klassert
2014-03-07  3:04           ` Paul Moore
2014-03-07 11:23             ` Steffen Klassert
2014-03-07 15:50               ` Paul Moore
2014-03-04 12:26 ` [PATCH 0/2] af_key: fixes for sleeping while atomic Nikolay Aleksandrov
2014-03-04 12:26   ` [PATCH 1/2] net: af_key: fix sleeping under rcu Nikolay Aleksandrov
2014-03-04 12:46     ` David Laight
2014-03-04 21:40       ` David Miller
2014-03-04 12:26   ` [PATCH 2/2] selinux: add gfp argument to security_xfrm_policy_alloc and fix callers Nikolay Aleksandrov
2014-03-07  3:22     ` Paul Moore
2014-03-07 10:52       ` Nikolay Aleksandrov
2014-03-05 12:07   ` [PATCH 0/2] af_key: fixes for sleeping while atomic Steffen Klassert
2014-03-05 22:21   ` Paul Moore
2014-03-07 11:44 ` [PATCHv2 " Nikolay Aleksandrov
2014-03-07 11:44   ` [PATCHv2 1/2] net: af_key: fix sleeping under rcu Nikolay Aleksandrov
2014-03-07 11:44   ` [PATCHv2 2/2] selinux: add gfp argument to security_xfrm_policy_alloc and fix callers Nikolay Aleksandrov
2014-03-07 22:27     ` Paul Moore
2014-03-10 12:52       ` Steffen Klassert
  -- strict thread matches above, loose matches on Subject: below --
2014-03-18  7:43 pull request (net): ipsec 2014-03-18 Steffen Klassert
2014-03-18  7:43 ` [PATCH 2/2] selinux: add gfp argument to security_xfrm_policy_alloc and fix callers Steffen Klassert

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