Re: Regression in backport MEMREAD ioctl ? [Was: Re: mt7622: belkin-rt3200: r22602-42eeb22450: Kernel panic: kernel stack overflow]

2023-04-29 Thread Michał Kępień via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
> > https://github.com/openwrt/openwrt/pull/12472
> 
> thanks a lot for your attempt, but unfortunately it didn't fixed the issue. 
> 
> I've tried to revert commit fa4dc86 ("kernel: backport MEMREAD ioctl") and
> that fixed the issue as Felix already hinted.

Just to close the loop here: a different fix has been prepared that
replaces recursion with iteration in the mtk_bmt driver:

https://github.com/openwrt/openwrt/pull/12494

This revised fix appears to be working:

https://github.com/openwrt/openwrt/pull/12472#issuecomment-1525636591

-- 
Best regards,
Michał Kępień


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Regression in backport MEMREAD ioctl ? [Was: Re: mt7622: belkin-rt3200: r22602-42eeb22450: Kernel panic: kernel stack overflow]

2023-04-24 Thread Petr Štetiar
Michał Kępień  [2023-04-24 10:27:48]:

Hi Michał,

> > > Since the panic message includes mentions of a stack overflow, another
> > > idea would be to backport this upstream patch as well:
> > > 
> > >  
> > > https://lore.kernel.org/linux-mtd/20230417205654.1982368-1-a...@kernel.org/
> > > 
> > > This patch has been reviewed, but it has not yet been merged anywhere.
> > 
> > Please send a patch to the openwrt mailing list or create a pull request on
> > github.
> 
> https://github.com/openwrt/openwrt/pull/12472

thanks a lot for your attempt, but unfortunately it didn't fixed the issue. 

I've tried to revert commit fa4dc86 ("kernel: backport MEMREAD ioctl") and
that fixed the issue as Felix already hinted.

Cheers,

Petr

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Regression in backport MEMREAD ioctl ? [Was: Re: mt7622: belkin-rt3200: r22602-42eeb22450: Kernel panic: kernel stack overflow]

2023-04-24 Thread Michał Kępień via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
> > Since the panic message includes mentions of a stack overflow, another
> > idea would be to backport this upstream patch as well:
> > 
> >  
> > https://lore.kernel.org/linux-mtd/20230417205654.1982368-1-a...@kernel.org/
> > 
> > This patch has been reviewed, but it has not yet been merged anywhere.
> 
> Please send a patch to the openwrt mailing list or create a pull request on
> github.

https://github.com/openwrt/openwrt/pull/12472

-- 
Best regards,
Michał Kępień


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Regression in backport MEMREAD ioctl ? [Was: Re: mt7622: belkin-rt3200: r22602-42eeb22450: Kernel panic: kernel stack overflow]

2023-04-21 Thread Hauke Mehrtens

On 4/21/23 15:17, Michał Kępień wrote:

Hi Petr,


Since the crash happens right after snand driver initialization, I think the
most likely candidate is this one:
fa4dc86e9808 kernel: backport MEMREAD ioctl

Maybe there are still some stack declarations of struct mtd_oob_ops left
that aren't fully initialized.


thanks for looking into that Felix, Michał any idea what might be wrong here?


I remember looking for uninitialized fields in all existing instances of
struct mtd_oob_ops in version 5.15.98 of the Linux kernel source tree
while preparing the MEMREAD backports.  However, it did not occur to me
to check OpenWRT-specific patches in the same way (sorry!) - and a naïve
search uncovers these two locations:

 $ git grep -E 'struct mtd_oob_ops [^=*{}]+;' -- 
':!target/linux/generic/backport-5.15/'
 
package/boot/uboot-mediatek/patches/100-07-mtd-nmbm-add-support-for-mtd.patch:+ 
struct mtd_oob_ops ops;
 
package/boot/uboot-mediatek/patches/100-07-mtd-nmbm-add-support-for-mtd.patch:+ 
struct mtd_oob_ops ops;
 
package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch:+
 struct mtd_oob_ops ops;


These patches are applied to U-Boot and not the kernel. The 
"fa4dc86e9808 kernel: backport MEMREAD ioctl"  change only changes he 
kernel.




Since the panic message includes mentions of a stack overflow, another
idea would be to backport this upstream patch as well:

 https://lore.kernel.org/linux-mtd/20230417205654.1982368-1-a...@kernel.org/

This patch has been reviewed, but it has not yet been merged anywhere.


Please send a patch to the openwrt mailing list or create a pull request 
on github.


hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Regression in backport MEMREAD ioctl ? [Was: Re: mt7622: belkin-rt3200: r22602-42eeb22450: Kernel panic: kernel stack overflow]

2023-04-21 Thread Michał Kępień via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Hi Petr,

> > Since the crash happens right after snand driver initialization, I think the
> > most likely candidate is this one:
> > fa4dc86e9808 kernel: backport MEMREAD ioctl
> > 
> > Maybe there are still some stack declarations of struct mtd_oob_ops left
> > that aren't fully initialized.
> 
> thanks for looking into that Felix, Michał any idea what might be wrong here?

I remember looking for uninitialized fields in all existing instances of
struct mtd_oob_ops in version 5.15.98 of the Linux kernel source tree
while preparing the MEMREAD backports.  However, it did not occur to me
to check OpenWRT-specific patches in the same way (sorry!) - and a naïve
search uncovers these two locations:

$ git grep -E 'struct mtd_oob_ops [^=*{}]+;' -- 
':!target/linux/generic/backport-5.15/'

package/boot/uboot-mediatek/patches/100-07-mtd-nmbm-add-support-for-mtd.patch:+ 
struct mtd_oob_ops ops;

package/boot/uboot-mediatek/patches/100-07-mtd-nmbm-add-support-for-mtd.patch:+ 
struct mtd_oob_ops ops;

package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch:+
 struct mtd_oob_ops ops;

Both structures in the first patch are zeroed out using memset() after
they are declared, so that's fine, but the one in the second patch
isn't.

Given that MediaTek hardware is involved here, this sounds like a solid
lead.  Updating 100-11-env-add-support-for-NMBM-upper-MTD-layer.patch so
that the line quoted above says this instead:

struct mtd_oob_ops ops = {};

would be my first suggestion.

Since the panic message includes mentions of a stack overflow, another
idea would be to backport this upstream patch as well:

https://lore.kernel.org/linux-mtd/20230417205654.1982368-1-a...@kernel.org/

This patch has been reviewed, but it has not yet been merged anywhere.

Hope this helps,

-- 
Best regards,
Michał Kępień


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel