From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Muhammad Bilal <meatuni001@gmail.com>
Cc: "Jorge Lopez" <jorge.lopez2@hp.com>,
"Hans de Goede" <hansg@kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Thomas Weißschuh" <linux@weissschuh.net>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH v6] platform/x86: hp-bioscfg: fix heap OOB in hp_enforce_single_line_input()
Date: Wed, 21 Oct 2026 12:40:58 +0300 (EEST) [thread overview]
Message-ID: <273be4cc-ad7d-cdcd-de25-8d1439bed3e3@linux.intel.com> (raw)
In-Reply-To: <a905f45d-aec8-569f-d5bc-718896f7c9c9@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 726 bytes --]
On Wed, 21 Oct 2026, Ilpo Järvinen wrote:
> On Wed, 21 Oct 2026, Muhammad Bilal wrote:
>
> > Hi Ilpo,
> >
> > > Why use n variant?
> > strnlen() keeps the read within count, which is the size of buf as far
> > as this helper knows, so it does not depend on the caller NUL
> > terminating the buffer. Both current callers pass a kstrdup() copy, so
> > strlen() works too. I can switch to it in v7 if you prefer.
>
> As the contract here is the input must be a string, I don't see any need
> to limit the length with n variant so I do prefer strlen(). Also, we know
> that it should not be longer than count anyway.
I only now notice Andy's comments which seem better suggestion in general.
--
i.
next prev parent reply other threads:[~2026-10-21 9:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 2:53 Muhammad Bilal
2026-10-20 21:19 ` Ilpo Järvinen
2026-10-21 3:41 ` Muhammad Bilal
2026-10-21 9:05 ` Ilpo Järvinen
2026-10-21 9:40 ` Ilpo Järvinen [this message]
2026-10-21 6:35 ` Andy Shevchenko
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=273be4cc-ad7d-cdcd-de25-8d1439bed3e3@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hansg@kernel.org \
--cc=jorge.lopez2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=meatuni001@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®