From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm2-f2.google.com (mail-wm2-f2.google.com [74.125.225.130]) (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 33BC23DC4DE for ; Tue, 7 Jul 2026 16:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783440930; cv=none; b=cX69UQ+3aa0+PbMKXmLGFa7OzXe4GRRBqzGb5IiEXrDHkTqxAl8oUTaFJT4DaVkdVMMXVwr+3n2HGcs7rLKKdgkyXfX1Zt5VdgWUGMK0AeYHjGwGh+4q0zitWBhCOywrkGVWhgnRNeq8Qgbd3t9fa3gJFPak7AsgYolzig734nY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783440930; c=relaxed/simple; bh=75niY7Ljy7FT8jvSV7EktRwrOBqI3lwLXWuqSCh0cQo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gy8P+hWxUohl2/H220JrCmtJ3wq8qR1oQAH4MFajVa5cB2XJO2Amx6XXDj8LqWt6MUqPEvltkv0+LP4wtO+22w5PuSzfBe0k1QBDpVWe7XeX+D2KzzWw5JauG2MEtyB4sOGYaYyodnL6EjzKxMqoyxEieMHfCaO3MRAzkocg0F4= 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=YgJdEqnl; arc=none smtp.client-ip=74.125.225.130 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="YgJdEqnl" Received: by mail-wm2-f2.google.com with SMTP id 5b1f17b1804b1-493b7612512so211255e9.0 for ; Tue, 07 Jul 2026 09:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783440928; x=1784045728; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=75niY7Ljy7FT8jvSV7EktRwrOBqI3lwLXWuqSCh0cQo=; b=YgJdEqnlIgXKoytqAB/JelMn0j5QKGOJbMW4x5jKs9vY2rDBuOzJXqRLqqcjuJT5qa 1LdqUT+bZVHHLJyn6JrF/NWuZ7TAfG+44wB6UxACyYOz3qxOt45h0vyLxTgr4EcO/FBy lkzsjIqsNpC4MXDpxlLrQIh40A2QnqVyj5JPoLGw3E5BYxGfGvfgyJCtPJn1u9vbj1je GFcenXpHJy9uAIBKoANU9b6P1a+OmxZ0+BzdukwYOYUs1xc1Dr4yZhNiFvDD+RT7mGkF 0tf780j7F/EaVN+gICsO7FYkcFoOfNXkI9rNZNF01YsXiiRoPldcZsQ/tII82i3Wssww Dmag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783440928; x=1784045728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=75niY7Ljy7FT8jvSV7EktRwrOBqI3lwLXWuqSCh0cQo=; b=nIVi8SAk4Zl6WLUNWKIqA/eDaVMzqLhG3BgyO6k9UkR2BXeayR0t99OnAWxk9/A45A Yt/SwkBZt0T8cTm/NafIrnT5Ns2Oan8utiArwSR0UOaP/sxgbuHrM7jJ3tzD96agcqmV B6xFhDblV6+YdVTxo6/1jfXjFVF6C+xA1jel9k0nM2LrPwUElw0U+E64H83U4nugQkeT 13Q2cAgiiIEwHimmPAji6dlNfvjdH/ildspTbkl5Q16cCuYlIjuH4hLU+8msyoQ4+GhN +efd+0TfD168j8yYjdB00AKYETTTnZoExnSVFcbiDtPHmnlhU7CkU3DQmkqv0bRevmvq JDTw== X-Forwarded-Encrypted: i=1; AHgh+RrBN2JN/EZRABI2Ov7XarWiLibPlKs2kHXToZc3bSMaax+3JN8ONnjBLSHLWBVI49SGb0Ahfv0XqsbL020=@vger.kernel.org X-Gm-Message-State: AOJu0YzxH+Xu1avHOubC82RqirnJsZMj3ehQkMtZvTbW2fquRHi31qfW cDDbK4ixxAIQnYo6pvx+hFNkmKpq5NLVOMbbwd73/xpTR5jDEnNg8sRp X-Gm-Gg: AfdE7ckNzPXl6HS1EYF8k969gpZk0XSk906uTzkamiFIteFFk4XTJI+ONvAwu9lHA76 I/bHGyN/bILC4h2zgdMcW5gWRhMt+xEtZ/cBgyVo/rA3wFpQFrAVrhSBKsOJQO0oCi8qWaGCbPW k2D1WdahdjrVi39SZQpuoxRWOSEiQaXkKaObCi15WVFUZaYcoL1xROH0DCF95u8gZtazdJnfOa9 BleR0Fl0LxSdaP0geSckB/7pqCLd/oiNV1gQwZfSWXTxZ6cAFrqjCgEo49zcLjWzwsUt5/IGEPZ 7B1bOIH/LE8QalwhsQba6ZGYS7Zlsg8rIlPU50cbNnKXg3lMaoGV0jK2Z8qg9t55UN22XmcSpFX RvlnEH1t8c6yDOsGz+spmm86sjwkPlT15jwUbRA53mfo1Od/hSSqhv/ZLJF6pz0wr+YG3rqN+9U mulmvR8PivpiI= X-Received: by 2002:a05:600c:8708:b0:493:c991:8e56 with SMTP id 5b1f17b1804b1-493e1008e65mr38795035e9.4.1783440927256; Tue, 07 Jul 2026 09:15:27 -0700 (PDT) Received: from fedora ([212.253.209.56]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493e0aa7da9sm70402585e9.1.2026.07.07.09.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 09:15:26 -0700 (PDT) From: Serhat Kumral To: yanjun.zhu@linux.dev Cc: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org, dsahern@kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+8c9eede336e3a843750e@syzkaller.appspotmail.com Subject: Re: [PATCH v2] RDMA/rxe: rework per-net tunnel socket lifetime to fix refcount underflow Date: Tue, 7 Jul 2026 18:54:21 +0300 Message-ID: <20260707155421.18021-1-serhatkumral1@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <91a47c3a-d6c5-4998-99e2-fb615253853b@linux.dev> References: <91a47c3a-d6c5-4998-99e2-fb615253853b@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Yanjun, > The current ordering introduces a subtle race that > can leave an RXE link in an unrecoverable state. > > If the DELLINK path sets RXE_NET_SK_PUT first and > then finds ndev == NULL, it returns without calling rxe_net_uninit(). > > Finally, the per-netns UDP socket reference (nr_sk4/nr_sk6) is never > decremented. You are right, thanks for catching this. The once-only bit must not be consumed by a path that can then fail to do the actual put. In v3 the put no longer depends on ib_device_get_netdev() at all: the struct net pointer is recorded in struct rxe_dev at creation time and used for the put directly. That way the invocation that wins the test_and_set_bit() can never fail to drop the references, even if the queued unregister has already cleared the ib_device -> netdev association. I chose this over reordering the bit test against the netdev lookup because a reordered lookup still has a smaller window where both racing paths see a NULL netdev. I will send v3 shortly. Thanks, Serhat