From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 02F2A34A3CB for ; Wed, 17 Dec 2025 12:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765975661; cv=none; b=H7ngK6y8ghRc/GILxLwTX2jbz3QAQUpMr3i7yLdB4nD2tBmBqNFSu7qvPgd+UoHy2feGHGkfN0nYVZkI3500o0zihPoiqwhtChoUxoq8juC+ndqxsMAe5rlPex2wCqEBajQpI2BxTszIIFJULQ+gm4yChFhNeFBUy+oZSMNthHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765975661; c=relaxed/simple; bh=JR4+kJaBlmpbY4kjmuT+WtD5sCcuiWQvS1lbYm26OEU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=XMUVlChCeAe/fXBmIEk7FPwqHUCeYyPUG51gWFyspfCZg1pbqycIUJ3D1Qh45cGzT89GWdmX7JInLubh4vJ/0P6PDgQmj0YQCLOzelmka1dIUCQ2jMHKJf17Kt+cpqg5W2D7hVk7HWtHhpvmHErnZRUQZwEJWZxyyXYmJaxuF5c= 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=cv9ns7cC; arc=none smtp.client-ip=209.85.214.177 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="cv9ns7cC" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2a110548f10so6404845ad.1 for ; Wed, 17 Dec 2025 04:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765975659; x=1766580459; 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; bh=x3j0D4wFBpoCqxcj3+92dqkBBHNQldTemKoyK60bvQY=; b=cv9ns7cCE11T2uc7BE/THK0dhyaErs2Z8WdzvHVhc9cxS/MwTYHfDTFmchqUSF+c6a 2rv9+2/9yFYpbDFme7rnXi0GC7HMGYj+GchWN/8RbtHu+1QH85/dtnh5Bdg93iW+nGRU f/zHZNcgMSwqaAEddSHydnhvwGiGd9aH58LRkbBzgHB37O9v3ikzh07H/1cXClZlO+Ci 0E590474L5Zm4Kje38WwgID1gB1E1WA2MHZp/lKSblLokucQ4yj9M4lWIozDhxUr63x5 by3r1D08kAFy07kr6ncQO+4CiA4t9IHfAouV8nL1CQUx4B7Tt7KOKg1gauIsAOmpyrSt eb5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765975659; x=1766580459; 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; bh=x3j0D4wFBpoCqxcj3+92dqkBBHNQldTemKoyK60bvQY=; b=vH7pHGvexq62dA8jgrx9CuGGqwmRudK3BB1XrdlHzOBSXyf2zkT4HlVEK7L5n1M890 xsyG4N4x4FiR0m3db4M+C64Ve64SJ/ja5HJ56L8s8SUy//ZHhoHP1riRiLlLkXvVUqhH T4VSxg44PDEkyw7CNWeKCTgKRCudriINJ2r5z3kabuDVhVzQ6GWh2qq1MktAypoz8puy 723Xt4tnR+FrW705/yTXD9Xa2d9RjRx+2dcKFTa0e8HdmTRfCFhJi4j+gUTd0lmU5aBc dpNQFt46fffmwaa+8Wr7uWqBJ00dN4kK6LjEKVpDgacQEexQ/PuW4z29cZBe6egk27GC RLDQ== X-Forwarded-Encrypted: i=1; AJvYcCWmaRJNWqSLU+aM91fop/uQrNLhyYoFnv0RudFsiJINxjiYinZ/QCq4BveH4Xeqo6sc0IqWqfYzHtvtdwI=@vger.kernel.org X-Gm-Message-State: AOJu0YxkEryhMPxZ4MnFxtJHePeKF2eE939QVXNJMTHx0RLzexM9l3i0 0CSJrTLuegyIzvftWvxaEuw3yHgUMwo3orvQ+/1syxdXwC1/QB/tuzGb X-Gm-Gg: AY/fxX4rOuOayLEBfGLX0rdkoi7Uf9JE2cW6zmel9XPZGFNAruYg3236g8taUUGxSqo PDZNpPqP8bHV+XYTjnG3cf+2AcDWvkKnNP7jtMVmvObD9eb6Zo0djbBySpQ+gkyiKWPhOGY0bs8 C4wswCGHfRO5GUu9T7yGglyHulFtVD1YtJSt+5V7BTmWD4VReWbx1wHflsHfKP2myVKI95C82Zq 99Ont5ZHSef8WE61xwBT8LyczXCq0nFjQkivziwNUkR3PIcRLq9XK+jvF2Em/UeJDrIpVBTHzv/ G8u15ee1JMycHGFcpKEVL7X/n391wA3O4uFQHHI77yXsPGtJcphWsklKbd7txTA0Q8271Mbj8FE j8LPCR5V2el7Tozd48xbGixwyg9YpMjlN7Xgks9mRPEx7v8W0FLHv00H00i0e+KFUoc688u5BSc EQdxI2ad3w3Yo8CW45UEsbJ+dPHP4jFDEsrbTy4BI4oxB1kRsR/XgRAyLUPPNH+siLn/Xpq8JO X-Google-Smtp-Source: AGHT+IH2v3JUr3tYGdDGzF39tRQhcdxW5++x3/G76FKsq3X0gc2QFhfLukE8mQjsMLw71amUacV/Gg== X-Received: by 2002:a17:903:8cc:b0:298:2237:7b9b with SMTP id d9443c01a7336-29f24388becmr116421805ad.7.1765975659178; Wed, 17 Dec 2025 04:47:39 -0800 (PST) Received: from poi.localdomain (KD118158218050.ppp-bb.dion.ne.jp. [118.158.218.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a0e96df1c9sm98306795ad.39.2025.12.17.04.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 04:47:38 -0800 (PST) From: Qianchang Zhao To: linux-nfc@lists.01.org Cc: Krzysztof Kozlowski , Paolo Abeni , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Qianchang Zhao Subject: [PATCH v2 0/2] nfc: llcp: fix double put/unlock on LLCP_CLOSED in recv handlers Date: Wed, 17 Dec 2025 21:46:57 +0900 Message-Id: <20251217124659.19274-1-pioooooooooip@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes a refcount/locking imbalance in NFC LLCP receive handlers when the socket is already in LLCP_CLOSED. nfc_llcp_recv_disc() used to perform release_sock()/nfc_llcp_sock_put() in the CLOSED branch but did not exit, and then performed the same cleanup again on the common exit path. Drop the redundant CLOSED-branch cleanup so the common exit path runs it exactly once, while keeping the existing DM_DISC reply behavior. nfc_llcp_recv_hdlc() performed the CLOSED cleanup but then continued processing and later cleaned up again on the common exit path. Return immediately after the CLOSED cleanup. Changes in v2: - Drop Reported-by tags - Add missing Fixes tags Build-tested with: make M=net/nfc (no NFC HW available for runtime testing). Qianchang Zhao (2): nfc: llcp: avoid double release/put on LLCP_CLOSED in nfc_llcp_recv_disc() nfc: llcp: stop processing on LLCP_CLOSED in nfc_llcp_recv_hdlc() net/nfc/llcp_core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.34.1