From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 9220444211E; Thu, 30 Jul 2026 14:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785421980; cv=none; b=BU831Ygqa36uCz2Xe7C+44t3KQlFiI5wzLjBQh0g8pkcXXILVl8RVjNRqfolWELUVx/OLIoOqUIh1QZvWJp5Oe/J3z4dfCqhUc5TkC6hPId4XqYZb/lSEAJRROINFatr9vBh19TvZKPGoXlCEQf4lr80t2kIYyOhS6T8Q/9Ghtg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785421980; c=relaxed/simple; bh=8qFVTGUa+GC9wSzYs+vRyxwq64qe+W/gUDcf5LEkZtg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pvGqAKf+l2p4Ym/rJuRiheZi4sDEgKha9jFNe/1573ivhK4uLRpH0iD4MSZeU6CUxTvxervV3c2NyGu+x6upKC/UHvk35D4v/UiFGlWKQASBRrlcB5Aj/kx56e+LgbTugAuGDHIcluAYsB4Q4QCk79cCT7SF0jiwmbdyiVzKgnk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PUGbil61; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PUGbil61" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96B7A1F000E9; Thu, 30 Jul 2026 14:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785421979; bh=HnpmOQCq0VUnwCTpX9V4mM4yhFC072PB3hi1fxG2J8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PUGbil61Zls/bnvT0vw5RzcORnd+5XLGDYnExDMWc38Y8kl0lEO6BOoZWu6GxhJTd iJJ1erqq7w5cYW14x6ZB6kD1mT3LFsTxpH9V9dy4l8D3xtpJOy8heALal9mFOjEpsb 99iqKN6DBMBQ1UhV9Xp7qV3FtFyVuQIicJpfnJHk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+85d0bec020d805014a3a@syzkaller.appspotmail.com, Helen Koike , Tung Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.1 285/744] tipc: fix infinite loop in __tipc_nl_compat_dumpit Date: Thu, 30 Jul 2026 16:09:18 +0200 Message-ID: <20260730141450.347826113@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141444.267951807@linuxfoundation.org> References: <20260730141444.267951807@linuxfoundation.org> User-Agent: quilt/0.69 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 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Helen Koike [ Upstream commit 22f8aa35964e8f2ab026578f45befc9605fd1b28 ] cmd->dumpit callback can return a negative errno, causing an infinite loop due to the while(len) condition. As the loop never terminates, genl_mutex is never released, and other tasks waiting on it starve in D state. Check dumpit's return value, propagate it and jump to err_out on error. Reported-by: syzbot+85d0bec020d805014a3a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=85d0bec020d805014a3a Fixes: d0796d1ef63d ("tipc: convert legacy nl bearer dump to nl compat") Signed-off-by: Helen Koike Reviewed-by: Tung Nguyen Link: https://patch.msgid.link/20260713204940.647668-1-koike@igalia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/tipc/netlink_compat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 2a786c56c8c59e..d9a4f94ea2d43d 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -221,6 +221,10 @@ static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, int rem; len = (*cmd->dumpit)(buf, &cb); + if (len < 0) { + err = len; + goto err_out; + } nlmsg_for_each_msg(nlmsg, nlmsg_hdr(buf), len, rem) { err = nlmsg_parse_deprecated(nlmsg, GENL_HDRLEN, -- 2.53.0