mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] move key_init to security_initcall
Date: Mon, 25 Oct 2004 13:50:16 -0700	[thread overview]
Message-ID: <20041025135016.M2357@build.pdx.osdl.net> (raw)

During system boot many probes, etc. will generate upcalls to userspace
via call_usermodehelper().  This has the effect of calling execve()
before the key subsystem has been initialized, and thus Oopsing on a
NULL key_jar during key_alloc().  Move key_init to security_initcall so
that it's called along with other securty initialization routines which
have similar requirements.

Signed-off-by: Chris Wright <chrisw@osdl.org>

===== security/keys/key.c 1.1 vs edited =====
--- 1.1/security/keys/key.c	2004-10-19 02:40:15 -07:00
+++ edited/security/keys/key.c	2004-10-25 13:28:37 -07:00
@@ -1036,4 +1036,4 @@
 
 } /* end key_init() */
 
-subsys_initcall(key_init);
+security_initcall(key_init);



--
Example Oops:

Unable to handle kernel NULL pointer dereference at 0000000000000094 RIP:
<ffffffff80163760>{kmem_flagcheck+32}
PML4 7febe067 PGD 7fec1067 PMD 0
Oops: 0000 [5] PREEMPT SMP
CPU 0
Modules linked in:
Pid: 13, comm: hotplug Tainted: G   M  2.6.10-rc1
RIP: 0010:[<ffffffff80163760>] <ffffffff80163760>{kmem_flagcheck+32}
RSP: 0000:0000010037e79bc0  EFLAGS: 00010246
RAX: 000001007ff45e10 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00000000000000d0 R08: 0000000000000000 R09: 000001007ff45e10
R10: 00000000ffffffff R11: 0000000000000000 R12: 000001007ff45e10
R13: ffffffff805caae0 R14: 0000000000000008 R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffffffff807199c0(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000094 CR3: 0000000000101000 CR4: 00000000000006e0
Process hotplug (pid: 13, threadinfo 0000010037e78000, task 000001007feb1130)
Stack: ffffffff80163ec0 000001003fff9e50 0000010037e79c58 ffffffffffffffea
       ffffffff80272d7f 0000000000000010 001f00003ffedab8 0000000000000000
       000001003ffedab8 0000000000000000
Call Trace:<ffffffff80163ec0>{kmem_cache_alloc+16} <ffffffff80272d7f>{key_alloc+223}
       <ffffffff80273fc5>{keyring_alloc+37} <ffffffff802759a0>{install_process_keyring+80}
       <ffffffff8017ddae>{filp_close+126} <ffffffff801899d7>{compute_creds+55}
       <ffffffff801abf37>{load_elf_binary+3175} <ffffffff80188666>{copy_strings+486}
       <ffffffff801ab2d0>{load_elf_binary+0} <ffffffff80189c24>{search_binary_handler+276}
       <ffffffff80189ff4>{do_execve+420} <ffffffff80148e90>{__call_usermodehelper+0}
       <ffffffff8010f084>{sys_execve+68} <ffffffff801112f5>{execve+101}
       <ffffffff80148e90>{__call_usermodehelper+0} <ffffffff80148df6>{____call_usermodehelper+182}
       <ffffffff80111287>{child_rip+8} <ffffffff80148e90>{__call_usermodehelper+0}
       <ffffffff80148d40>{____call_usermodehelper+0} <ffffffff8011127f>{child_rip+0}

                 reply	other threads:[~2004-10-25 20:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041025135016.M2357@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®