Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4908395pxv; Tue, 6 Jul 2021 12:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiu1KWK398O0nbexSamAykXOLIoAPwlRQ/MfoSBmRWamrmrrt3soI62eJtBM4hkV4d4Bjp X-Received: by 2002:a92:c8d2:: with SMTP id c18mr15576513ilq.301.1625598432639; Tue, 06 Jul 2021 12:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625598432; cv=none; d=google.com; s=arc-20160816; b=WtJ/b2sEiEs5NgIB/g7d8Y1U36wQoMj07OwD7IYLj8lVBMVlybssNHBzoEdND0J41X pdlOrrZqdc9mJ1vVhKqn9ewLjgK360Ur/IlsYPja3aze4DjsSTi2eGVAZiLTityqNQmK gQS5JS95zlIHj5gbN5CF2IewzPIICfn0htzPXGmuVc9+GMxCQ1sMf5CyHkTvj09q9XAN lBDyNAZRszxZK98EASM5RjXUsv/h36hzsQ5ALRW2YlgjOVt7P9V0WPmjBvvzlOUaQYMR JIPNdYXiG9oymKO4oMBs47JOh7Ko9znEsXH9bDpcNUpZWuAU+cgAXgbuJ9ZOO1WRvc4K NBUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/YkwNFbzkW01UFRzqtT90WCUsD7JjRXMGBdplkun1aw=; b=Ie0XlboUCnkWzqdgYSR8aeJ7jZn2GoHA4NHrsJKPpQq0LHfff86aP3RtS6MRvfI0/Z X7pNXaI35IoIVphJ8DL25ieoAIOlKARa8DqvnBGaJ+q710UB4KugZmm0+dmMqY4EhzQq 8xQ3NE8DWrAPFb0apYJV8DKW5RTYHIo7LSFcLouo99cb+inK2Ef8IFFu5gf23EvBPf0O ua7IkRYwaTPi1B0E08OEkw52b/8nx7SFkW1NNjSdZHmaTYLkthrbYUS19l7h3Cad5QXK BD7QwlfudDuP/b93aoBFM+gtQrB1YhBFry+kZe/6lJXb7BwK3rK0DsKjLufYkbDJBn7m gILA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k35si14558400jac.11.2021.07.06.12.07.00; Tue, 06 Jul 2021 12:07:12 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231727AbhGFTJI (ORCPT + 99 others); Tue, 6 Jul 2021 15:09:08 -0400 Received: from mga11.intel.com ([192.55.52.93]:6713 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231438AbhGFTJH (ORCPT ); Tue, 6 Jul 2021 15:09:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="206166874" X-IronPort-AV: E=Sophos;i="5.83,329,1616482800"; d="scan'208";a="206166874" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 12:06:27 -0700 X-IronPort-AV: E=Sophos;i="5.83,329,1616482800"; d="scan'208";a="427687568" Received: from agluck-desk2.sc.intel.com ([10.3.52.146]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 12:06:26 -0700 From: Tony Luck To: Borislav Petkov Cc: Tony Luck , Ding Hui , naoya.horiguchi@nec.com, osalvador@suse.de, Youquan Song , huangcun@sangfor.com.cn, x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] More machine check recovery fixes Date: Tue, 6 Jul 2021 12:06:17 -0700 Message-Id: <20210706190620.1290391-1-tony.luck@intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a couple of issues in machine check handling 1) A repeated machine check inside the kernel without calling the task work function between machine checks it will go into an infinite loop 2) Machine checks in kernel functions copying data from user addresses send SIGBUS to the user as if the application had consumed the poison. But this is wrong. The user should see either an -EFAULT error return or a reduced byte count (in the case of write(2)). Tony Luck (3): x86/mce: Change to not send SIGBUS error during copy from user x86/mce: Avoid infinite loop for copy from user recovery x86/mce: Drop copyin special case for #MC arch/x86/kernel/cpu/mce/core.c | 62 ++++++++++++++++++++++++---------- arch/x86/lib/copy_user_64.S | 13 ------- include/linux/sched.h | 1 + 3 files changed, 45 insertions(+), 31 deletions(-) -- 2.29.2