From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145393; b=NuEnyQJQ4199CugyoMN3dKEhVW60aVYjDd4nOQ/bi63a0CSEomsc5Mj5a+wJabuDOo4p RQCz/Wh8+RG68d3lWwWLL6jcnApCumJq9qoBB0Bomey7eV8TNIm8akkjC9aSM7Iq/ONmZ vFGMcJlnIAZFHhjzO1YvRZsCLGp2q2tFbwDqzijfzKb8eJ+8UNHVcxS3nzq2qxrhG5vOQ w8E+Vo5vtgpudCQdWYQBi5arzk2qcbmsP8SLSjNayXYz6lbcr1q5XavxWcnnVETbWPLk1 +lFuT0zCPx/3SukE57Ct2wMmyp3u2nDUxq8pqzS+UsvkpVJMiV7B4XlVpGKOEJ+GUkQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796145393; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=9qDnFKBLllB4vVs0b90a9cp7wk9WHMB+4+uHz7Om1mM=; b=LwYLDzKFb28dA6MLjdGHA/OVGCMbQILx45BaQsIkPVHgIwHxKNq6RXCLOCp5JEj+w02g v+nX7h6ATzqA6/l9iO2D8TWccBz2phOO7trI8U4E39LAjQpUtV5X0dgZHDrdD7ad4THVl qjdxVXPlgyVury4sSzYJAnCwcirCXYOg1fTTdvPxWsr3kgN1EGb8SUPjx4ZEEgwiPRanX hOsX/Bu/QKuepL5D1Y4uuqdSCpBK1d1ghBCZSmh1iIJUPERAFR1XNbeYV2wHoBiJ/qCja hoNhmZszeyZRhmzDgUZsycy2H+H0fWBrvLfphOA5IQ2Me7skVObJiReHvXlxhFJM82A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b="JXQvLuT/"; arc=none smtp.remote-ip=209.85.222.50 Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DECE3606A322 for ; Tue, 1 Dec 2026 17:16:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DECE3606A322 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.a=rsa-sha256 header.s=google header.b=JXQvLuT/ Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-9906034086cso3398623241.1 for ; Tue, 01 Dec 2026 09:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1796145392; x=1796750192; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=9qDnFKBLllB4vVs0b90a9cp7wk9WHMB+4+uHz7Om1mM=; b=JXQvLuT/5EFqWxbIsn3/pSZzXgfq2jp8Ueo8gd4yx00OyJswW+oLI1Gq+UmiIY1YZo g0k5HifO7Im72DobA3TbuQ6DYFylaQUvqZdM4Us/GFUXNbo/h0IlsAbBHJqVs70N2NUD ry3zM2QTPwIcMdksVi/jH7gyMMKCjawuf9MWoYqIQZniuk6h2DNTOEGQMyf+HKCOgM6k T6m2etegTHxXFP7Zi6I8PvfEh+Lg4X5Lmm71YfFd3II3HXfxbX5YizG5vllny3AtTmMY Cie+7UNUh4BM9D5afOVJ5Ywyyo6uWrXOunWF5IZMPufLVKQCQiqZZWSdAvHHiGRHfoIl Hyrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796145392; x=1796750192; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=9qDnFKBLllB4vVs0b90a9cp7wk9WHMB+4+uHz7Om1mM=; b=1Y5yhlQAx1Uj8t0x2wlUDfcA1WQ/R2Iy6ILwHiEZuwxptN2g9BdJhZ4df0MiPtkgpK jXW7K6O/iqBAOhUhHZMq8jMXOT2dklgqHNd5N52l9x1YxVnSe1+W6ZFou/zghBCsBDxa VLGr0U5IcjAgnMTOCHv84iwnSt/7c8ErCurUjHnMEKZfeZDL4pfURWGbQyt476Q6jX7C Dexbw0Vw5UivIOiXuUyPt6LHimnGF6mw2sMRoTCZ320FR1pYsL0HDOgXxTIBxvXx3lRM ofLT2Fw2Jf7Qbtqk1k3r6fb0suEnQrMn4FZGuwNW/YhEHKjuAfMLn3kFUjIZgjvVREka ywhg== X-Forwarded-Encrypted: i=1; AL+hErEG/KdB99QE6IqPu3uLJGLr6Q92680lebffo3PF5F/pARoGb1UK9rgjlUIkdVDeWzoZIbckVQU=@vger.kernel.org X-Gm-Message-State: APuU4Z+f8Zyn/lEeYBdm3y4ZX1guFl4XLx34FtSxdlbU6P8tUw0nBsWC fn5q5PBdXerutCveVHe5wzbFCHoxgXTrw0gsV0MtxbSUT38FTyyQIHGwBPpWzPnCaXs= X-Gm-Gg: AZFdTZeyv1AypFJaVBAunYV5Uv+3jlCWC13hsK9JqKfoLvkZ8GD3liPAMwJ4QHTLO7m Ao61UgnNZD2oWtvzgvIhZwhERSBf2sJspZqOAqMmuzERns/j/nQIs7Bk30SOHYj9J3v1DlQ4GU6 Jw7zLQgtPu54dhpP+R/rermsd/uaq5TsjwbcOVkyzkIbQaC3nd+ZEOyCSRLhAN9iK+3O14NIy9n jyUE5+14iSZZolDUWAcwUUlhjOeg9++hNwuEqCzeogfRdshu1xJqp41sZ7d7QCRahKW3Y1R3VtM RPIoF5zD498wmrzRCDYBx3v7TviFrydHN8mYpzINkqwQjKa6RXH3yK7SQ6TckG0Jc/RBn+Ya2T0 QMYGjjIaco2eEjX95lWWzNAFaRKvidk6nAN5bnJv75fo3TztYQl8NppyElSUIdE1meZ/vAQrtij 3pLwExyhjZaPNxyUVkLeFnau1OFWaRQ8t8hGbGnEUnBDG+cCfImvIG9FdnIOmnxVGkvTvjjxpn/ YTuRR9fLELjwUcNw60tV6RKlZr4n6P5lnYfurpy9p2+0WIqVinXkMxhovagQTvIMIlK4eTubzA1 mK3n X-Received: by 2002:a05:6102:160b:b0:7cc:9d82:61e2 with SMTP id ada2fe7eead31-7d739696e23mr23665358137.13.1796145391747; Tue, 01 Dec 2026 09:16:31 -0800 (PST) Received: from ziepe.ca ([142.177.118.84]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349f2186sm333180266d6.29.2026.12.01.09.16.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 09:16:31 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xYRSw-00000001GOG-2lJr; Tue, 01 Dec 2026 13:16:30 -0400 Date: Tue, 1 Dec 2026 13:16:30 -0400 From: Jason Gunthorpe To: Leon Romanovsky Cc: Jaeyeong Lee , Artemy Kovalyov , Yishai Hadas , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v3] RDMA/mlx5: Preserve DEVX objects after failed output copy Message-ID: <20261201171630.GK1856591@ziepe.ca> References: <20261111105346.3220427-1-lee@jaeyeong.cc> <20261115135123.GD42525@unreal> <20261122103715.51731-1-lee@jaeyeong.cc> <179574905000.68536.2524255610860968331@jaeyeong.cc> <20261201153000.GG31440@unreal> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201153000.GG31440@unreal> On Tue, Dec 01, 2026 at 05:30:00PM +0200, Leon Romanovsky wrote: > On Fri, Nov 27, 2026 at 03:10:55AM +0000, Jaeyeong Lee wrote: > > A DEVX create command can succeed before indirect mkey registration or > > copying the command output to userspace fails. The current unwind path > > destroys the hardware object directly, ignores a destroy failure, and > > frees struct devx_obj. > > > > If the object cannot be destroyed, > > How can this happen? This is exactly why your reproducer is invalid, it > does not account for how real hardware behaves. It definately can happen, I gave an example intending him to paste it over.. You can create a PD with devx, stall the kernel thread through various well known means and then make the copy fail. During the stall you guess the PDN and create a MR within it. Now FW will not destroy the object due to its refcounting. There are probably many examples beyond this. The patch looks OK to me and the code now matches how this was expected to be used, with finalize preceeding a manual copy to user. Jason