From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B8600352C39 for ; Tue, 24 Mar 2026 19:12:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774379545; cv=none; b=V91RlLytcpWWgySyKegRC6tNHvAxl1xL+pkCPeplQ3SkBP6mlW9aanxjgsAhjIwQV2l6/kFs7Qv1Lm955eCLO1t7tgLGAJM2lcjkhygHaNZCgczWSv+bdBkH1DKmhdB/Zr7vp7l4kU8zdk/RcqI8rM2IeRaoMIOTMD1yNbR9OGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774379545; c=relaxed/simple; bh=JYwpm7xWcBPTEZEFJrn1nve4OhheMg8a2qenc2pJAkI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=VrAT5PoPTmidXaBf4knn9YmqM8uZTWPgjLbUSAvB1nyvtID8uJkScxpYp6w2s1iCPqzXbNeNnvzuGHfXQzRPR/meZOD6IzfRCgC3WgfJXWHcoCTa7z/k+ZUpJmayMkJ0QN2w6efYgP40/hvN1pHp8BebgDx5lEk/BekGS67E9Fg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=I/BULYD8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="I/BULYD8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28886C19424; Tue, 24 Mar 2026 19:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774379545; bh=JYwpm7xWcBPTEZEFJrn1nve4OhheMg8a2qenc2pJAkI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=I/BULYD8A0tOJuckQCnR1jZ90RKv2fCChJ896VaEzt15+wt7laI832Qe7RtggD9Y0 M3fd6S5+QcQ/oqZNMlfYOuqLZ7QfdkBFF6RCjJs796GVggtHHxYqW8kuNMDlK7SF23 D7Utfbe3Ic4sAs4e8pTcRpwjAZEgaD/P69kLdNUE= Date: Tue, 24 Mar 2026 12:12:24 -0700 From: Andrew Morton To: "Christian A. Ehrhardt" Cc: linux-kernel@vger.kernel.org, David Howells , Kees Cook , Petr Mladek , David Gow Subject: Re: [PATCH RESEND 3/3] lib: Fix length calculation in extract_kvec_to_sg Message-Id: <20260324121224.c7efad04eafeead81aead946@linux-foundation.org> In-Reply-To: <20260323212350.807118-4-lk@c--e.de> References: <20260323212350.807118-1-lk@c--e.de> <20260323212350.807118-4-lk@c--e.de> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 23 Mar 2026 22:23:50 +0100 "Christian A. Ehrhardt" wrote: > When extracting from a kvec to a scatterlist, do not > cross page boundaries. The required length is already > calculated but not used as intended. > > The previous changes to the kunit_iov_iter.c demonstrate > that the patch is necessary. Thanks. > Cc: David Howells > Cc: Andrew Morton > Cc: stable@vger.kernel.org # v6.5+ Could we please have a description of the userspace-visible impact? To help others understand why we're proposing a backport, > --- a/lib/scatterlist.c > +++ b/lib/scatterlist.c > @@ -1249,7 +1249,7 @@ static ssize_t extract_kvec_to_sg(struct iov_iter *iter, > else > page = virt_to_page((void *)kaddr); > > - sg_set_page(sg, page, len, off); > + sg_set_page(sg, page, seg, off); > sgtable->nents++; > sg++; > sg_max--; I'm thinking the series should be split up - this patch for 7.0-rcX and -stable, the kunit changes for 7.0-rcX. Or do you think we should -stableize the kunit changes also? Or we put it all into 7.0-rcX and let the -stable patch trickle back later on. After all, 018584697533 was a couple of years ago. It's hard to decide on these things without that userspace-visible impact thing!