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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 756E7C4320A for ; Sun, 22 Aug 2021 14:36:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E54386136A for ; Sun, 22 Aug 2021 14:36:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E54386136A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0AF826B006C; Sun, 22 Aug 2021 10:36:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0600C8D0001; Sun, 22 Aug 2021 10:36:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E90A66B0073; Sun, 22 Aug 2021 10:36:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id CDF4A6B006C for ; Sun, 22 Aug 2021 10:36:15 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7E7B227051 for ; Sun, 22 Aug 2021 14:36:15 +0000 (UTC) X-FDA: 78502966710.21.3F5559C Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf10.hostedemail.com (Postfix) with ESMTP id 6FC296001982 for ; Sun, 22 Aug 2021 14:36:14 +0000 (UTC) Received: from zn.tnic (p200300ec2f2da100ab464a00f653617a.dip0.t-ipconnect.de [IPv6:2003:ec:2f2d:a100:ab46:4a00:f653:617a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 0F2BE1EC04F0; Sun, 22 Aug 2021 16:36:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629642968; h=from:from: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:in-reply-to:in-reply-to: references:references; bh=xSosRj+gN6K6/WaqvzcoxmyNJvtEyhrgOWDYMQsCGNo=; b=JMU3sneeIbjx/sVlruL4kgrKGsIdwixSJQb56941V6UwFAyS35rn/iiVoZVPy07EWOiCDB sJYERF9Yt09gmU1/vgn2UEqp2ryQ1S/j6eyetpP9F3giSwZAJX9pRJwwX4fGgHl3f/g6fG glBv9rZOqxxoCg6Ja0zyweOK2wwXs7s= Date: Sun, 22 Aug 2021 16:36:46 +0200 From: Borislav Petkov To: "Luck, Tony" Cc: Jue Wang , Ding Hui , naoya.horiguchi@nec.com, osalvador@suse.de, Youquan Song , huangcun@sangfor.com.cn, x86@kernel.org, linux-edac@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] x86/mce: Avoid infinite loop for copy from user recovery Message-ID: References: <20210706190620.1290391-1-tony.luck@intel.com> <20210818002942.1607544-1-tony.luck@intel.com> <20210818002942.1607544-2-tony.luck@intel.com> <20210820185945.GA1623421@agluck-desk2.amr.corp.intel.com> <20210820202346.GA1623796@agluck-desk2.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210820202346.GA1623796@agluck-desk2.amr.corp.intel.com> Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=JMU3snee; dmarc=pass (policy=none) header.from=alien8.de; spf=pass (imf10.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6FC296001982 X-Stat-Signature: 96oe71f9uqp1ssxyfqopcjrdux5xfge6 X-HE-Tag: 1629642974-648811 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Aug 20, 2021 at 01:23:46PM -0700, Luck, Tony wrote: > To recover we need to have some other place to jump to (besides the > normal extable error return ... which isn't working if we find ourselves > in this situation) when we hit a fault covered by an extable entry. And > also know how many machine checks is "normal" before taking the other path. Hohumm, we're on the same page here. ... > Bottom line is that I don't think this panic can actually happen unless > there is some buggy kernel code that retries get_user() or copyin() > indefinitely. You know how such statements of "well, this should not really happen in practice" get disproved by, well, practice. :-) I guess we'll see anyway what actually happens in practice. > Probably the same for the two different addresses case ... though I'm > not 100% confident about that. There could be some ioctl() that peeks > at two parts of a passed in structure, and the user might pass in a > structure that spans across a page boundary with both pages poisoned. > But that would only hit if the driver code ignored the failure of the > first get_user() and blindly tried the second. So I'd count that as a > critically bad driver bug. Right. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette