From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3547DC04AB6 for ; Tue, 28 May 2019 11:53:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 126292075B for ; Tue, 28 May 2019 11:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbfE1Lxv (ORCPT ); Tue, 28 May 2019 07:53:51 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50285 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbfE1Lxu (ORCPT ); Tue, 28 May 2019 07:53:50 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1hVafq-0003mE-N3; Tue, 28 May 2019 13:53:46 +0200 Date: Tue, 28 May 2019 13:53:46 +0200 From: Sebastian Andrzej Siewior To: Rasmus Villemoes Cc: Yury Norov , Andrew Morton , tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: LZ4 decompressor broken on ARM due to missing strchrnul() string traverse in cpumask_parse" Message-ID: <20190528115346.f5a7kn3hdnuf5rts@linutronix.de> References: <20190528110412.gg66fl67yahtwb6i@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 366ABC04AB6 for ; Tue, 28 May 2019 11:53:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 039CC2075B for ; Tue, 28 May 2019 11:53:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HXZ0KLUd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 039CC2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YWtmpfnwN71Nh1/TxO8Du5cQIZ1iMJbGUchaOaOJ3wE=; b=HXZ0KLUdJ8Vx0n 4g40OMOWK0Yqo2V/E7BQJRHT9oLJujuO/EQOLWQmreOfJGOEUOE7hjDsACDIJLJswrZaukJtUPYOX sWp993y2nEeIldDxI8c03n6+bfBfkuloLqN5p4Ll0hMs9kISwz1oh65NlT/Ha32xu78MJJ9gmS5WP 4RaHRYjIUsRUm+DWayNueGlOrN/dJyOsVVpPX8SPIWhE1MfduqOMKdJpS8JyVuR0wwudFAZe72pdr GtHaaljI5ajJ6upzzefqhU1901ryenjIWW1BLsMx36aHYpA1XQNxNCABhhRTyKMGzgCIUkChm+r9b YvzXBuTgjp2RJTyWmBwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVafz-0005LA-7O; Tue, 28 May 2019 11:53:55 +0000 Received: from galois.linutronix.de ([2a01:7a0:2:106d:700::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVafv-0005KR-CB for linux-arm-kernel@lists.infradead.org; Tue, 28 May 2019 11:53:52 +0000 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1hVafq-0003mE-N3; Tue, 28 May 2019 13:53:46 +0200 Date: Tue, 28 May 2019 13:53:46 +0200 From: Sebastian Andrzej Siewior To: Rasmus Villemoes Subject: Re: LZ4 decompressor broken on ARM due to missing strchrnul() string traverse in cpumask_parse" Message-ID: <20190528115346.f5a7kn3hdnuf5rts@linutronix.de> References: <20190528110412.gg66fl67yahtwb6i@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190528_045351_554551_EE287F3E X-CRM114-Status: GOOD ( 13.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Morton , tglx@linutronix.de, Yury Norov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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