From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796450140; b=TOd23aauwHhyzME0bIYA7o8pZ/sBjjyXGrFvGhqlqlitPY83f0NRSMdrwj4oF7f45TtB 0065H4Pt/UkejLTvEuRiIb+Wc9sKfWUiXXDgHbHI55Rmu87xdePaZV4bWPlbU2lYCbZ65 RIZiOOFa8BTpNl49wYjiD2cBL/sOCHqmZugenZpdfvq6HTbJ5OdtPRD+21SB2lEeuvxNI rcpBOHVi3ffc5/QtH3pLYH690hnM6cTeLzQSxM8xUsG94qo/RH1drOQmBkYCw4F5s9ksS MC3Xk+8ijwkTCWc2xqBdxIul2KOaIOA+6kK+FuwpMw6nOyxPpqj38jZS4vN0JupQv9A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796450140; 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:In-Reply-To:References: Content-Type:Content-Transfer-Encoding:MIME-Version; bh=/a8o/7aSV+ezxdzIkmT757C9r327RbIoslwADLTjU/s=; b=PNV5LB/6HcTnUKQnTpAozcF6XpitmfOKn+dZmPXjGWA/C91pGIRG5EG9iApuTMPJE9CY E5fpLHmfZdRJSbuO60ecKFY93pM0oZPjhzaLtRVCSAIfhwdswiNTEEQTI6irlXXCg5wUV PBqkYdO0M5hFX9BTRTCTCK8Txq4Adr8Ep9LZokGRLdc16WncPcmVw+RcoQA3SP9nMEpk0 0UhMk0tuKqBHFKS0gqO2mCAF84qvgZ203mPdlD9ptza/VvYIlQevtC7vQqosQwA1aZpVw RC9/Ab1+vjjobYUaAnyc6xTNNPiiDBZ8V0rW2VmoEB+DOYS2EXO4/gVBPYxojDCxoOQ== 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=YMwoDLZY; arc=none smtp.remote-ip=209.85.214.171 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 B702B606A322 for ; Sat, 5 Dec 2026 05:55:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B702B606A322 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=YMwoDLZY Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2f02ee04378so15991775ad.1 for ; Fri, 04 Dec 2026 21:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796450139; x=1797054939; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=/a8o/7aSV+ezxdzIkmT757C9r327RbIoslwADLTjU/s=; b=YMwoDLZYuyc3/VDP3ihZDCdBbTWU6Sb8Age91JT8RMZmfAq33D9/Q+/7PN3YO9bU8d 2bhETTJRWiibigyv066/Lna9+7tbDyRI4AGovaduCAV0qGjoI0oytz8ceoAjEPqdmWih Eyes6nHj/U2JMSvLtX88qQt5Txsdy5yYZTutAVLLo1F0zw6i6hdDNpfDZQ1r0odnwz06 HldxTXVXsRR8VS48uTQQ01qxilXstgf7YXXeC6Gujc2XPl/BHhgh1lzJdaQ22l7Cuvql LmyxPDlVb1R0yOliES3gHRGQiHc92WKgSFNDzL6TpnorsYn4xxYpsZ9eRPxWUb2dQKYZ M5hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796450139; x=1797054939; h=mime-version:content-transfer-encoding:content-type: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=/a8o/7aSV+ezxdzIkmT757C9r327RbIoslwADLTjU/s=; b=lbj2WZgYrIBnVjJTprXgzLQMuCfUjl5Xxj+qPSPzUnElhGQ/IZ6Nf0tUaYBjcBA549 zKn7Hm36Uwe/AbZPw1fVfuP61O+Z5/yNuc8iDstsXOyt1zCB7Egk6qMo2hn5MvUC0d96 iXJtjFWmpi5uiHvvKQyKwARNjuqFpGfwoxMyO/AW74kJTbs/yY6Rdv8daupLR4SFs6nN M5oZsiTEpofoZDSPvuSCY8652JzxYK31KwemPY/P60WeqPvEwj75r8+HMcgkIvz9GFWj UHPqWt5ziA/xaKiPLLztbxUWFppopgxTFz0kw+o1wcehn9TW+jYUIqews/cNUBHxlf+j DMnQ== X-Forwarded-Encrypted: i=1; AL+hErGqbtuxJ78EKxQ6rtC4LYMkWMsC9PxeWK/BtDIIm7p312d/M72qA/c/Q31T2qnPh0ECSAtMqP8IWM8dSck=@vger.kernel.org X-Gm-Message-State: AB4q+uFd8zOBzVjG+d2lPA6+hB0X5pVjeuXlbDwH62Rn2jtfLGB7irmt 1f4ibvXaQibgRdKgtxj5w411yA4j/O7o4iunnFL3WGQ6XExGSY/S2N/W X-Gm-Gg: AZFdTZfbL3vcDpQg9At9HW1oVlkWtIkqB/8IAy8NHrXj2Uh1Drnh4DBQhr89bOMlH27 C+X5QeX4zcl9Q0dBcJCZr/PIkd0z7Y/9/b91cnKqxJ/l8Pw3CEwtF9SXDjS//cFaQ6tY2MmbgeF rO3M8dfWTAKNoEKZKMju2C5DLtvc6ulvuJOViISRN3ie7/mI7on3lfcRApgxdRYNX3XKorid2oX eyKLHP0u1TUoeCejuUbs0WPIUT6ZgHqTlXUzkhAs8/K5XuGNx3EXk7DOw3+0Xd5LBCEp0skVh1x m+dFukrJGYU59j3AcUVcR2QxVsex5iSOWksfgQpjSGRvhizfhBXkRfgx8QOf9Sm8cin5aVotuEg blacuE0GswFOGTptUpUT/DAQ8iuMhZ3h/I43b2F9SMk9RSci0TjWzsIdBnsGwxF0geXdRXcwqRa Q52/aS0mnG6QEhgWqJn+X9WUk9C+cJA7UHxw/ZCVbMPYjdZSsPvHYA/ojv/0+Cb86qDSnJxlvRl Cwc/gG17upX1gtqQWY5DsuUu3pbcTg+DsCLez1clURWDgXNaDJ5kYtvMAGh3vNmihqGq8KLrq8Y Z47LZcNlNPO/SXtwAiimGr4QQ1jiYMgkPTrFzZE7OAYLxvE= X-Received: by 2002:a17:90b:2f4c:b0:3b5:8f72:e47d with SMTP id 98e67ed59e1d1-3b5e06a232bmr3967232a91.48.1796450139037; Fri, 04 Dec 2026 21:55:39 -0800 (PST) Received: from [169.254.42.106] ([113.200.174.55]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5ddb881bfsm7207756a91.1.2026.12.04.21.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 21:55:38 -0800 (PST) From: Zheng Shuhao To: hch@infradead.org Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, cem@kernel.org, djwong@kernel.org, hemanth.selam@gmail.com, shinsj4653@gmail.com, syzbot+e7f24354da9f7915bc54@syzkaller.appspotmail.com Subject: Re: [PATCH v3] xfs: fix slab-use-after-free in xrep_newbt_free() Date: Sat, 05 Dec 2026 13:31:00 +0800 Message-ID: <179644866020.268.4885883217145755379@gmail.com> In-Reply-To: References: <179630412330.565.9260762935217160800@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 > The email format is a bit odd. It obviously is a reply continuing > the previous discussion, but it breaks threading and adds a new subject. I was told that new versions of a patch should be posted in a new thread to a= void mess. Sorry :) > So xfs_alloc_commit_autoreap won't have any effect and we can just > remove it entirely. I've gone through the code carefully.It seems that removing this call in junkit really doesn't seem to have any noticeable side effects overall... If the filesystem is already shut down, the remaining deferred items stay attached to the transaction until the repair unwinds and the transaction is canceled. If an EFI was already committed without an EFD, log recovery will handle it. If xfs_defer_finish_noroll() fails, it cancels the paused items before returning, so the autoreap pointer can already be stale and must not be unpaused. If the final transaction roll fails after xfs_defer_finish_noroll() succeeds, the paused items remain attached to the new transaction; teardown cancels them regardless of whether they are paused. In the successful case, the reservations have already been removed from the list before execution falls through to junkit, so its cleanup loop has no autoreap items to unpause. I also found another route to junkit: xrep_newbt_free_extent() can return an error. The reservation that returned the error has already been removed from the list; any remaining deferred items are canceled when the transaction is torn down. I also ran some tests after removing this call. It looks like it hasn't introduced any obvious problems, and the results are consistent with the baseline. I reran the ten tests that had failed in the previous run using fresh disk overlays and a fresh log device. xfs/310 passed after enabling CONFIG_DM_SNAPSHOT and CONFIG_DM_DELAY. The other nine failures were also present in the baseline and list-empty results: four network-dependent generic tests, generic/794's EOF-gap mismatch, three xfsprogs manpage-output mismatches, and the same reproducible-image mismatch in xfs/841. There were no unexpected writeback or no-space errors. The focused reproducer also completed without a KASAN/use-after-free report, and xfs_repair -n exited successfully. The trace recorded one defer-finish error and one transaction-roll error. This was a rerun of the ten failed tests, not a new full -g auto run. But is it appropriate to do so? It does change the original semantics to some= degree =E2=80=94 is this the kind of change I shouldn't be the one submittin= g?