From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B287C412C05 for ; Tue, 14 Jul 2026 17:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784050884; cv=none; b=Y4jH8genYgmn1GsBnJLrPlaldJFmLfwW2S4ROdiVnzhereWQGhCr5nuvc1FWeQPue4njg/xzSgvpCeGU/0JfBy7t6rJ8pmyVgUY3L4V+7mRWLvGUXACOCAmJ+HXYa8eOIl/16pKkZvwrAEubs5wZi3AXZg/sBDcC5B6T39NBUkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784050884; c=relaxed/simple; bh=/8kwpS51oEAHEw6EL4bUzPsL8La9wbzGzhSRkOOzhFs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CIm78OSJWVFyFA2tBIRUcaLHQXoKOGkn+kywnz5D/M8xRm4N+iin5woL9uQf9a8kXooTt68xEdwZ8sAIuPg5oc2zrFO22iHTnr5WdWw5nzrC2xvUpg8q0WBG0icRjCWwEWv9KyxT+TUkIV4rSd1g2IBaSniXZNLiOI+GxsKKziw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pzgvaeY5; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pzgvaeY5" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2cad4170e8eso55233855ad.3 for ; Tue, 14 Jul 2026 10:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784050880; x=1784655680; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=11t9d++r0bmMhzQdiTZcpMyL88ikh+EriVNoFZhMUAE=; b=pzgvaeY5hJUBe35j86/xzRYNAapiLHnWP2fsSZCPw53h8g4lU2+gR46zSP/WPsZAaJ GT4c3j8hYxdDU2YZPwXL5s3yu41s2YNICen+3urnMH8ifE5iqVwFX7uVshD6Sze1bv2O 2ELclrhnUgew7Mp/6WESn2MtUDJkZ46VC2zWqConFPQP7Ihj7JAPGvSUSGXGjG0XFKd1 5L39HaSyCO6hoGlr2WwWd7oXybc6FYbwqKxucpYtB8fZRPT8VeXzzpXTBylUKw1qrekd KFNtp5MWvv7u9ePJYETRkKR74WPEy2pZyejUozJWj9b52rURHZFR52GKYhDq+9AY8iF4 jK+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784050880; x=1784655680; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=11t9d++r0bmMhzQdiTZcpMyL88ikh+EriVNoFZhMUAE=; b=YI2iAREd5p2F+IKdbgzK/fGy1nZM+9EDQrQw9c8JXBKlPjFeq2Pdcyh5yUgtUJOX7+ 5WV7HjE1sxHelJPuB0Ms/r65ns+rN/sAo2uQ1UjMvPDTn2BscRj5NJXuuWw6brvBHypH 4kzBV8sV2m4sq9D/MrSTmcQhBMx6dO6IWh/3ipWUdQ69YsFHK8osgKLFU4i7r24RKAft Rm9iNPW6hxr4dAlrl1/eL/P7GgZbf0kWazBMgYpXcrN1ckw/mXHb6CQUkEbmsHCBfQTi ncX3UTvj1/IbabSPYZdyhrhPWogFFtPCLdpZGO34nmmPeruIsjq/4QCCWEIDjZiGzova 0DkQ== X-Forwarded-Encrypted: i=1; AHgh+RolT2MNAWEAef+xMq4QZ1FPQdE3ogmrN/zK0ytvT5pfCXD+t1I1vnT6Y8BurnyZbwem6F0K/wvJEYppvt0=@vger.kernel.org X-Gm-Message-State: AOJu0YxLz5/8bl4b88i5NXklSJ1B6OTvoFPy6mCvPM4+vHOo2a8yYMkX G+wp1/pt37TVqoeK7sRXZMR9INx+PMEGx882UPQLjR94iGt6lpV7Fg8P X-Gm-Gg: AfdE7clRqg+Pti9nTDDDLkA+2QQrMs7x99f1wxFmaG5h94WIYT4q26eDBO7dndcZIGl 3sKmL9LWeUL0j8TQeHcWW3nkd01SWWLSkiwo8jUVD2PIdClCBS/khbUJW90X7vzSm1UoZ88ChTH m96DmAdT+JcaqtdKTmXdCqfLnghF/QQ/czbn6pzBXYIe8+O+LncHKxEyH2HQqNm61FRa3fG5no/ JcrnILzALiOJMtUihgqhnoNBw9762IIS52qQTQAhCMaKgCrf6gy7klWip8gU9dEmhvrj5N86xZE gJuCHUfJtOYNX9FLN50utaqG6KP7Es/hHEWQWG2+LCRpquo6dQMAQxnss3f7lx4Z64NxftN9cRK i0OO3LKvDys12pCq3USam5fJ+oOS4UAryt3UPCOoj+mHQAUawPBsEFjnctHdOqxktsDhH9Hc5RD xclQKNLquat9CYTUs/sipZHdJfdHOGkpZ5/haS6pM2rjuWJy2duz4GfrjUMFVaIrQ3NU/i X-Received: by 2002:a05:6a21:3282:b0:3bf:6c08:4ec6 with SMTP id adf61e73a8af0-3c357263c10mr3492675637.59.1784050879544; Tue, 14 Jul 2026 10:41:19 -0700 (PDT) Received: from fx.tailc0aff1.ts.net ([206.206.192.132]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b87b92b27sm38055954c88.6.2026.07.14.10.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 10:41:18 -0700 (PDT) From: Weiming Shi To: Jon Maloy , netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Hoang Huu Le , Xiang Mei , Tung Quang Nguyen , linux-kernel@vger.kernel.org, Weiming Shi Subject: [PATCH net v3 0/2] tipc: fix NULL deref in tipc_named_node_up() on empty publication list Date: Tue, 14 Jul 2026 10:41:08 -0700 Message-ID: <20260714174110.1571033-1-bestswngs@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit named_distribute() stamps the last_bulk flag on the tail skb of the publication list. When the list is empty no skb is enqueued and the tail access dereferences NULL. tipc_named_node_up() hits this on an empty cluster_scope, which happens with a node-id configuration where cluster_scope is populated only later by tipc_net_finalize(). It is reachable by an unprivileged user over a UDP bearer in a user+net namespace. Patch 1 guards tipc_node_xmit() against an empty list, so the allocation- failure path in named_distribute() cannot pass an empty list down to tipc_lxc_xmit(), which has the same tail-of-empty-list deref. Patch 2 emits an item-less bulk when the publication list is empty, so the peer still receives the last_bulk flag and does not stall this node's later name updates. Changes in v3: - Split into two patches; add patch 1 to guard tipc_node_xmit() against the tipc_lxc_xmit() deref reachable via the allocation-failure path. - Break out of the build loop on allocation failure instead of returning, so the last_bulk flag is still applied to the last queued skb. Changes in v2: - Instead of returning early on an empty cluster_scope (which would stall the peer, since it waits for a bulk with the last_bulk flag before accepting later name updates), emit an item-less bulk so the peer opens normally. Thanks to Tung Quang Nguyen for the review of v1. Weiming Shi (2): tipc: guard against empty list in tipc_node_xmit() tipc: fix NULL deref in tipc_named_node_up() on empty publication list net/tipc/name_distr.c | 16 +++++++++++++++- net/tipc/node.c | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) base-commit: 4595d2c77ea4bfe4ae0efa38770a59ee5d2f06d3 -- 2.43.0