linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: SeongJae Park <sjpark@amazon.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon: fix stringop-overread warning in kunit test
Date: Mon, 20 Sep 2021 15:18:50 +0000	[thread overview]
Message-ID: <20210920151850.4433-1-sj@kernel.org> (raw)
In-Reply-To: <20210920100132.1390409-1-arnd@kernel.org>

On Mon, 20 Sep 2021 12:01:23 +0200 Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> gcc-11 points out that strnlen() with a fixed length on a constant
> input makes no sense:
> 
> In file included from mm/damon/dbgfs.c:623:
> mm/damon/dbgfs-test.h: In function 'damon_dbgfs_test_str_to_target_ids':
> mm/damon/dbgfs-test.h:23:47: error: 'strnlen' specified bound 128 exceeds source size 4 [-Werror=stringop-overread]
>    23 |         answers = str_to_target_ids(question, strnlen(question, 128),
>       |                                               ^~~~~~~~~~~~~~~~~~~~~~
> mm/damon/dbgfs-test.h:30:47: error: 'strnlen' specified bound 128 exceeds source size 7 [-Werror=stringop-overread]
>    30 |         answers = str_to_target_ids(question, strnlen(question, 128),
>       |                                               ^~~~~~~~~~~~~~~~~~~~~~
> mm/damon/dbgfs-test.h:37:47: error: 'strnlen' specified bound 128 exceeds source size 5 [-Werror=stringop-overread]
>    37 |         answers = str_to_target_ids(question, strnlen(question, 128),
>       |                                               ^~~~~~~~~~~~~~~~~~~~~~
> 
> Use a plain strlen() instead.
> 
> Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thank you for the patch!  However, a same change has already merged[1] in -mm.
Sorry for that.

[1] https://lore.kernel.org/mm-commits/20210915033531.IdrhacHQk%25akpm@linux-foundation.org/


Thanks,
SJ

[...]


      reply	other threads:[~2021-09-20 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 10:01 Arnd Bergmann
2021-09-20 15:18 ` SeongJae Park [this message]

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=20210920151850.4433-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjpark@amazon.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