[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260126165450.f83b1895deeda8e4332a57d3@linux-foundation.org>
Date: Mon, 26 Jan 2026 16:54:50 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: SeongJae Park <sj@...nel.org>
Cc: Thorsten Blum <thorsten.blum@...ux.dev>, David Hildenbrand
<david@...nel.org>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka
<vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>, Suren Baghdasaryan
<surenb@...gle.com>, Michal Hocko <mhocko@...e.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/cma: Replace snprintf with strscpy in cma_new_area
On Mon, 26 Jan 2026 16:47:22 -0800 SeongJae Park <sj@...nel.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];
Powered by blists - more mailing lists