From: Kees Cook <kees@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Jiazi Li <jqqlijiazi@gmail.com>,
Andy Shevchenko <andy@kernel.org>,
Ping-Ke Shih <pkshih@realtek.com>,
Julia Lawall <Julia.Lawall@inria.fr>,
Nicolas Palix <nicolas.palix@imag.fr>,
linux-hardening@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 0/3] Add str_alloc_free() helper
Date: Mon, 11 May 2026 12:31:29 -0700 [thread overview]
Message-ID: <202605111230.319F9EDB2@keescook> (raw)
In-Reply-To: <fe81137b849e349bd9b0529c7e0e4be6b4099a5b.camel@sipsolutions.net>
On Thu, May 07, 2026 at 01:10:03PM +0200, Johannes Berg wrote:
> On Thu, 2026-05-07 at 19:03 +0800, Jiazi Li wrote:
> > Currently finds 4 locations:
> > ./drivers/net/wireless/realtek/rtw89/fw.c:2557:7-12: opportunity for str_alloc_free(valid)
> > ./drivers/net/wireless/realtek/rtw89/fw.c:2693:7-12: opportunity for str_alloc_free(valid)
> > ./drivers/android/tests/binder_alloc_kunit.c:196:6-21: opportunity for str_alloc_free(alloc -> pages [ i ])
> > ./mm/slub.c:1634:3-8: opportunity for str_alloc_free(alloc)
>
> It's what, three characters shorter for four users each? Is there really
> much point?
>
> Reading just the name also is really confusing - yes it lines up with
> str_assert_deassert, but "alloc_free" really doesn't seem very obvious -
> why would you alloc and free a string in one function call?
Yeah, there seems to only be 1 source file instance of this? I don't
think this needs the entire helper infrastructure.
--
Kees Cook
prev parent reply other threads:[~2026-05-11 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 11:03 [PATCH v3 0/3] Add str_alloc_free() helper Jiazi Li
2026-05-07 11:03 ` [PATCH v3 1/3] lib/string_choices: " Jiazi Li
2026-05-08 5:18 ` Greg KH
2026-05-07 11:03 ` [PATCH v3 2/3] wifi: rtw89: Make use of str_alloc_free helper Jiazi Li
2026-05-07 11:04 ` [PATCH v3 3/3] coccinelle: Add rules to find str_alloc_free() replacements Jiazi Li
2026-05-07 11:10 ` [PATCH v3 0/3] Add str_alloc_free() helper Johannes Berg
2026-05-11 19:31 ` Kees Cook [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=202605111230.319F9EDB2@keescook \
--to=kees@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=andy@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=jqqlijiazi@gmail.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nicolas.palix@imag.fr \
--cc=pkshih@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.