From: Andrew Morton <akpm@linux-foundation.org>
To: SeongJae Park <sj@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>, Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/cma: Replace snprintf with strscpy in cma_new_area
Date: Mon, 26 Jan 2026 16:54:50 -0800 [thread overview]
Message-ID: <20260126165450.f83b1895deeda8e4332a57d3@linux-foundation.org> (raw)
In-Reply-To: <20260127004723.74422-1-sj@kernel.org>
On Mon, 26 Jan 2026 16:47:22 -0800 SeongJae Park <sj@kernel.org> wrote:
> > @@ -233,7 +234,7 @@ static int __init cma_new_area(const char *name, phys_addr_t size,
> > cma_area_count++;
> >
> > if (name)
> > - snprintf(cma->name, CMA_MAX_NAME, "%s", name);
> > + strscpy(cma->name, name);
>
> Any reason to drop CMA_MAX_NAME protection? You can pass the size of
> destination buffer as the third argument of strscpy().
strscpy() will now use sizeof(cma->name):
char name[CMA_MAX_NAME];
next prev parent reply other threads:[~2026-01-27 0:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 17:45 Thorsten Blum
2026-01-27 0:47 ` SeongJae Park
2026-01-27 0:54 ` Andrew Morton [this message]
2026-01-27 1:05 ` SeongJae Park
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=20260126165450.f83b1895deeda8e4332a57d3@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Liam.Howlett@oracle.com \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=thorsten.blum@linux.dev \
--cc=vbabka@suse.cz \
/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