From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6925EC282EC for ; Sat, 8 Mar 2025 11:26:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A70556B0082; Sat, 8 Mar 2025 06:26:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F9C06B0083; Sat, 8 Mar 2025 06:26:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C31C6B0085; Sat, 8 Mar 2025 06:26:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7181B6B0082 for ; Sat, 8 Mar 2025 06:26:03 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1AA7B16168E for ; Sat, 8 Mar 2025 11:26:05 +0000 (UTC) X-FDA: 83198154690.12.0E163D7 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by imf27.hostedemail.com (Postfix) with ESMTP id 4A4D340002 for ; Sat, 8 Mar 2025 11:26:01 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=nrcv0zI8; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf27.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741433163; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GM5S3cFClXldgr+roHNekbKFyWqgvgh/iNs0mzaLJow=; b=WbjHMewomhjXUWbyfiWX7EmCZsTFm+hRyjm2sj4QkVR+TGXxHFASAKTJd++ZmEMJii1KHP QONJB1wP494QP1nBDRyZn9TId5pGNiqqu6gHrzv3vYlPgXuQHPoeCjiuoH9krI4/hTVYET uxTPTv4cdfTOPR7dPqVzVMg2U7W+hug= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741433163; a=rsa-sha256; cv=none; b=CMSbNYptS7O122BvhNqZj3RutPmdHZlm6u7Rma0bGA+z1S6uTvGT/pNqdRI7sTby3v5vNM ESSin3PkX/f1GH74daqCy/dSguuf0bPSzfLLkNDmqRdI83er9SdB/8P1MfAKzIumI/CBdz 6iCO1HrWOaHjKw2bwFzF303cGr6WdmQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=nrcv0zI8; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf27.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1741433159; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=GM5S3cFClXldgr+roHNekbKFyWqgvgh/iNs0mzaLJow=; b=nrcv0zI8TlJV+Jt83FYP39G7IgQpiAOFyUKA/UZC44Fk3QpkHs7bDCfDFykZjSwOWRzIWtbmZoSWuysaTqgmeeUEoLig97SxlkUvkf/zWLyF4ePxCu6Qu8I6i/pC+EjwrAv01bU1Xh6tXJLteGqtDa0naEcLKCn8y9UEVPzKvlo= Received: from 30.246.161.128(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0WQukq4m_1741433156 cluster:ay36) by smtp.aliyun-inc.com; Sat, 08 Mar 2025 19:25:57 +0800 Message-ID: <5966a572-f69b-404d-b632-9b29f52656b0@linux.alibaba.com> Date: Sat, 8 Mar 2025 19:25:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/3] x86/mce: Use is_copy_from_user() to determine copy-from-user context To: Borislav Petkov Cc: tony.luck@intel.com, peterz@infradead.org, catalin.marinas@arm.com, yazen.ghannam@amd.com, akpm@linux-foundation.org, linmiaohe@huawei.com, nao.horiguchi@gmail.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, jpoimboe@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, baolin.wang@linux.alibaba.com, tianruidong@linux.alibaba.com References: <20250307054404.73877-1-xueshuai@linux.alibaba.com> <20250307054404.73877-2-xueshuai@linux.alibaba.com> <20250307204018.GAZ8tZstt11Y4KFprC@fat_crate.local> From: Shuai Xue In-Reply-To: <20250307204018.GAZ8tZstt11Y4KFprC@fat_crate.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: xi3oeu8zodx3emsm9st6ax4q9jdro6is X-Rspamd-Server: rspam05 X-Rspam-User: X-Rspamd-Queue-Id: 4A4D340002 X-HE-Tag: 1741433161-250635 X-HE-Meta: U2FsdGVkX1+0wLktR0f+GAtS1RHslV0jn11fKQHs6XRPPsaSlHhBZeAq77oSibeFwLeiYvF84KVlX7RcYOqtLhNYznnu0kvJukG8UEZbKMpp2Ylk5r+infyjj160sabih42UFnYyUeLSv5Hb70XsLxoFfFCHdqBcK/WM2+JQ+x56IW3MtnZL0lDdZRA8GhVuy00S0pkB4jYMB41zRLVwbwcw/A1K7gVC1i4bVW3CSIre2Duj2xp8IUQnpI11mFP2kkl2JBBQAf8CSNlFrFMB/XyAEY11/LHVJoD1Y7rV198z+wAYCRAddt4G1PF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EkR0U= X-Bogosity: Ham, tests=bogofilter, spamicity=0.034642, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 在 2025/3/8 04:40, Borislav Petkov 写道: > On Fri, Mar 07, 2025 at 01:44:02PM +0800, Shuai Xue wrote: >> Commit 4c132d1d844a ("x86/futex: Remove .fixup usage") introduced a new >> extable fixup type, EX_TYPE_EFAULT_REG, and commit 4c132d1d844a >> ("x86/futex: Remove .fixup usage") updated the extable fixup type for >> copy-from-user operations, changing it from EX_TYPE_UACCESS to >> EX_TYPE_EFAULT_REG. The error context for copy-from-user operations no >> longer functions as an in-kernel recovery context. Consequently, the error >> context for copy-from-user operations no longer functions as an in-kernel >> recovery context, resulting in kernel panics with the message: "Machine >> check: Data load in unrecoverable area of kernel." >> >> The critical aspect is identifying whether the error context involves a >> read from user memory. We do not care about the ex-type if we know its a > > Please use passive voice in your commit message: no "we" or "I", etc, > and describe your changes in imperative mood. > > Also, pls read section "2) Describe your changes" in > Documentation/process/submitting-patches.rst for more details. > > Also, see section "Changelog" in > Documentation/process/maintainer-tip.rst > > Bottom line is: personal pronouns are ambiguous in text, especially with > so many parties/companies/etc developing the kernel so let's avoid them > please. > > "ex-type"? > > Please write in plain English - not in a programming language. > >> MOV reading from userspace. is_copy_from_user() return true when both of >> the following conditions are met: >> >> - the current instruction is copy > > There is no "copy instruction". You mean the "current operation". > >> - source address is user memory > > So you can simply say "when reading user memory". Simple. >> >> So, use is_copy_from_user() to determin if a context is copy user directly. > > Unknown word [determin] in commit message. > Suggestions: ['determine', > > Please introduce a spellchecker into your patch creation workflow. > > Also, run your commit messages through AI to correct the grammar and > formulations in them. Certainly, thank you for bringing that to my attention. I will refine the commit log accordingly. > > The more important part which I asked for already is, is is_copy_from_user() > exhaustive in determining the that the operation really is a copy from user? > > The EX_TYPE_UACCESS things *explicitly* marked such places in the code. Does > is_copy_from_user() guarantee the same, without false positives? > Following your discussion with Tony, it seems that we have reached a conclusion. Thanks. Best Regards, Shuai