From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7919) id 2D9063858402; Thu, 24 Aug 2023 12:17:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D9063858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692879452; bh=b3YjZE31q+6QyHtn1R7KU2IM2WdYanoDADR0+MLe7+Q=; h=From:To:Subject:Date:From; b=EZ802wlX7FCzPCZYCXAfQuh8K9FqoYE8cTnArdFd/Eso9HTE9r6SACr/uI6sh4+SF Y+JNust8IiqWztHOayRXk+IvpbJszLkgdzHJroAbIMpG9RGT7yoLr4YcvV8o/8Lr3l 7j65LkkZwOGWmpTmOIz64EvxUdEgrF0I8jaVQuJY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sam James To: glibc-cvs@sourceware.org Subject: [glibc/release/2.38/master] sysdeps: tst-bz21269: handle ENOSYS & skip appropriately X-Act-Checkin: glibc X-Git-Author: Sam James X-Git-Refname: refs/heads/release/2.38/master X-Git-Oldrev: c8ecda6251dd4a0dfe074e0a6011211cadeef742 X-Git-Newrev: ad9b8399537670a990572c4b0c4da5411e3b68cf Message-Id: <20230824121732.2D9063858402@sourceware.org> Date: Thu, 24 Aug 2023 12:17:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ad9b8399537670a990572c4b0c4da5411e3b68cf commit ad9b8399537670a990572c4b0c4da5411e3b68cf Author: Sam James Date: Sat Aug 5 00:04:33 2023 +0100 sysdeps: tst-bz21269: handle ENOSYS & skip appropriately SYS_modify_ldt requires CONFIG_MODIFY_LDT_SYSCALL to be set in the kernel, which some distributions may disable for hardening. Check if that's the case (unset) and mark the test as UNSUPPORTED if so. Reviewed-by: DJ Delorie Signed-off-by: Sam James (cherry picked from commit 652b9fdb77d9fd056d4dd26dad2c14142768ab49) Diff: --- sysdeps/unix/sysv/linux/i386/tst-bz21269.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c index f508ef8f16..28f5359bea 100644 --- a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c +++ b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c @@ -52,7 +52,16 @@ xset_thread_area (struct user_desc *u_info) static void xmodify_ldt (int func, const void *ptr, unsigned long bytecount) { - TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, func, ptr, bytecount) == 0); + long ret = syscall (SYS_modify_ldt, func, ptr, bytecount); + + if (ret == -1) + { + if (errno == ENOSYS) + FAIL_UNSUPPORTED ("modify_ldt not supported"); + FAIL_EXIT1 ("modify_ldt failed (errno=%d)", errno); + } + + return 0; } static int