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 154CA8462; Tue, 15 Jul 2025 13:49:26 +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=1752587366; cv=none; b=b1JMSp34ZJEqB2r74j19PdNTUD2vzrZxSut08HiuhfI0+M5Ohho1VrlvWIEVw5vwCdBhbie7FZQH0yw4m2ceqJ8OM5Vib48mJ4fvQNOr1v++SOB2hIXxTfRJpJmyKnVXVzW+ttpc1lwJcjg/A/QQdW79aehMwmP043baFgUMp7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587366; c=relaxed/simple; bh=MV8Ka6TOa/xGpEKuuldkyI2cPbjqrs/mHQw29cbgpg4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iTwwFpc9Rd8r1kA0qSuzIyszpRwSgZxEZvlopOs9JtGybMA1BXk7a5s36eTNpSd7M6cigMPkAIJhwKEhoZ/O2i2drNNLqj+hMdB2OzJdZZdwtfjHNOtXo0tey+8JFenijUJ4lHVPMr1+qudBijcAxcX66qVfc1BPjcJ+zeLUNwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mUWFSVDf; 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="mUWFSVDf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FA5DC4CEE3; Tue, 15 Jul 2025 13:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752587366; bh=MV8Ka6TOa/xGpEKuuldkyI2cPbjqrs/mHQw29cbgpg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mUWFSVDfF4bTgoIoDcgoLt/hzorzeGA/iKyl5tY0/LgCy16oEVLktk+i9DZGffdad zXN//nauQ19Rx/5ldCgN1T/SKiR3ogZfBvnAS6706AJeCLW3bjd9NwJGNKigZenlRg KO3HCRKkBLQIKnTSRD6vYK6nvViO5SYFKH5f7ugY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuniyuki Iwashima , Jakub Kicinski Subject: [PATCH 6.1 42/88] netlink: Fix rmem check in netlink_broadcast_deliver(). Date: Tue, 15 Jul 2025 15:14:18 +0200 Message-ID: <20250715130756.216506136@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250715130754.497128560@linuxfoundation.org> References: <20250715130754.497128560@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuniyuki Iwashima commit a3c4a125ec725cefb40047eb05ff9eafd57830b4 upstream. We need to allow queuing at least one skb even when skb is larger than sk->sk_rcvbuf. The cited commit made a mistake while converting a condition in netlink_broadcast_deliver(). Let's correct the rmem check for the allow-one-skb rule. Fixes: ae8f160e7eb24 ("netlink: Fix wraparounds of sk->sk_rmem_alloc.") Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20250711053208.2965945-1-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/netlink/af_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1393,7 +1393,7 @@ static int netlink_broadcast_deliver(str rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc); rcvbuf = READ_ONCE(sk->sk_rcvbuf); - if ((rmem != skb->truesize || rmem <= rcvbuf) && + if ((rmem == skb->truesize || rmem <= rcvbuf) && !test_bit(NETLINK_S_CONGESTED, &nlk->state)) { netlink_skb_set_owner_r(skb, sk); __netlink_sendskb(sk, skb);