From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 72EF43537ED for ; Tue, 24 Mar 2026 20:41:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774384915; cv=pass; b=cvsNYUZZV7ac6u//ZJywDz3KtfeLpa11MPkqCV+l9kk9csSCnvClGIBUh0t54KJsFpkkWxZehPAA0NAVeefmOrHmKVblcuxXAbGGgYGfWtGd3tK+T45zlJk9YoyJ0SukYjn1TolGmqcm0SnFtgTMCT/daBeWUTTf26snhU/nqUs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774384915; c=relaxed/simple; bh=5blVK14x8Lihzg5spk91t7mq2piZufJgptDciWj1X90=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=sTStWVocyDZG/DEBu2pVr7LPSxRbXtLMrBJSjuzP8lRqDy1gsqSLYndaZRdiHaHueywKxRfet8mWvraOZYYL9s79FeZY2+NvdEAOeo7rtPLc8EBdv3kpFHh2E1Cxd/ErHbMEjQcNGj1FPu0CXj1/xznjafd5D+qlCXYjJiq334Q= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=eNTgtjdK; arc=pass smtp.client-ip=136.143.169.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="eNTgtjdK" ARC-Seal: i=1; a=rsa-sha256; t=1774384898; cv=none; d=zohomail.eu; s=zohoarc; b=HMrMWtUvAqVn2S32irYh9sXEDyYDpHrAhIhrXOqkHwhies+iTCwk3jVBhoENur6jCTjcPWGnnPIFrlmJcde2dNsKE7VfR4Xc6FhD1Ud1PxPFmHtFfmnGEnl3VZEQWTJEQmwVGB8A6WR9NaphmhPJMIP2I280RQF/CtA9fEMBqM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1774384898; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=wuVyzBxXaGgcQ5ejN0LoDAtk1DkmHgkxComQCzj/jWQ=; b=hacwnOk83C+Qpj1V650gdo1/fCyQKWQKlUB2uYccBXW07yBxDDteWp15K4UOwQWTmOM2dF2GbmWZytFThiV04ukeHIPafwHDOf9rwBz9GNrjj1aEpYVKQ4BbxgupXpWv7VJQWRvB12UwkLn6et+VJGVxLgU7/3EfL2RhKiheUWA= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1774384898; s=zmail; d=objecting.org; i=objecting@objecting.org; h=Date:Date:From:From:To:To:CC:Subject:Subject:In-Reply-To:References:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=wuVyzBxXaGgcQ5ejN0LoDAtk1DkmHgkxComQCzj/jWQ=; b=eNTgtjdKGTE9Ri8wCmdTuRf6Xh1tdFIMWRKXxnQwt3pcbep/BEiiIM/0Jk4+8x03 ym9tJt/f7wOHI1TerMf9QNbO/v3Z8MSsRh4vD0ocVKK9zRAVzps8DqkajEE+Db9oXHj Sk/gZiT4OIpbewC0dzGig/jC6GgliZRGMhM1vs7o= Received: by mx.zoho.eu with SMTPS id 1774384895523859.9905744009749; Tue, 24 Mar 2026 21:41:35 +0100 (CET) Date: Tue, 24 Mar 2026 20:41:33 +0000 From: Josh Law To: "Christian A. Ehrhardt" , linux-kernel@vger.kernel.org, Andrew Morton , David Howells CC: Kees Cook , Petr Mladek , David Gow Subject: Re: [PATCH v2 0/3] Fix length calculation bug in extract_kvec_to_sg User-Agent: Thunderbird for Android In-Reply-To: <20260324203453.810499-1-lk@c--e.de> References: <20260324203453.810499-1-lk@c--e.de> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External On 24 March 2026 20:34:50 GMT, "Christian A=2E Ehrhardt" wr= ote: >There is a bug in extract_kvec_to_sg() where the length >of a scatterlist segment is miscalculated=2E The actual fix >is a one-liner and it is quite obvious from reading the >code that this is what was intened=2E > >As this is a core library function this series first adds >test cases to the kunit_iov_iter test that demonstrate that >there is a bug before actually fixing it in the last commit=2E > >The bug was orignally introduced into kernel v6=2E3 where the >function lived in fs/netfs/iterator=2Ec=2E It was later moved >to lib/scatterlist=2Ec in v6=2E5=2E Thus the actual fix is only >marked for backports to v6=2E5+=2E > >--- >Changes in v2: >Addresss valid issues raised by AI review >https://sashiko=2Edev/#/patchset/20260323212350=2E807118-1-lk@c--e=2Ede: >- Add kunit assertions for OOM conditions in the test >- Reorder commits=2E >- Fix sg_max =3D=3D 0 case=2E >- Fix return value if we run out of sg entries=2E >- Adjust tests to catch these cases, too=2E >--- > >Christian A=2E Ehrhardt (3): > lib: kunit_iov_iter: Improve error detection > lib: kunit_iov_iter: Add tests for extract_iter_to_sg > lib: Fix length calculation in extract_kvec_to_sg > > lib/scatterlist=2Ec | 2 +- > lib/tests/kunit_iov_iter=2Ec | 147 ++++++++++++++++++++++++++++++++++++- > 2 files changed, 147 insertions(+), 2 deletions(-) > Hello again Christian! Great job fixing those AI reviews! Those are sometimes important, And your= code is completely solid, i personally tested it all for you :)=20 Cc: Stable is also justified I will add what was good about this code on the respective threads Whole series:=20 Reviewed-by: Josh Law Tested-By: Josh Law V/R Josh Law