From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 9AA673846427; Wed, 26 Oct 2022 15:18:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AA673846427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666797507; bh=QBZMlvgjSRuGQksBFvk/CxQ8vFjKiBnHVYGBx0p1Zns=; h=From:To:Subject:Date:From; b=Zj+fNlqdWqtBesJFEZC3XVVg+9Vf9f2lo2ajNgc5WDKqnOgSBz4EzsYighB+r2jX4 eqPPawdeJxGfFKfpoeKp3TidHKPwH9lgIVz72Zar3/XM3WGdF9h+f/zQ1YyI1L6Qvt vKwKEKdyQKhRvUXKGxZApKpReW135Td2LwDkjO3c= 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: 5440678ee1801698f97c52e227aaeff7a84e4516 X-Git-Newrev: 281929afda989a938a1fec31613c1c548ceecbaa Message-Id: <20221026151827.9AA673846427@sourceware.org> Date: Wed, 26 Oct 2022 15:18:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=281929afda989a938a1fec31613c1c548ceecbaa commit 281929afda989a938a1fec31613c1c548ceecbaa 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;