mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steve Kemp <kernel@steve.org.uk>
To: linux-kernel@vger.kernel.org
Subject: Possible NULL pointer dereference in m32r
Date: Mon, 1 Feb 2010 21:36:35 +0000	[thread overview]
Message-ID: <20100201213635.GA24391@steve.org.uk> (raw)

   arch/m32r/kernel/smp.c contains the following code:

--
    preempt_disable();
    cpu_id = smp_processor_id();
    mmc = &mm->context[cpu_id];
    cpu_mask = mm->cpu_vm_mask;
    cpu_clear(cpu_id, cpu_mask);

#iffdef DEBUG_SMP
   if (!mm)
       BUG();
#endif
--

  mm might be NULL, but this would only be detected after it
 has been dereferenced, and only then if DEBUG_SMP is defined.

  I'd suggest changing to read something like this:

--
    if ( !mm )
        BUG();

    preempt_disable();
--

Steve
--
http://www.steve.org.uk/

                 reply	other threads:[~2010-02-01 21:52 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=20100201213635.GA24391@steve.org.uk \
    --to=kernel@steve.org.uk \
    --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

Powered by JetHome