Subject: Re: [syzbot] [net?] Internal error in ipvlan_get_L3_hdr

From: "Russell King (Oracle)" <[email-masked]>
Date: Wed, 14 Jun 2023 10:44:08 +0100

On Wed, Jun 14, 2023 at 10:49:16AM +0200, Dmitry Vyukov wrote:
> On Wed, 14 Jun 2023 at 09:35, syzbot
> <[email-masked]> wrote:
> >
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit:    33f2b5785a2b Merge tag 'drm-fixes-2023-06-09' of git://ano..
> > git tree:       upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=1749d065280000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=869b244dcd5d983c
> > dashboard link: https://syzkaller.appspot.com/bug?extid=96a7f60bd78d03b6b991
> > compiler:       arm-linux-gnueabi-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> > userspace arch: arm
> 
> +arm maintainers
> 
> #syz set subsystems: arm
> 
> ip6_output() is recursed 9 times in the stack.
> 
> Eric pointed out that:
> 
> #define MAX_NEST_DEV 8
> #define XMIT_RECURSION_LIMIT    8
> 
> So net stack can legitimately do this recursion and arm stack is 2x
> smaller than x86_64 stack (8K instead of 16K).
> 
> Should arm stack be increased? Or MAX_NEST_DEV/XMIT_RECURSION_LIMIT
> reduced for arm?

Do we guarantee that order-2 allocations will succeed on a 4k page-
sized system? It seems it would be a doubling of the chances of
failure.

Another solution would be to use vmalloc, but then I'd start to
worry about vmalloc space. With a 16k vmalloc allocation (plus
guard page and alignment) that'll be 32k per thread, and 32k
threads would be 512M, which for a 3G:1G user/kernel split is
too way too big, so I don't think vmalloc is an option.

Is there nothing that net can do to reduce its stack usage?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!