From patchwork Mon Dec 16 17:50:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11294945 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 84BAC138D for ; Mon, 16 Dec 2019 18:23:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6208D206EC for ; Mon, 16 Dec 2019 18:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520597; bh=EwT10ETY9MI/NdSUuESri3Es+yuKxE44eF/VBhE5Dkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=faqJlUF3uIxeM67GF/A+sXyYFuDyoIsgTA4VSaupH4nqepB0UPYqMqZE5XvAyUmz6 2edGpYoHFcSArhUknhyxblk/sR9AVnNShg/YKAe/yHe96R+8AHwVYbuj3NW0gcO95s c2bnEcdfbM0ucH8xqvH2DY3TjIW4Cb/lgz7Nm+LM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732090AbfLPSUa (ORCPT ); Mon, 16 Dec 2019 13:20:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:50750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732088AbfLPSUa (ORCPT ); Mon, 16 Dec 2019 13:20:30 -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 B5B9720717; Mon, 16 Dec 2019 18:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520429; bh=EwT10ETY9MI/NdSUuESri3Es+yuKxE44eF/VBhE5Dkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GodSTTnSBZhzF6WptlEJxHxmtcwN4qGjGeNdbNk2h9/61X8I32euIuPj8sHacT5K2 /Iqmqa7bhm+FEkaoGqdpOqCCYPVTALPieMjpmZhkyLn/L/UvH5INbVrwVCGqopOCcr zwG5SjOz4nhGZ2JVJuLlSHLd+3SjlVovMxgi9tcg= 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.4 151/177] seccomp: avoid overflow in implicit constant conversion Date: Mon, 16 Dec 2019 18:50:07 +0100 Message-Id: <20191216174847.985672730@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174811.158424118@linuxfoundation.org> References: <20191216174811.158424118@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;