From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35E08C433F5 for ; Mon, 28 Mar 2022 11:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241496AbiC1Ljn (ORCPT ); Mon, 28 Mar 2022 07:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241636AbiC1LdI (ORCPT ); Mon, 28 Mar 2022 07:33:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D5645838E; Mon, 28 Mar 2022 04:24:45 -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 2E4E4B80D13; Mon, 28 Mar 2022 11:24:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E68B3C340EC; Mon, 28 Mar 2022 11:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648466682; bh=zZZ8+bt+swbdKgisPUds2B86Lnz7Y1ZXyD/TXnFQ/U8=; h=From:To:Cc:Subject:Date:From; b=RZadlyaqcCtLQnqqPkFDmnHPv+Mebg3N5ffXyI782VhCLqFEqR3OUZonhi4QZEo5l QFFVXUEX/WOVAbxE1GYbxz6wS0SWrFW9uueWJeNRC8jXYXsdQFtJoAF3KVqXZ/hbtp ldPYQjTIhqlasZBatD4O+5FzfUD85amIXT2gg+XpNS7qBpILOcDSk2UAos6JIAFIp3 UKHXz30s8Q7pUEkKdpQkJ6HMAZi6NCnZH0gOBdIO1HZ18GwFiRcs581/9HjojBYUY2 tl7tJIxsAIaCBdID+a5fuA0p65HX78/88Bg3hpN3C5AhE3jV7yaieub8HHRTsSYonO yTwgSoqghZFTg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Christian=20G=C3=B6ttsche?= , Paul Moore , Sasha Levin , stephen.smalley.work@gmail.com, eparis@parisplace.org, selinux@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 1/8] selinux: use correct type for context length Date: Mon, 28 Mar 2022 07:24:32 -0400 Message-Id: <20220328112440.1557113-1-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christian Göttsche [ Upstream commit b97df7c098c531010e445da88d02b7bf7bf59ef6 ] security_sid_to_context() expects a pointer to an u32 as the address where to store the length of the computed context. Reported by sparse: security/selinux/xfrm.c:359:39: warning: incorrect type in arg 4 (different signedness) security/selinux/xfrm.c:359:39: expected unsigned int [usertype] *scontext_len security/selinux/xfrm.c:359:39: got int * Signed-off-by: Christian Göttsche [PM: wrapped commit description] Signed-off-by: Paul Moore Signed-off-by: Sasha Levin --- security/selinux/xfrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index 56e354fcdfc6..5304dd49e054 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c @@ -344,7 +344,7 @@ int selinux_xfrm_state_alloc_acquire(struct xfrm_state *x, int rc; struct xfrm_sec_ctx *ctx; char *ctx_str = NULL; - int str_len; + u32 str_len; if (!polsec) return 0; -- 2.34.1