Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3456719pxb; Mon, 4 Apr 2022 17:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyOrl46HW61hGkC1jjnzzyrbrSxDYXqovfFWzQPykgKC3wRC0PBaCBTgjvYpStUHAHJbw3 X-Received: by 2002:a17:903:2309:b0:153:ad3f:b074 with SMTP id d9-20020a170903230900b00153ad3fb074mr703846plh.82.1649118872595; Mon, 04 Apr 2022 17:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649118872; cv=none; d=google.com; s=arc-20160816; b=ifxeDhg+Ud9fW+Ml1jExpZKWUXnw2Dm0FdCcYrNj64Bfx5VfZfad9jGtogm8531Aii CmU0eOD6hOfgLCBOtXvyTLoyxm5kKj1R6/9/qrZ6XYNIOlpAb4xHG0HPFFkv0ABUWw6q hU/wO893jcG6t6ura0wdMK2RQnKvUWupnqav7oaEomnZ6Mm4375ROM3j3YqRqUjHWCh3 rMmjyyfMjCoi5XojcKqI9/FzS4H0epsF7GVlHbWj1qCHYbqB9IuVhnnGzXAOcjBFn8aU i/Ph7QjXm4A2Y/pHe5HrtQxImwRqA5dK+is1+8tbb13usHm9EPTjThb6xCWawQPjXfSP +X7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ubrQWMJ1uk1qCVEaNU5C2Zro8EhwB8oevnnpqgA4914=; b=soIqc3a59LUqGmI5RKJ8bQXPUp4L8aypFGgpeJQrGiB+0BT5CHrzTmEFTjVKIJIC8d DDMeEYPQiAJmsaVNq2kWbsROPR0ymGbO39hX00tJsVmXvqNb/fVl94ANwEsl5dEJN//h tc2RExtnHqpXNo3YY0LBn3s/0jtxluwCgEMWgLvy/4UidgN+i+YrMBytIFnQ6KwmftDW ChfzjVYX7+dqdKDVyFJ8VKarB06ZcxhMVRtitSIYAIIIYGsnNu4R2lsmvfIO0k0nALHc PlTgf10PC14LCyMsXa3yIW+xgL3VrplWLvQ5H+YIfwOeyGFbniQERxboKc/i3jnhCX5u YsCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=P8OPWdRl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s21-20020a170902a51500b00153f463a7e2si10377607plq.126.2022.04.04.17.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 17:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=P8OPWdRl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 594808A6E7; Mon, 4 Apr 2022 16:52:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236141AbiDARDg (ORCPT + 99 others); Fri, 1 Apr 2022 13:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbiDARDf (ORCPT ); Fri, 1 Apr 2022 13:03:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE6C15D3BC for ; Fri, 1 Apr 2022 10:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ubrQWMJ1uk1qCVEaNU5C2Zro8EhwB8oevnnpqgA4914=; b=P8OPWdRlRLUHuHDjNg/AEpbeSW 8lDIDtxENtgnP3j0mnwrc4UpN30iC8l0480E2xJlIqvFDT/9tLnNZ4kIkTGDKco8e25z4qbqBNyYS T37IqOFNe64r7yf9dN/FYoVdNv+HXNSLlHhChTAAaHX3Y7tgj3yl5/yPbSNYwSU4Gwo6SlDxmUV/D Z1jrDMzNDL6A2KJm5oONP4rAIjlrJzA3I7Q/oErDE05f1OkcIO/ZcR0YWokAFFlbt1YpdykHGZnws 5RkiZd9bA8Iki7it0/BNlmqEH3t/F7gJvzrzWLnQjtFGRKam9FW/vszqamqlwghy8vwio9l3k41Eh f6xU3dug==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1naKeP-003OVv-FC; Fri, 01 Apr 2022 17:01:29 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id A3DBB9861EF; Fri, 1 Apr 2022 19:01:26 +0200 (CEST) Date: Fri, 1 Apr 2022 19:01:26 +0200 From: Peter Zijlstra To: Youquan Song Cc: Tony Luck , Borislav Petkov , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org, Zhiquan Li , Youquan Song Subject: Re: [PATCH] x86/uaccess: restore get_user exception type to EX_TYPE_UACCESS Message-ID: <20220401170126.GY8939@worktop.programming.kicks-ass.net> References: <20220328201748.1864491-1-tony.luck@intel.com> <20220330123205.GL8939@worktop.programming.kicks-ass.net> <20220331113125.GA2628@linux-youquan.bj.intel.com> <20220331175113.GV8939@worktop.programming.kicks-ass.net> <20220401124519.GA6935@linux-youquan.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220401124519.GA6935@linux-youquan.bj.intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Fri, Apr 01, 2022 at 08:45:19PM +0800, Youquan Song wrote: > On Thu, Mar 31, 2022 at 07:51:13PM +0200, Peter Zijlstra wrote: > > On Thu, Mar 31, 2022 at 07:31:25PM +0800, Youquan Song wrote: > > > > Did you do your testing on RHEL or something daft like that? > > > Tested on RHEL8.x > > > > Right; the home of obsolete software.. :-) > > > > > > Something like the below can also work, I suppose. But please, add > > > > coherent comments to the extable code with useful references to the MCE > > > > code that does this abuse. > > > Here is the full fix patch depending on your suggestion. Thanks a lot! > > > > Did you verify this was indeed the only UACCESS I lost? > > The full fix patch has included a change in error_context to identify > this case to be MCE_IN_KERNEL_COPYIN. I verfied it fix the issue. That's not what I asked... :-( What that means is that you go look at the commits that reworked all this; starting here: https://lore.kernel.org/all/20211110100102.250793167@infradead.org/ and check how many UACCESS's got removed: $ git diff 3411506550b1..82a8954acd93 | grep "^-.*UA" | wc -l 33 And then verify they're all good now and that we don't find another missing instance in a few weeks or later... Because when I look at that, stuff like: --- a/arch/x86/include/asm/futex.h +++ b/arch/x86/include/asm/futex.h @@ -17,13 +17,9 @@ do { \ int oldval = 0, ret; \ asm volatile("1:\t" insn "\n" \ "2:\n" \ - "\t.section .fixup,\"ax\"\n" \ - "3:\tmov\t%3, %1\n" \ - "\tjmp\t2b\n" \ - "\t.previous\n" \ - _ASM_EXTABLE_UA(1b, 3b) \ + _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %1) \ : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \ - : "i" (-EFAULT), "0" (oparg), "1" (0)); \ + : "0" (oparg), "1" (0)); \ if (ret) \ goto label; \ *oval = oldval; \ makes me think this isn't the last of it... Hmmm?