From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonas Rebmann <jre@pengutronix.de>
Cc: Kees Cook <kees@kernel.org>, Andy Shevchenko <andy@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@pengutronix.de
Subject: Re: [PATCH 4/5] lib/string_helpers: use full destination buffer in string_unescape()
Date: Thu, 17 Sep 2026 15:32:08 +0300 [thread overview]
Message-ID: <aqvdyIsM_TV4OC4W@ashevche-desk.local> (raw)
In-Reply-To: <ae3d04de-b12b-454d-93f7-31ce912f6f8c@pengutronix.de>
On Thu, Sep 17, 2026 at 11:02:52AM +0200, Jonas Rebmann wrote:
> On 2026-09-17 09:45, Andy Shevchenko wrote:
> > On Wed, Sep 16, 2026 at 07:38:09PM +0200, Jonas Rebmann wrote:
...
> > > + test_string_unescape_one(test, "short buffer", UNESCAPE_HEX, "\\x41\\x41B", 4, "AAB", 3);
> > > + test_string_unescape_one(test, "unrecognized escape at end", UNESCAPE_HEX, "B\\qX", 4, "B\\q", 3);
> >
> > Still wondering if we can incorporate this into the "combined" loop?
>
> Both these tests really only fail without my fixes because the
> destination buffer is short, barely fitting the result.
>
> With a buffer length of 4 it yields "A\", for 5 "AA" and for 6 "AAB",
> a bug because "AAB" would fit the 4 byte buffer too.
So, we need to extend the current loop to pass the buffer length like -5, -4,
-3, -2, -1, 0, +1 from the expected length and check that it's cut correctly
along with no garbage at the end. It will help all test cases, and not just
a single one or a couple.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-09-17 12:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 17:38 [PATCH 0/5] lib/string_helpers: fixes and test cases for string_unescape() Jonas Rebmann
2026-09-16 17:38 ` [PATCH 1/5] lib/tests: string_helpers: check null terminator too Jonas Rebmann
2026-09-17 7:14 ` Andy Shevchenko
2026-09-17 8:58 ` Jonas Rebmann
2026-09-17 9:07 ` Andy Shevchenko
2026-09-16 17:38 ` [PATCH 2/5] lib/tests: string_helpers: drop unused parameters Jonas Rebmann
2026-09-17 7:18 ` Andy Shevchenko
2026-09-17 8:58 ` Jonas Rebmann
2026-09-16 17:38 ` [PATCH 3/5] lib/tests: string_helpers: introduce test_string_unescape_one Jonas Rebmann
2026-09-17 7:21 ` Andy Shevchenko
2026-09-17 8:58 ` Jonas Rebmann
2026-09-17 9:08 ` Andy Shevchenko
2026-09-17 9:56 ` Jonas Rebmann
2026-09-17 12:17 ` Andy Shevchenko
2026-09-16 17:38 ` [PATCH 4/5] lib/string_helpers: use full destination buffer in string_unescape() Jonas Rebmann
2026-09-17 7:45 ` Andy Shevchenko
2026-09-17 9:02 ` Jonas Rebmann
2026-09-17 12:32 ` Andy Shevchenko [this message]
2026-09-17 15:47 ` Jonas Rebmann
2026-09-16 17:38 ` [PATCH 5/5] lib/string_helpers: fix counting of remaining bytes " Jonas Rebmann
2026-09-17 8:04 ` Andy Shevchenko
2026-09-16 21:36 ` [PATCH 0/5] lib/string_helpers: fixes and test cases for string_unescape() Andrew Morton
2026-09-16 23:13 ` Eric Biggers
2026-09-17 0:04 ` Andrew Morton
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=aqvdyIsM_TV4OC4W@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andy@kernel.org \
--cc=jre@pengutronix.de \
--cc=kees@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@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®