Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1186898ybv; Thu, 20 Feb 2020 15:05:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxkaS2Jit5iKng2cI7fQ5xOwXFg6t8h4f7EijZEYI14RaNv7msJoEruq4mldce+fUi4sv22 X-Received: by 2002:a05:6830:1049:: with SMTP id b9mr26850829otp.100.1582239946033; Thu, 20 Feb 2020 15:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582239946; cv=none; d=google.com; s=arc-20160816; b=hbPacEiNpOC5gpDUPK38okbgOzKfYsnt1xCqGOHfbTF0Rf8h5KLYps3swdhJuUyu53 LMCYh3/MIIAn08W4u1dQHa1OugHB2I2dhUT0l1hX6eOJM+HbQj8ZrF2pXQp4eC0LkKHD CbQkaGRpmgVhV6qppbW1RJD2q4FXgj6Tq9a4zjYgi091/D36/kDa8J/lSNxDm+tv3gp3 gYSJpQgPqcBRahmU1KdHGGGrJuUxJ/k2dXPlnu/NCmdEDKFpSiQLGrKuGB//4iwciQ1x 9Ais8Y41kG7zWd0BWUfr9C3VsGTyzU5uY8kMiKFxjwUOM70r/KEpSmmh55CQuzREjQrT SfAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=WYZIYvGY8m/+vgHDg2J/54yx2yP9mb5iHZCMy5wPUP8=; b=P0bdl/2Bt9NWStiuwv6dqOENyJ8FsFnip2qJFilr/7BX8l+xh9c2I6Wetlyy9SYpu0 BAXdtsqs4A7z+ywh5ZmyWPnmsVic8ZwgZgWFwekcZKLmcIrj0NGJouiER2AvTfSOjkGo yeN1gdySCcCWS2LrIw+4HvFqwEtAwikjuDix6XPShIU3V00Hm9HBVsPWbkXevHh1rqEi ViXjkFhHQLcKMcxm67d0dY2mFfCSQf/isFMQtjS3gMgnlXNRZsJ+mpWhWd3V6h3ASMM7 ZRLb2AyrtmXUO4s6IxvNuEuYXSa3tCI/oW4KrsG8JUBAfogdTMgMpsnoKT1qM8BATjjT BsRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u204si373233oia.55.2020.02.20.15.05.33; Thu, 20 Feb 2020 15:05:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729245AbgBTXEX (ORCPT + 99 others); Thu, 20 Feb 2020 18:04:23 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:44613 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbgBTXEX (ORCPT ); Thu, 20 Feb 2020 18:04:23 -0500 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j4urk-0001Jy-ST; Fri, 21 Feb 2020 00:04:21 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 4BCBA100E35; Fri, 21 Feb 2020 00:04:20 +0100 (CET) From: Thomas Gleixner To: Brian Gerst Cc: LKML , the arch/x86 maintainers Subject: Re: [PATCH] x86/entry/32: Add missing ASM_CLAC in general_protection entry In-Reply-To: References: <87zhdeq4qu.fsf@nanos.tec.linutronix.de> Date: Fri, 21 Feb 2020 00:04:20 +0100 Message-ID: <87r1yooo7f.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Brian Gerst writes: > On Wed, Feb 19, 2020 at 4:58 AM Thomas Gleixner wrote: >> >> All exception entry points must have ASM_CLAC right at the >> beginning. The general_protection entry is missing one. >> >> Fixes: e59d1b0a2419 ("x86-32, smap: Add STAC/CLAC instructions to 32-bit kernel entry") >> Signed-off-by: Thomas Gleixner >> Cc: stable@vger.kernel.org >> --- >> arch/x86/entry/entry_32.S | 1 + >> 1 file changed, 1 insertion(+) >> >> --- a/arch/x86/entry/entry_32.S >> +++ b/arch/x86/entry/entry_32.S >> @@ -1681,6 +1681,7 @@ SYM_CODE_START(int3) >> SYM_CODE_END(int3) >> >> SYM_CODE_START(general_protection) >> + ASM_CLAC >> pushl $do_general_protection >> jmp common_exception >> SYM_CODE_END(general_protection) > > How about moving ASM_CLAC to common_exception instead? That would > save a few bytes (kernel text + alternatives), and the AC bit has no > effect on kernel stack pushes. Agreed, but that's a seperate cleanup. The fix is the right thing also for backports. Aisde of that this mindlessly copied code will be gone in the foreseeable future. Just lacks some testing and changelog writing :) Thanks, tglx