Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6585101ybe; Wed, 18 Sep 2019 06:01:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpBybh9IEX4eTQsjuqkLk1D1lcLh06+xwcc5hvRoohBREnTluk1JW+Rx4V+gdR8iLckaY4 X-Received: by 2002:a17:906:af8c:: with SMTP id mj12mr9662531ejb.58.1568811713222; Wed, 18 Sep 2019 06:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568811713; cv=none; d=google.com; s=arc-20160816; b=SET3nhmuodS7pIGQzoQyhFowfFAKqkRferlP3wHXVAZqKBmgMhP2S4FLwHC+Hqaonu +T9kFjdqAYRXnTpH6TolaJ1DuyE2nffK+54jpBT82SVMwps16bZ8/7SQ0KSS56z+anUr 6JU4zX5LC1qUtCfdI6YUwmfwjKmWRGgHY+Z8aGxiNgY9KVdQLBB4Sluxbj3b+v1pVoEk IgK19/B4AynDrotNBfxOkoQTpAPWCGTJGVYbiS7xKKoTV1R6Sa4XAcmIxIVH0o6aBcUG mFU5F2B6tpOaREJ/An4CjXBfWTafJv2Rb5worvx/JE553vyCP7Ppk3NKyBEWGOErl+1m RO8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ukceLRPnaSY+jAoZDZD7AXhSAqsZX0yiZGBB4pTsQK0=; b=ZryebCyAB9rU2aw6I4/20DIl5gGBsvZYBxkULnSryW6xUthNPmR2a1ppc41NhVguOR 2FNlXVfzjiNCOd+TLB9iCm1hEYmQ1IXkrWoKxr1/Fod/9ZFZsDFKK69SLlXRJfus7QEq hwSyxU1hH8zzdM7kKGENLIW7BIjfoHs2uT0EEYFjHPW0EaTh+pyeYxCmGB2POCnLCElX g9Zsaz6a00TKCvQusEI/iZPqQwVFlgPPrTzQPwL0Af3lwcMiuJuHbZ1YGEx7o8Qms1xh Zj111ZmCevnNTzOpoGacqDQFC5Sm90w1RSPFMYaOP4EKmnpFYeaYb9vPAQ8oythQlOl3 PowA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k39si3302780edb.52.2019.09.18.06.01.28; Wed, 18 Sep 2019 06:01:53 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729284AbfIRKBa (ORCPT + 99 others); Wed, 18 Sep 2019 06:01:30 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43904 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbfIRKB3 (ORCPT ); Wed, 18 Sep 2019 06:01:29 -0400 Received: from static-dcd-cqq-121001.business.bouyguestelecom.com ([212.194.121.1] helo=elm) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iAWm2-0001XJ-Nx; Wed, 18 Sep 2019 10:01:22 +0000 Date: Wed, 18 Sep 2019 12:01:21 +0200 From: Tyler Hicks To: Christian Brauner Cc: keescook@chromium.org, luto@amacapital.net, jannh@google.com, wad@chromium.org, shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Tycho Andersen , stable@vger.kernel.org Subject: Re: [PATCH 3/4] seccomp: avoid overflow in implicit constant conversion Message-ID: <20190918100121.GB5088@elm> References: <20190918084833.9369-1-christian.brauner@ubuntu.com> <20190918084833.9369-4-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190918084833.9369-4-christian.brauner@ubuntu.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-09-18 10:48:32, Christian Brauner wrote: > USER_NOTIF_MAGIC is assigned to int variables in this test so set it to INT_MAX > to avoid warnings: > > seccomp_bpf.c: In function ‘user_notification_continue’: > seccomp_bpf.c:3088:26: warning: overflow in implicit constant conversion [-Woverflow] > #define USER_NOTIF_MAGIC 116983961184613L > ^ > seccomp_bpf.c:3572:15: note: in expansion of macro ‘USER_NOTIF_MAGIC’ > resp.error = USER_NOTIF_MAGIC; > ^~~~~~~~~~~~~~~~ > > Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") > Signed-off-by: Christian Brauner > Cc: Kees Cook > Cc: Andy Lutomirski > Cc: Will Drewry > Cc: Shuah Khan > Cc: Alexei Starovoitov > Cc: Daniel Borkmann > Cc: Martin KaFai Lau > Cc: Song Liu > Cc: Yonghong Song > Cc: Tycho Andersen > CC: Tyler Hicks INT_MAX should be a safe value to use. Reviewed-by: Tyler Hicks Tyler > Cc: Jann Horn > Cc: stable@vger.kernel.org > Cc: linux-kselftest@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: bpf@vger.kernel.org > --- > tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c > index ee52eab01800..921f0e26f835 100644 > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -3080,7 +3081,7 @@ static int user_trap_syscall(int nr, unsigned int flags) > return seccomp(SECCOMP_SET_MODE_FILTER, flags, &prog); > } > > -#define USER_NOTIF_MAGIC 116983961184613L > +#define USER_NOTIF_MAGIC INT_MAX > TEST(user_notification_basic) > { > pid_t pid; > -- > 2.23.0 >