Re: Re: [PATCH v4] PCI: rcar-ep: Fix the issue of the name parameter when calling devm_request_mem_region

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Wed, Jan 8, 2025 at 11:57 AM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > From: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
> > On Wed, Jan 8, 2025 at 10:45 AM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > > > From: kingdix10@xxxxxx <kingdix10@xxxxxx>
> > > > Sent: 08 January 2025 04:59
> > > > Subject: Re: Re: [PATCH v4] PCI: rcar-ep: Fix the issue of the name
> > > > parameter when calling devm_request_mem_region
> > > >
> > > > On Tue, 2025-01-07 at 16:56 -0600, Bjorn Helgaas wrote:
> > > > > On Tue, Jan 07, 2025 at 09:51:23PM +0800, kingdix10@xxxxxx wrote:
> > > > > > From: King Dix <kingdix10@xxxxxx>
> > > > > >
> > > > > > When using devm_request_mem_region to request a resource, if the
> > > > > > passed variable is a stack string variable, it will lead to an
> > > > > > oops issue when executing the command cat /proc/iomem.
> > > > > >
> > > > > > Fix this by replacing outbound_name with the name of the
> > > > > > previously requested resource.
> > > > >
> > > > > Thanks a lot for doing this work!
> > > > >
> > > > > Add "()" after function names in subject and commit log.
> > > > >
> > > >
> > > > Thanks for your review. I will fix the issue right now.
> > > >
> > > > > Please include a couple lines of the oops message to help people
> > > > > connect the problem with the fix.
> > >
> > > Maybe Prabhakar should be able to provide Oops log, as it is tested on real platform??
> > >
> > It doesn't Oops out, it just prints a null string. Below are the logs from RZ/G2M:
> >
> > $  cat /proc/iomem
> > 30000000-37ffffff :
> > 38000000-3fffffff :

Prabhakar's original email showed garbage here.
Looks like your mailer removed it...

> Before patch:
>
> fe000000-fe07ffff : fe000000.pcie-ep apb-base
> fe100000-fe1fffff :
> fe200000-fe3fffff :

Same here.

> After applying the patch:
> fe000000-fe07ffff : fe000000.pcie-ep apb-base
> fe100000-fe1fffff : memory0
> fe200000-fe3fffff : memory1
>
> kingdix10@xxxxxx, maybe you need to update commit description referring oops.

Depending on the data found in memory at the time of printing, the
output will be different.  I guess it might still crash in the (very
unlikely) case that no NUL-terminator is found, and the string iterator
will access unmapped memory above the stack.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux