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 X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1559EC43219 for ; Thu, 2 May 2019 13:07:43 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE88A205C9 for ; Thu, 2 May 2019 13:07:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DrRGZ9RN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE88A205C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1hMBQq-0005wv-Lx; Thu, 02 May 2019 09:07:24 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1hMBQp-0005wo-BT for kernelnewbies@kernelnewbies.org; Thu, 02 May 2019 09:07:23 -0400 Received: by mail-ed1-x533.google.com with SMTP id j20so2020872edq.10 for ; Thu, 02 May 2019 06:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=vWOwxXNN+4qz5J5fnezUBzby+IekGHhsayUToWTXnyI=; b=DrRGZ9RNeigmvnqxVr8JPm043U+Rlme3SivIJ5oSwq7LHdzKHOOJ4LFtOTd1Ji5SDL RzBogzRF6rVDdzQhYnxoo1MyAhkihR8jUeqlHApm9yhQe7/nY/Neh0T3U/XAm8ZvBd4I 4SG0Dd6CcX+gLX1cZycgSXs77adnQ6Woml3utbfGe1HCDZJaF4pnV/09My4jh2BgfGtK jPsEPZyarHjBC6wu/brKr96/rG8sgIrgB/2QYBJjtymErOafru+wlOLVKFLWoB8j9y3s Bye+5E4NBL5S7oeX0Nh/LX39AZQKgLiHBq6iHu2B5KzP1T8t2CNpmZc4A9uf1MEr3JiT sbsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vWOwxXNN+4qz5J5fnezUBzby+IekGHhsayUToWTXnyI=; b=kzw3C66HBDeZ+Sx9/BDVqY/ndTBRpk5G6jVNwnSBgq+E5SMtye++VA5RMWy9O55xXI /rqg4H3QMadoCiY4kUctIhDOmOKrtc4ELrc4iKdrQmgoZc7p2FMP7gpiKWFA6xXwYxR9 /a6g4Z+hsFau3PypgqBCqtbGuLP6efmrDjmVdYcOC+2Bv9SHfSf0Y7/t3NyffNIRFAIB VnvznG4m1E1LE5iFoc9ZyxzBfbpYhi8yZpmOjU/RrQs3wLH3nEJXewaZQb+9G045dDD+ A4VVnbNqqIHta9Oyr4qkvV2Ehtt9MQ5gNQ6EXDjxDgmCa4vVH44ms3uS588RX7Ly+3fx OIcQ== X-Gm-Message-State: APjAAAUmdZlqqfP9j7C6DHAViGn2mmCwX8X/zlSG7qynWvggvND0NW7J 1bxFNWa5xXqIHVG3pLb8ZQdM1SU97pFtR79/gkaqNRAO X-Google-Smtp-Source: APXvYqx06PnEqjpq/zvqmJeBJ4/YMNkJkz+BJzaitqGAlGU77wwaRQzL36jEqJA+QvkFVZp5C9IEtviHQEzr4VY8avY= X-Received: by 2002:aa7:db50:: with SMTP id n16mr2420041edt.108.1556802380871; Thu, 02 May 2019 06:06:20 -0700 (PDT) MIME-Version: 1.0 From: Karaoui mohamed lamine Date: Thu, 2 May 2019 09:06:09 -0400 Message-ID: Subject: ULIMIT: limiting user virtual address space (stack inluded) To: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4649337057682163352==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============4649337057682163352== Content-Type: multipart/alternative; boundary="000000000000e5bf6f0587e74c1b" --000000000000e5bf6f0587e74c1b Content-Type: text/plain; charset="UTF-8" Hi all, According to the man page of "ulimit", it is possible to limit the virtual address space of a user process: https://ss64.com/bash/ulimit.html To limit the virtual address space to 2 GB: $ ulimit -SH -v 1048576 However, it seems that "stack" allocation ignores this limit (I tried with both kernel 4.4 and 4.15). I found this article (patch) that seems to fix the problem: https://lwn.net/Articles/373701/ My questions are: - Why is the stack allocation not placed within the "ulimit" limit? (is it a bug?) - Is there a way, in user space, to force the stack to be allocated at a certain address? - Will the patch above (or similar) ever be integrated into the Linux kernel? Regards, Mohamed --000000000000e5bf6f0587e74c1b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

According to t= he man page of "ulimit", it is possible to limit the virtual addr= ess space of a user process:=C2=A0https://ss64.com/bash/ulimit.html
To limit the virtual a= ddress space to 2 GB:
$ ulimit -SH -v=C2=A01048576=C2=A0

However, it seems that "stack" allocation ig= nores this limit (I tried with both kernel 4.4 and 4.15).

I found this article (patch) that seems to fix the problem:
https://lwn.net/Articles/37= 3701/

My questions are:=C2=A0
- = Why is the stack allocation not placed within the "ulimit" limit?= (is it a bug?)
- Is there a way, in user space, to force the sta= ck to be allocated at a certain address?=C2=A0
- Will the patch a= bove (or similar) ever be integrated into the Linux kernel?

<= /div>
Regards,
Mohamed

--000000000000e5bf6f0587e74c1b-- --===============4649337057682163352== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============4649337057682163352==--