From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B67623858039; Wed, 3 Nov 2021 13:16:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B67623858039 From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/28531] [x86] Cancelable syscall stubs fail to preserve 16-byte stack alignment Date: Wed, 03 Nov 2021 13:16:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.22 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2021 13:16:13 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28531 --- Comment #4 from H.J. Lu --- Do you have a testcase? I tried diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 2bd31686fd..ca0b14abc3 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -22,6 +22,14 @@ #include +static void +check (void) +{ + char *sp =3D CURRENT_STACK_FRAME; + if ((((uintptr_t) sp) + sizeof (char *)) & (sizeof (char *) - 1)) + asm ("hlt"); +} + /* The next two functions are similar to pthread_setcanceltype() but more specialized for the use in the cancelable functions like write(). They do not need to check parameters etc. */ @@ -29,6 +37,7 @@ int attribute_hidden __pthread_enable_asynccancel (void) { + check (); struct pthread *self =3D THREAD_SELF; int oldval =3D THREAD_GETMEM (self, cancelhandling); on release/2.22/master branch. "hlt" was never triggered. --=20 You are receiving this mail because: You are on the CC list for the bug.=