Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #93951

Bug#1146373: linux-libc-dev: sbrk(2) allocates more than memory + swap space

Path csiph.com!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From Carl Wuebker <office@wuebker.com>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#1146373: linux-libc-dev: sbrk(2) allocates more than memory + swap space
Date Mon, 31 Aug 2026 23:40:01 +0200
Message-ID <NyhTr-erc9-5@gated-at.bofh.it> (permalink)
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Mon Aug 31 21:37:08 2026
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -1.451
Reply-To Carl Wuebker <office@wuebker.com>, 1146373@bugs.debian.org
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc debian-kernel@lists.debian.org
X-Debian-Pr-Message report 1146373
X-Debian-Pr-Package linux-libc-dev
X-Debian-Pr-Source linux, linux-2.6, linux-2.6.24
MIME-Version 1.0
User-Agent Mozilla Thunderbird
Content-Language en-US
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Get-Message-Sender-Via s13510.usc1.stableserver.net: authenticated_id: office@wuebker.com
X-Authenticated-Sender s13510.usc1.stableserver.net: office@wuebker.com
X-Originating-IP 185.181.254.185
X-Spampanel-Domain s13510.usc1.stableserver.net
X-Spampanel-Username 185.181.254.185
Authentication-Results antispamcloud.com; auth=pass smtp.auth=185.181.254.185@s13510.usc1.stableserver.net
X-Spampanel-Outgoing-Class ham
X-Spampanel-Outgoing-Evidence SB/global_tokens (0.00134430972012)
X-Recommended-Action accept
X-Filter-ID 9kzQTOBWQUFZTohSKvQbgI7ZDo5ubYELi59AwcWUnuXzU9sIBhGmBf22OitvWdfTjlH0hQvgyDX2 5okh0Agp7Su2SmbhJN1U9FKs8X3+Nt1q+DnKBrRYyHu/zY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.com
X-Greylist delayed 7896 seconds by postgrey-1.37 at buxtehude; Mon, 31 Aug 2026 21:35:24 UTC
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1988434
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 61
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc office@wuebker.com
X-Original-Date Mon, 31 Aug 2026 12:23:35 -0700
X-Original-Message-ID <a6fc0db7-9849-4716-9cd8-77a68140a1a1@wuebker.com>
X-Original-X-Complaints-To abuse@master.antispamcloud.com
Xref csiph.com linux.debian.bugs.dist:1307336 linux.debian.kernel:93951

Cross-posted to 2 groups.

Show key headers only | View raw


Package: linux-libc-dev
Version: 6.12.107-1
Severity: normal
Dear Maintainer,

   The problem is that sbrk(2) checks each new request against the 
machine's total RAM + swap space.  It should check each new request 
against total RAM + swap space - memory that has already been allocated 
to the current process.

Steps to reproduce:
1. Compile & run the program below on a machine with 32 GiB memory & 24 
GiB swap

--- eatmem_bad.c
#include <stdio.h>
#include <unistd.h>

intptr_t bigMem = (intptr_t) 128LL*1024*1024*1024;

int main(int argc,char *argv[]) {
     intptr_t i;
     unsigned long long mem;

     if (argc != 1)
         { (void) fprintf(stderr,"Usage: %s\n", argv[0]); return 2; }

     mem=0;
     for (i = bigMem; i >= 16; i /= 2)
         if (sbrk(i) != (void *) -1)
             mem |= i;

     (void) printf("Memory=%llu MiB\n",mem / (1024*1024));

     return 0;
     }
---

Expected (and correct) result:
Memory=56718 MiB

Actual result:
Memory=65535 MiB

-- System Information:
Debian Release: 13.6
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.107+deb13-amd64 (SMP w/14 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE 
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

Back to linux.debian.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Bug#1146373: linux-libc-dev: sbrk(2) allocates more than memory + swap space Carl Wuebker <office@wuebker.com> - 2026-08-31 23:40 +0200
  Bug#1146373: linux-libc-dev: sbrk(2) allocates more than memory + swap space Uwe Kleine-König <ukleinek@debian.org> - 2026-09-16 20:50 +0200
  Bug#1146373: linux-libc-dev: sbrk(2) allocates more than memory + swap space Uwe Kleine-König <ukleinek@debian.org> - 2026-09-23 16:30 +0200
  Bug#1146373: marked as done (linux-libc-dev: sbrk(2) allocates  more than memory + swap space) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2026-09-25 13:40 +0200

csiph-web