Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5333929ybv; Tue, 11 Feb 2020 13:43:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzQerIoRzSSONRQlm5B1oNION64QXTCfRgIoTRermAY9nTY3vOcjWKJ6XgqOmb5+ZQO7bma X-Received: by 2002:a05:6830:1498:: with SMTP id s24mr7178789otq.79.1581457415092; Tue, 11 Feb 2020 13:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457415; cv=none; d=google.com; s=arc-20160816; b=yZT6iT08f4gbc/t76RLorGGt2JUWXBYN//T7Wv+UarDnitlhRekqHfJxznqOFI5Dxk Rk1MdCEnBet4Yno5CaWC0OKRSRFfS+r9BRnk6FkWgsiZ00v1Oox0A4bTbe6KITRPBol2 IvqKAen4ZGTnlcL3nT/s3JnGO8QuSP4e2488LE77gQzoIykY1Ohhh4lwgLQJ1JFg77Gy znzyTg5UohbiyrX8kIKRrzvRm8Q8wPWLGvh9XnAgLkArgHzXFuGDb4NaYpRBTE3Cyaf7 jsavxRboQmDqXKxF9PeCvhdq0V6w3SYCkWrxru0GmI0nXPC6eov7TgMfNCicg4vXSdgW V9lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=px+A28Rcg2eDPkm0mqwpJgDtHMc1TX3lN2kA0mCOfZA=; b=qEJkLb9TR+ym54LY6RnH8w/VGW1Cqau272zr2xmhkBTm3rSB9ddL8IJge56LGhBSZr y0xIczTW9gkG5iLPps6EmHUAWDd40MEAIgpxVnKo5jEZkX1WGNdC9lK23PNLOn+wc57z 3rUxXJ/L58n091cJntFCTWveWkz8rjaTO5gqEuIxZu+1BVOQhNLcpIiGOnfyL5dlWbOr nbMMmk0st/hF7RYtSZINMWG3k0wS70SxydD3iApLO2eNXk4lk7rVsq9QUg/X6JGtkUml vUc9oPESCEgiJwqyzw6BXDJNOuXafg6b/39utR/QRSl6eFjRaT4+ENlTrp5/bqvzpTsb M9hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=msfipC7T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m85si2235060oig.158.2020.02.11.13.43.23; Tue, 11 Feb 2020 13:43:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=msfipC7T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731944AbgBKVG4 (ORCPT + 99 others); Tue, 11 Feb 2020 16:06:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:43586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729031AbgBKVG4 (ORCPT ); Tue, 11 Feb 2020 16:06:56 -0500 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8DC6820708; Tue, 11 Feb 2020 21:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581455215; bh=ial5lfm1joGz3c4sbCOYuWw3kSyd3YsJFbgXFfG8r/g=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=msfipC7T9DKYbMKWk/VLVW4IMh7VnAItA5wtAxaobNWwXfYmHZ/X/Ymmq8lsnLEGN Wu+pQMJuctk58waK3nUpMbXZ4UDxTjq9yOcqf5kjKIuTY+pyZfL45ptaFYdIywNhS+ cyd182nfjlqDLv5IJ8aOb17XICywoddq/X6ljmcc= Subject: Re: [PATCH v3 7/7] selftests/exec: Add READ_IMPLIES_EXEC tests To: Kees Cook Cc: Ingo Molnar , Hector Marco-Gisbert , Catalin Marinas , Will Deacon , Jason Gunthorpe , Jann Horn , Russell King , x86@kernel.org, kernel-hardening@lists.openwall.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah References: <20200210193049.64362-1-keescook@chromium.org> <20200210193049.64362-8-keescook@chromium.org> <4f8a5036-dc2a-90ad-5fc8-69560a5dd78e@kernel.org> <202002111124.0A334167@keescook> From: shuah Message-ID: Date: Tue, 11 Feb 2020 14:06:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <202002111124.0A334167@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/20 12:25 PM, Kees Cook wrote: > On Tue, Feb 11, 2020 at 11:11:21AM -0700, shuah wrote: >> On 2/10/20 12:30 PM, Kees Cook wrote: >>> In order to check the matrix of possible states for handling >>> READ_IMPLIES_EXEC across native, compat, and the state of PT_GNU_STACK, >>> add tests for these execution conditions. >>> >>> Signed-off-by: Kees Cook >> >> No issues for this to go through tip. >> >> A few problems to fix first. This fails to compile when 32-bit libraries >> aren't installed. It should fail the 32-bit part and run other checks. > > Do you mean the Makefile should detect the missing compat build deps and > avoid building them? Testing compat is pretty important to this test, so > it seems like missing the build deps causing the build to fail is the > correct action here. This is likely true for the x86/ selftests too. > > What would you like this to do? > selftests/x86 does this already and runs the dependency check in x86/Makefile. check_cc.sh:# check_cc.sh - Helper to test userspace compilation support Makefile:CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32) Makefile:CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) Makefile:CAN_BUILD_WITH_NOPIE := $(shell ./check_cc.sh $(CC) trivial_program.c -no-pie) Take a look and see if you can leverage this. thanks, -- Shuah