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 5315DC6FA82 for ; Thu, 15 Sep 2022 01:48:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFAE36B0071; Wed, 14 Sep 2022 21:48:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAA386B0073; Wed, 14 Sep 2022 21:48:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC0048D0001; Wed, 14 Sep 2022 21:48:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B8D9A6B0071 for ; Wed, 14 Sep 2022 21:48:52 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 872224041F for ; Thu, 15 Sep 2022 01:48:52 +0000 (UTC) X-FDA: 79912636104.13.9AA041B Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf23.hostedemail.com (Postfix) with ESMTP id 2E17A1400B6 for ; Thu, 15 Sep 2022 01:48:51 +0000 (UTC) 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 ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=tWXlOsDr; spf=pass (imf23.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663206532; a=rsa-sha256; cv=none; b=D6coV9OHfzrpkhZdKCbIxtCSYnS02llzzzOxfteaFMjwPhMtdvyXnX+mx2rc/ZHKXZTR3N QkMbl4rsyjNYG4YckxzJqeBadFazG2AD0MNM/27kQ9Osm7giNKtsW3AuS0Jzuv6bWYB+I0 nvZGenaw47EybbJwEt4eDPNUDaDgCm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663206532; 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: in-reply-to:in-reply-to:references:dkim-signature; bh=YfBJ/GC8iJydQQDAOa7qVsrlMvw7oRL/3fIgXnJ2x8Q=; b=INf3K8FIO9JU2lriUGXxKSznZYUQdbP3ic7sMIR0pZIB7TnUzggjng4ZjFQ5Yu+6fF9wzT PnFgnCzb0ldSEsYAH7C5Ivwty79vgNg3WdX9M1UnNgA4hOzVZKvam7ZR5LszZem4jmOYLi iLT4AtVPKJx1eAwjO9mVcGxbov9N3zI= X-Stat-Signature: fussrh9sgwa6q9tbc85hk77y3k373njq X-Rspamd-Queue-Id: 2E17A1400B6 X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=tWXlOsDr; spf=pass (imf23.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspamd-Server: rspam12 X-HE-Tag: 1663206531-436926 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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