linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Purva Yeshi <purvayeshi550@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vmscan: Initialize dirty to prevent uninitialized use
Date: Tue, 25 Mar 2025 14:35:53 -0600	[thread overview]
Message-ID: <CAOUHufaFz=G+0o5c+u9YY-4n1KExS6_tOFATY1TMyWWcrAQ8Ng@mail.gmail.com> (raw)
In-Reply-To: <20250325194920.53307-1-purvayeshi550@gmail.com>

On Tue, Mar 25, 2025 at 1:49 PM Purva Yeshi <purvayeshi550@gmail.com> wrote:
>
> Fix Smatch-detected error:
> mm/vmscan.c:3509 walk_pte_range() error: uninitialized symbol 'dirty'.
> mm/vmscan.c:3522 walk_pte_range() error: uninitialized symbol 'dirty'.
> mm/vmscan.c:3600 walk_pmd_range_locked() error: uninitialized symbol 'dirty'.
> mm/vmscan.c:3614 walk_pmd_range_locked() error: uninitialized symbol 'dirty'.
> mm/vmscan.c:4220 lru_gen_look_around() error: uninitialized symbol 'dirty'.
> mm/vmscan.c:4232 lru_gen_look_around() error: uninitialized symbol 'dirty'.
>
> Smatch reports 'dirty' as uninitialized, leading to potential
> undefined behavior.

Thanks -- this seems like false positives from Smatch, where the
problem should be fixed.

> Explicitly initialize dirty to 0 in walk_pte_range(),
> walk_pmd_range_locked(), and lru_gen_look_around() in mm/vmscan.c
> to fix Smatch error.
>
> Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>


  reply	other threads:[~2025-03-25 20:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25 19:49 Purva Yeshi
2025-03-25 20:35 ` Yu Zhao [this message]
2025-03-26  6:48   ` Purva Yeshi

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='CAOUHufaFz=G+0o5c+u9YY-4n1KExS6_tOFATY1TMyWWcrAQ8Ng@mail.gmail.com' \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=purvayeshi550@gmail.com \
    /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