Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2416053rwd; Mon, 15 May 2023 11:20:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zkEK56BxhtCklQDF7yC/T0p03d9YNTL3p/dNV7JEydUhA+4fIgDUOK8xXKRE3TtC5zzVn X-Received: by 2002:a17:903:41d2:b0:1ab:28b4:6d5 with SMTP id u18-20020a17090341d200b001ab28b406d5mr52406120ple.5.1684174799723; Mon, 15 May 2023 11:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684174799; cv=none; d=google.com; s=arc-20160816; b=vherXDFJAgSO5gQ+tubcDrxEq4K/lE0uAiETwLsoC7Q6hX8w1zZ5M+FcDneG0Rimhe kNv7rMLeD/x7YnfGrWNBhtCWvpbBpeB11NqKo1RsHDMBVnyqNPv+Qmk7nrLVhnZNLgKj zR2Tt0MLfOH/W4KmIPt7CQyIOSWHgbndOw4vgzUaMMY9JkJhQyWrEoK/+za0LzYs600h Q6EfL2xFOW8x/oVeAuFgi4/osFcBrr1VDm/tu6QskKi78UZNDCVpc2P9hNNB2aO7DkAZ e49d12arSlXA5jkF8LD+yEE52F0kO2iGT3Zkx9FZ+gTigGsKp8uAaBV7Q081uESb/2f9 zDBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=0mSaHf0z4H/25tkQER9uB8ytIeulJA6BHDHaGGeScc8=; b=f1RD9usSYjSODG+FptjhzmC5nGH54KB4VcJ4UBN9Rxq1jlMEQKKzHs6BJYVnm4ecuL qnFMKY3cLRzuvbKea7yzokMbZ78mFUanwKT5r8+WB3gBl6E/y2OeFUBOQui3Jh2G8U8d iCCX+7fR7UuyQOS9k4/UgI5QB2kdmGEykmPDaQB7RqbL2ZQmFiqp2L5nhBTTD34WBf+R UJ45aF63t3R/jVIHW1TorI9wxXe4kLV1URM6FzYEGJcPWwnevDpCUJcGMutgvGkVyiFK 6JBKp8rCWiH6FG50MJFl8GMAbQhic7RREXkfnQleg0rC6WuQw11NfOY/S6UGw0Ftq2UX oJDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=W4umkPDO; 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 bj3-20020a170902850300b001ab0340f9cesi15921980plb.11.2023.05.15.11.19.47; Mon, 15 May 2023 11:19:59 -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=W4umkPDO; 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 S244944AbjEOSDj (ORCPT + 99 others); Mon, 15 May 2023 14:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244853AbjEOSDK (ORCPT ); Mon, 15 May 2023 14:03:10 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9EEE1CBBF for ; Mon, 15 May 2023 11:00:44 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1929818d7faso73456030fac.0 for ; Mon, 15 May 2023 11:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684173638; x=1686765638; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=0mSaHf0z4H/25tkQER9uB8ytIeulJA6BHDHaGGeScc8=; b=W4umkPDOYnX9LBbSIbjR8NqLV96FNNnGrKovk6clhtH+Ob6vVA/thEAIOGKBeslT+4 WbszT7aF4iGAuXxwF5unWu7UYp5nHO9D4r+3KjLgw+V2B74+eq8A+dWlhcpphfH1hErU iXjlu0t5F+2kbJyT4RCcD3e68fxYU1/GUD9LU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684173638; x=1686765638; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0mSaHf0z4H/25tkQER9uB8ytIeulJA6BHDHaGGeScc8=; b=MfhJ6Qmr5WVGs7Nclbc/hX8EuacYfFq9TWWB/gvV5KOy3bQP5Giytq4NI9aXL32ckP xWDv2hLE6c4GyJw8RcAIRetAHv1vpThUkyr4np0Je176ppNr1vAXBgU9XpMHDdILdH6s HIrZAxwQTcds8Kuj9sRQpTBCPVcMn6AJ4aJ6Mn1lWZavbGM8LQ91A9AuvAUmX/I0urYk Wwttw8qjaz9HKjCeG5WbQEBoGLc31WkUj6iAt4zwy4zToWeoSdvd3Yv1cfcjqsiZcIwF Ft04gj0/pK9xSCYlcxyEGRMXNDv2unZ8aeyuyaMCY6aU/H7kLbAPywQwClME+xTgjccg Yodw== X-Gm-Message-State: AC+VfDylnLhTvuwUkLcmYkqBTimWXsvxpkyO5AyTbICUcu47SzzRShp9 rcdchMpJEzsVP6v/D3/9WVOfpCD/hMmTwP/NXzv8HA== X-Received: by 2002:aca:d885:0:b0:394:441a:6de7 with SMTP id p127-20020acad885000000b00394441a6de7mr8548261oig.12.1684173638588; Mon, 15 May 2023 11:00:38 -0700 (PDT) MIME-Version: 1.0 From: Jeff Xu Date: Mon, 15 May 2023 11:00:27 -0700 Message-ID: Subject: 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 Content-Type: text/plain; charset="UTF-8" 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 autolearn=unavailable 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 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