1. 25 Jan, 2021 7 commits
  2. 18 Jan, 2021 2 commits
    • Lorenzo Bianconi's avatar
      mt76: mt7663s: fix rx buffer refcounting · 952de419
      Lorenzo Bianconi authored
      Similar to mt7601u driver, fix erroneous rx page refcounting
      
      Fixes: a66cbdd6 ("mt76: mt7615: introduce mt7663s support")
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/dca19c9d445156201bc41f7cbb6e894bbc9a678c.1610644945.git.lorenzo@kernel.org
      952de419
    • Lorenzo Bianconi's avatar
      mt7601u: fix rx buffer refcounting · d24c7905
      Lorenzo Bianconi authored
      Fix the following crash due to erroneous page refcounting:
      
      [   32.445919] BUG: Bad page state in process swapper/1  pfn:11f65a
      [   32.447409] page:00000000938f0632 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x11f65a
      [   32.449605] flags: 0x8000000000000000()
      [   32.450421] raw: 8000000000000000 ffffffff825b0148 ffffea00045ae988 0000000000000000
      [   32.451795] raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000
      [   32.452999] page dumped because: nonzero mapcount
      [   32.453888] Modules linked in:
      [   32.454492] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.11.0-rc2+ #1976
      [   32.455695] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-1.fc33 04/01/2014
      [   32.457157] Call Trace:
      [   32.457636]  <IRQ>
      [   32.457993]  dump_stack+0x77/0x97
      [   32.458576]  bad_page.cold+0x65/0x96
      [   32.459198]  get_page_from_freelist+0x46a/0x11f0
      [   32.460008]  __alloc_pages_nodemask+0x10a/0x2b0
      [   32.460794]  mt7601u_rx_tasklet+0x651/0x720
      [   32.461505]  tasklet_action_common.constprop.0+0x6b/0xd0
      [   32.462343]  __do_softirq+0x152/0x46c
      [   32.462928]  asm_call_irq_on_stack+0x12/0x20
      [   32.463610]  </IRQ>
      [   32.463953]  do_softirq_own_stack+0x5b/0x70
      [   32.464582]  irq_exit_rcu+0x9f/0xe0
      [   32.465028]  common_interrupt+0xae/0x1a0
      [   32.465536]  asm_common_interrupt+0x1e/0x40
      [   32.466071] RIP: 0010:default_idle+0x18/0x20
      [   32.468981] RSP: 0018:ffffc90000077f00 EFLAGS: 00000246
      [   32.469648] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
      [   32.470550] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff81aac3dd
      [   32.471463] RBP: ffff88810022ab00 R08: 0000000000000001 R09: 0000000000000001
      [   32.472335] R10: 0000000000000046 R11: 0000000000005aa0 R12: 0000000000000000
      [   32.473235] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      [   32.474139]  ? default_idle_call+0x4d/0x200
      [   32.474681]  default_idle_call+0x74/0x200
      [   32.475192]  do_idle+0x1d5/0x250
      [   32.475612]  cpu_startup_entry+0x19/0x20
      [   32.476114]  secondary_startup_64_no_verify+0xb0/0xbb
      [   32.476765] Disabling lock debugging due to kernel taint
      
      Fixes: c869f77d ("add mt7601u driver")
      Co-developed-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Acked-by: default avatarJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/62b2380c8c2091834cfad05e1059b55f945bd114.1610643952.git.lorenzo@kernel.org
      d24c7905
  3. 14 Jan, 2021 2 commits
  4. 08 Jan, 2021 25 commits
  5. 07 Jan, 2021 4 commits
    • Jakub Kicinski's avatar
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 0565ff56
      Jakub Kicinski authored
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2021-01-07
      
      We've added 4 non-merge commits during the last 10 day(s) which contain
      a total of 4 files changed, 14 insertions(+), 7 deletions(-).
      
      The main changes are:
      
      1) Fix task_iter bug caused by the merge conflict resolution, from Yonghong.
      
      2) Fix resolve_btfids for multiple type hierarchies, from Jiri.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        bpftool: Fix compilation failure for net.o with older glibc
        tools/resolve_btfids: Warn when having multiple IDs for single type
        bpf: Fix a task_iter bug caused by a merge conflict resolution
        selftests/bpf: Fix a compile error for BPF_F_BPRM_SECUREEXEC
      ====================
      
      Link: https://lore.kernel.org/r/20210107221555.64959-1-alexei.starovoitov@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0565ff56
    • Jakub Kicinski's avatar
      Merge branch 'net-fix-netfilter-defrag-ip-tunnel-pmtu-blackhole' · 704a0f85
      Jakub Kicinski authored
      Florian Westphal says:
      
      ====================
      net: fix netfilter defrag/ip tunnel pmtu blackhole
      
      Christian Perle reported a PMTU blackhole due to unexpected interaction
      between the ip defragmentation that comes with connection tracking and
      ip tunnels.
      
      Unfortunately setting 'nopmtudisc' on the tunnel breaks the test
      scenario even without netfilter.
      
      Christinas setup looks like this:
           +--------+       +---------+       +--------+
           |Router A|-------|Wanrouter|-------|Router B|
           |        |.IPIP..|         |..IPIP.|        |
           +--------+       +---------+       +--------+
                /             mtu 1400           \
               /                                  \
       +--------+                                  +--------+
       |Client A|                                  |Client B|
       +--------+                                  +--------+
      
      MTU is 1500 everywhere, except on Router A to Wanrouter and
      Wanrouter to Router B.
      
      Router A and Router B use IPIP tunnel interfaces to tunnel traffic
      between Client A and Client B over WAN.
      
      Client A sends a 1400 byte UDP datagram to Client B.
      This packet gets encapsulated in the IPIP tunnel.
      
      This works, packet is received on client B.
      
      When conntrack (or anything else that forces ip defragmentation) is
      enabled on Router A, the packet gets dropped on Router A after
      encapsulation because they exceed the link MTU.
      
      Setting the 'nopmtudisc' flag on the IPIP tunnel makes things worse,
      no packets pass even in the no-netfilter scenario.
      
      Patch one is a reproducer script for selftest infra.
      
      Patch two is a fix for 'nopmtudisc' behaviour so ip_tunnel will send
      an icmp error to Client A.  This allows 'nopmtudisc' tunnel to forward
      the UDP datagrams.
      
      Patch three enables ip refragmentation for all reassembled packets, just
      like ipv6.
      ====================
      
      Link: https://lore.kernel.org/r/20210105231523.622-1-fw@strlen.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      704a0f85
    • Florian Westphal's avatar
      net: ip: always refragment ip defragmented packets · bb4cc1a1
      Florian Westphal authored
      Conntrack reassembly records the largest fragment size seen in IPCB.
      However, when this gets forwarded/transmitted, fragmentation will only
      be forced if one of the fragmented packets had the DF bit set.
      
      In that case, a flag in IPCB will force fragmentation even if the
      MTU is large enough.
      
      This should work fine, but this breaks with ip tunnels.
      Consider client that sends a UDP datagram of size X to another host.
      
      The client fragments the datagram, so two packets, of size y and z, are
      sent. DF bit is not set on any of these packets.
      
      Middlebox netfilter reassembles those packets back to single size-X
      packet, before routing decision.
      
      packet-size-vs-mtu checks in ip_forward are irrelevant, because DF bit
      isn't set.  At output time, ip refragmentation is skipped as well
      because x is still smaller than the mtu of the output device.
      
      If ttransmit device is an ip tunnel, the packet size increases to
      x+overhead.
      
      Also, tunnel might be configured to force DF bit on outer header.
      
      In this case, packet will be dropped (exceeds MTU) and an ICMP error is
      generated back to sender.
      
      But sender already respects the announced MTU, all the packets that
      it sent did fit the announced mtu.
      
      Force refragmentation as per original sizes unconditionally so ip tunnel
      will encapsulate the fragments instead.
      
      The only other solution I see is to place ip refragmentation in
      the ip_tunnel code to handle this case.
      
      Fixes: d6b915e2 ("ip_fragment: don't forward defragmented DF packet")
      Reported-by: default avatarChristian Perle <christian.perle@secunet.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Acked-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bb4cc1a1
    • Florian Westphal's avatar
      net: fix pmtu check in nopmtudisc mode · 50c66167
      Florian Westphal authored
      For some reason ip_tunnel insist on setting the DF bit anyway when the
      inner header has the DF bit set, EVEN if the tunnel was configured with
      'nopmtudisc'.
      
      This means that the script added in the previous commit
      cannot be made to work by adding the 'nopmtudisc' flag to the
      ip tunnel configuration. Doing so breaks connectivity even for the
      without-conntrack/netfilter scenario.
      
      When nopmtudisc is set, the tunnel will skip the mtu check, so no
      icmp error is sent to client. Then, because inner header has DF set,
      the outer header gets added with DF bit set as well.
      
      IP stack then sends an error to itself because the packet exceeds
      the device MTU.
      
      Fixes: 23a3647b ("ip_tunnels: Use skb-len to PMTU check.")
      Cc: Stefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Acked-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      50c66167