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 0BF6BC4332F for ; Wed, 23 Nov 2022 08:40:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78CE88E0001; Wed, 23 Nov 2022 03:40:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73C1E6B0073; Wed, 23 Nov 2022 03:40:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B7DE8E0001; Wed, 23 Nov 2022 03:40:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4B4AD6B0071 for ; Wed, 23 Nov 2022 03:40:10 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 22E051A11C9 for ; Wed, 23 Nov 2022 08:40:10 +0000 (UTC) X-FDA: 80164059780.26.C904822 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id AB34E1C000F for ; Wed, 23 Nov 2022 08:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669192808; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CSsK49BB0QehTaq7s72UHqC+yK7r2J42taJ8WZgTeaE=; b=UbFEsmwl+YQYrt28st/Ixvy7J3g/yZvjKiQ3NYjp4mNKo/9Sst62mSLVuf+teohRyi6kbl 8YUiaF0ihokdhqsPbF1Wf7qclhcVFvCv6rP0/1zPHRkL8/2VYWbnBohn5dkAA7OTFPKEEM FckzsF8TA8Xmx+QaSUz7JR7KGMdYbpg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-628-YG7xGiYpPS6wiAWyZm_r7A-1; Wed, 23 Nov 2022 03:40:06 -0500 X-MC-Unique: YG7xGiYpPS6wiAWyZm_r7A-1 Received: by mail-wm1-f72.google.com with SMTP id l32-20020a05600c1d2000b003cfefa531c9so1627497wms.0 for ; Wed, 23 Nov 2022 00:40:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CSsK49BB0QehTaq7s72UHqC+yK7r2J42taJ8WZgTeaE=; b=wZeZj6GNwTyRzrVh22GU8ZKCni7N8nGJhQtQpsShnWK+57xYO2NWfJCtiGEWW9JLnG 8ha35UQHg5VTwVMv4hklFJhLH0BHeUbhkUsHJmXJcWj0MmDqkD0tGgqzlaEsJsksCJgq Y4vdkaTBqz92obpXX55JhvBB2085fzTY/IlQXDLU6NXPII1c6zJxq4+DqLV16Vwi5+yS 0qpkflhl1HfNy2UE4eMpsTewF42stoFUbWT8rYXKIptGCkuMVGMMyaYaRABObpI3mfci LybBRzgmD4xVn+TQCHIVfKeNWS4X5jCIstTjHWxeviJTpTwqUocuadqMAton+saHRl/8 OXKQ== X-Gm-Message-State: ANoB5pk3WJ2qfcE+v2rPnrG5wymjlESxwgAXSoEYYZdGpp2vC433SzaD uh2Gbmz0wBQaMrzWpoe7rN5LIUhnjvG+6nD0EhRtYMszkrhHWuDxBAy5NetOMogbpcSW8FEiXrn CtJI+J88qlxo= X-Received: by 2002:a5d:6f0f:0:b0:236:5b81:1daa with SMTP id ay15-20020a5d6f0f000000b002365b811daamr7396601wrb.17.1669192805366; Wed, 23 Nov 2022 00:40:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf6QOnQvBzB6n112DRc9RH4+gTUwZYkUf68gnI2V7DPxPxw3tyuQ0+/0nTKyVjoqiuMFlpRKHQ== X-Received: by 2002:a5d:6f0f:0:b0:236:5b81:1daa with SMTP id ay15-20020a5d6f0f000000b002365b811daamr7396576wrb.17.1669192805070; Wed, 23 Nov 2022 00:40:05 -0800 (PST) Received: from ?IPV6:2003:cb:c704:9f00:a98d:4026:7c44:40fd? (p200300cbc7049f00a98d40267c4440fd.dip0.t-ipconnect.de. [2003:cb:c704:9f00:a98d:4026:7c44:40fd]) by smtp.gmail.com with ESMTPSA id x20-20020a05600c189400b003c6deb5c1edsm1379153wmp.45.2022.11.23.00.40.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Nov 2022 00:40:04 -0800 (PST) Message-ID: Date: Wed, 23 Nov 2022 09:40:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v1] mm/gup: disallow FOLL_FORCE|FOLL_WRITE on hugetlb mappings To: Mike Kravetz , Andrew Morton Cc: Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu , John Hubbard , syzbot+f0b97304ef90f0d0b1dc@syzkaller.appspotmail.com References: <20221031152524.173644-1-david@redhat.com> <20221121133320.a4e1c70af6ca72f29795fd5f@linux-foundation.org> <4b926dc7-b8ec-e363-b9d8-35c0f2c897f6@redhat.com> <20221122150355.41805b9013855cf0433b6612@linux-foundation.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UbFEsmwl; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669192808; a=rsa-sha256; cv=none; b=FMwxksiYTKVSkz8JEN4CjXix9Hxwu/liuK+gpQrQQggQ2c5LgiidAV0mAE4hLdljbYxqFQ 7QmMaU2DXq7yRvvtwms0ISn9TS3sluvI5WLJsCMg2V3xn09Q2FnN0DGkKqQBTCq4uPZZ4S wFozq7hgrq4P9tv/v0TtumrKSkLuRC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669192808; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CSsK49BB0QehTaq7s72UHqC+yK7r2J42taJ8WZgTeaE=; b=CNg3jF7M/AAPvDJUY7RE5gcC3xGDl2u0ornS0zas0C9iwWbcULC2MFzDxC/ALLT8OrOkDv TpbO0vNyrdUUEZqykyeKhYA2XHgLHx7eoYr35br9HmbIyD+8WSQApm+Rq3ICFRnMxCwdHo DkzwpUsOyhVaPGQk/M7nQGCkBMjE31o= X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UbFEsmwl; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: 6kbacd1ggbtdkeu84dd3tcfcpbtfbwi3 X-Rspamd-Queue-Id: AB34E1C000F X-Rspamd-Server: rspam09 X-HE-Tag: 1669192808-311284 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 23.11.22 00:48, Mike Kravetz wrote: > On 11/22/22 15:03, Andrew Morton wrote: >> On Tue, 22 Nov 2022 13:59:25 -0400 Jason Gunthorpe wrote: >> >>>>> >>>>> While that's certainly valid, it's not the common use case with >>>>> hugetlb pages. >>>> >>>> FWIW, I did check with our product teams and they do not knowingly make use >>>> of private mappings without write. Of course, that is only a small and >>>> limited sample size. >>> >>> Yeah, if it is only this case I'm comfortable as well >>> >> >> So.... I am to slap a cc:stable on this patch and we're all good? > > I think we will also need a Fixes tag. There are two options for this: > 1) In this patch David rightly points out > "I assume this has been broken at least since 2014, when mm/gup.c came to > life. I failed to come up with a suitable Fixes tag quickly." > So, we could go with some old gup commit. > 2) One of the benefits of this patch is silencing the warning introduced > by 1d8d14641fd9 ("mm/hugetlb: support write-faults in shared mappings"). > So, we could use this for the tag. It is also more in line with David's > suggestion to "backport it into 6.0/6.1 to fix the warning". > > My suggestion would be to use 1d8d14641fd9 for the fixes tag. However, > David may have a better suggestion/idea. Right, in an ideal world we'd backport this patch here to the dawn of time where hugetlb + gup came to life and FOLL_FORCE was not properly fenced of for hugetlb. However, such a patch is not really stable-worthy I guess. So I'm fine with "fixing the warning introduced for finding such previously wrong behavior" instead. Fixes: 1d8d14641fd9 ("mm/hugetlb: support write-faults in shared mappings") Cc: -- Thanks, David / dhildenb