U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Jerome Forissier <jerome.forissier@linaro.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 3/3] net: use strnstr() for lwip_strnstr()
Date: Mon, 20 Jan 2025 19:05:47 -0600	[thread overview]
Message-ID: <20250121010547.GA2881802@bill-the-cat> (raw)
In-Reply-To: <20250103232118.711135-4-heinrich.schuchardt@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

On Sat, Jan 04, 2025 at 12:21:18AM +0100, Heinrich Schuchardt wrote:

> Using strstr() instead of strnstr() creates a security concern.
> 
> Fixes: 1c41a7afaa15 ("net: lwip: build lwIP")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>  lib/lwip/u-boot/arch/cc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/lwip/u-boot/arch/cc.h b/lib/lwip/u-boot/arch/cc.h
> index de138846358..6104c296f6f 100644
> --- a/lib/lwip/u-boot/arch/cc.h
> +++ b/lib/lwip/u-boot/arch/cc.h
> @@ -34,7 +34,7 @@
>  	       x, __LINE__, __FILE__); } while (0)
>  
>  #define atoi(str) (int)dectoul(str, NULL)
> -#define lwip_strnstr(a, b, c)  strstr(a, b)
> +#define lwip_strnstr(a, b, c)  strnstr(a, b, c)
>  
>  #define LWIP_ERR_T int
>  #define LWIP_CONST_CAST(target_type, val) ((target_type)((uintptr_t)val))

This leads to:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=10370&view=logs&j=45c0c132-56cd-504a-56c7-1b8a534aa92b&t=f95d3367-9db2-5f2a-d3ed-8901d714dd66
as a failure, that I only end up seeing in Azure (I didn't track down if
there's some good reason we don't see this in Gitlab).

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  parent reply	other threads:[~2025-01-21  1:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03 23:21 [PATCH 0/3] net: use strnstr() for lwip_strnstr() Heinrich Schuchardt
2025-01-03 23:21 ` [PATCH 1/3] lib: implement strnstr() Heinrich Schuchardt
2025-01-06  7:44   ` Jerome Forissier
2025-01-06 10:14     ` Rasmus Villemoes
2025-01-06 10:22       ` Jerome Forissier
2025-01-03 23:21 ` [PATCH 2/3] test: unit tests for strstr() and strnstr() Heinrich Schuchardt
2025-01-09  7:53   ` Ilias Apalodimas
2025-01-03 23:21 ` [PATCH 3/3] net: use strnstr() for lwip_strnstr() Heinrich Schuchardt
2025-01-06  7:50   ` Jerome Forissier
2025-01-21  1:05   ` Tom Rini [this message]
2025-01-21  2:18     ` Heinrich Schuchardt
2025-01-21  2:33       ` Tom Rini
2025-01-20 20:52 ` [PATCH 0/3] " Tom Rini
2025-01-20 20:54   ` Tom Rini

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=20250121010547.GA2881802@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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