From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 61C553857363; Fri, 5 Aug 2022 19:35:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61C553857363 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] cheri: malloc: align up without breaking capability in memalign X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: b3d26f52f7084c1f008b3c746c01db4f122f7879 X-Git-Newrev: 4064e7a4fc027aef0f023dc93fe436a512b1aaf9 Message-Id: <20220805193540.61C553857363@sourceware.org> Date: Fri, 5 Aug 2022 19:35:40 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2022 19:35:40 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4064e7a4fc027aef0f023dc93fe436a512b1aaf9 commit 4064e7a4fc027aef0f023dc93fe436a512b1aaf9 Author: Szabolcs Nagy Date: Tue Mar 15 09:54:59 2022 +0000 cheri: malloc: align up without breaking capability in memalign Diff: --- malloc/malloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index 062ca0dc0a..02df29d2ad 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4982,8 +4982,7 @@ _int_memalign (mstate av, size_t alignment, size_t bytes) we can move to the next aligned spot -- we've allocated enough total room so that this is always possible. */ - brk = (char *) mem2chunk (((unsigned long) (m + alignment - 1)) & - - ((signed long) alignment)); + brk = (char *) mem2chunk (m + alignment - ((unsigned long) (m) % alignment)); if ((unsigned long) (brk - (char *) (p)) < MINSIZE) brk += alignment;