From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796362436; b=KyB5YamS8LAYB56yO6p+3bg26shNZtPmedOMfNWHSo7634QtVC6BBSBKqrBNGOYCbFQO PexReYWsmO/Wf6fFlHUZBs6cIGCrLVcu7hyv4xfqbrkpMubZfxYEKDOTE4D5a7VGuHDB8 TQmk9LOz30ambFAraxg0zQabV2a7S+JwNbvEQtXMe4BI3JoeieWAUfEiggXMMe/auIcmZ 5qef3h8FaMh8590hGo2LLJh7qrLukvn5ARKlB3Zoiw5RRM42oM5qxXCZM2nT3moR+Z/Cu rsZFqhnUaBq25wgX3rDGegimMpE9L/W3+igTuBq/uJ4lPZefLUW1NJmpu5HTA+AkMng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796362436; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ce5zwoI7A6AG+ASEXsfHujUjqBaL5L83DDkl4qJFOb8=; b=F9RxtW90rvojSafIG2vb1wBbnjUK/0pZi89czmvyV+qWy1IbsY83Ti761v3c5Q8wE8+d JzqTiHvh5KTAXB1U7mcYGWhi2AC++eLhfkoM7ycYjt/rPEhPx7K9bLLqnbTgmWseFdfH2 SCLlpaYwKaPEtue08/Fe6bACch2gC4ZeTI6AiyqkvutUwyRbwFT7Atl5tFJXk0zGqAgsa DmYIv/BzreiktlK0KnfA5W8JaNkqHROsevjtKpXcHbCxAaHs8XVM0/tlinBrf1d1+bIXt sCH4MTFHMEnbrvZZekpdOnkQD4m2A2HdUGEVeZxoBPgx0uz3xShb6c42hA2XvU5RCfw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Bpxp66Gs; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C04EE606A322 for ; Fri, 4 Dec 2026 05:33:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Bpxp66Gs Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCD1A1F000C2; Fri, 4 Dec 2026 05:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796362436; bh=ce5zwoI7A6AG+ASEXsfHujUjqBaL5L83DDkl4qJFOb8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Bpxp66GssTZaKReasn12qoXngUC95CCSUoUMFY0T++HG3dDZ58ctRTVsw20RaoK/R jMxpG1Yfn9zdovgaI47ZKEuM7syH9oN5OWRY96IsFQmeYmq9640m7sMDoMAA8oxmO4 qlJu2yn2Z85vsC1PBP5hwhCtHyBnM4r31eD9UPJRf0G9hnUzuzyui3GwHEiMYv+QI8 H3t0zy40DO0sOytrscCOBx6z8dgqe0H8lbTT0EUzzmzYO4ts5jDpGrgK8mVc4FVXUD cwrn5jjhqdGu/2+0xcDJIu0dqa+Lp6hUJHDxp2zoIC5yGm+Nq4J+Y+dZb2BKowirsp KQjokYvdEUPQA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v3 3/3] dm-verity: avoid corruption policy during FEC erasure lookup Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?5ZGo5Lyf5rGfIChXZWlqaWFuZyBaaG91KQ==?= , "Eric Biggers" , "Mikulas Patocka" Cc: =?utf-8?b?ZG0tZGV2ZWxAbGlzdHMubGludXguZGV2?= , =?utf-8?b?c2FtaXRvbHZhbmVuQGdvb2dsZS5jb20=?= , =?utf-8?b?YWdrQHJlZGhhdC5jb20=?= , =?utf-8?b?c25pdHpl?= =?utf-8?b?ckBrZXJuZWwub3Jn?= , =?utf-8?b?Ym1hcnpp?= =?utf-8?b?bnNAcmVkaGF0LmNvbQ==?= , =?utf-8?b?6YeR?= =?utf-8?b?57qi5a6HIChIb25neXUgSmluKQ==?= , =?utf-8?b?5ZC056Wl56aEIChYaWFuZ2x1IFd1KQ==?= , =?utf-8?b?5ZC05ZGo6ZWcIChKdXN0aW4gV3Up?= , =?utf-8?b?6IC/5oWI54aZIChDaXhpIEdlbmcvMTAwMzkp?= In-Reply-To: References: <5188c1e8-c08a-2a56-7e4c-1d84aba4df35@redhat.com> <179436615557.34024.8414792860115638345@unisoc.com> <20261113053639.GA76778@sol> <6b4ac19a42ce4297ae89ae0ae2fea674@zeshmbx08.spreadtrum.com> <20261202190429.GC338490@google.com> <35bcc428f6c0956f414a394d333e8e63@zeshmbx08.spreadtrum.com> <6e1ac631ecc44f41a38e8734cfffaca6@zeshmbx08.spreadtrum.com> <20261203184146.GC2267@sol> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 05:33:55 +0000 X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] dm-verity: changelog and fec_read_bufs() comment misattribute I/O errors - [Low] dm-verity: missing Fixes trailer for commit a739ff3f543a -- commit d8c123c7e724990ed762b6e89229b7699e6da1fb Author: =E5=91=A8=E4=BC=9F=E6=B1=9F (Weijiang Zhou) > dm-verity: avoid corruption policy during FEC erasure lookup > > fec_read_bufs() walks the hash tree through verity_hash_for_block() > only to find out which blocks of the RS codeword are erasures. That > walk is speculative: a verification failure only means that erasure > information is unavailable, yet it goes through verity_handle_err(), so > an I/O error during the walk triggers the corruption policy - a restart > or panic - instead of degrading to correction without erasure > information. > > Add a per-I/O erasure lookup flag to dm_verity_io, initialize it in > verity_map(), and set it only around the synchronous hash tree walk in > fec_read_bufs(). While the flag is set, a speculative verification > failure returns -EIO without invoking the corruption policy or > recording a mismatch. Real corruption found on the normal verification > path is still handled as before. > > Signed-off-by: weijiang.zhou [Severity: Low] This looks like a bug fix for FEC erasure lookups invoking verity_handle_err(). Should this include: Fixes: a739ff3f543a ("dm verity: add support for forward error correction= ") > diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c > index 396fe5e3db858..bab2fdc8b6f33 100644 > --- a/drivers/md/dm-verity-fec.c > +++ b/drivers/md/dm-verity-fec.c [ ... ] > @@ -227,20 +227,30 @@ static int fec_read_bufs(struct dm_verity *v, struc= t dm_verity_io *io, > } > =20 > /* locate erasures if the block is on the data device */ > - if (bufio =3D=3D v->fec->data_bufio && > - verity_hash_for_block(v, io, block, want_digest, > - &is_zero) =3D=3D 0) { > - /* skip known zero blocks entirely */ > - if (is_zero) > - goto done; > - > + if (bufio =3D=3D v->fec->data_bufio) { > /* > - * skip if we have already found the theoretical > - * maximum number (i.e. fec->roots) of erasures > + * This hash tree walk is speculative: a failure only > + * means erasure information is unavailable. Suppress > + * the corruption policy while it runs, so that an > + * I/O error here cannot restart or panic the system. > */ > - if (neras && *neras < v->fec->roots && > - fec_is_erasure(v, io, want_digest, bbuf)) > - fio->erasures[(*neras)++] =3D i; > + io->fec_erasure_lookup =3D true; > + r =3D verity_hash_for_block(v, io, block, want_digest, > + &is_zero); > + io->fec_erasure_lookup =3D false; [Severity: Low] Is the reference to I/O errors accurate here and in the commit message? In verity_verify_level(), hash block read I/O errors return ERR_PTR() from dm_bufio_read_with_ioprio() and take the IS_ERR(data) branch, returning without calling verity_handle_err() or checking io->fec_erasure_lookup. The new io->fec_erasure_lookup check is only reached after the read succeeds and verity_hash() finds a metadata digest mismatch, such as a corrupted hash block while recursive FEC is blocked. Also, fec_read_bufs() walks the hash tree on the first pass when neras is NULL to identify zero blocks, not solely to locate erasures. Updating the comment and commit message to describe metadata hash verification mismatches would make this accurate. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/f55322e3a71277d9274= 76ddb372064e0@zeshmbx08.spreadtrum.com?part=3D3