mbox series

[v2,0/2] Fix mmap memory boundary calculation

Message ID 20240805102554.154464-1-andi.shyti@linux.intel.com (mailing list archive)
Headers show
Series Fix mmap memory boundary calculation | expand

Message

Andi Shyti Aug. 5, 2024, 10:25 a.m. UTC
Hi,

this series fixes the memory limits calculation (start, end), in
order to avoid access to addresses not belonging to the mapped
page.

This series has been reviewed in other communities but, because
it needs to go through drm-tip, I am proposing it again here in
the intel-gfx mailing list.

Thanks a lot Jann for your inputs and reviews.

Rodrigo, could you please restate your review tag? I'm just
waiting for your tag in patch 1 to get this series in.

Thanks,
Andi

Changelog from v1:
==================
 - Added Jonathan's and Jann's tags.
 - pfn is now calculated inside the set_address_limits() as
   suggested by Jonathan.

Andi Shyti (2):
  drm/i915/gem: Adjust vma offset for framebuffer mmap offset
  drm/i915/gem: Fix Virtual Memory mapping boundaries calculation

 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 64 +++++++++++++++++++++---
 1 file changed, 58 insertions(+), 6 deletions(-)

Comments

Andi Shyti Aug. 5, 2024, 10:05 p.m. UTC | #1
Hi Greg,

> Andi Shyti (2):
>   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
>   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation

I have forgotten to Cc the stable mailing list here. These two
patches need to be merged together even if only the second patch
has the "Fixes:" tag.

Is there anything I should still do here?

I could have used the "Requires:" tag, but the commit id would
change in between merges and rebases.

Andi
Greg KH Aug. 6, 2024, 6:38 a.m. UTC | #2
On Mon, Aug 05, 2024 at 11:05:22PM +0100, Andi Shyti wrote:
> Hi Greg,
> 
> > Andi Shyti (2):
> >   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
> >   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
> 
> I have forgotten to Cc the stable mailing list here. These two
> patches need to be merged together even if only the second patch
> has the "Fixes:" tag.
> 
> Is there anything I should still do here?
> 
> I could have used the "Requires:" tag, but the commit id would
> change in between merges and rebases.

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>
Andi Shyti Aug. 6, 2024, 9:46 a.m. UTC | #3
Hi Greg,

same question without the stable mailing list not to trigger the
automatic reply.

> Andi Shyti (2):
>   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
>   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation

I have forgotten to actually Cc the stable mailing list here.
These two patches need to be merged together even if only the
second patch has the "Fixes:" tag.

I could have used the "Requires:" tag, but the commit id would
change in between merges and rebases.

Is there anything I should still do here? Do you want me to
take care and send the backports for kernels starting from 4.19?

Thanks,
Andi
Joonas Lahtinen Aug. 6, 2024, 12:08 p.m. UTC | #4
Quoting Andi Shyti (2024-08-06 12:46:07)
> Hi Greg,
> 
> same question without the stable mailing list not to trigger the
> automatic reply.
> 
> > Andi Shyti (2):
> >   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
> >   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
> 
> I have forgotten to actually Cc the stable mailing list here.
> These two patches need to be merged together even if only the
> second patch has the "Fixes:" tag.
> 
> I could have used the "Requires:" tag, but the commit id would
> change in between merges and rebases.

The patches were the top two in drm-intel-gt-next and committed
only few hours ago so I fixed up the patches adding Cc: stable
and Requires:

Regards, Joonas

> 
> Is there anything I should still do here? Do you want me to
> take care and send the backports for kernels starting from 4.19?
> 
> Thanks,
> Andi
Jann Horn Aug. 9, 2024, 2:48 p.m. UTC | #5
On Tue, Aug 6, 2024 at 2:08 PM Joonas Lahtinen
<joonas.lahtinen@linux.intel.com> wrote:
> Quoting Andi Shyti (2024-08-06 12:46:07)
> > Hi Greg,
> >
> > same question without the stable mailing list not to trigger the
> > automatic reply.
> >
> > > Andi Shyti (2):
> > >   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
> > >   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
> >
> > I have forgotten to actually Cc the stable mailing list here.
> > These two patches need to be merged together even if only the
> > second patch has the "Fixes:" tag.
> >
> > I could have used the "Requires:" tag, but the commit id would
> > change in between merges and rebases.
>
> The patches were the top two in drm-intel-gt-next and committed
> only few hours ago so I fixed up the patches adding Cc: stable
> and Requires:

I'm not very familiar with how the DRM trees work - shouldn't fixes in
i915 go on the separate drm-intel-fixes branch so that they don't have
to wait for a merge window?
Jann Horn Aug. 9, 2024, 3:40 p.m. UTC | #6
On Fri, Aug 9, 2024 at 4:48 PM Jann Horn <jannh@google.com> wrote:
> On Tue, Aug 6, 2024 at 2:08 PM Joonas Lahtinen
> <joonas.lahtinen@linux.intel.com> wrote:
> > Quoting Andi Shyti (2024-08-06 12:46:07)
> > > Hi Greg,
> > >
> > > same question without the stable mailing list not to trigger the
> > > automatic reply.
> > >
> > > > Andi Shyti (2):
> > > >   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
> > > >   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
> > >
> > > I have forgotten to actually Cc the stable mailing list here.
> > > These two patches need to be merged together even if only the
> > > second patch has the "Fixes:" tag.
> > >
> > > I could have used the "Requires:" tag, but the commit id would
> > > change in between merges and rebases.
> >
> > The patches were the top two in drm-intel-gt-next and committed
> > only few hours ago so I fixed up the patches adding Cc: stable
> > and Requires:
>
> I'm not very familiar with how the DRM trees work - shouldn't fixes in
> i915 go on the separate drm-intel-fixes branch so that they don't have
> to wait for a merge window?

Ah, nevermind, I see it is already in drm-intel-fixes. Sorry for the noise.
Joonas Lahtinen Aug. 12, 2024, 9:18 a.m. UTC | #7
Quoting Jann Horn (2024-08-09 18:40:45)
> On Fri, Aug 9, 2024 at 4:48 PM Jann Horn <jannh@google.com> wrote:
> > On Tue, Aug 6, 2024 at 2:08 PM Joonas Lahtinen
> > <joonas.lahtinen@linux.intel.com> wrote:
> > > Quoting Andi Shyti (2024-08-06 12:46:07)
> > > > Hi Greg,
> > > >
> > > > same question without the stable mailing list not to trigger the
> > > > automatic reply.
> > > >
> > > > > Andi Shyti (2):
> > > > >   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
> > > > >   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
> > > >
> > > > I have forgotten to actually Cc the stable mailing list here.
> > > > These two patches need to be merged together even if only the
> > > > second patch has the "Fixes:" tag.
> > > >
> > > > I could have used the "Requires:" tag, but the commit id would
> > > > change in between merges and rebases.
> > >
> > > The patches were the top two in drm-intel-gt-next and committed
> > > only few hours ago so I fixed up the patches adding Cc: stable
> > > and Requires:
> >
> > I'm not very familiar with how the DRM trees work - shouldn't fixes in
> > i915 go on the separate drm-intel-fixes branch so that they don't have
> > to wait for a merge window?
> 
> Ah, nevermind, I see it is already in drm-intel-fixes. Sorry for the noise.

Yeah, the DRM subsystem has a rather specific process.

Jann, do you consider the fix released already now that it is in -rc3 or will
you start the 30 day count from when 6.11 gets released? I hope the latter,
but just want to make sure there are no surprises.

Regards, Joonas
Jann Horn Aug. 12, 2024, 12:30 p.m. UTC | #8
On Mon, Aug 12, 2024 at 11:19 AM Joonas Lahtinen
<joonas.lahtinen@linux.intel.com> wrote:
> Quoting Jann Horn (2024-08-09 18:40:45)
> > On Fri, Aug 9, 2024 at 4:48 PM Jann Horn <jannh@google.com> wrote:
> > > On Tue, Aug 6, 2024 at 2:08 PM Joonas Lahtinen
> > > <joonas.lahtinen@linux.intel.com> wrote:
> > > > Quoting Andi Shyti (2024-08-06 12:46:07)
> > > > > Hi Greg,
> > > > >
> > > > > same question without the stable mailing list not to trigger the
> > > > > automatic reply.
> > > > >
> > > > > > Andi Shyti (2):
> > > > > >   drm/i915/gem: Adjust vma offset for framebuffer mmap offset
> > > > > >   drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
> > > > >
> > > > > I have forgotten to actually Cc the stable mailing list here.
> > > > > These two patches need to be merged together even if only the
> > > > > second patch has the "Fixes:" tag.
> > > > >
> > > > > I could have used the "Requires:" tag, but the commit id would
> > > > > change in between merges and rebases.
> > > >
> > > > The patches were the top two in drm-intel-gt-next and committed
> > > > only few hours ago so I fixed up the patches adding Cc: stable
> > > > and Requires:
> > >
> > > I'm not very familiar with how the DRM trees work - shouldn't fixes in
> > > i915 go on the separate drm-intel-fixes branch so that they don't have
> > > to wait for a merge window?
> >
> > Ah, nevermind, I see it is already in drm-intel-fixes. Sorry for the noise.
>
> Yeah, the DRM subsystem has a rather specific process.
>
> Jann, do you consider the fix released already now that it is in -rc3 or will
> you start the 30 day count from when 6.11 gets released? I hope the latter,
> but just want to make sure there are no surprises.

I will count the issue as fixed and start the 30 day count starting
from when a fix lands in any upstream release - either a mainline
release or a stable release. Since the fix has now been queued up for
6.6 and 6.10, I expect that to happen in a few days.