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: 813396 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp784162wro; Fri, 19 Jul 2024 07:35:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXre3TcslHfkOrvEope6Uz+DgWJtSimVW6pkr767ORAfw8qE+cH5Nt3JvQ4APSaW8olmiQ+xno09F594nc5rPMf X-Google-Smtp-Source: AGHT+IG2+mVMaaE9Og4/KZS0pxdTx7bFhFgv6Ek8jzBchCLbUEaC+cReRTk849qPkzVFDuUBRJRC X-Received: by 2002:a05:6102:3c8f:b0:48f:91cd:8c1a with SMTP id ada2fe7eead31-491597383c4mr9755490137.3.1721399741337; Fri, 19 Jul 2024 07:35:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1721399741; cv=pass; d=google.com; s=arc-20160816; b=Eum3CHU4z3L7qhK9MIwkqwsamHYK6yj3M3tigI6BZAPoT3M7n3d5KrR6nSCPtT/fi6 N/hhuQurpDwc8JnbGbmX98ElToZICrfswcBOvBw/od2zJMvwhjOnHQsyhVcSC7pCY5Om 0T0816U5BrQkBE1aNCrKELY6593hGMYp4bIKd8wUKm09AxYt+9ldDJmGmsF+B2pHfLef baFAWjpm5+pcuSJUujsOCsv3Cy/2hnllrpaneFxb/RapyFOD1sTYaLrcYyOpbXi5E14D NEqB+NHbr+tZBXRzJxl33RtbRWmPQ/Nf2cfLCRYLOJWgQ+vwQEfSxiX1+m8tr0T63EMb +nlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=o8X9ckJft0tGC9y3yClX7kGu6baVRoVztUcxR3OQcHg=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=k4WYH+EXiHKjrHVvLufS50qdf+lO01hQxzKTGx3B35dXgOXWBKvbJ8G1i4U89fyS+d dBDCdKZ146HKdQruClfY/lwdTZEemtRyBR6yFENcEYpFwj34qG9WI9YPPvQCb/x7z4eM zzP+qkViAxNLwOZ6t+xD48rB2b3GwIAR7r+OIZFYNZPdkhqpeCDhl6R0f3yIz5nV0wAc 6VWs3ahH3A2P24Cog54RU/TeEOIk/G3OzH358dyPOXRDtUVXyiOOHMpvnyKjVikPOT+y tG9hbA6W4kB5UtKhRPPbqgsr7I9vMMPqV5ehunGB+z6VpBROWiNtXiBoqXcN5TXKZqf/ 0rRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SgnJiEOR; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ada2fe7eead31-492793d0777si273343137.618.2024.07.19.07.35.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 07:35:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SgnJiEOR; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EDD3A384A42B for ; Fri, 19 Jul 2024 14:35:40 +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-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~patch=linaro.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);