From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dog.birch.relay.mailchannels.net (dog.birch.relay.mailchannels.net [23.83.209.48]) by sourceware.org (Postfix) with ESMTPS id C2201398EC30 for ; Wed, 10 Feb 2021 13:56:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C2201398EC30 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7D53A781E34 for ; Wed, 10 Feb 2021 13:56:55 +0000 (UTC) Received: from pdx1-sub0-mail-a29.g.dreamhost.com (100-96-133-12.trex.outbound.svc.cluster.local [100.96.133.12]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 1E2E2781027 for ; Wed, 10 Feb 2021 13:56:55 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a29.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.133.12 (trex/6.0.2); Wed, 10 Feb 2021 13:56:55 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Invention-Ski: 51983cff75eab9dc_1612965415334_100989738 X-MC-Loop-Signature: 1612965415334:1372832981 X-MC-Ingress-Time: 1612965415334 Received: from pdx1-sub0-mail-a29.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a29.g.dreamhost.com (Postfix) with ESMTP id D4FE47F177 for ; Wed, 10 Feb 2021 05:56:54 -0800 (PST) Received: from rhbox.redhat.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a29.g.dreamhost.com (Postfix) with ESMTPSA id 9945D7F182 for ; Wed, 10 Feb 2021 05:56:53 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a29 From: Siddhesh Poyarekar To: libc-stable@sourceware.org Subject: [COMMITTED/2.33 3/3] tunables: Disallow negative values for some tunables Date: Wed, 10 Feb 2021 19:26:04 +0530 Message-Id: <20210210135604.445223-3-siddhesh@sourceware.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210210135604.445223-1-siddhesh@sourceware.org> References: <20210210135604.445223-1-siddhesh@sourceware.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3495.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 13:56:58 -0000 The glibc.malloc.mmap_max tunable as well as al of the INT_32 tunables don't have use for negative values, so pin the hardcoded limits in the non-negative range of INT. There's no real benefit in any of those use cases for the extended range of unsigned, so I have avoided added a new type to keep things simple. (cherry picked from commit 228f30ab4724d4087d5f52018873fde22efea6e2) --- elf/dl-tunables.list | 6 ++++++ elf/tst-rtld-list-tunables.exp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list index 3cf0ad83ec..8ddd4a2314 100644 --- a/elf/dl-tunables.list +++ b/elf/dl-tunables.list @@ -64,6 +64,7 @@ glibc { type: INT_32 env_alias: MALLOC_MMAP_MAX_ security_level: SXID_IGNORE + minval: 0 } arena_max { type: SIZE_T @@ -109,22 +110,27 @@ glibc { skip_lock_busy { type: INT_32 default: 3 + minval: 0 } skip_lock_internal_abort { type: INT_32 default: 3 + minval: 0 } skip_lock_after_retries { type: INT_32 default: 3 + minval: 0 } tries { type: INT_32 default: 3 + minval: 0 } skip_trylock_internal_abort { type: INT_32 default: 3 + minval: 0 } } =20 diff --git a/elf/tst-rtld-list-tunables.exp b/elf/tst-rtld-list-tunables.= exp index 4f3f7ee4e3..9f66c52885 100644 --- a/elf/tst-rtld-list-tunables.exp +++ b/elf/tst-rtld-list-tunables.exp @@ -1,7 +1,7 @@ glibc.malloc.arena_max: 0x0 (min: 0x1, max: 0x[f]+) glibc.malloc.arena_test: 0x0 (min: 0x1, max: 0x[f]+) glibc.malloc.check: 0 (min: 0, max: 3) -glibc.malloc.mmap_max: 0 (min: -2147483648, max: 2147483647) +glibc.malloc.mmap_max: 0 (min: 0, max: 2147483647) glibc.malloc.mmap_threshold: 0x0 (min: 0x0, max: 0x[f]+) glibc.malloc.mxfast: 0x0 (min: 0x0, max: 0x[f]+) glibc.malloc.perturb: 0 (min: 0, max: 255) --=20 2.29.2