From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796363459; b=ghjweKV8hzH6Hjqsq4Pb8YhH89zeLRmtKxQ5aio4JGpF/SsuV+8z5ABlcAwnG4XO5rqw /d29y3XSJS6qqeIxbDKihxNyKJ3YA6h5qs8RZXCnJ8ed6gN+NFgwmbI8M3kl+LBd3JQij y+LBcEpKUoGFONs36m2iK2NPM5Hbz75MioqCALI5is2R0/dWUGvIQo2rA2VDBCD8sm0Ys IGdWF3iKyezVLnm2NRULhhpVUxaZruGtURQ7dzoOYgYPZMgKBHfhnTKKMwdSaA6GwGKMx gO52FmD/KBvLUAOi1jcWFW9o4GvKHsDYb6YAWKLQYyDWjBgNTWKMyOTu9SBbOOrncMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796363459; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=sfdtX+AMk0GV0DFugLCQwp2uj2b2EuXXPOZwDXZXvyA=; b=a+cyp4Bvu15Z6vO+kVdi4sCKgfG7ILWWDmN0Dq4bZxwM5bNjTipFzM6Z11KyGU9djf6c l0daCqK6MnCjO9hSxxL6hWlskCPmDXne3vQH+u9YCutXMgBIfyAqeCvR7IeywiQguLAlE fO/fPqrf1a/4QHwzjbRk8vZDC5egx7JtLnbmYOJKYh48ZRcs5XasSR7JtbvUF8JNOZB8t xScJFv6TZ3gtU5dmq2OluQX44CjCWuoF1mugdwUSySpSP6+HTRULYW9THO+L6Z/NPQfp4 oqcm8nUo1Nb26VnNa1UtRh92OA0OfU2/BVizkLvzGaJkO19nhR+HIChD2rtFUPPJxnw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=axCIDxql; arc=none smtp.remote-ip=209.85.221.42 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 97E16606A68F for ; Fri, 4 Dec 2026 05:50:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 97E16606A68F 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.a=rsa-sha256 header.s=20260707 header.b=axCIDxql Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-4a357b1c649so272395f8f.3 for ; Thu, 03 Dec 2026 21:50:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796363457; x=1796968257; 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:content-type; bh=sfdtX+AMk0GV0DFugLCQwp2uj2b2EuXXPOZwDXZXvyA=; b=axCIDxqlwSRz8j7m7Xo4UmcKgi2/mKMNQpaG5yHvKWATtkL3tauFi2bdcoymioEZW0 r02KTQikJuNyHygAxiM3rItPn+W57B++DODCoWYwvd0WGqTxmCzdQ9KLe6ygadJpsqhH fr9nSsgTlbRDpUstGGEtq1uJh4jKWYVfL2cr6KLOYE2axDZOyvQveGNWED4uMKD2aOLA vTCLBTdHw5zMdy+LOQzZS0T6jFoJ2Ri6ScIykG1baxFP75YP+klJJi33H+zPiFI/RKbg L2ubr/pXGdPPpHgPFpu468yDAgnXX9wAPqwW3EXvD+YqYOjXE+R6lXPiKxmr/eemIWsq IZKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796363457; x=1796968257; 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:content-type; bh=sfdtX+AMk0GV0DFugLCQwp2uj2b2EuXXPOZwDXZXvyA=; b=BtGWE5MX0roBg3LFrPSB6yiAdctoqowX4WKEqceAsOleueqsK3MSl1TwZm+0PDS6JR 06H/XixuHSTSVyqpLqBD5UvC2ZIYk8P2eFTDooPsLq3/+OvbgoH4RJvCwzJ00ElE0uKC yzswfoxNu88qBFk0GVbRJ7ofbHVaaLmclhJkA8f9DYp1Ia3xTfSYLtIfICRRX4JoARG0 vSoJe72oacn+yj3r50rFvZOGzJhUiY9MZJbECPrQxH903OZcf51wBw56SvHUFhkUqDZj +g0wfzG5jNJA9+hMg1t0bPKh4vcB33Dn6vNhZ4Ejvq5V46+HafAo3BOcRTfsk/+DY0v8 khcQ== X-Forwarded-Encrypted: i=1; AL+hErGqKPrgmeLvv4vru9SGRmBSTPnxfkqoE4Q6kdsce+iPf88QxUL63PgYXvE2khSt7TM8DTGCpeWUl84ZJgw=@vger.kernel.org X-Gm-Message-State: APuU4Z9cf6UfdXqZIXOdjzmtX4cCbty8uURHhJTxybSzWCFWiep19yJM CwK1VYDZNPdpvOkcL2gRFGj6JllijTICk5knRet1HiNYWkfI1mvb3JL0d2m7kGnsGbY= X-Gm-Gg: AZFdTZelo6PmFtPcb+qlRW63HN1DW9biDpeK/HM+fKb8PRKtglNt6BC/4ZbJzOzuSKz EnaqtCUpiNkjw43yCMkzrMfdl7vfxyX4843qXJNa20R6mu+Av/4V58pDC61j4adpbJgL2dtlrIS fL80RIjX7UAhPbRzukga/n5QII5MPEuselNajfpdQYaHwHEcIuvKLGks66oMSNDKgZJgvx3bzIW E2xeu+B0iuzuxF/+Ex20s3iWQGSaqA6X0cJfpQE10k5Rx3UVy5K4Cm7F4w8hm0QVDfz6F5+19ni XfNplZC5+xj07lUSXXRA0B6Mf9fLgZuEsX4OGgZf8ENI/U8mQ1RRQvC5dqzQhTk05XKdich7ZcO BELuuwu9GP3Sd26Bp8syh4ujAAjE1+MNF3BmqOq2i+XhnIAXVvB/NMGA5mRY8vDAlbS+/BrsiF/ OKZUqRMJau+D/t9SL1CZK6mxQPWhva+eeJL5rs02yO62GU34Acl8aQidUSV2jn3kNi+oC/kG/os T+II/IYzw3IukP6aRVxylsfyoxTuGlXiEVOz0Pl+i7InPCy6yCrQo0ZxwK/ki0SwJ1CC5aHFOgG EojrzMILAoeJrzj0FHZb664xnNjfdGQRD6skGkgKEhZGcZEeyHV1WMfSiahKORkvzi2VHe/BE2Q iAk8KGcjvgX87znzFZ1CD/Q== X-Received: by 2002:a05:6000:4a08:b0:48e:bf0:30f with SMTP id ffacd0b85a97d-4d1ea1d6039mr1706371f8f.34.1796363456990; Thu, 03 Dec 2026 21:50:56 -0800 (PST) Received: from Raghu007.. (sgyl-44-b2-v4wan-174108-cust110.vm6.cable.virginm.net. [80.1.81.111]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d1738cfb63sm3392911f8f.37.2026.12.03.21.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 21:50:56 -0800 (PST) From: Palla Raghunath To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Neill Kapron , =?UTF-8?q?Micha=C5=82=20Nazarewicz?= , Shuangpeng Bai , Shuah Khan , Brigham Campbell , linux-kernel-mentees@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+6227549bd2c8a1ec8ba0@syzkaller.appspotmail.com, raghunathpalla.0209@gmail.com Subject: Re: [PATCH v2] usb: gadget: f_fs: fix use-after-free of ffs_dev in ffs_free_inst() Date: Fri, 4 Dec 2026 05:50:55 +0000 Message-Id: <20261204055055.42724-1-raghunathpalla.0209@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <2026120350-conjuror-width-14d5@gregkh> References: <20261120230711.14330-1-raghunathpalla.0209@gmail.com> <2026120350-conjuror-width-14d5@gregkh> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Thu, Dec 03, 2026 at 11:16:58PM +0100, Greg Kroah-Hartman wrote: > Isn't this fixed cleaner by: > https://lore.kernel.org/r/20261120210616.2293426-1-shuangpeng.kernel@gmail.com > > If not, please resend and explain why that commit does not fix this > issue. I don't think it does. They are two different bugs on two different objects. Shuangpeng's patch is about struct ffs_data. ffs_func_unbind() drops its reference with functionfs_unbind() and then still takes ffs->eps_lock, so the patch moves functionfs_unbind() to the end. It only changes ffs_func_unbind(). This one is about struct ffs_dev. In the syzbot report the freed object was allocated in ffs_alloc_inst() and freed from ffs_free_inst(): Freed by task 17408: _ffs_free_dev drivers/usb/gadget/function/f_fs.c:4336 [inline] ffs_free_inst+0x233/0x2c0 drivers/usb/gadget/function/f_fs.c:4152 ffs_free_inst() drops ffs_dev_lock between ffs_release_dev() and _ffs_free_dev(), and the dev is still on ffs_devices in that window. A mount with the same name can pick it up through ffs_acquire_dev(), and the umount later writes to the freed dev in ffs_closed(). No gadget bind or unbind is involved. ffs_func_unbind() isn't in the syzbot report, and my reproducer only races configfs mkdir/rmdir of the function against mount/umount of functionfs, without ever binding a UDC. Shuangpeng's patch doesn't touch ffs_free_inst(), so that window is still there with it applied. I'll resend v2 with this explanation below the --- line. thanks, Raghunath