Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1904553pxb; Mon, 13 Sep 2021 07:53:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5WVuWaFN/8jOBjQNbuXQauzWje57TJO9EqamJWPytd7tb2UH9xFcpTR0WaihQPjmXa5gR X-Received: by 2002:a17:906:7802:: with SMTP id u2mr13266766ejm.325.1631544829001; Mon, 13 Sep 2021 07:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631544828; cv=none; d=google.com; s=arc-20160816; b=CKt2wCAd4w/MdJm4TDG8vZs5t68B0WcGhR0YXwpZqEEDsV4+Zv1UlQEHAQHD7TX1qV e2O4JTC1LrZUFjRM7cUEvG6HVWFCPkOvmUmFT7w4Trb5yazpgds0DN4oyqbEhH58K6eA jZ31S7kPQWj+ImAWD8oEyLhlHo0u15XmgcYGM9wwF/pp2YnBhSZrMpArELfMa7BJmjid DYBqol1EMEH90AOMnTD5WLeQn1yUrJC0eITXK7uuP6j0Z2bFgN5DPYMxdHwoNlESrZtX FMB4kvLtfo5JVStF7Zb66QF0T7fW2UFiqIEV2bx/iCG+YL1b/UF+SKKvhaCSMF907cID epRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PUZAnKEt5KR+OwzGAycBKS/1g08uwjXjaWw14Vq1zd4=; b=sfp8YZQ4vlgzJBxO87Svrh5fMKYPTVKb8QNqCJDhFcKCVFwIiUB6pQDVfTmZh/Heke lYjbRO8gOO8g9H8YsIudUJxcJQnzgNyTw8ZVTwmGDTB9AsLq2zu2TTFTHY0ejqZjhHXV zlpRL44Cq2xvXV0NBqlFRSvY1lsCgCmIPfQPgyHzLBuzG22Y1vvRYGQ31sdbCMQ1Uu+R zXnU18Qq6w5dbPFqYg+Q4hX+lZqU1jis2uYwPNIrQxzZMORRwqp0RCVTG2xGs26scbg6 c7DMrgTuw+nYIk65IQy1LsstbXsyGXVcPpmxd4r2SoZmYJ0SIMZSxiWjzXMrBhNUVwTB Ih1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G1FWDRts; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si8648530edm.103.2021.09.13.07.53.20; Mon, 13 Sep 2021 07:53:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G1FWDRts; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346363AbhIMOvu (ORCPT + 99 others); Mon, 13 Sep 2021 10:51:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:35794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346642AbhIMOqT (ORCPT ); Mon, 13 Sep 2021 10:46:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE16263227; Mon, 13 Sep 2021 13:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541530; bh=pUKMgRRhubTv8YlIAIeLAWIfKVKabc8WEZ8bBTka+oM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G1FWDRts7AjgM6o0sn+JzYZPZzcs2tzP6pE0hX0hw1gDJbdnIPY1Vz7wV2qYV43V5 pkVMq+OGSFFxQFHseBqgQIm5b3CxqjrP6/iVkhKMafW91WAGIO7j4UUO9kSuIP0rVt UbF5+ciS1QsDWqtd86KTm5W+BTY1bv2Z41Nwu4VE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Helge Deller , Arnd Bergmann , John David Anglin Subject: [PATCH 5.14 333/334] parisc: Fix unaligned-access crash in bootloader Date: Mon, 13 Sep 2021 15:16:27 +0200 Message-Id: <20210913131124.688441395@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Helge Deller commit c42813b71a06a2ff4a155aa87ac609feeab76cf3 upstream. Kernel v5.14 has various changes to optimize unaligned memory accesses, e.g. commit 0652035a5794 ("asm-generic: unaligned: remove byteshift helpers"). Those changes triggered an unalignment-exception and thus crashed the bootloader on parisc because the unaligned "output_len" variable now suddenly was read word-wise while it was read byte-wise in the past. Fix this issue by declaring the external output_len variable as char which then forces the compiler to generate byte-accesses. Signed-off-by: Helge Deller Cc: Arnd Bergmann Cc: John David Anglin Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 Fixes: 8c031ba63f8f ("parisc: Unbreak bootloader due to gcc-7 optimizations") Fixes: 0652035a5794 ("asm-generic: unaligned: remove byteshift helpers") Cc: # v5.14+ Signed-off-by: Greg Kroah-Hartman --- arch/parisc/boot/compressed/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/parisc/boot/compressed/misc.c +++ b/arch/parisc/boot/compressed/misc.c @@ -26,7 +26,7 @@ extern char input_data[]; extern int input_len; /* output_len is inserted by the linker possibly at an unaligned address */ -extern __le32 output_len __aligned(1); +extern char output_len; extern char _text, _end; extern char _bss, _ebss; extern char _startcode_end;