From patchwork Tue Mar 28 17:58:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Heimes X-Patchwork-Id: 1762446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=axlzr/H3; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PmHVK2jNpz1yYk for ; Wed, 29 Mar 2023 04:58:32 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1phDaT-0000Yr-4h; Tue, 28 Mar 2023 17:58:25 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1phDaR-0000Yb-Hy for kernel-team@lists.ubuntu.com; Tue, 28 Mar 2023 17:58:23 +0000 Received: from T570.fritz.box (p54abbcc7.dip0.t-ipconnect.de [84.171.188.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 2403D41E18 for ; Tue, 28 Mar 2023 17:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1680026303; bh=4o1PJAU5/cMAvdG5ACcRK/tzhOIthxEQCF+x2rZY4rs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=axlzr/H3mEpN8nmeJOi4zg7O/SSQL9LuudZ5ctubcgHFjZgwK7TB9YtVGB/B91Bxb 1hiRDHp+yBp1FhV4tlTY0v1TVXPHm7rj9pkarRBLJVJppxpDhWi8GsFi3OgMZwQN52 22aN4PrsklL/zSdvlGqK7+lw4EtUfxO9Qx8MjdDgAqeX3DUtjSFkEm8OsK5BPwKNBZ xgR63U9PFRyyJ8BIr0bobgozTLNcMn4IBaKsHQvFVY70rfy13hWpIxfTJ+ZVyodgdF rpCPm29a5sX4eDcsBl7rT4rKyGUjJS10DcfF3GdZN9A8RTgNvq1QQWvNwd2RtTLafQ 1ZGPF/0sWg1LA== From: frank.heimes@canonical.com To: kernel-team@lists.ubuntu.com Subject: [L][PATCH 1/1] s390/uaccess: add missing earlyclobber annotations to __clear_user() Date: Tue, 28 Mar 2023 19:58:20 +0200 Message-Id: <20230328175820.76363-2-frank.heimes@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230328175820.76363-1-frank.heimes@canonical.com> References: <20230328175820.76363-1-frank.heimes@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Heiko Carstens BugLink: https://bugs.launchpad.net/bugs/2013088 Add missing earlyclobber annotation to size, to, and tmp2 operands of the __clear_user() inline assembly since they are modified or written to before the last usage of all input operands. This can lead to incorrect register allocation for the inline assembly. Fixes: 6c2a9e6df604 ("[S390] Use alternative user-copy operations for new hardware.") Reported-by: Mark Rutland Link: https://lore.kernel.org/all/20230321122514.1743889-3-mark.rutland@arm.com/ Cc: stable@vger.kernel.org Reviewed-by: Gerald Schaefer Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik (cherry picked from commit 89aba4c26fae4e459f755a18912845c348ee48f3 linux-next) Signed-off-by: Frank Heimes --- arch/s390/lib/uaccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c index 720036fb1924..d44214072779 100644 --- a/arch/s390/lib/uaccess.c +++ b/arch/s390/lib/uaccess.c @@ -172,7 +172,7 @@ unsigned long __clear_user(void __user *to, unsigned long size) "4: slgr %0,%0\n" "5:\n" EX_TABLE(0b,2b) EX_TABLE(6b,2b) EX_TABLE(3b,5b) EX_TABLE(7b,5b) - : "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2) + : "+&a" (size), "+&a" (to), "+a" (tmp1), "=&a" (tmp2) : "a" (empty_zero_page), [spec] "d" (spec.val) : "cc", "memory", "0"); return size;