From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.177 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796450140; b=OjojCTeNs6pHuKiFln1qAEAv6ItHfc/HGszKze0Z4si2K5gKuKTXFK4898SJlwVyBNN1 3F/AqUroPsOhSsYf6opFHwfueLkXGqIu3nYMU247cCoAJ/1eifTjOjwO/IR78ywbdwcJ3 GEG+bTIXzX+kDYcSae/1ZVQ6mcjXAnSYW35pHHwIx6tAHlsk4dTfvELTBc1/bEpe9hITL l0tB1PBVpMR4YDc+NePmirrvIlWsQlEGn0sLNhnF/O8JU/A1VsD9KPy8bMkpSZ11HWjg6 w2YZXaxCcIMUVC13juPXA+uriIzG4TMi9APpMdVXUF789BKpxkflFUgeqU6PqlDFQyA== 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-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=BYU2MUnCfQA6TsT7sXm4smmluYKWDbgDgmijK7S/6+y1lCUE7jWa2eNWxjkxBuy0fhqF wrsNytITC0IzDv4Td65Jx+y2s1qLBECd7RWdZ/fwFxVFWTZFfAgRT+P2DWxgnxmInhY7H HkstEMTVTLE8UH4xBxdxM6EfGp6erJYn3jLxB6RJdEUHNLa/URFGRL91PkLEKSaO2QXUB 3lNACBKOJB7Ib4Rr42sfl4CDv1jYcVTo3FVepsC+nHS01wiZr9RZZvVopSTmrqx/sG1e8 uLZdSoXL6YBhBW5GV5KjYhgCAnRBFN0o3NW+cEjeLYePopBQG3AZ3ji0m7KeHxFTZoA== 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.177 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 D421C606A32D for ; Sat, 5 Dec 2026 05:55:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D421C606A32D 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-f177.google.com with SMTP id d9443c01a7336-2f04bea9a93so16798505ad.3 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=jJTVQnxOZGTX93+ZFRgeqnIeHBzgL/Sz2aqW/nbn26PYeBePJzMuGR4lLzej0ZuhZ8 n3BVIyxGihbMnP2GozaPaDVxSiHixKtVWy33xNBrI3Yi3jzhY82/SgkkCeB9L+4rxvUk tY2czgy3gD6ap9PmASz5rDU9JUbxFw5plP1HlSnDFjOfd6P0sYGG+c6ePa8z13i70ddh 03e6+wKmL+0c22mUgbm99iIkSidYePBq3wczrWnxDAi2nq7AU8ctZt9JDIdV4Rzj/w2T 89c/l6IyjVtAPdWoUhg0NYayXoliHyqCz0+SVudNh3A3tyHjwjy0fdkttf3CEIdF7x9Z p75w== X-Gm-Message-State: AB4q+uEcyWrSY2MZSNWAzwH1EWkNF003+gG6/RpS5yfP84omHK3HeEo9 aQSO3aXSeTRJ4FQB9DMLxTUuE3HV0cdTQy/dzpEMuAgKJ/B3G0UrxJOpjh453A== X-Gm-Gg: AZFdTZdlV5FtNTcRY/Hl2Jg1sZ6j+Z7802yKs0Lwo9Rl2fhcnzkfmst/dJESpU6epNH tHZjIFHL8wHZuZSIyhr9K04SMy19VCE2G+GOcdk+VJoxRcX3EQSticbfs8XAEbz2hjBNMhvkhE7 OE9noOKCTBxrzCA4QvlPTodq5pCBzKsdvoeeQmw6k1Lola5uCvqRBq9Iw6fDZdzNfhk9Kykd3OB arMssvfjgSlpTdmeOgjWaB7T5pk2me9HNz3IBSw8aiN+1t3SoFreo8ltP6D80SSocdTjv5w3OQF 7u7Hu2kHPHaNhQpYEVsVm0BcEusXz5sHl951dbW4VP6jwvdDeqFugAR75forCm+a8tJu4JiuQWI CTncF9Nwk0wPlhFXgzVydebMr3v9jcdx0TYFyF6vT6WL6ZtKqFHEzhhvBpZxBtgW+BLXO7tIyLe yXbJi5aRbD1gw9g+wwYjVBhoRa6Xjq0d4M9ziimshPacqhPsruXW1KJyhew6adb9cg72fJES7Do IFHvaXXBi6XWQai/jtv6VPhRi/o8iwXuZ/yviIwroOliWrS+ItiI/sCaD6syfDMA+gtTfjaXPRT PQG4/vQMbjK5W3PIDFGX3niwhRlDFMVhZ5ioH+eTcGUm/aI= 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-xfs@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?