Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2080576pxb; Mon, 18 Jan 2021 07:46:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9S9KFF5h2zH9Gh60/kvg0gk1MhQc0oVYph086T1seoi86AhTpzS7ixidCAozWn3jrD3/N X-Received: by 2002:a17:906:b0c2:: with SMTP id bk2mr204603ejb.223.1610984787005; Mon, 18 Jan 2021 07:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610984786; cv=none; d=google.com; s=arc-20160816; b=uNpRWAPpwMoIEu4JuuupcdqW3HS+TK4D5bGhk54Yc+h9zLg1hhdTjBkJ7WzDytkolp JO41UgtkwLWOdwlg02WrDDHPJ5JVt56qIucQrNFVA8+g0aJdQ1FqdqHjcPLw+ao2piHf MC+loL9MxL128DhHlvYgdzl7mj+qTDgmnaV4tOrwM8QoYhoUcRsmaXpvSQvkgqSoVKU3 w+kuvtJktb6rFnCMkVnSH2EvF5mRwA3Nvhu/xwOlSWwWd13ulsV4T1frsAD5nGGruEib mxVt62v49E1tRYlpZpXMJONJw2FCg4fjYCGxlhXv1alGg5pE2XQbODPtN2KwEo5r0sEp Yjtg== 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=RzHd1xNl9QC5sTnjUIzkxqrURiWyyH0SsnXWur2agWQ=; b=fAXRUMY6VFaHELtDSxiUn41nA5yPsRiRsvcGY0wnOetdJXTK6eMNzXEdWqKIf0F+8F 41vFdZA36KEC7R/61QP+/80IyBxVzDY22V+gEUX/V/IWiWLaNodgjYhXzZINhFgyTtP+ 9WaMNYNP7FkGU8UpMwKcxN+pboeXTCh8mSvpi5bLS9J4fuPa6RV7bMnExK+YgENpFtrJ e8aalOjMluwRqx7hZ9LKa1RgVTbSBjmbM9K4anwnLymqvXXf4NhrxITXC2Sh5hGYL4bA 0jEM0LEdV6BXe8ecmldzSdSwCYwKjGsclXmo4OTxqnhtlpnEFCBwGUNeb+8kk900RQPQ PGVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ReASYQRv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du19si6895000ejc.206.2021.01.18.07.46.02; Mon, 18 Jan 2021 07:46:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ReASYQRv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390848AbhARPnA (ORCPT + 99 others); Mon, 18 Jan 2021 10:43:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393474AbhARPka (ORCPT ); Mon, 18 Jan 2021 10:40:30 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0900C061574; Mon, 18 Jan 2021 07:39:49 -0800 (PST) Received: from zn.tnic (p200300ec2f069f009291f9f4a50f0191.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:9f00:9291:f9f4:a50f:191]) (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 445BA1EC04F0; Mon, 18 Jan 2021 16:39:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1610984388; 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=RzHd1xNl9QC5sTnjUIzkxqrURiWyyH0SsnXWur2agWQ=; b=ReASYQRviTwk2Oz0omPg5AaPzLdaKZMDCFMmuXmfjdiCEaDtlk4b3lpo2OLC823dl/5QCl PHWX4op3lR0ASByj0t1RBRP+vHTX/n+RXYFKMsJFWvC5/ogbUXoGq5BqDVag1zY8euFQna EOU9NwQ9xWa5zukG8TL/V4HLmfQoJuQ= Date: Mon, 18 Jan 2021 16:39:39 +0100 From: Borislav Petkov To: "Luck, Tony" Cc: x86@kernel.org, Andrew Morton , Peter Zijlstra , Darren Hart , Andy Lutomirski , linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3] x86/mce: Avoid infinite loop for copy from user recovery Message-ID: <20210118153939.GC30090@zn.tnic> References: <20210111214452.1826-1-tony.luck@intel.com> <20210115003817.23657-1-tony.luck@intel.com> <20210115152754.GC9138@zn.tnic> <20210115193435.GA4663@agluck-desk2.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210115193435.GA4663@agluck-desk2.amr.corp.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 11:34:35AM -0800, Luck, Tony wrote: > In the user mode case we should only bump mce_count to "1" and > before task_work() gets called. Ok, right, it should not be possible to trigger a second MCE while queue_task_work() runs when it is a user MCE. The handler itself won't touch the page with the hw error so our assumption is that it'll get poisoned. If it doesn't, I guess the memory failure code will kill the process yadda yadda... > It shouldn't hurt to do the same checks. Maybe it will catch something > weird - like an NMI handler on return from the machine check doing a > get_user() that hits another machine check during the return from this > machine check. Eww. > AndyL has made me extra paranoid. :-) Yeah, he comes up with the nuttiest scenarios. :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette