From patchwork Fri Jul 19 14:23:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1962520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=SgnJiEOR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WQXKJ70NTz1ySl for ; Sat, 20 Jul 2024 00:35:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EA76384F032 for ; Fri, 19 Jul 2024 14:35:47 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id 38C9D382EF18 for ; Fri, 19 Jul 2024 14:23:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38C9D382EF18 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 38C9D382EF18 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1036 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721399008; cv=none; b=tJHaTaactoLha8eoIfvY8BQDJh5whkSFKjxyQZCCZEHObu6m8Oc8flEQ5Mq2DaDRqb2OzKMZVY3f5Rd3BFuOXaoWlQryDaeOECo0VgfUb9znb7k+3WJL7iN2XRgryk27ZkHRq4Vh2zD6q1uSilil2sGgLsbM3VlHlQijKNBCmCk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721399008; c=relaxed/simple; bh=ztPCBqWH1ejNY1dvk4dBI3w3JOyIgqj3cTVk0XJtEMg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Lr18iY2HNwWuBEPyeQ3/QQ+TLw4gRIwLy+HBiFtbI2YlxGl/urzOg/vY+Z8/INkRq4beIf8XDKxdzBgEMeJok8UkPtjpcedZD13+ZfAcFMgWzP5/3O2lfpzUaMYeKjrTd61veqjyHIqXRLvDLDgQAnz+iBM8i/rmWC9sx3opuQw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2cb5b783c15so1033108a91.2 for ; Fri, 19 Jul 2024 07:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721399005; x=1722003805; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=o8X9ckJft0tGC9y3yClX7kGu6baVRoVztUcxR3OQcHg=; b=SgnJiEORkQrdcgC5LFmKuKuivKWGM7OUT3nnKGa2zOejHVRSC6ZHrPsTxZIRgQWXLW 1yD3iQhzzsPMGUM63TuxUK/b09VepVn+piIaM63HMWE30H7lyURg2uymQwjpfxg6cM06 twv2WbaZfnh7yQ57FZZ54K5ejFJra4CkK6vLKND1dSr9o5ukvIhKuiOxwPd2X+bHD2C8 D+p73zB92USFH02vxblKzvS2+FRNXi8Apq+wgAumNtt1fz9vNcSh66YMbAe8mCXEnpsP nSElNisBqwd1yQOoFEe9AG0G+G1lD2B56S0qFF1B8jP4siqy0bod8SfTB0FMrSDr6vwP hRNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721399005; x=1722003805; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o8X9ckJft0tGC9y3yClX7kGu6baVRoVztUcxR3OQcHg=; b=G7/G7Glt28kVPai06YwEYxyBNkwkPPB1KDVETmDd3Wl2R59GDpwyaYGzl010Rk7/ux e5EKmjfp73Vr9m040c67YCn0XouAOHSsnb/B6zOzGLPr0XjysNKxNy0J6BS5/9Nt9fSE xn1GyQ8J2hfO3QvnHKlcEoyvlwXE4Zvk8QB8iYeXkGj7D4z4ipkIh9/yw6tLGxNSOGw/ Pv0tmlqeNL3mULmK91bv8TUullClv3veq+g1PhBsZkdcrBtp6O1SHYES7D83rr49yqJ/ uEkxfOP2AFo7p7E0Z/xz07TOBkESUeMt34rjeyTHn4xecBdKJ2PWflF4bgAUhQ33ValW 55PA== X-Gm-Message-State: AOJu0YzyUsKvkrlUOYU7GORsp2SvvPGdOxM6Y6PTtRWxOKLzq6HAL1AS LXu0vc0i+w3CIq+GDB1aYJbK2befja7asuuvUc2NwNdM7K59Xm3/Kr8j6iisGI4lqicQFntC6cO Y X-Google-Smtp-Source: AGHT+IHffApkyV0RCjZzSTXNeiiG1sa1yKyrzFWtJr0WKZMczIBQtGU8PWvo+buEijh5YopncmpiPQ== X-Received: by 2002:a17:90a:a40d:b0:2c9:75a4:cc71 with SMTP id 98e67ed59e1d1-2cd161b89b1mr86280a91.32.1721399004776; Fri, 19 Jul 2024 07:23:24 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:842a:e498:ad33:bbad:a9fd]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cb77307630sm2861223a91.21.2024.07.19.07.23.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 07:23:24 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] linux: Also check pkey_get for ENOSYS on tst-pkey (BZ 31996) Date: Fri, 19 Jul 2024 11:23:15 -0300 Message-ID: <20240719142320.881675-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org The powerpc pkey_get/pkey_set support was only added for 64-bit [1], and tst-pkey only checks if the support was present with pkey_alloc (which does not fail on powerpc32, at least running a 64-bit kernel). Checked on powerpc-linux-gnu. [1] https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a803367bab167f5ec4fde1f0d0ec447707c29520 Reviewed-By: Andreas K. Huettel --- sysdeps/unix/sysv/linux/tst-pkey.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/tst-pkey.c b/sysdeps/unix/sysv/linux/tst-pkey.c index d9083daab9..46f55666da 100644 --- a/sysdeps/unix/sysv/linux/tst-pkey.c +++ b/sysdeps/unix/sysv/linux/tst-pkey.c @@ -205,7 +205,13 @@ do_test (void) " protection keys"); FAIL_EXIT1 ("pkey_alloc: %m"); } - TEST_COMPARE (pkey_get (keys[0]), 0); + if (pkey_get (keys[0]) < 0) + { + if (errno == ENOSYS) + FAIL_UNSUPPORTED + ("glibc does not support memory protection keys"); + FAIL_EXIT1 ("pkey_alloc: %m"); + } for (int i = 1; i < key_count; ++i) { keys[i] = pkey_alloc (0, i);