From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C83F192D91; Tue, 10 Sep 2024 10:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725964114; cv=none; b=AV6bNDDwYZ5SFfJpLCntpnlLI3zYgr1FlvtZLHOBRXys2YZHWrjxP6+TzjFNsw6+N1XGAOTyOZXTsJb1BUKH8TrDlLS0ws6Kvc0Tmk6YV66pUzops8SQMbhYpNF+WzivW+JdxANZcgzm9GTRt5y5nd4a4tN3jupvaYegkeCRR4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725964114; c=relaxed/simple; bh=7Fq8mxcXCX9lAPLaU+IzpR9Ug0YD1clQHKU/+jwftPY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b482fNID4FOBFYu9PnzQnQKfaR9EtBvwgPxYa3lRIrrCXBS+j6QzKG8lD5MmyH0X3CSRPMEuIX/TJQJ4k6ncUNZLsCp2lGIuDIo1oflkWNvrLQyWDuMbGXoEDlM0xnbQxi3s2XMLr4tOo5S1Ph1zaqPJ1s6ANlaeAMxtRLGx2CI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iW3ZnX6m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iW3ZnX6m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 236FDC4CEC3; Tue, 10 Sep 2024 10:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725964114; bh=7Fq8mxcXCX9lAPLaU+IzpR9Ug0YD1clQHKU/+jwftPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iW3ZnX6mwuVXdWlmyqhN7l9YCSj3hFTzGd5iU5GIySLGN8IE4xNWeVHjMZ59lXmSf jQmHB/9AYRckDiZvhGOf+tT634bMSvSHVPsB22A8w3ZDZfL21w2NMaVuPcsbGU3Vim urqDI38iDqSB2g/q6IvtcS2+u2VW1i8HPKSn3qXs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yunjian Wang , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 6.6 073/269] netfilter: nf_conncount: fix wrong variable type Date: Tue, 10 Sep 2024 11:31:00 +0200 Message-ID: <20240910092610.810593719@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092608.225137854@linuxfoundation.org> References: <20240910092608.225137854@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yunjian Wang [ Upstream commit 0b88d1654d556264bcd24a9cb6383f0888e30131 ] Now there is a issue is that code checks reports a warning: implicit narrowing conversion from type 'unsigned int' to small type 'u8' (the 'keylen' variable). Fix it by removing the 'keylen' variable. Signed-off-by: Yunjian Wang Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_conncount.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c index 5d8ed6c90b7e..5885810da412 100644 --- a/net/netfilter/nf_conncount.c +++ b/net/netfilter/nf_conncount.c @@ -321,7 +321,6 @@ insert_tree(struct net *net, struct nf_conncount_rb *rbconn; struct nf_conncount_tuple *conn; unsigned int count = 0, gc_count = 0; - u8 keylen = data->keylen; bool do_gc = true; spin_lock_bh(&nf_conncount_locks[hash]); @@ -333,7 +332,7 @@ insert_tree(struct net *net, rbconn = rb_entry(*rbnode, struct nf_conncount_rb, node); parent = *rbnode; - diff = key_diff(key, rbconn->key, keylen); + diff = key_diff(key, rbconn->key, data->keylen); if (diff < 0) { rbnode = &((*rbnode)->rb_left); } else if (diff > 0) { @@ -378,7 +377,7 @@ insert_tree(struct net *net, conn->tuple = *tuple; conn->zone = *zone; - memcpy(rbconn->key, key, sizeof(u32) * keylen); + memcpy(rbconn->key, key, sizeof(u32) * data->keylen); nf_conncount_list_init(&rbconn->list); list_add(&conn->node, &rbconn->list.head); @@ -403,7 +402,6 @@ count_tree(struct net *net, struct rb_node *parent; struct nf_conncount_rb *rbconn; unsigned int hash; - u8 keylen = data->keylen; hash = jhash2(key, data->keylen, conncount_rnd) % CONNCOUNT_SLOTS; root = &data->root[hash]; @@ -414,7 +412,7 @@ count_tree(struct net *net, rbconn = rb_entry(parent, struct nf_conncount_rb, node); - diff = key_diff(key, rbconn->key, keylen); + diff = key_diff(key, rbconn->key, data->keylen); if (diff < 0) { parent = rcu_dereference_raw(parent->rb_left); } else if (diff > 0) { -- 2.43.0