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 41F92C32771 for ; Fri, 16 Sep 2022 00:30:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8CB98D0003; Thu, 15 Sep 2022 20:30:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B3B888D0001; Thu, 15 Sep 2022 20:30:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DCB58D0003; Thu, 15 Sep 2022 20:30:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8AD1A8D0001 for ; Thu, 15 Sep 2022 20:30:34 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 573621A1A63 for ; Fri, 16 Sep 2022 00:30:34 +0000 (UTC) X-FDA: 79916067588.03.4AC2A2F Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf08.hostedemail.com (Postfix) with ESMTP id 174A91600AB for ; Fri, 16 Sep 2022 00:30:33 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id j6-20020a17090a694600b00200bba67dadso18852445pjm.5 for ; Thu, 15 Sep 2022 17:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=LkVlhoT05YAjjPwcAfjmZDP9UsS+FFKRNB8ZXWgizNo=; b=DjoMxV+z0+9E0zrKxLFmNhIwQWaK2UP963SC6a4w/xWf4GEdfwBjjnhsPM6p8ipdU/ 33DYPhphTHRc03WwY8oxvYA+6XCmuCkA2UGoogMhYr9oUIb7nCMsAsqRtk9T1oGXHoFQ uM0+EOdmgpgbLOJJfIHFGMSzdKzpW0r2VGFqPyMcUAlgdtFoqeRzDN+6x8KUrc8kzFoP RGVfiwN8pgCNK3ObPSA2YGJBuubZUpUdrUqAfQcJJO1iakP0RImflEM/YMgjFD2n+8ik 1XapeGaPVtB7FDhdhvpVBxe6Ae/Kw9hjSVLQncm4g39UORjWNCCowuNVY8V/Y+0eBdWO Jzww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=LkVlhoT05YAjjPwcAfjmZDP9UsS+FFKRNB8ZXWgizNo=; b=1m7etqJq+iav8o4gSXCpvzhevOfAsdoOnjHrkXWsu9toNgRIH8jM+mAmlAfM1mmF2Y 9b8L8rA/FNnVHSLNPNiD2SrWQjsXJIMcoGHQ3PRkAGTlnF3ij0kzR+l5rdmnGzKcXaOr 1Zk1c5WGXDkbZ17s3EuozdyJ93vptWVsUN1teZT4PuuXJTwm6EjV1IIq85jQU9aITk2y C+ZvADPCAm01u8XDiYrQGvDvEZBo6Uh95t+lXAZqyR4juPdLhi+KPUgdK5nEk1nyhDMr tlEVmM8IcE/nNswrwxthqQtbRy69wTa+cUt/Fb/RWjE/vtdo4Q+6TfZyISCUHw3tBAnE Vscw== X-Gm-Message-State: ACrzQf1Ku3G4hWANXqXAwgTNr3gyW9SH5pBrPhAX+IKSo6bLEROpB5Dt PGYBY2wOjSAKRpDNohbzKn4NC7AVRsNiybeJBQc= X-Google-Smtp-Source: AMsMyM4ZvGf4Boqd4PSzHhcRoMmJ8Amrcs8wuuFae2xRcVLms8MQYbsp4efTubS/3R0nAalOwzcL6qOW3udCM+JToow= X-Received: by 2002:a17:903:32c1:b0:176:d67b:cf70 with SMTP id i1-20020a17090332c100b00176d67bcf70mr2217900plr.117.1663288232822; Thu, 15 Sep 2022 17:30:32 -0700 (PDT) MIME-Version: 1.0 References: <44fe39d7-ac92-0abc-220b-5f5875faf3a9@oracle.com> In-Reply-To: From: Yang Shi Date: Thu, 15 Sep 2022 17:30:20 -0700 Message-ID: Subject: Re: Is it possible to corrupt disk when writeback page with undetected UE? To: Jane Chu Cc: "Luck, Tony" , Borislav Petkov , "djwong@kernel.org" , "x86@kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DjoMxV+z; spf=pass (imf08.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663288234; a=rsa-sha256; cv=none; b=gYnMCWRNaCUl5PZ03kYX06C4z/SSYi40H1pov1L5AKd86xq4npNx5N9Odk1mDAVI6tQPYQ Pt/gCfkjjmHIbD/wNymmEmNVprM1HCvYkED+8WEof/kzSI08SnxBns1A1iia2l5e1bi/yo si+woG4Zm2Pz7j0bFUIYI+RiUIEUnJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663288234; 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:references:dkim-signature; bh=LkVlhoT05YAjjPwcAfjmZDP9UsS+FFKRNB8ZXWgizNo=; b=o78jqdjVzpgOGPVJRJbuoZ1Vqq05q4x8j9/YeUK4lEUY1gcwExsC28CEoEuZm7C5Jyc6eu WdqenNWCqK8YmNSbr+czG+PYsVxZyYh3+dT/Vau/blIxig0cvGUlM/I6dzISd9d05B/qBo xpFl7uYJnVUKMFN28Amis7LZF67fdcg= X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 174A91600AB Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DjoMxV+z; spf=pass (imf08.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: 9cpwzqoaszyzk835nq5jq9ds7psy6wrg X-HE-Tag: 1663288233-265226 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 Thu, Sep 15, 2022 at 5:27 PM Jane Chu wrote: > > On 9/15/2022 3:50 PM, Luck, Tony wrote: > >> Suppose there is a UE in a DRAM page that is backed by a disk file. > >> The UE hasn't been reported to the kernel, but low level firmware > >> initiated scrubbing has already logged the UE. > >> > >> The page is then dirtied by a write, although the write clearly failed, > >> it didn't trigger an MCE. > >> > >> And without a subsequent read from the page, at some point, the page is > >> written back to the disk, leaving a PAGE_SIZE of zeros in the targeted > >> disk blocks. > >> > >> Is this mode of disk corruption possible? > > > > I didn't look at what was written to disk, but I have seen this. My test sequence > > was to compile and then immediately run an error injection test program that > > injected a memory UC error to an instruction. > > > > Because the program was freshly compiled, the executable file was in the > > page cache with all pages marked as modified. Later a sync (or memory > > pressure) wrote the dirty page with poison to filesystem. > > > > I did see an error reported by the disk controller. > > Thanks a lot for this information! > > Were you using madvise to inject an error to a mmap'ed address? > or a different tool? Do you still have the test documented > somewhere? > > And, aside from verifying every write with a read prior to sync, > any suggestion to minimize the window of such corruption? We discussed the topic at this year's LSFMM summit. Please refer to https://lwn.net/Articles/893565/ > > thanks! > -jane > > > > > -Tony >