From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1199 invoked by alias); 19 Feb 2018 10:13:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 1173 invoked by uid 89); 19 Feb 2018 10:13:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de From: Andreas Schwab To: Andrew Senkevich Cc: libc-alpha , max@quendi.de Subject: Re: [PATCH] Fix i386 memmove issue [BZ #22644] References: X-Yow: Uh-oh!! I'm having TOO MUCH FUN!! Date: Mon, 19 Feb 2018 10:31:00 -0000 In-Reply-To: (Andrew Senkevich's message of "Mon, 19 Feb 2018 10:45:56 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-02/txt/msg00492.txt.bz2 On Feb 19 2018, Andrew Senkevich wrote: > diff --git a/string/test-memmove.c b/string/test-memmove.c > index edc7a4c..8dc152b > --- a/string/test-memmove.c > +++ b/string/test-memmove.c > @@ -245,6 +245,49 @@ do_random_tests (void) > } > } > > +#if __SIZEOF_POINTER__ == 4 > +static void > +do_test2 (void) > +{ > + uint32_t i; > + uint32_t num = 0x20000000; > + uint32_t * large_buf = mmap (0, sizeof(uint32_t) * num, PROT_READ | > PROT_WRITE, > + MAP_PRIVATE | MAP_ANON, -1, 0); > + if (large_buf == MAP_FAILED) > + error (EXIT_FAILURE, errno, "large mmap failed"); > + > + if (!((uint32_t)(large_buf) < (0x80000000 - 128) && (0x80000000 + > 128) < (uint32_t)(&large_buf[num]))) > + { > + error (0, 0,"allocated large memory doesn't cross 0x80000000 boundary"); > + ret = 1; > + return; Please properly fold long lines, and remove the redundant parens. Also, there is no guarantee that the address range is unallocated. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."