From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 4D3033AE1B8 for ; Thu, 14 May 2026 11:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778759452; cv=none; b=erHXoYj5Euq18bDRMjjO9IfygCrB9PWbEGPgF4xZDiCY6eIuYyAuFoWWt8ajfUXf1gqmbH+2zsN2+w1xbbFGGeuBT6mgXysYfR+nKsug7Dify+ebn9qDeg6xAP9CuTQSfVZfYlvpZBE8XdMJaI/haSYxqE8FF1mzEoigEWKYi/0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778759452; c=relaxed/simple; bh=aLH5YBATn9eCNSGgtO3MOr4x22/bBQ7ESfJaSuBS89c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RKTWajXBju3f9DwtgbWd2UmwYWK4bsdAXCoE1SRnhzGmDP6XbSWwt56FcEUm6VFiyU8ZyrXock917KuhPpd0aWTns1rGsLrqGC+3fc9m15ob0++VtOD0lQ1asgky6MMy4BnLfhHasUUjxylC9wGIR9j85IN4g723huTMwQAdrdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=Eyab5e+l; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Eyab5e+l" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-50e97863425so78100171cf.0 for ; Thu, 14 May 2026 04:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1778759449; x=1779364249; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eDBCsEhXxpxSONCF+uEB0GBHYti2oMl8hGXWjjN3tJ8=; b=Eyab5e+lFUjSm4nW7eNvM6JdJ32/ERycNju1lNdhR8GloSudULEoHKEIOfAWwwCyxk 1hLLj+q0IAW0WwIfH4kR2Cl8+ACdg2zaHD6rF7kkUJ0UAvGUjdlw7SC97bMSX3fPg+bQ OOawlstlFz2ig0izecthlVxL2FcB+WazdNVoW8tbv4KkQ2o5m8ZQbsduaB0RVhb/ueFE 0KiPk6EYrHYS5744qMquHsgLjmapzvLRWV9iCrycWRlAk6x6WjrPc4f5C//OBtmqgOGK Y24zVHpX6JwO3SNLCfjdiArqkAzvTi5b6OXi7x5YeNl+YhEPQmOl5IT5B8efllbDhCbN zQpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778759449; x=1779364249; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eDBCsEhXxpxSONCF+uEB0GBHYti2oMl8hGXWjjN3tJ8=; b=JU/3636i1r9Zmk52eGW3B0Kh3j+rKXWOCEJDxAu0fOm3l4KYlfm6zsuC2e5MB+BOCP bfc0M52yIyn6V3VlA4LqCh7l3vRe1iFQZpP/szhALcFke2x/zbZxsTbTwf2sCMn/aXDY r5O5OyGeZZwWJBuo0euESevMsKGu1ccTLRV0+1s43nbL5DzDfO3i04d1KXNmTA8xo2jW NU9hacpOyFJfGYEB4nUTmZ2K7REKlgOXMkgB8orLP2RDEA7W7zcC+fQ70P2dAdDzLRgP A3y01Mld8T5HUYGv7QVAt9yorY18V40mF/EJyct1O3MnvVuxtGws3p/MNsGv8jWfYC8b amcg== X-Forwarded-Encrypted: i=1; AFNElJ/OvgXkYY4O5dQyDewnwsEeZjG8trAtDt9WY/UDoy+CnA3yDHmx0jslQqq0swEueTpRa+CTkF4ZU23kmMA=@vger.kernel.org X-Gm-Message-State: AOJu0YyoLPdi/Ky6cif2oi0iV4PwhRmL8Ux7sVdEJWmJ+HPc4hy3gidT NGoYuqqw3ma0S7xibdU/RlBZVVJCln1qxwYtKUAotgxcXmccXJsXCUJo162jEIn+IrY= X-Gm-Gg: Acq92OH5tTqSKzru5pFDG7EJaCPHyJ0rRPh6zlQyBmb978TG0vocXBHVqvDlJpZQjE+ PnSN5lQUkSIIgk5WbOMScRCEGBv2yOH8aJn6u8W7MrL/pkGEqN2uelwisglMBF+jMrX3NiRzQ3Z nKZA3hEq8My2VXaYBDevULW9cjFrGV/SMRJ61wC7QILcIHkFqjs+c9lLGkg//grQgudDJAvIdjP hUOogPNUKBIAIwq0q9LKveC3eHh0Nwc0/Ha0OD8sHrvUYCkL4aFHkhAtvzH0kRssqLs6MLmzXCh aNs5KBFCjBw3nwX1x4npdVIjgv1z2sS1WmCYxjUFrF327GKd+U2EsJXb0V4nqRv2x0rkoVicSsn kNt7LHuQpsIm0/zu3zXKWShkYCA7h4Nph3jxCVapjQk0s31jiw6OsUX0H5kiS/wIGnDVBWn9lCm vQnd6OparOI6wMKBeg/zN696BX8GPdz53uaCZJby/02zjKc5syST8iP2LnmjICrEs+BOkIgssnt LwkrQ== X-Received: by 2002:ac8:7fc2:0:b0:50e:5aed:caea with SMTP id d75a77b69052e-5162fe26062mr96232451cf.14.1778759449125; Thu, 14 May 2026 04:50:49 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5164585fa0asm15519921cf.31.2026.05.14.04.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2026 04:50:48 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wNUaW-000000057Ee-0Djd; Thu, 14 May 2026 08:50:48 -0300 Date: Thu, 14 May 2026 08:50:48 -0300 From: Jason Gunthorpe To: Edward Adam Davis Cc: akpm@linux-foundation.org, arjan@linux.intel.com, davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, hdanton@sina.com, horms@kernel.org, kuba@kernel.org, kuniyu@google.com, leon@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzbot+d8f76778263ab65c2b21@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com, yanjun.zhu@linux.dev, zyjzyj2000@gmail.com Subject: Re: [PATCH] RDMA/nldev: add mutual exclusion in nldev_dellink() Message-ID: <20260514115048.GX7702@ziepe.ca> References: <20260513234655.GW7702@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, May 14, 2026 at 03:31:22PM +0800, Edward Adam Davis wrote: > On Wed, 13 May 2026 20:46:55 -0300, Jason Gunthorpe wrote: > > On Wed, May 13, 2026 at 02:17:28PM -0400, Leon Romanovsky wrote: > > > > > > On Thu, 07 May 2026 20:50:10 +0800, Edward Adam Davis wrote: > > > > We must serialize calls to nldev_dellink() or risk a crash as syzbot > > > > reported: > > > > > > > > Call Trace: > > > > udp_tunnel_sock_release+0x6d/0x80 net/ipv4/udp_tunnel_core.c:197 > > > > rxe_release_udp_tunnel drivers/infiniband/sw/rxe/rxe_net.c:294 [inline] > > > > rxe_sock_put drivers/infiniband/sw/rxe/rxe_net.c:639 [inline] > > > > rxe_net_del+0xfb/0x290 drivers/infiniband/sw/rxe/rxe_net.c:660 > > > > rxe_dellink+0x15/0x20 drivers/infiniband/sw/rxe/rxe.c:254 > > > > > > > > [...] > > > > > > Applied, thanks! > > > > > > [1/1] RDMA/nldev: add mutual exclusion in nldev_dellink() > > > https://git.kernel.org/rdma/rdma/c/0b28000b64f40d > > > > This seems like a rxe bug, I would have expected the lock to be inside > > rxe to protect its racy implementation of rxe_net_del(), which looks > > like it is possibly also triggered by NETDEV_UNREGISTER... > No, it was triggered by RDMA_NLDEV_CMD_DELLINK, you can see the "call trace". > > > > ie it should not change nldev_dellink(). > While this could be fixed within RXE, the same issue affects all other > RXE-like submodules when they subsequently support the "dellink" interface, > therefore, handling this within nldev_dellink() is relatively more appropriate. Why would other modules have an issue? The problem is rxe's racey refcounting scheme for its lazy socket creation. There is nothing wrong with nldev, and now you've created some nasty BKL in the nldev code to fix rxe while ignoring its other races. Jason