Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1862552rwb; Fri, 19 Aug 2022 10:37:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7OF69GMtgv/PwJPk2DIgaIyn08kYilXUCGIErYrW7CvQ6a+Y7MBEi47b9Jpz4kfeW3fbds X-Received: by 2002:a65:6d8f:0:b0:41b:f0a5:4abf with SMTP id bc15-20020a656d8f000000b0041bf0a54abfmr7272478pgb.277.1660930646133; Fri, 19 Aug 2022 10:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930646; cv=none; d=google.com; s=arc-20160816; b=ADpysYQiUezB1psjx3jmpAusiAXECIty0MsTnP1ef0ucupZ4JWuiPj56rKpg//nEo9 tnrY96vHmeCIE1kOy+k6Nuwgklp3dLl5/gqgcgF7mmeKHU2TN93u0ccOJHx7GwXE12O9 YICYvNqB51cRyn/3yEgaQjcg+O7DfdZD1Mt+yl2UV136pNq9jZBgM2w7qlRzET6Yqs9z VDWeDzV6WyIVFVT4mIpMQ6xMdHA9mFgqblXt64gkqjbhpvUAWK1a8rsjC1XtUy5mIKI2 ts31kWqkcAiSCtEU0NLPLig5n0OwsOD7xZdHXL3syKlEQUH0W4l9arR8ySCF0S3eRYXq I7zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A5Gc/69quBEoqUd88kMYiqBj9FPA21EvT31vurr1ruA=; b=NnTVdUKqX/j/YLdMMiJdey5ogYM5yWWecgZgd1nO2+VVD0VIOD2m6WmhatUCh1VyzM niUX5/ptZdCx3aBwrBXPqyzVo4WH8AC4zG9iG66JVVfuq09awlsUWhfqp/BRIGfnBZCD XGrVFwwxo50SS+yilVrBYRiSC/gZC/JPvY/jRDu/tcJnKAol0Ic1+CPDXLi4Q/xZL8gE ZIbIsbqQko5pE9lYEkbxyUMxC6a5/OPQMwJQ7L/nW7F7Ze7QrSWlyGjsRg9cK2cxpsmM ZXccIB+HH63EzbgDzokTe1KCtxnIlvDshApyI3c0P9yM5Cjxj6whmfyJZd6T6kf5vzHu HB8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zj+L+HHB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090332c800b0016d854fd13dsi4598982plr.160.2022.08.19.10.37.15; Fri, 19 Aug 2022 10:37:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zj+L+HHB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351496AbiHSQF4 (ORCPT + 99 others); Fri, 19 Aug 2022 12:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351549AbiHSQCC (ORCPT ); Fri, 19 Aug 2022 12:02:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A88F610AE2D; Fri, 19 Aug 2022 08:53:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9E309B827F8; Fri, 19 Aug 2022 15:53:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD648C433C1; Fri, 19 Aug 2022 15:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924426; bh=aHuE6wBRStzp1g2yIHmE4JGTl1gGGkpMvqr3Z2LHwU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zj+L+HHB2cWDWXzLem83/v51tsLquT+53aRreBih++k/9CWftYeBVQq6c98V68qXA f4JfUGOBNvUdfwYh/kY5Pt/qHh3WAKGlwfLGsqAhT5wpjcliXx369Uw3saX4CFjfam d3T54Oa1fknb/pYfMMYZHd38CWUvPznVfhwB05k0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YiFei Zhu , Kees Cook , Sasha Levin Subject: [PATCH 5.10 149/545] selftests/seccomp: Fix compile warning when CC=clang Date: Fri, 19 Aug 2022 17:38:39 +0200 Message-Id: <20220819153836.004975936@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YiFei Zhu [ Upstream commit 3ce4b78f73e8e00fb86bad67ee7f6fe12019707e ] clang has -Wconstant-conversion by default, and the constant 0xAAAAAAAAA (9 As) being converted to an int, which is generally 32 bits, results in the compile warning: clang -Wl,-no-as-needed -Wall -isystem ../../../../usr/include/ -lpthread seccomp_bpf.c -lcap -o seccomp_bpf seccomp_bpf.c:812:67: warning: implicit conversion from 'long' to 'int' changes value from 45812984490 to -1431655766 [-Wconstant-conversion] int kill = kill_how == KILL_PROCESS ? SECCOMP_RET_KILL_PROCESS : 0xAAAAAAAAA; ~~~~ ^~~~~~~~~~~ 1 warning generated. -1431655766 is the expected truncation, 0xAAAAAAAA (8 As), so use this directly in the code to avoid the warning. Fixes: 3932fcecd962 ("selftests/seccomp: Add test for unknown SECCOMP_RET kill behavior") Signed-off-by: YiFei Zhu Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220526223407.1686936-1-zhuyifei@google.com Signed-off-by: Sasha Levin --- tools/testing/selftests/seccomp/seccomp_bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index e36745995f22..413a7b9f3c4d 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -798,7 +798,7 @@ void kill_thread_or_group(struct __test_metadata *_metadata, .len = (unsigned short)ARRAY_SIZE(filter_thread), .filter = filter_thread, }; - int kill = kill_how == KILL_PROCESS ? SECCOMP_RET_KILL_PROCESS : 0xAAAAAAAAA; + int kill = kill_how == KILL_PROCESS ? SECCOMP_RET_KILL_PROCESS : 0xAAAAAAAA; struct sock_filter filter_process[] = { BPF_STMT(BPF_LD|BPF_W|BPF_ABS, offsetof(struct seccomp_data, nr)), -- 2.35.1