From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-163.sinamail.sina.com.cn (mail3-163.sinamail.sina.com.cn [202.108.3.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2EBA23392C for ; Sat, 1 Aug 2026 03:50:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785556236; cv=none; b=UWD9itISmHkYbdG5Nvf0p2E0A+7FqjVA95qk65ToWsjpbGMITcsO4hS1Tdqmc7XI0ZsIfVNFAs2qrqD+Wi2W1bDppANv72PfDEyrxnJ2Ya3w5RMOcjC5UCA7w/K9Fc0ABWNdqM8RzzWhUFPmUCpMpbp0Bsu/MdnYCZTMyIejV+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785556236; c=relaxed/simple; bh=uIxGnwmADKYTvi+KebdVMx07EkHCx2IOcWSPvxu935g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lv9hUpfnn1Dq6j90PU9nZ91yo/xoTuBM2c19hu55wEhtKlSIAoDe2OsBiSdcbQwli3ir6y7574K58pgvHprmMUa9Iioi0uPmsR0Sy8Nc3+hnRgZu6SAHk6dXVLJEo8KbCLPEREBm5n+htC8WmCenzWI0nL5Xx9CbwPP5839tUnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=fHaC2NPo; arc=none smtp.client-ip=202.108.3.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="fHaC2NPo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1785556232; bh=2doaNvaeSdHY84NS/SmssotANpbcwyRDapzhfic2WKM=; h=From:Subject:Date:Message-ID; b=fHaC2NPousUZjJHyjDnaCs8jOQ/BiaQDX80AtVx4MkLX7qdLFCrmXz46uiZWft2wm 2BTzvvGwT2K03pybMdIjSJvG54kbCgieyAqMPepQjf5p8gwwvI38SCfpp4QwaRo26l 4HMebRvoBT2bFkkuvSmLefGzpJZQC+vQM4zx0s3U= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([221.216.154.155]) by sina.com (10.54.253.34) with ESMTP id 6A6D6CDD00005A1B; Sat, 1 Aug 2026 11:49:52 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 596876291689 X-SMAIL-UIID: 9D8C631DEF40449496BF22CAF745D165-20260801-114952-1 From: Hillf Danton To: Andi Shyti , Yun Zhou Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: fix use-after-free in debugfs directory during adapter removal Date: Sat, 1 Aug 2026 11:49:38 +0800 Message-ID: <20260801034940.813-1-hdanton@sina.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 31 Jul 2026 23:55:47 +0200 Andi Shyti wrote: > Hi Yun, > > On Wed, Jul 29, 2026 at 04:58:53PM +0800, Yun Zhou wrote: > > Move debugfs_remove_recursive() after device_unregister() in > > i2c_del_adapter() to fix a race condition where a new i2c device probe > > can access the adapter's already-freed debugfs dentry. > > > > The race occurs when: > > 1. i2c_del_adapter() calls debugfs_remove_recursive(adap->debugfs), > > freeing the debugfs dentry. > > 2. Before device_unregister() completes, another thread writes to the > > sysfs 'new_device' attribute, triggering i2c_device_probe(). > > 3. i2c_device_probe() calls debugfs_create_dir() with the stale > > adapter->debugfs pointer, causing a GPF in start_dirop() when > > trying to lock the freed inode. > > > > Reported-by: syzbot+1e3d934ee3cff1ac188b@syzkaller.appspotmail.com > > Closes: https://syzkaller.appspot.com/bug?extid=1e3d934ee3cff1ac188b > > Fixes: 73febd775bdb ("i2c: create debugfs entry per adapter") > > Cc: stable@vger.kernel.org > > Signed-off-by: Yun Zhou > > This is the third patch of this kind I've reviewed, starting from > the latest. I'm sorry, but I don't need AI to send me patches; I > can do that myself. I don't need intermediaries. > > If your goal is to be replaced by AI, you're doing a pretty good > job. > > I'm NAKing this patch on principle. Read your second patch to > understand why; read your own patches and understand them before > sending. > Given no version info in the subject line, can you show links to the first and second patches to double check AI. Hillf > Andi