From patchwork Mon Dec 16 17:49:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11294983 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6CBA109A for ; Mon, 16 Dec 2019 18:30:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4E2B20CC7 for ; Mon, 16 Dec 2019 18:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576521047; bh=EwT10ETY9MI/NdSUuESri3Es+yuKxE44eF/VBhE5Dkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MZyFwxOPf3hkKeC7c71WJidyPJIO8o/+4fiQcvQwwXQTMPH1EZdSVPOG2R6DmmSbc ipFaHsM8EpeWMamFsGtVnVRLqJpnDfseHXGYaTPDmm1suIqWO14sw2PJoUDCoBTuzL pb3T3VFhknSWjSJbNunl8Zk+DqMa5sQaEQxbPYRU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730573AbfLPSMV (ORCPT ); Mon, 16 Dec 2019 13:12:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:57096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730924AbfLPSMS (ORCPT ); Mon, 16 Dec 2019 13:12:18 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 103EF206B7; Mon, 16 Dec 2019 18:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519937; bh=EwT10ETY9MI/NdSUuESri3Es+yuKxE44eF/VBhE5Dkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uwnKulP14TAHsnlo1flBzSWOfuzC1UIbuW3qncqpJOM7EX61XfH2J/EIPWW8ymOZD 8xGXzXkN9TiyszGzRsEBCTFxsFEE1DO8fZYjLwpIpxA1eTFfghmPPuurW8XQhBWHL6 /T1E4SFCnenhJ2O3cj4zgMKsRQWthOzHwCF/deTU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Brauner , Tyler Hicks , Andy Lutomirski , Will Drewry , Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Tycho Andersen , linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Kees Cook Subject: [PATCH 5.3 131/180] seccomp: avoid overflow in implicit constant conversion Date: Mon, 16 Dec 2019 18:49:31 +0100 Message-Id: <20191216174841.842411126@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174806.018988360@linuxfoundation.org> References: <20191216174806.018988360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Christian Brauner commit 223e660bc7638d126a0e4fbace4f33f2895788c4 upstream. 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 Reviewed-by: Tyler Hicks 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: stable@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: netdev@vger.kernel.org Cc: bpf@vger.kernel.org Reviewed-by: Tycho Andersen Link: https://lore.kernel.org/r/20190920083007.11475-3-christian.brauner@ubuntu.com Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- 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 @@ -3077,7 +3078,7 @@ static int user_trap_syscall(int nr, uns 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;