From nobody Mon Mar 21 10:33:46 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BBAFA1A3612E; Mon, 21 Mar 2022 10:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KMWDp4wVSz3Hm3; Mon, 21 Mar 2022 10:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647858826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7oj5QI0LH9JMmQ4Gzy2BG8RPFBiGb5yKfZkxeVRy00k=; b=RdDHcAK8rik7bpOb51twXUG34ZzGGxBBS++chAKETHXiQvla3RgeWnYC0NlK2foqgLnFUx SjFg3UtF7fDDOWLkjRHqptE0EpuCTY8GSRI0xIhRBcPrTyk/BzixRk4oC/g2qQoODEEQoO JrUWLTA8Z227rPlVglKSQrCdyC08Ewy8TRUp+IFT2HmI2Bm8uEeLla+3S1QuTufIROrxDI 7aYxoTAV3t4Ka5WGBexQtk+0auLOVaNlKiuB3gUFg76oMm42aa0U/EYxUwJhi45IT2BkmO JIwwAnnOGILhW33kt0C5M2Z+lHmP4bN64IvJuQXUD1NM8nIdaKfXDntUB5qRhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88E0219CA2; Mon, 21 Mar 2022 10:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22LAXkpM086358; Mon, 21 Mar 2022 10:33:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22LAXkMn086357; Mon, 21 Mar 2022 10:33:46 GMT (envelope-from git) Date: Mon, 21 Mar 2022 10:33:46 GMT Message-Id: <202203211033.22LAXkMn086357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: cab496e16cb3 - main - Make SHMMAXPGS an unsigned long List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cab496e16cb384de03010d9dea7399cbbfb3c3f9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647858826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7oj5QI0LH9JMmQ4Gzy2BG8RPFBiGb5yKfZkxeVRy00k=; b=Zy4viLjI7hiOKU7uFC3RMvfcQK4Ag9OvtX77pZNW6xT3YyrwowiIEgseOjOC97bYpJJiB8 USXtk+BkMoZ7VHqaucTp8y7kWLg+6U5mz98i2D35Td34j95rcBkEpDZRrgbmrBWdYPPin4 Ri84eJSBuOvGGnePR33QHBd7YsvMzQnLJ2sg5CrRphiXLPi2d6kIig/eh7/L5VkU3MC98T F3ltgvot1fDIcK21FmqFti8XCc5PKgKzXI6eBuH+yBJ+EhSG2TfPV1U1E+/gVux0guat1O YWOIcy8I34N5Jv+v5pj6P3AyDwuBGurwlDEqprn6wUZr2VCruID1Mf2qIUoydA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647858826; a=rsa-sha256; cv=none; b=aO4pvKE1xCokY0sVx8B1qdGDhMqaq3L6mgaI6H1fbOFWHcaMvwDGXpF0gCqhK76C7O/rpi RBAY+xgwxmActZu8vCoVvCpgUvd4y9pfsOLUOvT62DBFop94XbAj+MKBx2L2zyrKps+Xs1 z5NMQOq4suBezAcPBjkrSQt/qSFthFp7Y58aotG6Hd41drpX8tqzd36jCFtCX7emM+rrTL meCbQ0u1nCjcyzBzChDWNqF54Pw3rY5+Yc3av38R1Cmi4BEkN0l3ERkloFlPZR7qlCyr6q JyxsGPGBIURM1FoeJ4sUmFQcIcAK9ApC5zOJmoo99WoLzGLeW1R+KqD0hGdU4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=cab496e16cb384de03010d9dea7399cbbfb3c3f9 commit cab496e16cb384de03010d9dea7399cbbfb3c3f9 Author: Andrew Turner AuthorDate: 2022-03-15 17:42:30 +0000 Commit: Andrew Turner CommitDate: 2022-03-21 10:27:35 +0000 Make SHMMAXPGS an unsigned long This is used to calculate sizes that are then stored in unsigned long fields. Make this unsigned long so the calculations use this type and not an int that can lead to an integer overflow with a large PAGE_SIZE. This allows building this on arm64 with PAGE_SIZE of 16k. Further work will be needed if a 32-bit architecture tries to use a similar sized page. Sponsored by: The FreeBSD Foundation --- sys/kern/sysv_shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 7ba6c1187bc7..658b48e2e2e1 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -155,7 +155,7 @@ static void shm_prison_cleanup(struct prison *); * Tuneable values. */ #ifndef SHMMAXPGS -#define SHMMAXPGS 131072 /* Note: sysv shared memory is swap backed. */ +#define SHMMAXPGS 131072ul /* Note: sysv shared memory is swap backed. */ #endif #ifndef SHMMAX #define SHMMAX (SHMMAXPGS*PAGE_SIZE)