1. 07 Mar, 2018 3 commits
  2. 06 Mar, 2018 8 commits
  3. 05 Mar, 2018 18 commits
  4. 04 Mar, 2018 11 commits
    • Guillaume Nault's avatar
      ppp: prevent unregistered channels from connecting to PPP units · 77f840e3
      Guillaume Nault authored
      PPP units don't hold any reference on the channels connected to it.
      It is the channel's responsibility to ensure that it disconnects from
      its unit before being destroyed.
      In practice, this is ensured by ppp_unregister_channel() disconnecting
      the channel from the unit before dropping a reference on the channel.
      
      However, it is possible for an unregistered channel to connect to a PPP
      unit: register a channel with ppp_register_net_channel(), attach a
      /dev/ppp file to it with ioctl(PPPIOCATTCHAN), unregister the channel
      with ppp_unregister_channel() and finally connect the /dev/ppp file to
      a PPP unit with ioctl(PPPIOCCONNECT).
      
      Once in this situation, the channel is only held by the /dev/ppp file,
      which can be released at anytime and free the channel without letting
      the parent PPP unit know. Then the ppp structure ends up with dangling
      pointers in its ->channels list.
      
      Prevent this scenario by forbidding unregistered channels from
      connecting to PPP units. This maintains the code logic by keeping
      ppp_unregister_channel() responsible from disconnecting the channel if
      necessary and avoids modification on the reference counting mechanism.
      
      This issue seems to predate git history (successfully reproduced on
      Linux 2.6.26 and earlier PPP commits are unrelated).
      Signed-off-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77f840e3
    • Davide Caratti's avatar
      tc-testing: skbmod: fix match value of ethertype · 79f3a8e6
      Davide Caratti authored
      iproute2 print_skbmod() prints the configured ethertype using format 0x%X:
      therefore, test 9aa8 systematically fails, because it configures action #4
      using ethertype 0x0031, and expects 0x0031 when it reads it back. Changing
      the expected value to 0x31 lets the test result 'not ok' become 'ok'.
      
      tested with:
       # ./tdc.py -e 9aa8
       Test 9aa8: Get a single skbmod action from a list
       All test results:
      
       1..1
       ok 1 9aa8 Get a single skbmod action from a list
      
      Fixes: cf797ac4 ("tc-testing: Add test cases for police and skbmod")
      Signed-off-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79f3a8e6
    • Shalom Toledo's avatar
      mlxsw: spectrum_switchdev: Check success of FDB add operation · 0a8a1bf1
      Shalom Toledo authored
      Until now, we assumed that in case of error when adding FDB entries, the
      write operation will fail, but this is not the case. Instead, we need to
      check that the number of entries reported in the response is equal to
      the number of entries specified in the request.
      
      Fixes: 56ade8fe ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
      Reported-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarShalom Toledo <shalomt@mellanox.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a8a1bf1
    • Linus Torvalds's avatar
      Linux 4.16-rc4 · 661e50bc
      Linus Torvalds authored
      661e50bc
    • David S. Miller's avatar
      Merge branch 'GSO_BY_FRAGS-correctness-improvements' · 19f6484f
      David S. Miller authored
      Daniel Axtens says:
      
      ====================
      GSO_BY_FRAGS correctness improvements
      
      As requested [1], I went through and had a look at users of gso_size to
      see if there were things that need to be fixed to consider
      GSO_BY_FRAGS, and I have tried to improve our helper functions to deal
      with this case.
      
      I found a few. This fixes bugs relating to the use of
      skb_gso_*_seglen() where GSO_BY_FRAGS is not considered.
      
      Patch 1 renames skb_gso_validate_mtu to skb_gso_validate_network_len.
      This is follow-up to my earlier patch 2b16f048 ("net: create
      skb_gso_validate_mac_len()"), and just makes everything a bit clearer.
      
      Patches 2 and 3 replace the final users of skb_gso_network_seglen() -
      which doesn't consider GSO_BY_FRAGS - with
      skb_gso_validate_network_len(), which does. This allows me to make the
      skb_gso_*_seglen functions private in patch 4 - now future users won't
      accidentally do the wrong comparison.
      
      Two things remain. One is qdisc_pkt_len_init, which is discussed at
      [2] - it's caught up in the GSO_DODGY mess. I don't have any expertise
      in GSO_DODGY, and it looks like a good clean fix will involve
      unpicking the whole validation mess, so I have left it for now.
      
      Secondly, there are 3 eBPF opcodes that change the gso_size of an SKB
      and don't consider GSO_BY_FRAGS. This is going through the bpf tree.
      
      Regards,
      Daniel
      
      [1] https://patchwork.ozlabs.org/comment/1852414/
      [2] https://www.spinics.net/lists/netdev/msg482397.html
      
      PS: This is all in the core networking stack. For a driver to be
      affected by this it would need to support NETIF_F_GSO_SCTP /
      NETIF_F_GSO_SOFTWARE and then either use gso_size or not be a purely
      virtual device. (Many drivers look at gso_size, but do not support
      SCTP segmentation, so the core network will segment an SCTP gso before
      it hits them.) Based on that, the only driver that may be affected is
      sunvnet, but I have no way of testing it, so I haven't looked at it.
      
      v2: split out bpf stuff
          fix review comments from Dave Miller
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      19f6484f
    • Daniel Axtens's avatar
      net: make skb_gso_*_seglen functions private · a4a77718
      Daniel Axtens authored
      They're very hard to use properly as they do not consider the
      GSO_BY_FRAGS case. Code should use skb_gso_validate_network_len
      and skb_gso_validate_mac_len as they do consider this case.
      
      Make the seglen functions static, which stops people using them
      outside of skbuff.c
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4a77718
    • Daniel Axtens's avatar
      net: xfrm: use skb_gso_validate_network_len() to check gso sizes · 80f5974d
      Daniel Axtens authored
      Replace skb_gso_network_seglen() with
      skb_gso_validate_network_len(), as it considers the GSO_BY_FRAGS
      case.
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      80f5974d
    • Daniel Axtens's avatar
      net: sched: tbf: handle GSO_BY_FRAGS case in enqueue · ee78bbef
      Daniel Axtens authored
      tbf_enqueue() checks the size of a packet before enqueuing it.
      However, the GSO size check does not consider the GSO_BY_FRAGS
      case, and so will drop GSO SCTP packets, causing a massive drop
      in throughput.
      
      Use skb_gso_validate_mac_len() instead, as it does consider that
      case.
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee78bbef
    • Daniel Axtens's avatar
      net: rename skb_gso_validate_mtu -> skb_gso_validate_network_len · 779b7931
      Daniel Axtens authored
      If you take a GSO skb, and split it into packets, will the network
      length (L3 headers + L4 headers + payload) of those packets be small
      enough to fit within a given MTU?
      
      skb_gso_validate_mtu gives you the answer to that question. However,
      we recently added to add a way to validate the MAC length of a split GSO
      skb (L2+L3+L4+payload), and the names get confusing, so rename
      skb_gso_validate_mtu to skb_gso_validate_network_len
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      779b7931
    • Linus Torvalds's avatar
      Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e64b9562
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A small set of fixes for x86:
      
         - Add missing instruction suffixes to assembly code so it can be
           compiled by newer GAS versions without warnings.
      
         - Switch refcount WARN exceptions to UD2 as we did in general
      
         - Make the reboot on Intel Edison platforms work
      
         - A small documentation update so text and sample command match"
      
      * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Documentation, x86, resctrl: Make text and sample command match
        x86/platform/intel-mid: Handle Intel Edison reboot correctly
        x86/asm: Add instruction suffixes to bitops
        x86/entry/64: Add instruction suffix
        x86/refcounts: Switch to UD2 for exceptions
      e64b9562
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7225a442
      Linus Torvalds authored
      Pull x86/pti fixes from Thomas Gleixner:
       "Three fixes related to melted spectrum:
      
         - Sync the cpu_entry_area page table to initial_page_table on 32 bit.
      
           Otherwise suspend/resume fails because resume uses
           initial_page_table and triggers a triple fault when accessing the
           cpu entry area.
      
         - Zero the SPEC_CTL MRS on XEN before suspend to address a
           shortcoming in the hypervisor.
      
         - Fix another switch table detection issue in objtool"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu_entry_area: Sync cpu_entry_area to initial_page_table
        objtool: Fix another switch table detection issue
        x86/xen: Zero MSR_IA32_SPEC_CTRL before suspend
      7225a442