Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp24249rwd; Mon, 15 May 2023 19:18:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GfA5NhOs0SR35NESy49tDMKo8uz4K8yqK3dP/vHe7p9b+euEYmab/hTW3T72QBm7/WGoZ X-Received: by 2002:a05:6a20:3c8b:b0:103:e735:d157 with SMTP id b11-20020a056a203c8b00b00103e735d157mr22251068pzj.59.1684203514840; Mon, 15 May 2023 19:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684203514; cv=none; d=google.com; s=arc-20160816; b=PzMSST6OVZ4aCZB8nfu2bE7Sx2XppxuHMMYXBi0+zu/xnL4LCCYQFJzw1dROn1RS2z Guil0+J/dRPX47OyU5y59FdPTxJgadFLdXkkCOPAJbRXu8LpYZyRijBbGhJrPOCpVB+r RVgjpsxUxvx2hL9D4qLgoewfSXiq1qvm4ORJPs+upEJoThp/vuqlu33GJ2NlIMWvvL51 eQumQHOGRNWXOXezeC9JIJ47ZJuYagKVEljUCNkinAAk3tagcgxLk2NEU5skbDcWl8qI 473qpJjiRUF/be3lb0I6N5+TGnTbvQM46c+Z88C4X1U5DuBTGC1XtApENk9J4cUlCdBt IY3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:to:subject:message-id :date:from:in-reply-to:references:mime-version:dkim-signature; bh=vOedSJ17V8iHt8KHOe3xnYUuoXUkebVLJNVs3KstdqI=; b=gKNf9K6rYltCnHPGLpHuNOCHx/V2+JlzsetiHmT+Waas7MNFkXk5y40WMu5NzJWlFo 9Jd0gO6Vn0deYephC3yhsXKE3Ip87VewIGh+0tkFycCam19+siqY8Gif955HAUbCNMam FSaKpuESXOpCR62uDamyQlE770I9T/FzAHFahL67HMPXmIOGyq8v5kL0+5t0CqkuWEMS hfHD4eIS5gCUXxVsbsaUdXEH+wrJCGhHej0C6qrIYEFG8UZeAe8kvMFjarbvOQthQkU7 rpbi+SN1jXNricjGeWr1OODftEDemlqXNqVnGFEd9We2NwLF9VZZXGYLItXF1PGmrisD lL9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aUHNG7WI; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a191-20020a6390c8000000b0051b930ef84bsi18380103pge.140.2023.05.15.19.18.08; Mon, 15 May 2023 19:18:34 -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=@chromium.org header.s=google header.b=aUHNG7WI; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjEPBlu (ORCPT + 99 others); Mon, 15 May 2023 21:41:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjEPBlt (ORCPT ); Mon, 15 May 2023 21:41:49 -0400 Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5CBE76 for ; Mon, 15 May 2023 18:41:48 -0700 (PDT) Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-18b1c643219so5616562fac.2 for ; Mon, 15 May 2023 18:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684201307; x=1686793307; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vOedSJ17V8iHt8KHOe3xnYUuoXUkebVLJNVs3KstdqI=; b=aUHNG7WIgh65aeOq/mwYfz+62LGweoGA/GHSVSaepQsF8GDMGY5iN4EV+lDiTkP6Gy UGEVeUcU8hw6rh9Sg2yz0hySRiFvwpx4o19DT9lRfptAnEOo0IzYBnrqHN5w6hTXv8jw Xk4owUbp1ktPr+cFzASk8e8UJl+jWZO2bkRWk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684201307; x=1686793307; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vOedSJ17V8iHt8KHOe3xnYUuoXUkebVLJNVs3KstdqI=; b=WYRAZzUD5wL3+ERb8HFpZO83VDK1ilFHsf48D3UJ3GFvn0Ox0SC4+iXzfeYP6SUkwZ iGM097B38q7NJOIHoath0AZ69LBop17hkJ4Rv2Q3a74F+rke3ozbByjcVqR0plEnsudY 7SU2zKP0Ar01mbWMbM6CTTSdImuewiIWy5PrRXFISiyrMICdmM/6eES4HBSuEKib7Xqj UA4+iATu5hzBHXchjCgzhNMj0aJBoLh0fF0W55MHo37pgGqovhsP0V19o5jNvKwq4KXb 9Tm4HiE1d+wkRyXcosk2WG2SOntiGQ7anSZGWEjFl7EynaQypByEDV0X5OqmlO2tL3OV FUEw== X-Gm-Message-State: AC+VfDwAyjdyFWLVQZwKbZZTzWOgy7qdc+o0N3YwLp0UgsGuFmHar8Np vb8iJGAVkraEOajwl8sEmBBZp2iuhZbqffWlgJbA3w== X-Received: by 2002:a05:6870:e14e:b0:196:8dc3:4e16 with SMTP id z14-20020a056870e14e00b001968dc34e16mr5220391oaa.39.1684201306869; Mon, 15 May 2023 18:41:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Xu Date: Mon, 15 May 2023 18:41:35 -0700 Message-ID: Subject: Re: mprotect outbound check. To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-hardening@vger.kernel.org, Jorge Lucangeli Obes , lstoakes@gmail.com, Liam.Howlett@oracle.com, peterx@redhat.com, zhangpeng.00@bytedance.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 + Peter, Lian, Lorenzo Is this related to this hotfix ? mm/mprotect: fix do_mprotect_pkey() return on error Thanks! -Jeff On Mon, May 15, 2023 at 11:00=E2=80=AFAM Jeff Xu wrot= e: > > Noticed there is a slight change for mprotect between 6.1 and 6.4 RC1 > > For example: > Consider the case below: > 1 mmap(0x5000000, PAGE_SIZE, ...) > 2 mprotect(0x5000000, PAGE_SIZE*4, ...) > > in 6.1 and before, 2 will fail, and in 6.4 RC1, it will pass. > > I know that munmap will accept out-of-bound cases like this (because > memory is freed anyway). > > Is this change intentional ? > > Thanks! > Best regards, > -Jeff