From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145012; b=a8wOz7KZAO99c0/xFkDiCXhCifp7dg8EsKkpZr0O2MTvdpBAl1CVz9cVsXzRco5bcVRO LoPWvC7Nr7o+GmpsoSktBe0srkuGF3Mk6IH+gODQUNPegDjLhPM88to7paEoMOJxuu/oJ Q1sttlTudXZi0IbnpclB+wbMwNh4Rh4hZTtYbOpX7/8/W6Wy0fawCwbteyACA4y9a5g8D 3cC8WqP3T5wCJ1AhOLKwBjlS82E8JLhUH2m5ydSOzcQJZESK08PebU3t2zKdbHu2pEuNK wydvUE2T4W57amfOgEbsSjzrHSlkD+wpJs51hYk0GaFd8tmh/tyHUhO7dQGm417F8OA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796145012; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=WCMZENKmB/GIRTzr1e2qbYP7UDHBaKeLv1kz7BvwjQA=; b=IZMTKrzqdtrzIqXR3RlFbE3PSqk5aD5f03TzDWt/XoTM0dISxEmHSoq4OACmOzcQoBIS 0cLYWbzbPoIOXuqJD0c7Rq/0Esq8PSu9wkC7mz2NRF9nzghC3LiSMYd1wtFMoBg36Y0Si 0l6Ffd3x5aQ/GFqhEelGQIOwVHHxGuMULUt9bmAGmTe3HZFNazojmrAEb6BesYcLIYNTn w/3jDMr1Mz4M89+8q8R38tRtbzY+LJo21VcMx8XXU5dQPBKestakpf8fnJu98zHo6BK9E 2+FK/HfpWySDzP8Kg3fG91zxNRAQ+EGc4mdHiDg3eI2fM3f7OMFKZRjhW78Z0f20rVw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XkjwLDUQ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E928606A32C; Tue, 1 Dec 2026 17:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XkjwLDUQ Received: by smtp.kernel.org (Postfix) with ESMTPSA id B93821F00899; Tue, 1 Dec 2026 17:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796145011; bh=WCMZENKmB/GIRTzr1e2qbYP7UDHBaKeLv1kz7BvwjQA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XkjwLDUQdCqB6kuIXodPaLXAOlLxFXJJ/4nO4H1Fo131lBAhv5aYYSh0e9BTGeNCl Dhrad0q203nfH0+uVv6tYCKI6Ul4j1Z2lxrLu46rMadhB/ZMP/+2wp6c4zEfg1LWao WjBX63fG7wVCfk+943Sg+sKkdMM8ygYVTyVz4J1w55YWVU6luWUug4bM/q3zNbV0JI FDR2jeRRK1Gi1eEpH3Ny4222Fu+SiItayFOJFXGxgIlA3tM+KcRvOk0EwEG9jnkDN8 Gja18cRVLBZRlL7Jl9+MNPFpDXxSjS4+XuV+1Db4klluCRHGqR6M5jg6WhRgcyk3ac 0SPuW/twqpvzw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v3 05/13] io_uring/dma-buf: switch to tag file filtering Reply-To: sashiko-reviews@lists.linux.dev To: "Nitesh Shetty" Cc: dri-devel@lists.freedesktop.org, nvdimm@lists.linux.dev, linux-ext4@vger.kernel.org, tytso@mit.edu, media-ci@linuxtv.org In-Reply-To: <20261201155938.3028275-6-nj.shetty@samsung.com> References: <20261201155938.3028275-1-nj.shetty@samsung.com> <20261201155938.3028275-6-nj.shetty@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 17:10:11 +0000 X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] io_uring/dma-buf: fput() in __io_register_dmabuf() unpins importer module -- commit 2e02bfbc83fd62e0046f2d9e78bfc97e418c5fff Author: Pavel Begunkov io_uring/dma-buf: switch to tag file filtering This commit replaces the exact target_file check on registered dma-bufs with tag-based file compatibility checking via dma_buf_io_file_compatible() and drops the target_file reference at the end of __io_register_dmabuf(). > diff --git a/io_uring/dma-buf.c b/io_uring/dma-buf.c > index fd9b8769818ad..fe735a8773b73 100644 > --- a/io_uring/dma-buf.c > +++ b/io_uring/dma-buf.c > @@ -4,7 +4,6 @@ static inline void io_release_dmabuf(void *priv) > { > struct io_buf_dma *bd =3D io_priv_to_dmabuf(priv); > =20 > - fput(bd->target_file); > dma_buf_io_ctx_release(bd->ctx); > kfree(bd); > } > @@ -52,13 +51,13 @@ int __io_register_dmabuf(struct io_ring_ctx *ctx, > if (ret) > goto err; > =20 > - bd->target_file =3D target_file; > imu->len =3D dmabuf->size; > imu->release =3D io_release_dmabuf; > imu->priv =3D bd; > imu->flags =3D IO_REGBUF_F_DMABUF; > imu->dir =3D IO_BUF_DEST | IO_BUF_SOURCE; > dma_buf_put(dmabuf); > + fput(target_file); > return 0; [Severity: High] Can dropping target_file in __io_register_dmabuf() allow the importer driver module to be unloaded while bd->ctx is still registered? When userspace closes target_fd and no other files remain open on the device (such as an NVMe namespace), nvme_ns_release() and bdev_release() drop the module references on nvme.ko and nvme-core.ko. Neither dma_buf_io_ctx_create() nor nvme_init_io_ctx_locked() pins the importer module; nvme_init_io_ctx_locked() only takes a kobject reference via nvme_get_ctrl(ctrl) and sets ctx->dev_ops =3D &nvme_dma_buf_io_ops. If nvme.ko is then unloaded while the buffer stays registered, nvme_remove() detaches the dma-buf and drops the driver's ctrl reference, and the later io_release_dmabuf() -> dma_buf_io_ctx_release() call invokes ctx->dev_ops->release(ctx) and ctrl->ops->free_ctrl(ctrl) in unmapped module memory. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201155938.3028= 275-1-nj.shetty@samsung.com?part=3D5