From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9E31B672 for ; Mon, 6 Jul 2026 00:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783297148; cv=none; b=TMDkMSNuLez2iu4g/fJhosx10LDuv4bDnWzJ80qT3zldsufICYMEMdocZ//G2+eCPsSECsfXs+AZVBN6yfhRpWEQd9AISlu1qzWRh/EvGs9KnbAOIeIYNjNEKS6eykUu/tbkGu6Vuga4WICxUqFDnrlyLOcKEtIHcQlx7+CsirE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783297148; c=relaxed/simple; bh=XNAQMIYc9ZRDSOp8V5ubzS3ebxg9YaW9O+SP9YWgzKo=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=WvB51HJJhf3K2Il1CavLTnYsKMsnp4h2I4QcoRQW2W8yVhA+S7QNioLEgtSK2PhVCxffaI62peGNmRchtEuiXki52yojJPzvhMHWpsIPraI5zGo+OpgJUych91G3uevT8TWyIyrksrDe1j0zCwFMN9A5IRDmPgfG4dpiu4ORWq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aRI8Po0H; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aRI8Po0H" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2c6b67d5fa1so23389625ad.2 for ; Sun, 05 Jul 2026 17:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783297146; x=1783901946; darn=vger.kernel.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=8L6ft2AOg2RjpM2tYUbetITvDdQkbq3wLtnJ5t5R/wE=; b=aRI8Po0HDPqBn8tkAKGV8AeKEk4uBemcgecDNrzGQoGhrYKJjLdGMLeDVChavo1rY9 Dmzs2o/qVtau4hZbIRjvTI+o1hFe/gj/VAFtgNSCDiKaO/azejolqdE52PJiAoeTSn8S TI+eYiw4WkeKBW+kaALiiMljDf8Bs0XYdaZjqS24735PjKFLKL3zGusMX36A1Z5Wm6mh QdxCyy7crPdxzaelzfH06S5e4cKE5anaj6e3a4L9aD++UB7rof0W+K2bs1e2olI9ibt4 yP81//quOtVZuW1LxaN4b6GYUS2Fi9H6arGcsyxEeC9bS/d3pTOLUyi6FNBssd6akVkU Untg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783297146; x=1783901946; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8L6ft2AOg2RjpM2tYUbetITvDdQkbq3wLtnJ5t5R/wE=; b=hB5JIsgrLwefvk+UNOilB0ZeESvq2SUNwXnxexzGUqBv/Y1tMFwk4jdgPyJS6i4Fpy 82PPhWTpUTWbAToUbcG3wTqVLHmsrFmxmnQwOo0Q/krP79gEglf9nNztcwBblZg3wBoy q7nK1I9ttahlouWE1CyhKZkU9/EbjTPXWXDoHPjjCjsYxDaoXWp4KQV9MjbBeLskzxR4 mvKjiHvTKBVTPb06Ynb3RB2JefjdKTj+AF8fgWSBO2djuRBlwhl/Iwao1q321lwJ7MVG bO0a4GRrAEZCssTdB9dd1mesLAw0EhHVaRMAVQYDNwHabKKKe4v8G9MoCc5DFLn/GZNd 3MLw== X-Forwarded-Encrypted: i=1; AHgh+RqZb1Ie2gaVtH+r4HcuHCteZ7Wy0MtEe5UZL043Cc2ovzVvQWjzRn235QOU6g6/fu9wveTOmOvuz/obwII=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3SM2UcbTze5EuRdxIAQGUIxydfll+RZrh1t1EKpxHR8wScjvG oLruIKF30wPLJISFBLR5yq8iP6SMP4aj3roxA54ZMQ+OqI33fPmK8RWV X-Gm-Gg: AfdE7clvITsw1YDrE91HRMT8eRTiC1uJ0pwkvxOQNYTizmCRRALu4XP/zOWLSVAiB3g /cJUpyybXmwcYHCc74pfus254oJOPC/XTOk7JyBdoU6rsR/xu+xZAb2IKtuEHSDEK4Y0OOOHrMp xXIOhuFwwOEYfftq1O2F/oPCxyMCDMcyg+C6aXNrmdX9rxQaxQuOKyMowBvVlFL2WCiy8IfcAiM 7XrKbt7HAksl8PrVs7vKcP9NyYy+8lzaRkimF+ujEye8eEh9Vakr2NOYtNSTAr3tuccEmZmaY7C 1BVxOJ9KDkf615F0jBe5pf5VCYpLhRz7FvU6jT0YrJSBG/Q6Eeb5id6cRioybGt5X/GWrr78TwK 0GPcBCEUUnVUoVa41gRM3hkED+n/YeeHqXC2OHtu1b7EUVOnDdUnACFXt7kjddVzU+/LyTB+UTF nqPl1tdD0wJQkoeGADpxThJGwqj9pgLl+2z+uOmJc89Hy1HVsc6FD9HfXhlkVPuKaFPIbEJ38iZ tUKbISmfopgf8aUmGU6TBxjkSvWMpZllg== X-Received: by 2002:a17:902:d508:b0:2c9:abe1:c352 with SMTP id d9443c01a7336-2cbb9e36f68mr76138015ad.13.1783297146144; Sun, 05 Jul 2026 17:19:06 -0700 (PDT) Received: from mars.local.gmail.com (221x241x217x81.ap221.ftth.ucom.ne.jp. [221.241.217.81]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cad77651c2sm39542415ad.49.2026.07.05.17.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2026 17:19:05 -0700 (PDT) Date: Mon, 06 Jul 2026 09:19:02 +0900 Message-ID: From: Hajime Tazaki To: akpm@linux-foundation.org Cc: liam@infradead.org, ljs@kernel.org, vbabka@kernel.org, jannh@google.com, pfalcato@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: nommu: add sysctl_max_map_count() check for do_mmap() In-Reply-To: <20260705151512.5edabd9bb5d11cb6f1c6309f@linux-foundation.org> References: <20260702012830.667205-1-thehajime@gmail.com> <20260705151512.5edabd9bb5d11cb6f1c6309f@linux-foundation.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII On Mon, 06 Jul 2026 07:15:12 +0900, Andrew Morton wrote: > > On Thu, 2 Jul 2026 10:28:30 +0900 Hajime Tazaki wrote: > > > The sysctl variable vm.max_map_count (sysctl_max_map_count) is not > > expose under !MMU case but used it wit the default vaule > > DEFAULT_MAX_MAP_COUNT as a limit of count. This is currently used when > > a vma entry is split into two chunks (split_vma()) but not used when > > allocated (do_mmap()). As a result, even if users request a large > > number of allocate memory, it will keep allocating until OOM happens. > > > > This commit introduces a check at the begining of do_mmap in nommu.c to > > prevent this situation. > > > > This is detected with a LTP (Linux Test Project) test, which linked > > below. > > AI review flagged a couple of issues in the current code, one quite > serious: > > https://sashiko.dev/#/patchset/20260702012830.667205-1-thehajime@gmail.com I will follow up with another patch for the issue detected here. btw, I found (and sashiko also detected) several typos for this particular patch. Can I send v2 patch with the additional fix, or do you prefer that I'll only send the additional patch ? anyway, thanks for your time to look at this. -- Hajime