Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4440934rwb; Tue, 6 Sep 2022 07:35:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kb82QTeJQr5ydXNnZ8N0uqSkCH4dmknN4NPPQyZuI5j+1rF80YuVD/6Pb6UE7wAfo88q8 X-Received: by 2002:a17:902:cf0e:b0:172:60b7:777c with SMTP id i14-20020a170902cf0e00b0017260b7777cmr55221165plg.132.1662474902408; Tue, 06 Sep 2022 07:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662474902; cv=none; d=google.com; s=arc-20160816; b=o6LALREi7ba1O3ybJcfaJeuQanNUxi0I3MkSM1tiztyGP34cyfZnekSzXTw9W1vdDB f+Le/NQFhv8K/xDS+QnQwe4zRayC7NuUZbhV+kz1OWfXbrOQY4PI0mqjCSsS67Av/lCN nNZ9mVJfI1Ng7D/eAdPea2n20lGCtewPjWzvnvrn7nf+1WItdNWRyjHDe3u53i/M8qBA TNEF7xvWuO4YHEe9VNPgUqQBcI0uQkTU1OdpgsYYOmyZwPBhk22zBGUYZOyY4sweBPL+ nR1HQji9yphAznH5fGF+PtTgrT624GHvrwJdWwm27CnTSzna6TsYG+phbqw86AuThqKR nGvQ== 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=ekGmXJxDaGFJKb4VyG3LhqiTggYItvpRGHlEPeETng0=; b=PmBut0BgJGm9FYoNs9r0pu2uCQRsnphFhT26iPRvk6gy60ec1kzxsFWDo9YSatGrzO mvQPAZf7NHynsUagb1wkLMskMMSbrQd0NEtSz1JWXKEcdCI/pwQNWgOEvcb9+qNdc7S9 mFqnVhil3Lm2rAgIjBNJuoYAxi/UzfNOEgcj10lhsoUIFfGSt9Cou218SfJslMTcLIJw dvolIUmhuWpiyC/7rlpPtqf8xCGZLhU+p0ObIVzJYsYGSgnaoFxMlkpswWS0J092fICo Z8D7NhTnul5gclZkegWmEWTd4dyZbvhM8uki8g0fDSYXJoaof/wLqHfvHgOJBJp27bzH yz4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zBLnSwEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a635850000000b0041bd3212b81si10153495pgm.254.2022.09.06.07.34.44; Tue, 06 Sep 2022 07:35:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zBLnSwEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237605AbiIFNrr (ORCPT + 99 others); Tue, 6 Sep 2022 09:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240582AbiIFNob (ORCPT ); Tue, 6 Sep 2022 09:44:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EED0A7F131; Tue, 6 Sep 2022 06:38:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93C7061560; Tue, 6 Sep 2022 13:36:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E3A7C43141; Tue, 6 Sep 2022 13:36:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471376; bh=MquDEA8CQgHmN0CUJSX4J17t2kk87gcl4YYwnL0gxWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zBLnSwEgh68WXGBLi25rDeuDXEZFXXrDOxxJhlI/l17vl0zTP2YUZvpGUvYZu8cPG Lv+/twdbx50jkIheeiwPljVm60l7kHqbL8PuMyPIZCmvBQek8w0tDIS6UR8uUwdGOL m/X4V+BOMZOeVhObDSnbjGAEInPo43U7wA/V77rA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Poimboeuf , Heiko Carstens , Vasily Gorbik Subject: [PATCH 5.10 61/80] s390: fix nospec table alignments Date: Tue, 6 Sep 2022 15:30:58 +0200 Message-Id: <20220906132819.604442990@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132816.936069583@linuxfoundation.org> References: <20220906132816.936069583@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Poimboeuf commit c9305b6c1f52060377c72aebe3a701389e9f3172 upstream. Add proper alignment for .nospec_call_table and .nospec_return_table in vmlinux. [hca@linux.ibm.com]: The problem with the missing alignment of the nospec tables exist since a long time, however only since commit e6ed91fd0768 ("s390/alternatives: remove padding generation code") and with CONFIG_RELOCATABLE=n the kernel may also crash at boot time. The above named commit reduced the size of struct alt_instr by one byte, so its new size is 11 bytes. Therefore depending on the number of cpu alternatives the size of the __alt_instructions array maybe odd, which again also causes that the addresses of the nospec tables will be odd. If the address of __nospec_call_start is odd and the kernel is compiled With CONFIG_RELOCATABLE=n the compiler may generate code that loads the address of __nospec_call_start with a 'larl' instruction. This will generate incorrect code since the 'larl' instruction only works with even addresses. In result the members of the nospec tables will be accessed with an off-by-one offset, which subsequently may lead to addressing exceptions within __nospec_revert(). Fixes: f19fbd5ed642 ("s390: introduce execute-trampolines for branches") Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/8719bf1ce4a72ebdeb575200290094e9ce047bcc.1661557333.git.jpoimboe@kernel.org Cc: # 4.16 Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -122,6 +122,7 @@ SECTIONS /* * Table with the patch locations to undo expolines */ + . = ALIGN(4); .nospec_call_table : { __nospec_call_start = . ; *(.s390_indirect*)