15 Jun, 2019

1 commit

  • The kbuild documentation clearly shows that the documents
    there are written at different times: some use markdown,
    some use their own peculiar logic to split sections.

    Convert everything to ReST without affecting too much
    the author's style and avoiding adding uneeded markups.

    The conversion is actually:
    - add blank lines and identation in order to identify paragraphs;
    - fix tables markups;
    - add some lists markups;
    - mark literal blocks;
    - adjust title markups.

    At its new index.rst, let's add a :orphan: while this is not linked to
    the main index.rst file, in order to avoid build warnings.

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

09 Jun, 2019

1 commit

  • Pull yet more SPDX updates from Greg KH:
    "Another round of SPDX header file fixes for 5.2-rc4

    These are all more "GPL-2.0-or-later" or "GPL-2.0-only" tags being
    added, based on the text in the files. We are slowly chipping away at
    the 700+ different ways people tried to write the license text. All of
    these were reviewed on the spdx mailing list by a number of different
    people.

    We now have over 60% of the kernel files covered with SPDX tags:
    $ ./scripts/spdxcheck.py -v 2>&1 | grep Files
    Files checked: 64533
    Files with SPDX: 40392
    Files with errors: 0

    I think the majority of the "easy" fixups are now done, it's now the
    start of the longer-tail of crazy variants to wade through"

    * tag 'spdx-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (159 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 450
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 449
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 448
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 446
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 444
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 443
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 442
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 440
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 438
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 437
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 436
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 435
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 434
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 433
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 432
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 431
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 430
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 429
    ...

    Linus Torvalds
     

08 Jun, 2019

1 commit

  • Pull networking fixes from David Miller:

    1) Free AF_PACKET po->rollover properly, from Willem de Bruijn.

    2) Read SFP eeprom in max 16 byte increments to avoid problems with
    some SFP modules, from Russell King.

    3) Fix UDP socket lookup wrt. VRF, from Tim Beale.

    4) Handle route invalidation properly in s390 qeth driver, from Julian
    Wiedmann.

    5) Memory leak on unload in RDS, from Zhu Yanjun.

    6) sctp_process_init leak, from Neil HOrman.

    7) Fix fib_rules rule insertion semantic change that broke Android,
    from Hangbin Liu.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
    pktgen: do not sleep with the thread lock held.
    net: mvpp2: Use strscpy to handle stat strings
    net: rds: fix memory leak in rds_ib_flush_mr_pool
    ipv6: fix EFAULT on sendto with icmpv6 and hdrincl
    ipv6: use READ_ONCE() for inet->hdrincl as in ipv4
    Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"
    net: aquantia: fix wol configuration not applied sometimes
    ethtool: fix potential userspace buffer overflow
    Fix memory leak in sctp_process_init
    net: rds: fix memory leak when unload rds_rdma
    ipv6: fix the check before getting the cookie in rt6_get_cookie
    ipv4: not do cache for local delivery if bc_forwarding is enabled
    s390/qeth: handle error when updating TX queue count
    s390/qeth: fix VLAN attribute in bridge_hostnotify udev event
    s390/qeth: check dst entry before use
    s390/qeth: handle limited IPv4 broadcast in L3 TX path
    net: fix indirect calls helpers for ptype list hooks.
    net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is set
    udp: only choose unbound UDP socket for multicast when not in a VRF
    net/tls: replace the sleeping lock around RX resync with a bit lock
    ...

    Linus Torvalds
     

07 Jun, 2019

5 commits

  • Pull NFS client fixes from Anna Schumaker:
    "These are mostly stable bugfixes found during testing, many during the
    recent NFS bake-a-thon.

    Stable bugfixes:
    - SUNRPC: Fix regression in umount of a secure mount
    - SUNRPC: Fix a use after free when a server rejects the RPCSEC_GSS credential
    - NFSv4.1: Again fix a race where CB_NOTIFY_LOCK fails to wake a waiter
    - NFSv4.1: Fix bug only first CB_NOTIFY_LOCK is handled

    Other bugfixes:
    - xprtrdma: Use struct_size() in kzalloc()"

    * tag 'nfs-for-5.2-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
    NFSv4.1: Fix bug only first CB_NOTIFY_LOCK is handled
    NFSv4.1: Again fix a race where CB_NOTIFY_LOCK fails to wake a waiter
    SUNRPC: Fix a use after free when a server rejects the RPCSEC_GSS credential
    SUNRPC fix regression in umount of a secure mount
    xprtrdma: Use struct_size() in kzalloc()

    Linus Torvalds
     
  • Currently, the process issuing a "start" command on the pktgen procfs
    interface, acquires the pktgen thread lock and never release it, until
    all pktgen threads are completed. The above can blocks indefinitely any
    other pktgen command and any (even unrelated) netdevice removal - as
    the pktgen netdev notifier acquires the same lock.

    The issue is demonstrated by the following script, reported by Matteo:

    ip -b - </proc/net/pktgen/pgctrl
    {
    echo rem_device_all
    echo add_device dummy0
    } >/proc/net/pktgen/kpktgend_0
    echo count 0 >/proc/net/pktgen/dummy0
    echo start >/proc/net/pktgen/pgctrl &
    sleep 1
    rmmod veth

    Fix the above releasing the thread lock around the sleep call.

    Additionally we must prevent racing with forcefull rmmod - as the
    thread lock no more protects from them. Instead, acquire a self-reference
    before waiting for any thread. As a side effect, running

    rmmod pktgen

    while some thread is running now fails with "module in use" error,
    before this patch such command hanged indefinitely.

    Note: the issue predates the commit reported in the fixes tag, but
    this fix can't be applied before the mentioned commit.

    v1 -> v2:
    - no need to check for thread existence after flipping the lock,
    pktgen threads are freed only at net exit time
    -

    Fixes: 6146e6a43b35 ("[PKTGEN]: Removes thread_{un,}lock() macros.")
    Reported-and-tested-by: Matteo Croce
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller

    Paolo Abeni
     
  • When the following tests last for several hours, the problem will occur.

    Server:
    rds-stress -r 1.1.1.16 -D 1M
    Client:
    rds-stress -r 1.1.1.14 -s 1.1.1.16 -D 1M -T 30

    The following will occur.

    "
    Starting up....
    tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu
    %
    1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00
    1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00
    1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00
    1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00
    "
    >From vmcore, we can find that clean_list is NULL.

    >From the source code, rds_mr_flushd calls rds_ib_mr_pool_flush_worker.
    Then rds_ib_mr_pool_flush_worker calls
    "
    rds_ib_flush_mr_pool(pool, 0, NULL);
    "
    Then in function
    "
    int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
    int free_all, struct rds_ib_mr **ibmr_ret)
    "
    ibmr_ret is NULL.

    In the source code,
    "
    ...
    list_to_llist_nodes(pool, &unmap_list, &clean_nodes, &clean_tail);
    if (ibmr_ret)
    *ibmr_ret = llist_entry(clean_nodes, struct rds_ib_mr, llnode);

    /* more than one entry in llist nodes */
    if (clean_nodes->next)
    llist_add_batch(clean_nodes->next, clean_tail, &pool->clean_list);
    ...
    "
    When ibmr_ret is NULL, llist_entry is not executed. clean_nodes->next
    instead of clean_nodes is added in clean_list.
    So clean_nodes is discarded. It can not be used again.
    The workqueue is executed periodically. So more and more clean_nodes are
    discarded. Finally the clean_list is NULL.
    Then this problem will occur.

    Fixes: 1bc144b62524 ("net, rds, Replace xlist in net/rds/xlist.h with llist")
    Signed-off-by: Zhu Yanjun
    Acked-by: Santosh Shilimkar
    Signed-off-by: David S. Miller

    Zhu Yanjun
     
  • The following code returns EFAULT (Bad address):

    s = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
    setsockopt(s, SOL_IPV6, IPV6_HDRINCL, 1);
    sendto(ipv6_icmp6_packet, addr); /* returns -1, errno = EFAULT */

    The IPv4 equivalent code works. A workaround is to use IPPROTO_RAW
    instead of IPPROTO_ICMPV6.

    The failure happens because 2 bytes are eaten from the msghdr by
    rawv6_probe_proto_opt() starting from commit 19e3c66b52ca ("ipv6
    equivalent of "ipv4: Avoid reading user iov twice after
    raw_probe_proto_opt""), but at that time it was not a problem because
    IPV6_HDRINCL was not yet introduced.

    Only eat these 2 bytes if hdrincl == 0.

    Fixes: 715f504b1189 ("ipv6: add IPV6_HDRINCL option for raw sockets")
    Signed-off-by: Olivier Matz
    Acked-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Olivier Matz
     
  • As it was done in commit 8f659a03a0ba ("net: ipv4: fix for a race
    condition in raw_sendmsg") and commit 20b50d79974e ("net: ipv4: emulate
    READ_ONCE() on ->hdrincl bit-field in raw_sendmsg()") for ipv4, copy the
    value of inet->hdrincl in a local variable, to avoid introducing a race
    condition in the next commit.

    Signed-off-by: Olivier Matz
    Signed-off-by: David S. Miller

    Olivier Matz
     

06 Jun, 2019

5 commits

  • This reverts commit e9919a24d3022f72bcadc407e73a6ef17093a849.

    Nathan reported the new behaviour breaks Android, as Android just add
    new rules and delete old ones.

    If we return 0 without adding dup rules, Android will remove the new
    added rules and causing system to soft-reboot.

    Fixes: e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied")
    Reported-by: Nathan Chancellor
    Reported-by: Yaro Slav
    Reported-by: Maciej Żenczykowski
    Signed-off-by: Hangbin Liu
    Reviewed-by: Nathan Chancellor
    Tested-by: Nathan Chancellor
    Signed-off-by: David S. Miller

    Hangbin Liu
     
  • ethtool_get_regs() allocates a buffer of size ops->get_regs_len(),
    and pass it to the kernel driver via ops->get_regs() for filling.

    There is no restriction about what the kernel drivers can or cannot do
    with the open ethtool_regs structure. They usually set regs->version
    and ignore regs->len or set it to the same size as ops->get_regs_len().

    But if userspace allocates a smaller buffer for the registers dump,
    we would cause a userspace buffer overflow in the final copy_to_user()
    call, which uses the regs.len value potentially reset by the driver.

    To fix this, make this case obvious and store regs.len before calling
    ops->get_regs(), to only copy as much data as requested by userspace,
    up to the value returned by ops->get_regs_len().

    While at it, remove the redundant check for non-null regbuf.

    Signed-off-by: Vivien Didelot
    Reviewed-by: Michal Kubecek
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • syzbot found the following leak in sctp_process_init
    BUG: memory leak
    unreferenced object 0xffff88810ef68400 (size 1024):
    comm "syz-executor273", pid 7046, jiffies 4294945598 (age 28.770s)
    hex dump (first 32 bytes):
    1d de 28 8d de 0b 1b e3 b5 c2 f9 68 fd 1a 97 25 ..(........h...%
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] kmemleak_alloc_recursive include/linux/kmemleak.h:55
    [inline]
    [] slab_post_alloc_hook mm/slab.h:439 [inline]
    [] slab_alloc mm/slab.c:3326 [inline]
    [] __do_kmalloc mm/slab.c:3658 [inline]
    [] __kmalloc_track_caller+0x15d/0x2c0 mm/slab.c:3675
    [] kmemdup+0x27/0x60 mm/util.c:119
    [] kmemdup include/linux/string.h:432 [inline]
    [] sctp_process_init+0xa7e/0xc20
    net/sctp/sm_make_chunk.c:2437
    [] sctp_cmd_process_init net/sctp/sm_sideeffect.c:682
    [inline]
    [] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1384
    [inline]
    [] sctp_side_effects net/sctp/sm_sideeffect.c:1194
    [inline]
    [] sctp_do_sm+0xbdc/0x1d60 net/sctp/sm_sideeffect.c:1165
    [] sctp_assoc_bh_rcv+0x13c/0x200
    net/sctp/associola.c:1074
    [] sctp_inq_push+0x7f/0xb0 net/sctp/inqueue.c:95
    [] sctp_backlog_rcv+0x5e/0x2a0 net/sctp/input.c:354
    [] sk_backlog_rcv include/net/sock.h:950 [inline]
    [] __release_sock+0xab/0x110 net/core/sock.c:2418
    [] release_sock+0x37/0xd0 net/core/sock.c:2934
    [] sctp_sendmsg+0x2c0/0x990 net/sctp/socket.c:2122
    [] inet_sendmsg+0x64/0x120 net/ipv4/af_inet.c:802
    [] sock_sendmsg_nosec net/socket.c:652 [inline]
    [] sock_sendmsg+0x54/0x70 net/socket.c:671
    [] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2292
    [] __sys_sendmsg+0x80/0xf0 net/socket.c:2330
    [] __do_sys_sendmsg net/socket.c:2339 [inline]
    [] __se_sys_sendmsg net/socket.c:2337 [inline]
    [] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2337
    [] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:3

    The problem was that the peer.cookie value points to an skb allocated
    area on the first pass through this function, at which point it is
    overwritten with a heap allocated value, but in certain cases, where a
    COOKIE_ECHO chunk is included in the packet, a second pass through
    sctp_process_init is made, where the cookie value is re-allocated,
    leaking the first allocation.

    Fix is to always allocate the cookie value, and free it when we are done
    using it.

    Signed-off-by: Neil Horman
    Reported-by: syzbot+f7e9153b037eac9b1df8@syzkaller.appspotmail.com
    CC: Marcelo Ricardo Leitner
    CC: "David S. Miller"
    CC: netdev@vger.kernel.org
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Neil Horman
     
  • When KASAN is enabled, after several rds connections are
    created, then "rmmod rds_rdma" is run. The following will
    appear.

    "
    BUG rds_ib_incoming (Not tainted): Objects remaining
    in rds_ib_incoming on __kmem_cache_shutdown()

    Call Trace:
    dump_stack+0x71/0xab
    slab_err+0xad/0xd0
    __kmem_cache_shutdown+0x17d/0x370
    shutdown_cache+0x17/0x130
    kmem_cache_destroy+0x1df/0x210
    rds_ib_recv_exit+0x11/0x20 [rds_rdma]
    rds_ib_exit+0x7a/0x90 [rds_rdma]
    __x64_sys_delete_module+0x224/0x2c0
    ? __ia32_sys_delete_module+0x2c0/0x2c0
    do_syscall_64+0x73/0x190
    entry_SYSCALL_64_after_hwframe+0x44/0xa9
    "
    This is rds connection memory leak. The root cause is:
    When "rmmod rds_rdma" is run, rds_ib_remove_one will call
    rds_ib_dev_shutdown to drop the rds connections.
    rds_ib_dev_shutdown will call rds_conn_drop to drop rds
    connections as below.
    "
    rds_conn_path_drop(&conn->c_path[0], false);
    "
    In the above, destroy is set to false.
    void rds_conn_path_drop(struct rds_conn_path *cp, bool destroy)
    {
    atomic_set(&cp->cp_state, RDS_CONN_ERROR);

    rcu_read_lock();
    if (!destroy && rds_destroy_pending(cp->cp_conn)) {
    rcu_read_unlock();
    return;
    }
    queue_work(rds_wq, &cp->cp_down_w);
    rcu_read_unlock();
    }
    In the above function, destroy is set to false. rds_destroy_pending
    is called. This does not move rds connections to ib_nodev_conns.
    So destroy is set to true to move rds connections to ib_nodev_conns.
    In rds_ib_unregister_client, flush_workqueue is called to make rds_wq
    finsh shutdown rds connections. The function rds_ib_destroy_nodev_conns
    is called to shutdown rds connections finally.
    Then rds_ib_recv_exit is called to destroy slab.

    void rds_ib_recv_exit(void)
    {
    kmem_cache_destroy(rds_ib_incoming_slab);
    kmem_cache_destroy(rds_ib_frag_slab);
    }
    The above slab memory leak will not occur again.

    >From tests,
    256 rds connections
    [root@ca-dev14 ~]# time rmmod rds_rdma

    real 0m16.522s
    user 0m0.000s
    sys 0m8.152s
    512 rds connections
    [root@ca-dev14 ~]# time rmmod rds_rdma

    real 0m32.054s
    user 0m0.000s
    sys 0m15.568s

    To rmmod rds_rdma with 256 rds connections, about 16 seconds are needed.
    And with 512 rds connections, about 32 seconds are needed.
    >From ftrace, when one rds connection is destroyed,

    "
    19) | rds_conn_destroy [rds]() {
    19) 7.782 us | rds_conn_path_drop [rds]();
    15) | rds_shutdown_worker [rds]() {
    15) | rds_conn_shutdown [rds]() {
    15) 1.651 us | rds_send_path_reset [rds]();
    15) 7.195 us | }
    15) + 11.434 us | }
    19) 2.285 us | rds_cong_remove_conn [rds]();
    19) * 24062.76 us | }
    "
    So if many rds connections will be destroyed, this function
    rds_ib_destroy_nodev_conns uses most of time.

    Suggested-by: Håkon Bugge
    Signed-off-by: Zhu Yanjun
    Signed-off-by: David S. Miller

    Zhu Yanjun
     
  • With the topo:

    h1 ---| rp1 |
    | route rp3 |--- h3 (192.168.200.1)
    h2 ---| rp2 |

    If rp1 bc_forwarding is set while rp2 bc_forwarding is not, after
    doing "ping 192.168.200.255" on h1, then ping 192.168.200.255 on
    h2, and the packets can still be forwared.

    This issue was caused by the input route cache. It should only do
    the cache for either bc forwarding or local delivery. Otherwise,
    local delivery can use the route cache for bc forwarding of other
    interfaces.

    This patch is to fix it by not doing cache for local delivery if
    all.bc_forwarding is enabled.

    Note that we don't fix it by checking route cache local flag after
    rt_cache_valid() in "local_input:" and "ip_mkroute_input", as the
    common route code shouldn't be touched for bc_forwarding.

    Fixes: 5cbf777cfdf6 ("route: add support for directed broadcast forwarding")
    Reported-by: Jianlin Shi
    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     

05 Jun, 2019

21 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2 of the license

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 315 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Armijn Hemel
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this file is gplv2 as found in copying

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190114.657082701@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 101 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190113.822954939@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not see http www gnu org
    licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 33 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081038.745679586@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license v2 as published
    by the free software foundation

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 2 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Armijn Hemel
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081037.837563564@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 135 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081036.435762997@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    released under terms in gpl version 2 see copying

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 5 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Armijn Hemel
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081035.689962394@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of version 2 of the gnu general public license as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not see http www gnu org
    licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Armijn Hemel
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000437.338011816@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin st fifth floor boston ma 02110
    1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 246 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin st fifth floor boston ma 02110
    1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 111 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.567572064@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2 and no later version this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 33 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000435.345978407@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of version 2 of the gnu general public license as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 64 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141901.894819585@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 263 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 and
    only version 2 as published by the free software foundation this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 294 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141900.825281744@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program can be redistributed or modified under the terms of the
    gnu general public license version 2 as published by the free
    software foundation this program is distributed without any warranty
    or implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license version 2 for more
    details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141900.551133917@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of version 2 of the gnu general public license as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin street fifth floor boston ma
    02110 1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 21 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141334.228102212@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin street fifth floor boston ma
    02110 1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 46 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141334.135501091@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • As Eric noted, the current wrapper for ptype func hook inside
    __netif_receive_skb_list_ptype() has no chance of avoiding the indirect
    call: we enter such code path only for protocols other than ipv4 and
    ipv6.

    Instead we can wrap the list_func invocation.

    v1 -> v2:
    - use the correct fix tag

    Fixes: f5737cbadb7d ("net: use indirect calls helpers for ptype hook")
    Suggested-by: Eric Dumazet
    Signed-off-by: Paolo Abeni
    Acked-by: Edward Cree
    Reviewed-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Paolo Abeni
     
  • By default, packets received in another VRF should not be passed to an
    unbound socket in the default VRF. This patch updates the IPv4 UDP
    multicast logic to match the unicast VRF logic (in compute_score()),
    as well as the IPv6 mcast logic (in __udp_v6_is_mcast_sock()).

    The particular case I noticed was DHCP discover packets going
    to the 255.255.255.255 address, which are handled by
    __udp4_lib_mcast_deliver(). The previous code meant that running
    multiple different DHCP server or relay agent instances across VRFs
    did not work correctly - any server/relay agent in the default VRF
    received DHCP discover packets for all other VRFs.

    Fixes: 6da5b0f027a8 ("net: ensure unbound datagram socket to be chosen when not in a VRF")
    Signed-off-by: Tim Beale
    Reviewed-by: David Ahern
    Signed-off-by: David S. Miller

    Tim Beale
     
  • Commit 38030d7cb779 ("net/tls: avoid NULL-deref on resync during device removal")
    tried to fix a potential NULL-dereference by taking the
    context rwsem. Unfortunately the RX resync may get called
    from soft IRQ, so we can't use the rwsem to protect from
    the device disappearing. Because we are guaranteed there
    can be only one resync at a time (it's called from strparser)
    use a bit to indicate resync is busy and make device
    removal wait for the bit to get cleared.

    Note that there is a leftover "flags" field in struct
    tls_context already.

    Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload")
    Signed-off-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Jakub Kicinski
     
  • This reverts commit 38030d7cb77963ba84cdbe034806e2b81245339f.
    Unfortunately the RX resync may get called from soft IRQ,
    so we can't take the rwsem to protect from the device
    disappearing.

    Signed-off-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Jakub Kicinski
     

03 Jun, 2019

1 commit

  • Rollover used to use a complex RCU mechanism for assignment, which had
    a race condition. The below patch fixed the bug and greatly simplified
    the logic.

    The feature depends on fanout, but the state is private to the socket.
    Fanout_release returns f only when the last member leaves and the
    fanout struct is to be freed.

    Destroy rollover unconditionally, regardless of fanout state.

    Fixes: 57f015f5eccf2 ("packet: fix crash in fanout_demux_rollover()")
    Reported-by: syzbot
    Diagnosed-by: Dmitry Vyukov
    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

01 Jun, 2019

1 commit

  • Due to a confusion I thought that eth_type_trans() was called by the
    network stack whereas it can actually be called by network drivers to
    figure out the skb protocol and next packet_type handlers.

    In light of the above, it is not safe to store the frame type from the
    DSA tagger's .filter callback (first entry point on RX path), since GRO
    is yet to be invoked on the received traffic. Hence it is very likely
    that the skb->cb will actually get overwritten between eth_type_trans()
    and the actual DSA packet_type handler.

    Of course, what this patch fixes is the actual overwriting of the
    SJA1105_SKB_CB(skb)->type field from the GRO layer, which made all
    frames be seen as SJA1105_FRAME_TYPE_NORMAL (0).

    Fixes: 227d07a07ef1 ("net: dsa: sja1105: Add support for traffic through standalone ports")
    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

31 May, 2019

4 commits

  • Pull yet more SPDX updates from Greg KH:
    "Here is another set of reviewed patches that adds SPDX tags to
    different kernel files, based on a set of rules that are being used to
    parse the comments to try to determine that the license of the file is
    "GPL-2.0-or-later" or "GPL-2.0-only". Only the "obvious" versions of
    these matches are included here, a number of "non-obvious" variants of
    text have been found but those have been postponed for later review
    and analysis.

    There is also a patch in here to add the proper SPDX header to a bunch
    of Kbuild files that we have missed in the past due to new files being
    added and forgetting that Kbuild uses two different file names for
    Makefiles. This issue was reported by the Kbuild maintainer.

    These patches have been out for review on the linux-spdx@vger mailing
    list, and while they were created by automatic tools, they were
    hand-verified by a bunch of different people, all whom names are on
    the patches are reviewers"

    * tag 'spdx-5.2-rc3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (82 commits)
    treewide: Add SPDX license identifier - Kbuild
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 225
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 224
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 223
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 222
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 221
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 220
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 218
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 217
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 216
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 215
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 214
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 213
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 211
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 210
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 209
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 207
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 203
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201
    ...

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Fix OOPS during nf_tables rule dump, from Florian Westphal.

    2) Use after free in ip_vs_in, from Yue Haibing.

    3) Fix various kTLS bugs (NULL deref during device removal resync,
    netdev notification ignoring, etc.) From Jakub Kicinski.

    4) Fix ipv6 redirects with VRF, from David Ahern.

    5) Memory leak fix in igmpv3_del_delrec(), from Eric Dumazet.

    6) Missing memory allocation failure check in ip6_ra_control(), from
    Gen Zhang. And likewise fix ip_ra_control().

    7) TX clean budget logic error in aquantia, from Igor Russkikh.

    8) SKB leak in llc_build_and_send_ui_pkt(), from Eric Dumazet.

    9) Double frees in mlx5, from Parav Pandit.

    10) Fix lost MAC address in r8169 during PCI D3, from Heiner Kallweit.

    11) Fix botched register access in mvpp2, from Antoine Tenart.

    12) Use after free in napi_gro_frags(), from Eric Dumazet.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (89 commits)
    net: correct zerocopy refcnt with udp MSG_MORE
    ethtool: Check for vlan etype or vlan tci when parsing flow_rule
    net: don't clear sock->sk early to avoid trouble in strparser
    net-gro: fix use-after-free read in napi_gro_frags()
    net: dsa: tag_8021q: Create a stable binary format
    net: dsa: tag_8021q: Change order of rx_vid setup
    net: mvpp2: fix bad MVPP2_TXQ_SCHED_TOKEN_CNTR_REG queue value
    ipv4: tcp_input: fix stack out of bounds when parsing TCP options.
    mlxsw: spectrum: Prevent force of 56G
    mlxsw: spectrum_acl: Avoid warning after identical rules insertion
    net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT
    r8169: fix MAC address being lost in PCI D3
    net: core: support XDP generic on stacked devices.
    netvsc: unshare skb in VF rx handler
    udp: Avoid post-GRO UDP checksum recalculation
    net: phy: dp83867: Set up RGMII TX delay
    net: phy: dp83867: do not call config_init twice
    net: phy: dp83867: increase SGMII autoneg timer duration
    net: phy: dp83867: fix speed 10 in sgmii mode
    net: phy: marvell10g: report if the PHY fails to boot firmware
    ...

    Linus Torvalds
     
  • TCP zerocopy takes a uarg reference for every skb, plus one for the
    tcp_sendmsg_locked datapath temporarily, to avoid reaching refcnt zero
    as it builds, sends and frees skbs inside its inner loop.

    UDP and RAW zerocopy do not send inside the inner loop so do not need
    the extra sock_zerocopy_get + sock_zerocopy_put pair. Commit
    52900d22288ed ("udp: elide zerocopy operation in hot path") introduced
    extra_uref to pass the initial reference taken in sock_zerocopy_alloc
    to the first generated skb.

    But, sock_zerocopy_realloc takes this extra reference at the start of
    every call. With MSG_MORE, no new skb may be generated to attach the
    extra_uref to, so refcnt is incorrectly 2 with only one skb.

    Do not take the extra ref if uarg && !tcp, which implies MSG_MORE.
    Update extra_uref accordingly.

    This conditional assignment triggers a false positive may be used
    uninitialized warning, so have to initialize extra_uref at define.

    Changes v1->v2: fix typo in Fixes SHA1

    Fixes: 52900d22288e7 ("udp: elide zerocopy operation in hot path")
    Reported-by: syzbot
    Diagnosed-by: Eric Dumazet
    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     
  • When parsing an ethtool flow spec to build a flow_rule, the code checks
    if both the vlan etype and the vlan tci are specified by the user to add
    a FLOW_DISSECTOR_KEY_VLAN match.

    However, when the user only specified a vlan etype or a vlan tci, this
    check silently ignores these parameters.

    For example, the following rule :

    ethtool -N eth0 flow-type udp4 vlan 0x0010 action -1 loc 0

    will result in no error being issued, but the equivalent rule will be
    created and passed to the NIC driver :

    ethtool -N eth0 flow-type udp4 action -1 loc 0

    In the end, neither the NIC driver using the rule nor the end user have
    a way to know that these keys were dropped along the way, or that
    incorrect parameters were entered.

    This kind of check should be left to either the driver, or the ethtool
    flow spec layer.

    This commit makes so that ethtool parameters are forwarded as-is to the
    NIC driver.

    Since none of the users of ethtool_rx_flow_rule_create are using the
    VLAN dissector, I don't think this qualifies as a regression.

    Fixes: eca4205f9ec3 ("ethtool: add ethtool_rx_flow_spec to flow_rule structure translator")
    Signed-off-by: Maxime Chevallier
    Acked-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Maxime Chevallier