Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1668227pxy; Thu, 29 Apr 2021 11:42:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxewU9mHzpnKi7ud/LJNxQy3OmW9WZ3Ch2OLHS1TRYJVFFCRAKJbnalCMRND9AEmlh2jVTN X-Received: by 2002:a63:df56:: with SMTP id h22mr1102918pgj.84.1619721767240; Thu, 29 Apr 2021 11:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619721767; cv=none; d=google.com; s=arc-20160816; b=S1juYErFUB/9AQHMIqeXyOo+9jWBzViDcX5lpeaGBKzqYATHAyFKWGvvmeSxYx1/KV 0KTtLHnl4ihYC4BHqusGNmvUJtge/QJY2hoCqiZw09+aqLYvvrG7eiNmfESvOgVV9jLc 9/p0hQQ92ZKZ7Lc+aYQ2oVcuDS8pX+2TRDXNFvaQM3K1RnN/k+4D6t6xXxMkqQy5WL5K vuec6/9kANfAwwccjwcDNhc9HINuSKkhW1ZIPkMx4qUE4kDwaYIkVNH+gf84LQ4GaJ2v zyMuXtMNgBp1+9NxnndxBf7MH72b5ujbd86y0fmwDVcxHrJH2YThINHc0GVLD7s+VFUZ 0org== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=0OUrEu3/29WV/lDM4r+szkRmP1MV+40G+dNKGjfZYt8=; b=VfLuyG6pxNCe/YuBt173ImHC3Ld91Pwk7zUvfiwvAA3/hcKVTN8CujaWAzAgNaSjCt pI3Xv6f2Vnqw3amL51SnA0LB6hfVf1J8GpwH/jD/AjoYCH+6WziTGhFhAhr2VOp820j4 qY1DMfPEXPV60w88IUxjxRBjLBBJmB4u3ad9pyePClmt9/4ey/R729vJddQtZZgEZ8F/ xNIIlCwp1y9QyVPdr3XLp6ORTZdubOll3Pu93cksP/hPHFFetWs5uOKMGFtuY5U7+O3m ljpSC4YPbpph4xVdFYQxJfmtDyxWCogpd5gBkuJDg/PaYoQF1+YM+ZVnAi02/GXmPxOW nK+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si579215ply.40.2021.04.29.11.42.34; Thu, 29 Apr 2021 11:42:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241240AbhD2SlO (ORCPT + 99 others); Thu, 29 Apr 2021 14:41:14 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59824 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241236AbhD2SlL (ORCPT ); Thu, 29 Apr 2021 14:41:11 -0400 Received: from mail-pl1-f200.google.com ([209.85.214.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lcBaJ-0001vm-FV for linux-kernel@vger.kernel.org; Thu, 29 Apr 2021 18:40:23 +0000 Received: by mail-pl1-f200.google.com with SMTP id z2-20020a1709030182b02900eca55a002dso16571342plg.0 for ; Thu, 29 Apr 2021 11:40:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0OUrEu3/29WV/lDM4r+szkRmP1MV+40G+dNKGjfZYt8=; b=ubyXPozTKoaaAv+jKcK0pVQx2OXFK0/PIizboTw4sntOpr2wx44XjIfZYOtlzJdH8R VKhA8Wul+/85tFKaNhC3y5jsklQzZc0AuNU+lsUIydCQAuR9lfeufFsj23nGwIYLaRoA luOoLfVt0Ab3gmxzKWz72yPBSNp/iLjZJobNE23o2gS0RFeDcPE18i1Le2lmWhvQZO2e gF2xZGZ32p3nw7Bw9ae9LyKl052UsKDGkCtM+iplgzkNypca0TxWfuyBzN5KqdjtLj2D TXzce16IBmA61IIkIoubG+2rnLb7Rswdsx+WiwV2YVtkWu6MutV8FrFN7JGwsNTMej+g 6E2A== X-Gm-Message-State: AOAM533cN24hIpguw3dx7EkGJMp8GnA20kWgUbe0rqI6a8NM/C9cC9t7 ROg0o3mzU0EtymCRF4W+r6XADJnGn/C0wdRETUgx0zNKcUwSsP3fsHeWoqOx5GHrN3l+7O19W3X SaXNDU4N1BXVV/fOyV0ScKfZLwWQrosQ0hvk41wf1hQ== X-Received: by 2002:a17:90a:cb0e:: with SMTP id z14mr11314576pjt.128.1619721622211; Thu, 29 Apr 2021 11:40:22 -0700 (PDT) X-Received: by 2002:a17:90a:cb0e:: with SMTP id z14mr11314560pjt.128.1619721622063; Thu, 29 Apr 2021 11:40:22 -0700 (PDT) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id i123sm3566618pfc.53.2021.04.29.11.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 11:40:21 -0700 (PDT) From: Tim Gardner To: dave.hansen@linux.intel.com Cc: tim.gardner@canonical.com, jarkko@kernel.org, shuah@kernel.org, linux-sgx@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/sgx: Defeat execute permissions test Date: Thu, 29 Apr 2021 12:39:52 -0600 Message-Id: <20210429183952.22797-2-tim.gardner@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210429183952.22797-1-tim.gardner@canonical.com> References: <20210429183952.22797-1-tim.gardner@canonical.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The permissions check on /dev/sgx_enclave appears to be an oversight in that it will not allow the test to continue. Skipping this test with a warning allows the test to proceed. Cc: Jarkko Sakkinen Cc: Dave Hansen Cc: Shuah Khan Cc: linux-sgx@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Tim Gardner --- tools/testing/selftests/sgx/load.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/sgx/load.c b/tools/testing/selftests/sgx/load.c index f441ac34b4d4..e5bcaca1c372 100644 --- a/tools/testing/selftests/sgx/load.c +++ b/tools/testing/selftests/sgx/load.c @@ -155,10 +155,8 @@ bool encl_load(const char *path, struct encl *encl) * bits set. It does not check that the current user is * the owner or in the owning group. */ - if (!(sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { - fprintf(stderr, "no execute permissions on device file %s\n", device_path); - goto err; - } + if (!(sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + fprintf(stderr, "Warning: no execute permissions on device file %s\n", device_path); ptr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); if (ptr == (void *)-1) { -- 2.17.1