Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2929053rwd; Wed, 14 Jun 2023 09:02:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40AiJRubp5+yN+eg2w9bTo1pJK4VSFYRx7BIlcT9U8TPdXFD4St1ZSS7VeQb08tR8uQun8 X-Received: by 2002:a17:907:36c8:b0:982:7434:ea84 with SMTP id bj8-20020a17090736c800b009827434ea84mr1810688ejc.10.1686758530423; Wed, 14 Jun 2023 09:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686758530; cv=none; d=google.com; s=arc-20160816; b=pR+TUqp7ZEvT4bN1VrbIaUdXOMmRzeLL0dQkOXGBCt3NL8MiqIfMwPSrVPmq+FapRb B1aV499+yUydkfxEvz/lB0AfCXQh9WQUdwON5jNarQU6BouWITc0XiGlLWejis/mDpK2 bNi/GIkSruffLDm+aqSX8RBy6zeeSFFquddeas6ySbbcaeM2Q9LJIevwcdJhVCN8QDMp yfGcNTNGb0+ve+xVKqOJ6yDnSqu6smftXzIiibj99TPjWlOyvtn0oW+wWJKDJHIrawz2 8ZGM2WJ3kZxzgAh9lTtLliWMJCQm7xkdDkFTsZv6h33ePm9jacA6W99C3pVWdRfI/dEn xdwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=VBEkKn5fELdXle4Y33cuC2dwRJcYuUrgCYNnAHpQ2ZE=; b=c4DS+aatzTrMvCPwI0hJR5TRzxxvMTuW68zfkPhGNGy4Ir584ydYTnG4KLJ9S4djec u4c4O0P7MLDy4EYRwzNq6r8MmjUfYwAN41yNp+ntPoi2fUBZ+TDS4iOqCSA2LiDOagAB fgPCyb5xLbYvTAzD7jNCbWTjtR0SZAwLIefJL6PkBLoblYNEuwXXUPycJ2bxZ/RQQCs0 1rnRH9R5Na294QgYcBcg/0wcKyl/MDCVG2De3SqXL7piX4EYsTN+C0XDy5bk1MtzmqtZ /y3lGBY2DCXbugLFThHKW1VZqi/BYVvbR2SlaxiYaAInAWweylcEkKq9oprim6/VgF9X TgNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XPY5paQ2; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb7-20020a1709070f8700b00977d1755a3dsi8470665ejc.36.2023.06.14.09.01.14; Wed, 14 Jun 2023 09:02:10 -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=@redhat.com header.s=mimecast20190719 header.b=XPY5paQ2; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236724AbjFNP6e (ORCPT + 99 others); Wed, 14 Jun 2023 11:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234375AbjFNP6d (ORCPT ); Wed, 14 Jun 2023 11:58:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9411721 for ; Wed, 14 Jun 2023 08:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686758266; 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=VBEkKn5fELdXle4Y33cuC2dwRJcYuUrgCYNnAHpQ2ZE=; b=XPY5paQ2q8RltU1/4zZzWoImwjKXBt3avg50FVXy+hqZWx8O7ovgoaYx85q7WzkOqDk8UO W2uYkkzGq/brzcBkN6Oqma9glm+3NQvVs90bgSaAi4YRN75EplJW9ZHc0ELOjsLL1Q60or 6+0UIyCD3dYDxz8hm/EPZizELZ43B+s= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-550-DIzVLYT1Ok2cSjtIHRGVdg-1; Wed, 14 Jun 2023 11:57:44 -0400 X-MC-Unique: DIzVLYT1Ok2cSjtIHRGVdg-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f81bdf4716so4103145e9.0 for ; Wed, 14 Jun 2023 08:57:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686758263; x=1689350263; 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=VBEkKn5fELdXle4Y33cuC2dwRJcYuUrgCYNnAHpQ2ZE=; b=DWTli3whBscxPB3fyMl+D4PXBP7VcAF8mVjBC0TvTgBScZ6649YQHEbiZ/TaklrQvr Qh4tKT4sZyV+dHdLy01ctYlTG6Un+giujBKwfKvagPiTTNlR7zXr7WGoXOZYvnLfHx0f PxsLTzR6ZwMSApZp3dWb6CJyTNHIvsSpvj5GgT4kTmdD/EVXRYcPB0kUQcpnCB4j+/k4 9RwzpngBXDSd7A/XSq+SPtU+j2+xv0rY0Jw6W0AF7m+GN8sMH9/xZnLxhaApkxUZilgI SK8FydWMxZfc8ID6dIUWDlg7DHKkKIGYCQsnelc4Wrb2UxAgPDUENKm+2m3eMGOtVmoe EP+A== X-Gm-Message-State: AC+VfDxlnjcNc+7yvmON+JHJ8J8FoH9BQ2jxoP0xKXXd+rMDeLk1jdnM VmHVs7QVAXJF0uRSa85NQotkh2tv3ANBPZ1pyZrYvT92VSjbES93u6Aczw+JcFuxTW+2++nJ5w+ u0q9aHIeD3rOuyH57/OGJZEPU X-Received: by 2002:a05:600c:4f96:b0:3f7:f302:161 with SMTP id n22-20020a05600c4f9600b003f7f3020161mr1999673wmq.8.1686758263554; Wed, 14 Jun 2023 08:57:43 -0700 (PDT) X-Received: by 2002:a05:600c:4f96:b0:3f7:f302:161 with SMTP id n22-20020a05600c4f9600b003f7f3020161mr1999658wmq.8.1686758263212; Wed, 14 Jun 2023 08:57:43 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:b200:7d03:23db:ad5:2d21? (p200300cbc704b2007d0323db0ad52d21.dip0.t-ipconnect.de. [2003:cb:c704:b200:7d03:23db:ad5:2d21]) by smtp.gmail.com with ESMTPSA id y10-20020a1c4b0a000000b003f5ffba9ae1sm17926102wma.24.2023.06.14.08.57.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jun 2023 08:57:42 -0700 (PDT) Message-ID: Date: Wed, 14 Jun 2023 17:57:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 2/7] mm/hugetlb: Fix hugetlb_follow_page_mask() on permission checks Content-Language: en-US To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox , Andrea Arcangeli , John Hubbard , Mike Rapoport , Vlastimil Babka , "Kirill A . Shutemov" , Andrew Morton , Mike Kravetz , James Houghton , Hugh Dickins References: <20230613215346.1022773-1-peterx@redhat.com> <20230613215346.1022773-3-peterx@redhat.com> <24bc512a-b5c2-b7ea-fa83-5752cec7455b@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,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 14.06.23 17:46, Peter Xu wrote: > On Wed, Jun 14, 2023 at 05:31:36PM +0200, David Hildenbrand wrote: >> On 13.06.23 23:53, Peter Xu wrote: >>> It seems hugetlb_follow_page_mask() was missing permission checks. For >>> example, one follow_page() can get the hugetlb page with FOLL_WRITE even if >>> the page is read-only. >> >> I'm curious if there even is a follow_page() user that operates on hugetlb >> ... >> >> s390x secure storage does not apply to hugetlb IIRC. > > You're the expert, so I'll rely on you. :) > Hehe, there is a comment in gmap_destroy_page(), above one of the follow_page() users: /* * Huge pages should not be able to become secure */ if (is_vm_hugetlb_page(vma)) goto out; -- Cheers, David / dhildenb