Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1801244pxp; Mon, 7 Mar 2022 02:40:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4+O6vzKj12x8SmCPkV6wJK1H3hMRVkMgP83ggkeedyvwcwci1vyZJVghPt6hW11MnqNVM X-Received: by 2002:a17:907:da9:b0:6da:beb8:fdac with SMTP id go41-20020a1709070da900b006dabeb8fdacmr8810168ejc.364.1646649618262; Mon, 07 Mar 2022 02:40:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646649618; cv=none; d=google.com; s=arc-20160816; b=jG/MwyzLrWT5APZJW8PncKIXwBcgboYuEat7/hwLBMddOTE/0K7Ux65P2r4jqk5Iob FYWZSrMk9pdxIrJBS7Q1K3fVIOibsCk6WKsxHl9H0a+sktPYFUWuEU9my+ZFFZVmmIIl 8iNASM5wLDq1EBEkt476KPppRGKXs7e1/UYqM8CmLgT2Pjf06rHSoX15SCOer+WsXbuk 3vdxhlWJEs+EkKZ1ruxoxqNI1o76xDLn8epMf6nbX+n5IVAzKqrdIU1vO+ZkyNOtEuHb d8mUpgYozmQWFM9SwLyIe3AcOotzufJ7UMT9jG65cRiP8n+Ujl8nvKR1PUV7ks+WprL0 pQ/Q== 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=YT9SaQp/EtivHrBj+MQF9iFDtD8yRPr0cubjp/QVDyA=; b=r7QXlpW3j4uOP79aR75uKe4i3Wv+Xa25X5/KIJGWtdo8DHCAxSn95DNyCUMZLrWWLh tLgvmIcEbTb9wqJO3yZ9RuLg88WR9wCaInZxL79ON1YVX21LkM6UiQQnhiJjc2VQBGIx IEBFZRXd7GGAl3Og8VFC9NhQCVqtx/gFpA+bbPdEjV14bjyh+3fPIj8GYirLHQ5sJbNP kLFFj0ozBkBjUgB6fDUmwSw3cJ0Ff133LhercqD6whpCFVHdBuSsojZ7utsKHuP7uQkj TvD+eBCDyitTfEmM1GDmwyuCwkIwF40oFIu0f/eftSO7ZvDf4QyAtcESeg4yYuslq/Pj JFpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="a/5O6lV/"; 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 z7-20020a056402274700b00415b1c624e8si9571240edd.516.2022.03.07.02.39.55; Mon, 07 Mar 2022 02:40:18 -0800 (PST) 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="a/5O6lV/"; 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 S242826AbiCGKLz (ORCPT + 99 others); Mon, 7 Mar 2022 05:11:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231229AbiCGJwK (ORCPT ); Mon, 7 Mar 2022 04:52:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C004776E27; Mon, 7 Mar 2022 01:45:12 -0800 (PST) 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 5B21F612D0; Mon, 7 Mar 2022 09:45:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60386C340E9; Mon, 7 Mar 2022 09:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646646311; bh=J2IJqSVavxlY4rZ2bGBmDCSa/4rvdwBbNFQjq4mtJSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a/5O6lV/rrOlzhAOgVhq2MotfkIClvar2FOZ9LmHXv/obedaUL+swvpvoy9AqHG8C +hWIeNGqrttW7qEvP+AMK3uVYEc5KTJacl0bNMbH1zW2kRoChqVDi411LiAiD7Hger OSTcFR0G1bbjMH6xelUJi6+1UvE60oY2P0dyl6fo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Leoshkevich , Alexander Gordeev , Heiko Carstens , Vasily Gorbik Subject: [PATCH 5.15 201/262] s390/extable: fix exception table sorting Date: Mon, 7 Mar 2022 10:19:05 +0100 Message-Id: <20220307091708.365171874@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091702.378509770@linuxfoundation.org> References: <20220307091702.378509770@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 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: Heiko Carstens commit c194dad21025dfd043210912653baab823bdff67 upstream. s390 has a swap_ex_entry_fixup function, however it is not being used since common code expects a swap_ex_entry_fixup define. If it is not defined the default implementation will be used. So fix this by adding a proper define. However also the implementation of the function must be fixed, since a NULL value for handler has a special meaning and must not be adjusted. Luckily all of this doesn't fix a real bug currently: the main extable is correctly sorted during build time, and for runtime sorting there is currently no case where the handler field is not NULL. Fixes: 05a68e892e89 ("s390/kernel: expand exception table logic to allow new handling options") Acked-by: Ilya Leoshkevich Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman --- arch/s390/include/asm/extable.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/arch/s390/include/asm/extable.h +++ b/arch/s390/include/asm/extable.h @@ -69,8 +69,13 @@ static inline void swap_ex_entry_fixup(s { a->fixup = b->fixup + delta; b->fixup = tmp.fixup - delta; - a->handler = b->handler + delta; - b->handler = tmp.handler - delta; + a->handler = b->handler; + if (a->handler) + a->handler += delta; + b->handler = tmp.handler; + if (b->handler) + b->handler -= delta; } +#define swap_ex_entry_fixup swap_ex_entry_fixup #endif