Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp198268rwn; Wed, 14 Sep 2022 18:57:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4juqEt2DVECDKDvUY3OLWCRq8YU6NV7WLYnDXvxKSEQD1+UQOXx2zZKrvtv0wMspAORbq3 X-Received: by 2002:a17:907:849:b0:77a:34b6:a23 with SMTP id ww9-20020a170907084900b0077a34b60a23mr18907552ejb.458.1663207059410; Wed, 14 Sep 2022 18:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663207059; cv=none; d=google.com; s=arc-20160816; b=Z4LSJTBKYTgbF66Ok6quyTGQdhh3wcK1B+PtkXTcJVtmzI+nFXXM0Y32xqrWF5lZZr FzzfUDKhZsHzH3OAnnImTOG3wexsJsr72hnCfO60Lf1jqk2ZMLK3JI19+EkQoCGnjM0p ymNVmmzTet0igxORsVCKhYPvEpgVr0bmRK0dgFoZFgWIJ5OtVLM9rKhPHrus+9J3REqN oBBEWk/CDU/dDK/9c23ET8SvRU7aemdTPs/A+hSTUYJ/iG2OLFUKtZjp/dULkzYOXjA2 rri18T/gcm0pT09xB2Lcr+vekvHRdbdD9rkHVzzDCvbQ1mn/lppmpuEzkFrHL9Ea2ueA 9OlA== 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 :message-id:subject:cc:to:from:dkim-signature:date; bh=YfBJ/GC8iJydQQDAOa7qVsrlMvw7oRL/3fIgXnJ2x8Q=; b=Yrv5xi6y+RL4Ad7Gli1kHWfg1+g6f4qY/8aElj4kxJFKdlrSK1QhHpA5On0BFVcj03 JUpt4wkBiqozrYIp2ls6yMFW2eV2zKkc7WxjZn2sW6IowaREJVdDzGbd8LoeDiWTfyDn r4eG0oQLkhOo0nS/btaOSUMBH3xVMMEooFhklkhm37CG6hzq5CkCkxAfNBkIXxdfKDSm 7lrOj0Hese0zHYnZiOt1COCKtNLRXcUN1IxGorareb3KVDKV1wabIBdZPSugsALZtwXZ 9zWZpIhMHPjrBmStQGPr+ksmPcuSCPlK64iBGfeSyiNP5Bq1LSiRetqjIyp551ZvzCSH hzSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=tWXlOsDr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170906794600b0073dcc5ebf4asi15036466ejo.397.2022.09.14.18.57.01; Wed, 14 Sep 2022 18:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=tWXlOsDr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230044AbiIOBtA (ORCPT + 99 others); Wed, 14 Sep 2022 21:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230031AbiIOBsy (ORCPT ); Wed, 14 Sep 2022 21:48:54 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA9D8E4DC for ; Wed, 14 Sep 2022 18:48:52 -0700 (PDT) Date: Thu, 15 Sep 2022 10:48:43 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1663206531; 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: in-reply-to:in-reply-to; bh=YfBJ/GC8iJydQQDAOa7qVsrlMvw7oRL/3fIgXnJ2x8Q=; b=tWXlOsDrBYO+izjXmjHpqkFMxiargiwT8rlf4lp4qGvTMbVb3NinF3u1DU9Kf2g85coPB8 ghn+CUmEy+1JN7p11ySJ82P3MKuxQNDrtGKS5PH9JO7NYVLVYON+TSdutM3ncB+xKm0do2 EbW4hkKK4iyoJsb1BaI0ypu0I4Jgfrc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Naoya Horiguchi To: Shuai Xue Cc: linmiaohe@huawei.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cuibixuan@linux.alibaba.com, baolin.wang@linux.alibaba.com, zhuo.song@linux.alibaba.com, Naoya Horiguchi Subject: Re: [PATCH] mm,hwpoison: check mm when killing accessing process Message-ID: <20220915012626.GA1791458@hori.linux.bs1.fc.nec.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220914064935.7851-1-xueshuai@linux.alibaba.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, Sep 14, 2022 at 02:49:35PM +0800, Shuai Xue wrote: > The GHES code calls memory_failure_queue() from IRQ context to queue work > into workqueue and schedule it on the current CPU. Then the work is > processed in memory_failure_work_func() by kworker and calls > memory_failure(). > > When a page is already poisoned, commit a3f5d80ea401 ("mm,hwpoison: send > SIGBUS with error virutal address") make memory_failure() call > kill_accessing_process() that: > > - holds mmap locking of current->mm > - does pagetable walk to find the error virtual address > - and sends SIGBUS to the current process with error info. > > However, the mm of kworker is not valid. Therefore, check mm when killing > accessing process. > > Fixes: a3f5d80ea401 ("mm,hwpoison: send SIGBUS with error virutal address") > Signed-off-by: Shuai Xue Thank you for the patch, the fix itself makes sense to me. I agree with this patch with applying comments from Andrew. Acked-by: Naoya Horiguchi