23 Dec, 2019

1 commit


20 Dec, 2019

1 commit


14 Dec, 2019

1 commit

  • We got another syzbot report [1] that tells us we must use
    write_lock_irq()/write_unlock_irq() to avoid possible deadlock.

    [1]

    WARNING: inconsistent lock state
    5.5.0-rc1-syzkaller #0 Not tainted
    --------------------------------
    inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-R} usage.
    syz-executor826/9605 [HC1[1]:SC0[0]:HE0:SE1] takes:
    ffffffff8a128718 (disc_data_lock){+-..}, at: sp_get.isra.0+0x1d/0xf0 drivers/net/ppp/ppp_synctty.c:138
    {HARDIRQ-ON-W} state was registered at:
    lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485
    __raw_write_lock_bh include/linux/rwlock_api_smp.h:203 [inline]
    _raw_write_lock_bh+0x33/0x50 kernel/locking/spinlock.c:319
    sixpack_close+0x1d/0x250 drivers/net/hamradio/6pack.c:657
    tty_ldisc_close.isra.0+0x119/0x1a0 drivers/tty/tty_ldisc.c:489
    tty_set_ldisc+0x230/0x6b0 drivers/tty/tty_ldisc.c:585
    tiocsetd drivers/tty/tty_io.c:2337 [inline]
    tty_ioctl+0xe8d/0x14f0 drivers/tty/tty_io.c:2597
    vfs_ioctl fs/ioctl.c:47 [inline]
    file_ioctl fs/ioctl.c:545 [inline]
    do_vfs_ioctl+0x977/0x14e0 fs/ioctl.c:732
    ksys_ioctl+0xab/0xd0 fs/ioctl.c:749
    __do_sys_ioctl fs/ioctl.c:756 [inline]
    __se_sys_ioctl fs/ioctl.c:754 [inline]
    __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:754
    do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
    entry_SYSCALL_64_after_hwframe+0x49/0xbe
    irq event stamp: 3946
    hardirqs last enabled at (3945): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
    hardirqs last enabled at (3945): [] _raw_spin_unlock_irq+0x23/0x80 kernel/locking/spinlock.c:199
    hardirqs last disabled at (3946): [] trace_hardirqs_off_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:42
    softirqs last enabled at (2658): [] spin_unlock_bh include/linux/spinlock.h:383 [inline]
    softirqs last enabled at (2658): [] clusterip_netdev_event+0x46f/0x670 net/ipv4/netfilter/ipt_CLUSTERIP.c:222
    softirqs last disabled at (2656): [] spin_lock_bh include/linux/spinlock.h:343 [inline]
    softirqs last disabled at (2656): [] clusterip_netdev_event+0x1bb/0x670 net/ipv4/netfilter/ipt_CLUSTERIP.c:196

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(disc_data_lock);

    lock(disc_data_lock);

    *** DEADLOCK ***

    5 locks held by syz-executor826/9605:
    #0: ffff8880a905e198 (&tty->legacy_mutex){+.+.}, at: tty_lock+0xc7/0x130 drivers/tty/tty_mutex.c:19
    #1: ffffffff899a56c0 (rcu_read_lock){....}, at: mutex_spin_on_owner+0x0/0x330 kernel/locking/mutex.c:413
    #2: ffff8880a496a2b0 (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:338 [inline]
    #2: ffff8880a496a2b0 (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x2d/0x1a0 drivers/tty/serial/8250/8250_core.c:116
    #3: ffffffff8c104048 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x24/0x330 drivers/tty/serial/8250/8250_port.c:1823
    #4: ffff8880a905e090 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x22/0x90 drivers/tty/tty_ldisc.c:288

    stack backtrace:
    CPU: 1 PID: 9605 Comm: syz-executor826 Not tainted 5.5.0-rc1-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:

    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x197/0x210 lib/dump_stack.c:118
    print_usage_bug.cold+0x327/0x378 kernel/locking/lockdep.c:3101
    valid_state kernel/locking/lockdep.c:3112 [inline]
    mark_lock_irq kernel/locking/lockdep.c:3309 [inline]
    mark_lock+0xbb4/0x1220 kernel/locking/lockdep.c:3666
    mark_usage kernel/locking/lockdep.c:3554 [inline]
    __lock_acquire+0x1e55/0x4a00 kernel/locking/lockdep.c:3909
    lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485
    __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
    _raw_read_lock+0x32/0x50 kernel/locking/spinlock.c:223
    sp_get.isra.0+0x1d/0xf0 drivers/net/ppp/ppp_synctty.c:138
    sixpack_write_wakeup+0x25/0x340 drivers/net/hamradio/6pack.c:402
    tty_wakeup+0xe9/0x120 drivers/tty/tty_io.c:536
    tty_port_default_wakeup+0x2b/0x40 drivers/tty/tty_port.c:50
    tty_port_tty_wakeup+0x57/0x70 drivers/tty/tty_port.c:387
    uart_write_wakeup+0x46/0x70 drivers/tty/serial/serial_core.c:104
    serial8250_tx_chars+0x495/0xaf0 drivers/tty/serial/8250/8250_port.c:1761
    serial8250_handle_irq.part.0+0x2a2/0x330 drivers/tty/serial/8250/8250_port.c:1834
    serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1820 [inline]
    serial8250_default_handle_irq+0xc0/0x150 drivers/tty/serial/8250/8250_port.c:1850
    serial8250_interrupt+0xf1/0x1a0 drivers/tty/serial/8250/8250_core.c:126
    __handle_irq_event_percpu+0x15d/0x970 kernel/irq/handle.c:149
    handle_irq_event_percpu+0x74/0x160 kernel/irq/handle.c:189
    handle_irq_event+0xa7/0x134 kernel/irq/handle.c:206
    handle_edge_irq+0x25e/0x8d0 kernel/irq/chip.c:830
    generic_handle_irq_desc include/linux/irqdesc.h:156 [inline]
    do_IRQ+0xde/0x280 arch/x86/kernel/irq.c:250
    common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:607

    RIP: 0010:cpu_relax arch/x86/include/asm/processor.h:685 [inline]
    RIP: 0010:mutex_spin_on_owner+0x247/0x330 kernel/locking/mutex.c:579
    Code: c3 be 08 00 00 00 4c 89 e7 e8 e5 06 59 00 4c 89 e0 48 c1 e8 03 42 80 3c 38 00 0f 85 e1 00 00 00 49 8b 04 24 a8 01 75 96 f3 90 2f fe ff ff 0f 0b e8 0d 19 09 00 84 c0 0f 85 ff fd ff ff 48 c7
    RSP: 0018:ffffc90001eafa20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffd7
    RAX: 0000000000000000 RBX: ffff88809fd9e0c0 RCX: 1ffffffff13266dd
    RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000000
    RBP: ffffc90001eafa60 R08: 1ffff11013d22898 R09: ffffed1013d22899
    R10: ffffed1013d22898 R11: ffff88809e9144c7 R12: ffff8880a905e138
    R13: ffff88809e9144c0 R14: 0000000000000000 R15: dffffc0000000000
    mutex_optimistic_spin kernel/locking/mutex.c:673 [inline]
    __mutex_lock_common kernel/locking/mutex.c:962 [inline]
    __mutex_lock+0x32b/0x13c0 kernel/locking/mutex.c:1106
    mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1121
    tty_lock+0xc7/0x130 drivers/tty/tty_mutex.c:19
    tty_release+0xb5/0xe90 drivers/tty/tty_io.c:1665
    __fput+0x2ff/0x890 fs/file_table.c:280
    ____fput+0x16/0x20 fs/file_table.c:313
    task_work_run+0x145/0x1c0 kernel/task_work.c:113
    exit_task_work include/linux/task_work.h:22 [inline]
    do_exit+0x8e7/0x2ef0 kernel/exit.c:797
    do_group_exit+0x135/0x360 kernel/exit.c:895
    __do_sys_exit_group kernel/exit.c:906 [inline]
    __se_sys_exit_group kernel/exit.c:904 [inline]
    __x64_sys_exit_group+0x44/0x50 kernel/exit.c:904
    do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
    entry_SYSCALL_64_after_hwframe+0x49/0xbe
    RIP: 0033:0x43fef8
    Code: Bad RIP value.
    RSP: 002b:00007ffdb07d2338 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
    RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043fef8
    RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
    RBP: 00000000004bf730 R08: 00000000000000e7 R09: ffffffffffffffd0
    R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001
    R13: 00000000006d1180 R14: 0000000000000000 R15: 0000000000000000

    Fixes: 6e4e2f811bad ("6pack,mkiss: fix lock inconsistency")
    Signed-off-by: Eric Dumazet
    Reported-by: syzbot
    Cc: Arnd Bergmann
    Signed-off-by: Jakub Kicinski

    Eric Dumazet
     

25 Oct, 2019

1 commit

  • Some interface types could be nested.
    (VLAN, BONDING, TEAM, MACSEC, MACVLAN, IPVLAN, VIRT_WIFI, VXLAN, etc..)
    These interface types should set lockdep class because, without lockdep
    class key, lockdep always warn about unexisting circular locking.

    In the current code, these interfaces have their own lockdep class keys and
    these manage itself. So that there are so many duplicate code around the
    /driver/net and /net/.
    This patch adds new generic lockdep keys and some helper functions for it.

    This patch does below changes.
    a) Add lockdep class keys in struct net_device
    - qdisc_running, xmit, addr_list, qdisc_busylock
    - these keys are used as dynamic lockdep key.
    b) When net_device is being allocated, lockdep keys are registered.
    - alloc_netdev_mqs()
    c) When net_device is being free'd llockdep keys are unregistered.
    - free_netdev()
    d) Add generic lockdep key helper function
    - netdev_register_lockdep_key()
    - netdev_unregister_lockdep_key()
    - netdev_update_lockdep_key()
    e) Remove unnecessary generic lockdep macro and functions
    f) Remove unnecessary lockdep code of each interfaces.

    After this patch, each interface modules don't need to maintain
    their lockdep keys.

    Signed-off-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Taehee Yoo
     

15 Sep, 2019

1 commit


07 Sep, 2019

1 commit


23 Aug, 2019

1 commit


09 Aug, 2019

1 commit


30 Jul, 2019

1 commit

  • Mark switch cases where we are expecting to fall through.

    This patch fixes the following warning (Building: i386):

    drivers/net/hamradio/baycom_epp.c: In function ‘transmit’:
    drivers/net/hamradio/baycom_epp.c:491:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (i) {
    ^
    drivers/net/hamradio/baycom_epp.c:504:3: note: here
    default: /* fall through */
    ^~~~~~~

    Notice that, in this particular case, the code comment is
    modified in accordance with what GCC is expecting to find.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can distribute 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 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 3 file(s).

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

    Thomas Gleixner
     

24 May, 2019

3 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 either version 2 of the license or at
    your option any 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 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
    675 mass ave cambridge ma 02139 usa please note that the gpl allows
    you to use the driver not the radio in order to use the radio you
    need a license from the communications authority of your country

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071859.472520794@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 either version 2 of the license or at
    your option any 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 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
    675 mass ave cambridge ma 02139 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Ellerman (powerpc)
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

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

    this module 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 either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

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

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

    Thomas Gleixner
     

21 May, 2019

2 commits


19 Feb, 2019

1 commit


03 Jan, 2019

1 commit

  • Using del_timer() + add_timer() is generally unsafe on SMP,
    as noticed by syzbot. Use mod_timer() instead.

    kernel BUG at kernel/time/timer.c:1136!
    invalid opcode: 0000 [#1] PREEMPT SMP KASAN
    CPU: 1 PID: 1026 Comm: kworker/u4:4 Not tainted 4.20.0+ #2
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Workqueue: events_unbound flush_to_ldisc
    RIP: 0010:add_timer kernel/time/timer.c:1136 [inline]
    RIP: 0010:add_timer+0xa81/0x1470 kernel/time/timer.c:1134
    Code: 4d 89 7d 40 48 c7 85 70 fe ff ff 00 00 00 00 c7 85 7c fe ff ff ff ff ff ff 48 89 85 90 fe ff ff e9 e6 f7 ff ff e8 cf 42 12 00 0b e8 c8 42 12 00 0f 0b e8 c1 42 12 00 4c 89 bd 60 fe ff ff e9
    RSP: 0018:ffff8880a7fdf5a8 EFLAGS: 00010293
    RAX: ffff8880a7846340 RBX: dffffc0000000000 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffffffff816f3ee1 RDI: ffff88808a514ff8
    RBP: ffff8880a7fdf760 R08: 0000000000000007 R09: ffff8880a7846c58
    R10: ffff8880a7846340 R11: 0000000000000000 R12: ffff88808a514ff8
    R13: ffff88808a514ff8 R14: ffff88808a514dc0 R15: 0000000000000030
    FS: 0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000000061c500 CR3: 00000000994d9000 CR4: 00000000001406e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    decode_prio_command drivers/net/hamradio/6pack.c:903 [inline]
    sixpack_decode drivers/net/hamradio/6pack.c:971 [inline]
    sixpack_receive_buf drivers/net/hamradio/6pack.c:457 [inline]
    sixpack_receive_buf+0xf9c/0x1470 drivers/net/hamradio/6pack.c:434
    tty_ldisc_receive_buf+0x164/0x1c0 drivers/tty/tty_buffer.c:465
    tty_port_default_receive_buf+0x114/0x190 drivers/tty/tty_port.c:38
    receive_buf drivers/tty/tty_buffer.c:481 [inline]
    flush_to_ldisc+0x3b2/0x590 drivers/tty/tty_buffer.c:533
    process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
    worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
    kthread+0x357/0x430 kernel/kthread.c:246
    ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Eric Dumazet
    Reported-by: syzbot
    Cc: Andreas Koensgen
    Signed-off-by: David S. Miller

    Eric Dumazet
     

15 Dec, 2018

1 commit


24 Oct, 2018

1 commit

  • Pull tty ioctl updates from Al Viro:
    "This is the compat_ioctl work related to tty ioctls.

    Quite a bit of dead code taken out, all tty-related stuff gone from
    fs/compat_ioctl.c. A bunch of compat bugs fixed - some still remain,
    but all more or less generic tty-related ioctls should be covered
    (remaining issues are in things like driver-private ioctls in a pcmcia
    serial card driver not getting properly handled in 32bit processes on
    64bit host, etc)"

    * 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (53 commits)
    kill TIOCSERGSTRUCT
    change semantics of ldisc ->compat_ioctl()
    kill TIOCSER[SG]WILD
    synclink_gt(): fix compat_ioctl()
    pty: fix compat ioctls
    compat_ioctl - kill keyboard ioctl handling
    gigaset: add ->compat_ioctl()
    vt_compat_ioctl(): clean up, use compat_ptr() properly
    gigaset: don't try to printk userland buffer contents
    dgnc: don't bother with (empty) stub for TCXONC
    dgnc: leave TIOC[GS]SOFTCAR to ldisc
    remove fallback to drivers for TIOCGICOUNT
    dgnc: break-related ioctls won't reach ->ioctl()
    kill the rest of tty COMPAT_IOCTL() entries
    dgnc: TIOCM... won't reach ->ioctl()
    isdn_tty: TCSBRK{,P} won't reach ->ioctl()
    kill capinc_tty_ioctl()
    take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()
    synclink: reduce pointless checks in ->ioctl()
    complete ->[sg]et_serial() switchover
    ...

    Linus Torvalds
     

13 Oct, 2018

1 commit

  • First of all, make it return int. Returning long when native method
    had never allowed that is ridiculous and inconvenient.

    More importantly, change the caller; if ldisc ->compat_ioctl() is NULL
    or returns -ENOIOCTLCMD, tty_compat_ioctl() will try to feed cmd and
    compat_ptr(arg) to ldisc's native ->ioctl().

    That simplifies ->compat_ioctl() instances quite a bit - they only
    need to deal with ioctls that are neither generic tty ones (those
    would get shunted off to tty_ioctl()) nor simple compat pointer ones.

    Note that something like TCFLSH won't reach ->compat_ioctl(),
    even if ldisc ->ioctl() does handle it - it will be recognized
    earlier and passed to tty_ioctl() (and ultimately - ldisc ->ioctl()).

    For many ldiscs it means that NULL ->compat_ioctl() does the
    right thing. Those where it won't serve (see e.g. n_r3964.c) are
    also easily dealt with - we need to handle the numeric-argument
    ioctls (calling the native instance) and, if such would exist,
    the ioctls that need layout conversion, etc.

    All in-tree ldiscs dealt with.

    Signed-off-by: Al Viro

    Al Viro
     

06 Oct, 2018

1 commit

  • In yam_ioctl(), the concrete ioctl command is firstly copied from the
    user-space buffer 'ifr->ifr_data' to 'ioctl_cmd' and checked through the
    following switch statement. If the command is not as expected, an error
    code EINVAL is returned. In the following execution the buffer
    'ifr->ifr_data' is copied again in the cases of the switch statement to
    specific data structures according to what kind of ioctl command is
    requested. However, after the second copy, no re-check is enforced on the
    newly-copied command. Given that the buffer 'ifr->ifr_data' is in the user
    space, a malicious user can race to change the command between the two
    copies. This way, the attacker can inject inconsistent data and cause
    undefined behavior.

    This patch adds a re-check in each case of the switch statement if there is
    a second copy in that case, to re-check whether the command obtained in the
    second copy is the same as the one in the first copy. If not, an error code
    EINVAL will be returned.

    Signed-off-by: Wenwen Wang
    Signed-off-by: David S. Miller

    Wenwen Wang
     

05 Jul, 2018

1 commit


20 Jun, 2018

1 commit

  • The array bpq_eth_addr is only used to get the size of an
    address, whereas the bcast_addr is used to set the broadcast
    address. This leads to a warning when using clang:
    drivers/net/hamradio/bpqether.c:94:13: warning: variable 'bpq_eth_addr' is not
    needed and will not be emitted [-Wunneeded-internal-declaration]
    static char bpq_eth_addr[6];
    ^

    Remove both variables and use the common eth_broadcast_addr
    to set the broadcast address.

    Signed-off-by: Stefan Agner
    Signed-off-by: David S. Miller

    Stefan Agner
     

07 Jun, 2018

1 commit

  • Pull networking updates from David Miller:

    1) Add Maglev hashing scheduler to IPVS, from Inju Song.

    2) Lots of new TC subsystem tests from Roman Mashak.

    3) Add TCP zero copy receive and fix delayed acks and autotuning with
    SO_RCVLOWAT, from Eric Dumazet.

    4) Add XDP_REDIRECT support to mlx5 driver, from Jesper Dangaard
    Brouer.

    5) Add ttl inherit support to vxlan, from Hangbin Liu.

    6) Properly separate ipv6 routes into their logically independant
    components. fib6_info for the routing table, and fib6_nh for sets of
    nexthops, which thus can be shared. From David Ahern.

    7) Add bpf_xdp_adjust_tail helper, which can be used to generate ICMP
    messages from XDP programs. From Nikita V. Shirokov.

    8) Lots of long overdue cleanups to the r8169 driver, from Heiner
    Kallweit.

    9) Add BTF ("BPF Type Format"), from Martin KaFai Lau.

    10) Add traffic condition monitoring to iwlwifi, from Luca Coelho.

    11) Plumb extack down into fib_rules, from Roopa Prabhu.

    12) Add Flower classifier offload support to igb, from Vinicius Costa
    Gomes.

    13) Add UDP GSO support, from Willem de Bruijn.

    14) Add documentation for eBPF helpers, from Quentin Monnet.

    15) Add TLS tx offload to mlx5, from Ilya Lesokhin.

    16) Allow applications to be given the number of bytes available to read
    on a socket via a control message returned from recvmsg(), from
    Soheil Hassas Yeganeh.

    17) Add x86_32 eBPF JIT compiler, from Wang YanQing.

    18) Add AF_XDP sockets, with zerocopy support infrastructure as well.
    From Björn Töpel.

    19) Remove indirect load support from all of the BPF JITs and handle
    these operations in the verifier by translating them into native BPF
    instead. From Daniel Borkmann.

    20) Add GRO support to ipv6 gre tunnels, from Eran Ben Elisha.

    21) Allow XDP programs to do lookups in the main kernel routing tables
    for forwarding. From David Ahern.

    22) Allow drivers to store hardware state into an ELF section of kernel
    dump vmcore files, and use it in cxgb4. From Rahul Lakkireddy.

    23) Various RACK and loss detection improvements in TCP, from Yuchung
    Cheng.

    24) Add TCP SACK compression, from Eric Dumazet.

    25) Add User Mode Helper support and basic bpfilter infrastructure, from
    Alexei Starovoitov.

    26) Support ports and protocol values in RTM_GETROUTE, from Roopa
    Prabhu.

    27) Support bulking in ->ndo_xdp_xmit() API, from Jesper Dangaard
    Brouer.

    28) Add lots of forwarding selftests, from Petr Machata.

    29) Add generic network device failover driver, from Sridhar Samudrala.

    * ra.kernel.org:/pub/scm/linux/kernel/git/davem/net-next: (1959 commits)
    strparser: Add __strp_unpause and use it in ktls.
    rxrpc: Fix terminal retransmission connection ID to include the channel
    net: hns3: Optimize PF CMDQ interrupt switching process
    net: hns3: Fix for VF mailbox receiving unknown message
    net: hns3: Fix for VF mailbox cannot receiving PF response
    bnx2x: use the right constant
    Revert "net: sched: cls: Fix offloading when ingress dev is vxlan"
    net: dsa: b53: Fix for brcm tag issue in Cygnus SoC
    enic: fix UDP rss bits
    netdev-FAQ: clarify DaveM's position for stable backports
    rtnetlink: validate attributes in do_setlink()
    mlxsw: Add extack messages for port_{un, }split failures
    netdevsim: Add extack error message for devlink reload
    devlink: Add extack to reload and port_{un, }split operations
    net: metrics: add proper netlink validation
    ipmr: fix error path when ipmr_new_table fails
    ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds
    net: hns3: remove unused hclgevf_cfg_func_mta_filter
    netfilter: provide udp*_lib_lookup for nf_tproxy
    qed*: Utilize FW 8.37.2.0
    ...

    Linus Torvalds
     

16 May, 2018

1 commit


26 Apr, 2018

1 commit

  • The check for len > 0 is always true and hence is redundant as
    this check is already being made to execute the code inside the
    while-loop. Hence it is redundant and can be removed.

    Cleans up cppcheck warning:
    drivers/net/hamradio/mkiss.c:220: (warning) Identical inner 'if'
    condition is always true.

    Signed-off-by: Colin Ian King
    Signed-off-by: David S. Miller

    Colin Ian King
     

27 Mar, 2018

1 commit


22 Nov, 2017

1 commit

  • With all callbacks converted, and the timer callback prototype
    switched over, the TIMER_FUNC_TYPE cast is no longer needed,
    so remove it. Conversion was done with the following scripts:

    perl -pi -e 's|\(TIMER_FUNC_TYPE\)||g' \
    $(git grep TIMER_FUNC_TYPE | cut -d: -f1 | sort -u)

    perl -pi -e 's|\(TIMER_DATA_TYPE\)||g' \
    $(git grep TIMER_DATA_TYPE | cut -d: -f1 | sort -u)

    The now unused macros are also dropped from include/linux/timer.h.

    Signed-off-by: Kees Cook

    Kees Cook
     

16 Nov, 2017

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    1) Maintain the TCP retransmit queue using an rbtree, with 1GB
    windows at 100Gb this really has become necessary. From Eric
    Dumazet.

    2) Multi-program support for cgroup+bpf, from Alexei Starovoitov.

    3) Perform broadcast flooding in hardware in mv88e6xxx, from Andrew
    Lunn.

    4) Add meter action support to openvswitch, from Andy Zhou.

    5) Add a data meta pointer for BPF accessible packets, from Daniel
    Borkmann.

    6) Namespace-ify almost all TCP sysctl knobs, from Eric Dumazet.

    7) Turn on Broadcom Tags in b53 driver, from Florian Fainelli.

    8) More work to move the RTNL mutex down, from Florian Westphal.

    9) Add 'bpftool' utility, to help with bpf program introspection.
    From Jakub Kicinski.

    10) Add new 'cpumap' type for XDP_REDIRECT action, from Jesper
    Dangaard Brouer.

    11) Support 'blocks' of transformations in the packet scheduler which
    can span multiple network devices, from Jiri Pirko.

    12) TC flower offload support in cxgb4, from Kumar Sanghvi.

    13) Priority based stream scheduler for SCTP, from Marcelo Ricardo
    Leitner.

    14) Thunderbolt networking driver, from Amir Levy and Mika Westerberg.

    15) Add RED qdisc offloadability, and use it in mlxsw driver. From
    Nogah Frankel.

    16) eBPF based device controller for cgroup v2, from Roman Gushchin.

    17) Add some fundamental tracepoints for TCP, from Song Liu.

    18) Remove garbage collection from ipv6 route layer, this is a
    significant accomplishment. From Wei Wang.

    19) Add multicast route offload support to mlxsw, from Yotam Gigi"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2177 commits)
    tcp: highest_sack fix
    geneve: fix fill_info when link down
    bpf: fix lockdep splat
    net: cdc_ncm: GetNtbFormat endian fix
    openvswitch: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start
    netem: remove unnecessary 64 bit modulus
    netem: use 64 bit divide by rate
    tcp: Namespace-ify sysctl_tcp_default_congestion_control
    net: Protect iterations over net::fib_notifier_ops in fib_seq_sum()
    ipv6: set all.accept_dad to 0 by default
    uapi: fix linux/tls.h userspace compilation error
    usbnet: ipheth: prevent TX queue timeouts when device not ready
    vhost_net: conditionally enable tx polling
    uapi: fix linux/rxrpc.h userspace compilation errors
    net: stmmac: fix LPI transitioning for dwmac4
    atm: horizon: Fix irq release error
    net-sysfs: trigger netlink notification on ifalias change via sysfs
    openvswitch: Using kfree_rcu() to simplify the code
    openvswitch: Make local function ovs_nsh_key_attr_size() static
    openvswitch: Fix return value check in ovs_meter_cmd_features()
    ...

    Linus Torvalds
     

14 Nov, 2017

1 commit

  • Pull timer updates from Thomas Gleixner:
    "Yet another big pile of changes:

    - More year 2038 work from Arnd slowly reaching the point where we
    need to think about the syscalls themself.

    - A new timer function which allows to conditionally (re)arm a timer
    only when it's either not running or the new expiry time is sooner
    than the armed expiry time. This allows to use a single timer for
    multiple timeout requirements w/o caring about the first expiry
    time at the call site.

    - A new NMI safe accessor to clock real time for the printk timestamp
    work. Can be used by tracing, perf as well if required.

    - A large number of timer setup conversions from Kees which got
    collected here because either maintainers requested so or they
    simply got ignored. As Kees pointed out already there are a few
    trivial merge conflicts and some redundant commits which was
    unavoidable due to the size of this conversion effort.

    - Avoid a redundant iteration in the timer wheel softirq processing.

    - Provide a mechanism to treat RTC implementations depending on their
    hardware properties, i.e. don't inflict the write at the 0.5
    seconds boundary which originates from the PC CMOS RTC to all RTCs.
    No functional change as drivers need to be updated separately.

    - The usual small updates to core code clocksource drivers. Nothing
    really exciting"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits)
    timers: Add a function to start/reduce a timer
    pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday()
    timer: Prepare to change all DEFINE_TIMER() callbacks
    netfilter: ipvs: Convert timers to use timer_setup()
    scsi: qla2xxx: Convert timers to use timer_setup()
    block/aoe: discover_timer: Convert timers to use timer_setup()
    ide: Convert timers to use timer_setup()
    drbd: Convert timers to use timer_setup()
    mailbox: Convert timers to use timer_setup()
    crypto: Convert timers to use timer_setup()
    drivers/pcmcia: omap1: Fix error in automated timer conversion
    ARM: footbridge: Fix typo in timer conversion
    drivers/sgi-xp: Convert timers to use timer_setup()
    drivers/pcmcia: Convert timers to use timer_setup()
    drivers/memstick: Convert timers to use timer_setup()
    drivers/macintosh: Convert timers to use timer_setup()
    hwrng/xgene-rng: Convert timers to use timer_setup()
    auxdisplay: Convert timers to use timer_setup()
    sparc/led: Convert timers to use timer_setup()
    mips: ip22/32: Convert timers to use timer_setup()
    ...

    Linus Torvalds
     

04 Nov, 2017

1 commit


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

01 Nov, 2017

1 commit


27 Oct, 2017

1 commit

  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly. Initialization was entirely missing.

    Cc: Jean-Paul Roubelat
    Cc: linux-hams@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: David S. Miller

    Kees Cook
     

22 Oct, 2017

1 commit

  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable sixpack.refcnt is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: David S. Miller

    Elena Reshetova
     

18 Oct, 2017

2 commits

  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly.

    Cc: Joerg Reuter
    Cc: linux-hams@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: David S. Miller

    Kees Cook
     
  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly.

    Cc: Andreas Koensgen
    Cc: linux-hams@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: David S. Miller

    Kees Cook
     

17 Oct, 2017

1 commit


05 Oct, 2017

1 commit

  • Drop the arguments from the macro and adjust all callers with the
    following script:

    perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \
    $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h)

    Signed-off-by: Kees Cook
    Acked-by: Geert Uytterhoeven # for m68k parts
    Acked-by: Guenter Roeck # for watchdog parts
    Acked-by: David S. Miller # for networking parts
    Acked-by: Greg Kroah-Hartman
    Acked-by: Kalle Valo # for wireless parts
    Acked-by: Arnd Bergmann
    Cc: linux-mips@linux-mips.org
    Cc: Petr Mladek
    Cc: Benjamin Herrenschmidt
    Cc: Lai Jiangshan
    Cc: Sebastian Reichel
    Cc: Kalle Valo
    Cc: Paul Mackerras
    Cc: Pavel Machek
    Cc: linux1394-devel@lists.sourceforge.net
    Cc: Chris Metcalf
    Cc: linux-s390@vger.kernel.org
    Cc: linux-wireless@vger.kernel.org
    Cc: "James E.J. Bottomley"
    Cc: Wim Van Sebroeck
    Cc: Michael Ellerman
    Cc: Ursula Braun
    Cc: Viresh Kumar
    Cc: Harish Patil
    Cc: Stephen Boyd
    Cc: Michael Reed
    Cc: Manish Chopra
    Cc: Len Brown
    Cc: Arnd Bergmann
    Cc: linux-pm@vger.kernel.org
    Cc: Heiko Carstens
    Cc: Tejun Heo
    Cc: Julian Wiedmann
    Cc: John Stultz
    Cc: Mark Gross
    Cc: linux-watchdog@vger.kernel.org
    Cc: linux-scsi@vger.kernel.org
    Cc: "Martin K. Petersen"
    Cc: Greg Kroah-Hartman
    Cc: "Rafael J. Wysocki"
    Cc: Oleg Nesterov
    Cc: Ralf Baechle
    Cc: Stefan Richter
    Cc: Guenter Roeck
    Cc: netdev@vger.kernel.org
    Cc: Martin Schwidefsky
    Cc: Andrew Morton
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: Sudip Mukherjee
    Link: https://lkml.kernel.org/r/1507159627-127660-11-git-send-email-keescook@chromium.org
    Signed-off-by: Thomas Gleixner

    Kees Cook
     

30 Sep, 2017

1 commit