mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel: initialize cpumask before parsing
Date: Thu, 1 Apr 2021 09:34:43 -0400	[thread overview]
Message-ID: <20210401093443.019b57d2@gandalf.local.home> (raw)
In-Reply-To: <20210401055823.3929-1-penguin-kernel@I-love.SAKURA.ne.jp>

On Thu,  1 Apr 2021 14:58:23 +0900
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:

> KMSAN complains that new_value at cpumask_parse_user() from
> write_irq_affinity() from irq_affinity_proc_write() is uninitialized.
> 
>   [  148.133411][ T5509] =====================================================
>   [  148.135383][ T5509] BUG: KMSAN: uninit-value in find_next_bit+0x325/0x340
>   [  148.137819][ T5509]
>   [  148.138448][ T5509] Local variable ----new_value.i@irq_affinity_proc_write created at:
>   [  148.140768][ T5509]  irq_affinity_proc_write+0xc3/0x3d0
>   [  148.142298][ T5509]  irq_affinity_proc_write+0xc3/0x3d0
>   [  148.143823][ T5509] =====================================================
> 
> Since bitmap_parse() from cpumask_parse_user() calls find_next_bit(),
> any alloc_cpumask_var() + cpumask_parse_user() sequence has possibility
> that find_next_bit() accesses uninitialized cpu mask variable. Fix this
> problem by replacing alloc_cpumask_var() with zalloc_cpumask_var().
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
>  kernel/irq/proc.c    | 4 ++--
>  kernel/profile.c     | 2 +-


>  kernel/trace/trace.c | 2 +-

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

  reply	other threads:[~2021-04-01 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  5:58 Tetsuo Handa
2021-04-01 13:34 ` Steven Rostedt [this message]
2021-04-10 11:38 ` [tip: irq/core] kernel: Initialize " tip-bot2 for Tetsuo Handa

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=20210401093443.019b57d2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=tglx@linutronix.de \
    /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®