From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
tglx@linutronix.de, Yury Norov <ynorov@marvell.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: LZ4 decompressor broken on ARM due to missing strchrnul() string traverse in cpumask_parse"
Date: Tue, 28 May 2019 13:53:46 +0200
Message-ID: <20190528115346.f5a7kn3hdnuf5rts@linutronix.de> (raw)
In-Reply-To: <ffc779fe-3735-9665-8ee2-6a3ff1a7dd83@rasmusvillemoes.dk>
On 2019-05-28 13:33:12 [+0200], Rasmus Villemoes wrote:
> > How do we deal with this one?
>
> Urgh. The problem is really in arch/arm/boot/compressed/decompress.c
> which does
>
> #define _LINUX_STRING_H_
>
> preventing linux/string.h from providing strchrnul. It also #includes
> asm/string.h, which for arm has a declaration of strchr(), explaining
> why this didn't use to fail.
>
> However, the solution is also in the same file, it already has a section
>
> /* Not needed, but used in some headers pulled in by decompressors */
> extern char * strstr(const char * s1, const char *s2);
> extern size_t strlen(const char *s);
> extern int memcmp(const void *cs, const void *ct, size_t count);
>
> so just add another declaration to that list - I strongly assume we
> won't get a link failure since I find it hard to believe the
> decompressor would actually call cpumask_parse...
The hunk at the bottom of this mail compiles. Care to send to formal
patch?
> I'm wondering why this wasn't caught by 0day and/or while in -next?
must be related to lz4 usage in the configs tested :) A few set
XZ/LZO/LZMA. Majority falls back to GZIP.
> Rasmus
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index c16c1829a5e4f..05814c2b382a3 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -32,6 +32,7 @@
extern char * strstr(const char * s1, const char *s2);
extern size_t strlen(const char *s);
extern int memcmp(const void *cs, const void *ct, size_t count);
+extern char * strchrnul(const char *,int);
#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
Sebastian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply index
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 11:04 Sebastian Andrzej Siewior
2019-05-28 11:33 ` Rasmus Villemoes
2019-05-28 11:53 ` Sebastian Andrzej Siewior [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=20190528115346.f5a7kn3hdnuf5rts@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=tglx@linutronix.de \
--cc=ynorov@marvell.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
Linux-ARM-Kernel Archive on lore.kernel.org
Archives are clonable:
git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
linux-arm-kernel@lists.infradead.org
public-inbox-index linux-arm-kernel
Example config snippet for mirrors
Newsgroup available over NNTP:
nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git