Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp9489920ybc; Sat, 30 Nov 2019 08:16:52 -0800 (PST) X-Google-Smtp-Source: APXvYqy1HJkyfh8OfTOo0z9N7YUIJI6WypSG6/Fm80VtTLywMo61pmO5KBBTETwTzuVBisrQfi1X X-Received: by 2002:a50:f38e:: with SMTP id g14mr1875624edm.168.1575130612790; Sat, 30 Nov 2019 08:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575130612; cv=none; d=google.com; s=arc-20160816; b=0P88HmSWdkfvzRbb3vPDUMhZlWq2oiopPWtWYHxaf2N152ekbzx9Kv6RsWg5KH9SBt F8yOFlEbUYwGEr1TM9f5hBvnwellri+kzwf1xHnXxVQWgH61LppcX731FfiWmSi3J3UJ +ymBzIRWsEJfofOfAnGSWarnkHfehNzLqeJ4D9ORUHDj0JMTDnuUp1QafAYaAkN+gs1A k8T1G/SyrLiuE6HOM05qfESTdRnAj/ZHU3xj9mLcW0oZmw1kLn8qWaM7n7PQ+27aqOso GqJx5jxlV3l8PhI8ZBaUXi/aNMG2ZUMLUIZeNlf5XgXesil08HoAecYomv1noGNJijx8 7zQw== 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=ODJuHGe9WgQW36Ci2aMzJGsTEI0RMME9CeNAPNQ613E=; b=rNnrUlew44aptPlZhwzRNLcAf+Ia5APusnOCMJUrdLOB8ia0Uj8iWjCJPG6BlrDaCm hPbWZ52sI3S48oAsk4delaQt8Sj9r85ZEJ7skZmRwvKmT4cEeTRV+LHlhSEdNi0o+A9m eAgS5GmHRp9U7ZOW2kr7UXxEEiVimaDBfKmMuBqis6Say0O9n+cwgqj1XH003BE7fyA4 nBBIB6zx2r6sYc8x7sPFiVZ7UhYQOa7qfD+nENwgTxEBYYwNdH501aKL0imR3v0QBBNO G8J6edvyy7gOh3s8osX+1f2I3qUau24T635DLLntuMRw3AEDMjLUMgvIoBUmYYunyjWe 3HNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eCHYX35v; 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 g3si3100618edn.190.2019.11.30.08.16.25; Sat, 30 Nov 2019 08:16:52 -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=eCHYX35v; 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 S1726946AbfK3QNE (ORCPT + 99 others); Sat, 30 Nov 2019 11:13:04 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36474 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfK3QNE (ORCPT ); Sat, 30 Nov 2019 11:13:04 -0500 Received: by mail-pf1-f195.google.com with SMTP id b19so16128761pfd.3 for ; Sat, 30 Nov 2019 08:13:03 -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=ODJuHGe9WgQW36Ci2aMzJGsTEI0RMME9CeNAPNQ613E=; b=eCHYX35v0tNsJ8Wyr7huWqSL/Q7uu9HMJts4X7sI/QKLD3KSpwVU1yKPvnWbgBDkck w55L5neeBImSshB4MOgvDxkc/9a3orK3a1S1HHbjOdPtVF8JRjkP0b1vdUZecBgtQ4Bb d660NmRHJmW/YEooGXS1R++4WmwRxc6UkSjVo= 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=ODJuHGe9WgQW36Ci2aMzJGsTEI0RMME9CeNAPNQ613E=; b=e4VySywJUHmMNJg8TnJ5AGbtB+XK5GHgte7zuV7vDYEjDNmnQdSksGkHF5VN4+WtHj 4i+FDqI4it+9giXOFf81AO84t65gc4DytJPGYgRjQbvHfZrIX1WOOsrUQ5jg/Xhv9UXL FXwRlY65eKC/mgd4x/ZRfPe8vvQQ/HMCuprgQZSfa2kTzpjFUAh2Xr+7qFmt0bQkIY// 2kKA9ekUQ2ctx7jwi8jePIxeAJUI29/+5x+RAWUIyT7q9oHW1E4nBw3UNOhMSuNgxTZH wG1p+y7Oj95lbX4JWed5O/dgknisWt1a6YMXA7VrLA+XZSTsd3Q8CylWi2qT+EE1YuDY +a1w== X-Gm-Message-State: APjAAAXk9ElRg+6+DB6WXuq6EAUy5RDablKebf36R6FoMS8PKvyTHOEj IpmEd8FqvURiTRZlsLXFAcE/7w== X-Received: by 2002:a62:5e04:: with SMTP id s4mr64130438pfb.63.1575130383668; Sat, 30 Nov 2019 08:13:03 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 67sm19071797pfw.82.2019.11.30.08.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 08:13:02 -0800 (PST) Date: Sat, 30 Nov 2019 08:13:01 -0800 From: Kees Cook To: Max Filippov Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Will Drewry , Shuah Khan Subject: Re: [PATCH] tools/testing/selftests/seccomp: change USER_NOTIF_MAGIC definition Message-ID: <201911300811.7D70D30@keescook> References: <20191129055128.25952-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191129055128.25952-1-jcmvbkbc@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 28, 2019 at 09:51:28PM -0800, Max Filippov wrote: > USER_NOTIF_MAGIC is used to both initialize seccomp_notif_resp::val and > verify syscall resturn value. On 32-bit architectures syscall return > value has type long, but the value of USER_NOTIF_MAGIC has type long > long because it doesn't fit into long. As a result all syscall return > value comparisons with USER_NOTIF_MAGIC are false. This is also reported > by the compiler when '-W' is added to CFLAGS. Hi! Thanks for sending this. There is already a patch in the pipeline for getting it fixed; it should show up in Linus's tree soon: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/seccomp&id=223e660bc7638d126a0e4fbace4f33f2895788c4 -- Kees Cook