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 6DB28C43334 for ; Fri, 15 Jul 2022 17:07:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DECB940206; Fri, 15 Jul 2022 13:07:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9401E9401FB; Fri, 15 Jul 2022 13:07:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8078B940206; Fri, 15 Jul 2022 13:07:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 714AC9401FB for ; Fri, 15 Jul 2022 13:07:43 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 411D4121419 for ; Fri, 15 Jul 2022 17:07:43 +0000 (UTC) X-FDA: 79689966006.03.BCE6764 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id A86FE1C008E for ; Fri, 15 Jul 2022 17:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657904862; 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:references:references; bh=EHV1QhmT8JPtQAFBTILbNQ8Q1Cjq9HLm6CE8YiVAOqY=; b=HzCz4i1CRZnA8H4XddeyoNsY/0brqmpuZZZFq8tvyLh+tP8DvuVVFFQ2EfZniEQq5gREw3 2CWAqCMeUE1TvPnhAvjaWmB0WUAf/ezsjlOD/t79f31Vhu9H0UBrZOYyfyqMPY4fSJGKxd Q7o0jlJFiOUOBt2zzBzqCx1yl++sJuE= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-FXBkc7xZPbei3BlP6kHpaw-1; Fri, 15 Jul 2022 13:07:41 -0400 X-MC-Unique: FXBkc7xZPbei3BlP6kHpaw-1 Received: by mail-qk1-f200.google.com with SMTP id bq33-20020a05620a46a100b006b579909e2eso3874316qkb.17 for ; Fri, 15 Jul 2022 10:07:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=EHV1QhmT8JPtQAFBTILbNQ8Q1Cjq9HLm6CE8YiVAOqY=; b=HbAUi/2dtLSon5V+hxhm8ZLvAF0m3lYaAubta8bMJe6b1pO7y/K0R/eAFWuq/VlFMm 0AE3uR9enWI9CUtyoo/YJPNgU2IHTOpwwF1RCDCoPWrfc7wJHW83Hnlu/TJATCufOoqD maVewrYgMGT8ApT93wmHdoP/nuuVpwEujhYMslyn3ys+kz/q4Y64Q4QlRWQJz1tp5oR8 Ti/PZwvBCx17XdIO4S1MoTSNZeNCfRxJjF5hPLTh3U3wInKAfgwzDsPNrq8tGWU2srNo XFiDM6a3T1E5pBBFtkxc92NEHswf0Xy+J7V15oB3G+emBnJlao3m72H7yGxZ2t3aO+NY sxGg== X-Gm-Message-State: AJIora/tc7L4obOLQSypHIrMtb7EcGRkZFiBMiByqZjH2o3X9hhImyMO tvAmvyhZbZTpHlOLt8Q1xSwPjZoSCgckqOoQVLhqs4OaecMnTGCRa0Vrw/cdJslA5VpBLAgWmsp EcpW95ULrvcU= X-Received: by 2002:ad4:5ca6:0:b0:473:9f3b:a1d with SMTP id q6-20020ad45ca6000000b004739f3b0a1dmr9561445qvh.25.1657904860522; Fri, 15 Jul 2022 10:07:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vAuzSiARBGaAHLEmB8N33I1B7gu/rnc5VEXZTohrWR9BX1q7CVNeim/8VUENoLr9NCJjPJqg== X-Received: by 2002:ad4:5ca6:0:b0:473:9f3b:a1d with SMTP id q6-20020ad45ca6000000b004739f3b0a1dmr9561418qvh.25.1657904860087; Fri, 15 Jul 2022 10:07:40 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-37-74-12-30-48.dsl.bell.ca. [74.12.30.48]) by smtp.gmail.com with ESMTPSA id bs33-20020a05620a472100b006b5d665634asm418164qkb.65.2022.07.15.10.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 10:07:39 -0700 (PDT) Date: Fri, 15 Jul 2022 13:07:38 -0400 From: Peter Xu To: Axel Rasmussen Cc: Miaohe Lin , Andrew Morton , Mike Kravetz , Muchun Song , Linux MM , LKML Subject: Re: [PATCH] mm/hugetlb: avoid corrupting page->mapping in hugetlb_mcopy_atomic_pte Message-ID: References: <20220712130542.18836-1-linmiaohe@huawei.com> <20220713102357.8328614813db01b569650ffd@linux-foundation.org> <402ae708-4c86-8feb-75c4-9339e1deac3b@huawei.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HzCz4i1C; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf21.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657904862; 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=EHV1QhmT8JPtQAFBTILbNQ8Q1Cjq9HLm6CE8YiVAOqY=; b=6jg8T29jnrSPcvkBVjs6hW13h4jaJg5Ez1uuB4UFMV77iB45NtLLhpNONxpJedO2mR5WZ3 azXwih/fEzFH0sJjeRQrFG45TxkcHUJ807ISix5lJNiXRxc+bleYfgTukzUS0p+0Hiintq RZe5n9Nq7+eL7bZMWqNFQoauojCuvsU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657904862; a=rsa-sha256; cv=none; b=rQL75SDvRkcSr5oNuobtvb0ZyA3I8rbfEdpUu0ebSLUq//q1228+sHpvBBuC3rQcj8Nm24 9R3qAdXLFMBCaAk9t/7J0Yhae+3AQT/kQs0eAMIkUtGxNN4qC3uCC6ZuohEmWkfACnWsGM E8achSwUF10SwcDTpGYiO+yEzbFLZhQ= Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HzCz4i1C; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf21.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A86FE1C008E X-Rspam-User: X-Stat-Signature: 8e5csxuhpnk6w4gsm3x9rwtqk1axrou3 X-HE-Tag: 1657904862-490259 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 Fri, Jul 15, 2022 at 09:45:37AM -0700, Axel Rasmussen wrote: > I agree we should either: > - Update the UFFD selftest to exercise this case > - Or, don't allow it, update vma_can_userfault() to also require VM_SHARED > for VM_UFFD_MINOR registration. > > The first one is unfortunately not completely straightforward as Peter > described. I would say it's probably not worth holding up this fix while we > wait for it to happen? Agreed, Andrew has already queued it. It actually is a real fix since we never forbid the user running private mappings upon minor faults, so it's literally a bug in kernel irrelevant of the kselftest. > > I don't really have a strong preference between the two. The second option > is what I originally proposed in the first version of the minor fault > series, so going back to that isn't a problem at least from my perspective. > If in the future we find a real use case for this, we could always easily > re-enable it and add selftests for it at that point. I'd go for fixing the test case if possible. Mike, would it be fine if we go back to /dev/hugepages path based approach in the test case? Thanks, -- Peter Xu