Re: [PATCH] lib: scatterlist: Fix sg_split_phys to preserve original scatterlist offsets
From: Andrew Morton
Date: Thu Mar 27 2025 - 14:50:53 EST
On Wed, 26 Mar 2025 14:13:02 +0530 T Pratham <t-pratham@xxxxxx> wrote:
> >> Is this merely from code inspection, or is this issues known to have
> >> observable runtime effects?
> >>
> >> If the latter, please provide a complete description.
> > Hi,
> >
> > I am using this function in a crypto driver that I'm currently
> > developing (not yet sent to mailing list). During testing, it was
> > observed that the output scatterlists (except the first one) contained
> > incorrect garbage data.
> >
> > I narrowed this issue down to the call of sg_split(). Upon debugging
> > inside this function, I found that this resetting of offset is the cause
> > of the problem, causing the subsequent scatterlists to point to
> > incorrect memory locations in a page. By removing this code, I am
> > obtaining expected data in all the split output scatterlists. Thus, this
> > was indeed causing observable runtime effects!
> >
> > Regards
> > T Pratham <t-pratham@xxxxxx>
>
> Hi Andrew,
>
> Do you need the above details to be incorporated into the commit message
> and be resent? Kindly let me know.
I pasted it into the changelog.
I also added cc:stable, as this might be affecting other drivers,
whether in-tree or out-of-tree.