Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5434690ybv; Tue, 11 Feb 2020 15:54:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwrEHYLOIYuMTqpUtbvlaQ3wUQPXhRG49yUd7EnHjiW6imOk0zNr8jZUQm5AUBS7KPk8T7u X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr6829105otq.1.1581465269551; Tue, 11 Feb 2020 15:54:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581465269; cv=none; d=google.com; s=arc-20160816; b=DX4vgI+lubRxLncbM3Vv6StKFxQPaVVNVHvSZIpbhjn8qAfnldJ9tOS+eBDf2S47n7 pJ+PalMLzdMNNzD8AN5UMmaEBGB1idbsSOlpKHKqzb+OA3OGPBvVLMfuQuNoYusHldCb PgWSNvPEkMd1mIfxW1P8XTeBV+7Q6Kq0xnfHrvKDkjE05MSJAxleoOtL2ZwMOqtVdIvC iOmucCJrgYyzfO8EYz0exc35LIipIUZ6hKqqcoSF8GJM1Ma0fLE9oV7lspggTzfamaNs /bU72i2k7k0Y1Mu7EYGQfxjGwkExhdCJMX8gl11ZfuPiecQzVeq3Q8HC3XyQ2Mv3q959 m0FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BDlxFx20QE0gAgkEMA+u4mAwlJYSDizranolCfN6FSU=; b=neNXor+ruwFHIx3N/ORs6CS8KwSHuzSHbhcwLf024+M5X4RBSgWlQyPSPbTHFbvSxV q6sVsqG7jvvbN+cODN0ptNiPZrLqboQpvuZOC4xBUqVAiI6kZxlzvP3Auh/1s+swySEd 22GFvzeCVlr4h8Q5jkp43r7hVl7C5stMRu0ZwJQpiX8NH4LasDJDU9O9FOHC8eb4wlFQ 4L3oT3uQfpq7lIdhD04kGB4S+s+IsWpEVG39kPUpC9lEUlH4aywq4jMCf21z+NsM/Pea +a/7gi/vpF2PVDtFsvgBLMeZvupwOCfowy3Q3Q2VzNpZ/axLA7E6Q27BFVH3HS3SXssq RUCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XB7DUxrO; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si2609496oti.269.2020.02.11.15.54.17; Tue, 11 Feb 2020 15:54:29 -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=@chromium.org header.s=google header.b=XB7DUxrO; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728047AbgBKXyJ (ORCPT + 99 others); Tue, 11 Feb 2020 18:54:09 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:55262 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727988AbgBKXyJ (ORCPT ); Tue, 11 Feb 2020 18:54:09 -0500 Received: by mail-pj1-f68.google.com with SMTP id dw13so46273pjb.4 for ; Tue, 11 Feb 2020 15:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BDlxFx20QE0gAgkEMA+u4mAwlJYSDizranolCfN6FSU=; b=XB7DUxrOlRWKCxIVzsmwUiozIyPNm+XipqRy+ojNQXQ4il5NSGcySle4DA3copkxR0 txpPB/fPke36xIv/qe2phszSj0yMMBhZ7SSIKgC8wlYAX/nwLnydJ9528PktuoKka0Xo FIQk6kwnmb94p+mMQF56OxOJi3mG8ahbOTuU8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BDlxFx20QE0gAgkEMA+u4mAwlJYSDizranolCfN6FSU=; b=rTza/O1v905qRlOGwAmGXuROcs+W/iYSUPp0GvOs0MzoRkjpdRPX0p/0Fuog3K8p+v 6sRhr+JRaGs2sf+C25StxmR22yVc8yPeqpEBt8jirgJubivS9jGC/AgBllRWmRTfIARW 0V0NP2N1+AwDwJNnudGA/KHDj7Nu9FXGjSNy63rJgfIQI1n/EAUqVxPDWdgIYgAmvQOk maama5OL6ZrEYglTm3XBIRkSOrewv/cuDnmRQ8No0f3Jy47Fav6mjSAqeKoSr+iXJ9cQ 9e/gjgFX5W7rvkEm16OJy/8nLCaAnjJZP/eaIGvASTZl0rdn5CClmubYeoJViIS+FtZ2 YCmg== X-Gm-Message-State: APjAAAVaugeIXrWnsCV/FNKP8T763FCV76FoZEvgB0gw/6Pphsa4U9/i 7+trZk8i4YmlJG2W++emBtdzzA== X-Received: by 2002:a17:902:708b:: with SMTP id z11mr5645748plk.121.1581465248817; Tue, 11 Feb 2020 15:54:08 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l13sm4513339pjq.23.2020.02.11.15.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 15:54:08 -0800 (PST) Date: Tue, 11 Feb 2020 15:54:06 -0800 From: Kees Cook To: shuah 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 Subject: Re: [PATCH v3 7/7] selftests/exec: Add READ_IMPLIES_EXEC tests Message-ID: <202002111549.CF18B7B3B@keescook> References: <20200210193049.64362-1-keescook@chromium.org> <20200210193049.64362-8-keescook@chromium.org> <4f8a5036-dc2a-90ad-5fc8-69560a5dd78e@kernel.org> <202002111124.0A334167@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 02:06:53PM -0700, shuah wrote: > 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. I did before, and it can certainly be done, but their stuff is somewhat specific to x86_64/ia32. I'm looking at supporting _all_ compat for any 64-bit architecture. I can certainly write some similar build tooling, but the question I have for you is one of coverage: If a builder is 64-bit, it needs to be able to produce 32-bit compat binaries for testing, otherwise the test is incomplete. (i.e. the tests will only be able to test native behavior and not compat). This doesn't seem like an "XFAIL" situation to me, and it doesn't seem right to silently pass. It seems like the build should explicitly fail because the needed prerequisites are missing. Do you instead want me to just have it skip building the compat binaries if it can't build them? -- Kees Cook