Skip to content
  • Guillaume Nault's avatar
    ipmr: Fix skb headroom in ipmr_get_route(). · 7901cd97
    Guillaume Nault authored
    In route.c, inet_rtm_getroute_build_skb() creates an skb with no
    headroom. This skb is then used by inet_rtm_getroute() which may pass
    it to rt_fill_info() and, from there, to ipmr_get_route(). The later
    might try to reuse this skb by cloning it and prepending an IPv4
    header. But since the original skb has no headroom, skb_push() triggers
    skb_under_panic():
    
    skbuff: skb_under_panic: text:00000000ca46ad8a len:80 put:20 head:00000000cd28494e data:000000009366fd6b tail:0x3c end:0xec0 dev:veth0
    ------------[ cut here ]------------
    kernel BUG at net/core/skbuff.c:108!
    invalid opcode: 0000 [#1] SMP KASAN PTI
    CPU: 6 PID: 587 Comm: ip Not tainted 5.4.0-rc6+ #1
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-2.fc30 04/01/2014
    RIP: 0010:skb_panic+0xbf/0xd0
    Code: 41 a2 ff 8b 4b 70 4c 8b 4d d0 48 c7 c7 20 76 f5 8b 44 8b 45 bc 48 8b 55 c0 48 8b 75 c8 41 54 41 57 41 56 41 55 e8 75 dc 7a ff <0f> 0b 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
    ...
    7901cd97