From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 DC1933EDADB for ; Mon, 18 May 2026 10:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779100360; cv=none; b=CnEbUBcDsHh+CrWGbf/riUISkI/BfC59fNCtXQw0d1y+1b13jHzlWDjIGIdklZKYbSe97SWE8XiiJYPo2eu+7cnyACocWi36vWFaB9iPjCx6qYOg3nBllvA6GziaqAgLiHr2kuZcLGjrWbKBqwbi6Y26CVbcIetI9RpiKHXPSAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779100360; c=relaxed/simple; bh=m9+vZFxcuGPYWJBP3wktaN7W2WK4EAv2F55wBzi2Ppk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tVx/FT2ICm8o+YRuHX1wRIE1YJljVCaNwwD6Ey73D0+wbCW3hwRO0tHmDR7KhCvJFY19d4yK2oz+9DvLcmhar3bJYrj2i3hKgXJP48M4QvkhAlM0unN148MJa6oBxISDSqJr/IS/57IWxPDAaJZXkP9hm9J2MpzYTxyWKD1cwIY= 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=kKGD8u9W; arc=none smtp.client-ip=209.85.208.46 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="kKGD8u9W" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-67e24b8ef55so3686121a12.1 for ; Mon, 18 May 2026 03:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779100340; x=1779705140; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zoNzxGFL2Ujj/KuhI6hgWUIPCWaa3YVWWoq6Rexykog=; b=kKGD8u9WfUlh8C8qg0OHIKF7TnWNfk/Zq1f43h7Tzl2hvqn8D8PrBSiN9K0XDJx1qy WyuwcExNonp7DfifZfgFSPaWaTIpWvNE9/QlRj+eteLbPnAUgA07jgGtwroWjq8SASNF PXRiasnlodQUPHCOIoZpjvuCOGwdeYmjItzY5PdpyrYZ1Ka8uJgjXXJPAxGsyNdfQV0O Zv9mDKJ3jb+/ntQz+UeqCvbrwBx3z9X3PwXcH/LXktJqpFzdQOzkS43NdylIsOnkL9qn aNK6crOdJr6yhtaeEM39pBCfsWKzbGjGF2+2jtIMsnKOLZFccDbPwmxCCRw7iqZ4lxSl 1E0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779100340; x=1779705140; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zoNzxGFL2Ujj/KuhI6hgWUIPCWaa3YVWWoq6Rexykog=; b=MluRvKRT0J7FrJ4Jt9c9iBZFfEmFdXpPubDxUXGQo3Uuia9iTZL2xCrvj3pVfrKqRT AvHwR8EZF4LnfESGhDi8wPwynZq4W1SMFLvZfkHq9sxAEIeq9f8expz1Qq2QArqf5i60 iDtja0JEQJi4ePojTioxgwWvZARTQzWr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23a62f3a-bd51797a61emr744815966b.29.1779100339507; Mon, 18 May 2026 03:32:19 -0700 (PDT) Received: from ?IPV6:2620:10d:c096:325:77fd:1068:74c8:af87? ([2620:10d:c092:600::1:ec20]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bd4f4ded942sm545073266b.36.2026.05.18.03.32.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2026 03:32:18 -0700 (PDT) Message-ID: Date: Mon, 18 May 2026 11:32:16 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] fuse: wait for aborted connection before releasing last fuse_dev To: Bernd Schubert , Bernd Schubert , Berkant Koc , Greg KH , Miklos Szeredi Cc: "security@kernel.org" , Joanne Koong , "linux-kernel@vger.kernel.org" , "io-uring@vger.kernel.org" , Jens Axboe , fuse-devel References: <20260517095846.fuse-iouring-uaf.dc5f5dbb71dc@berkoc.com> <2026051703-equinox-multitude-91e2@gregkh> <20260517-fuse-uaf-cover@berkoc.com> <20260517-fuse-uaf-patch2@berkoc.com> <08d3f6e0-7745-4084-995a-95ddb77f7f11@ddn.com> <9f3f3dc7-1c52-49b6-91d5-046f1fc7b2a8@gmail.com> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/18/26 10:50, Bernd Schubert wrote: >>>> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c >>>> index 5dda7080f4a9..7d9c06654a98 100644 >>>> --- a/fs/fuse/dev.c >>>> +++ b/fs/fuse/dev.c >>>> @@ -2566,6 +2566,7 @@ int fuse_dev_release(struct inode *inode, struct file *file) >>>> if (last) { >>>> WARN_ON(fc->iq.fasync != NULL); >>>> fuse_abort_conn(fc); >>>> + fuse_wait_aborted(fc); >>>> } >>>> fuse_conn_put(fc); >>>> } >>> >>> I might be wrong, but I don't think it is possible, Maybe Pavel or Jens >>> could help (added to CC). Basically as long as >>> fuse_uring_async_stop_queues() runs we do not have completed all >>> io-uring commands via io_uring_cmd_done() and as long as we do not have >>> completed these io-uring commands. >> >> If I understand the question right, yes, fuse io_uring cmd requests hold >> a reference to the fuse file, so until you complete them the file will >> not get released. > > > Sorry, had totally messed up the phrase, can't read it myself. > > What I mean is that the io-uring was set up with /dev/fuse as file and > as long as fuse holds non-completed 'struct io_uring_cmd *cmd' objects > there is a reference on the /dev/fuse fd, which blocks the call of > fuse_dev_release(). Yep, that's right -- Pavel Begunkov