1. 19 Feb, 2018 1 commit
    • Eric Dumazet's avatar
      netfilter: IDLETIMER: be syzkaller friendly · cfc2c740
      Eric Dumazet authored
      We had one report from syzkaller [1]
      
      First issue is that INIT_WORK() should be done before mod_timer()
      or we risk timer being fired too soon, even with a 1 second timer.
      
      Second issue is that we need to reject too big info->timeout
      to avoid overflows in msecs_to_jiffies(info->timeout * 1000), or
      risk looping, if result after overflow is 0.
      
      [1]
      WARNING: CPU: 1 PID: 5129 at kernel/workqueue.c:1444 __queue_work+0xdf4/0x1230 kernel/workqueue.c:1444
      Kernel panic - not syncing: panic_on_warn set ...
      
      CPU: 1 PID: 5129 Comm: syzkaller159866 Not tainted 4.16.0-rc1+ #230
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:17 [inline]
       dump_stack+0x194/0x257 lib/dump_stack.c:53
       panic+0x1e4/0x41c kernel/panic.c:183
       __warn+0x1dc/0x200 kernel/panic.c:547
       report_bug+0x211/0x2d0 lib/bug.c:184
       fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
       fixup_bug arch/x86/kernel/traps.c:247 [inline]
       do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
       do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
       invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:988
      RIP: 0010:__queue_work+0xdf4/0x1230 kernel/workqueue.c:1444
      RSP: 0018:ffff8801db507538 EFLAGS: 00010006
      RAX: ffff8801aeb46080 RBX: ffff8801db530200 RCX: ffffffff81481404
      RDX: 0000000000000100 RSI: ffffffff86b42640 RDI: 0000000000000082
      RBP: ffff8801db507758 R08: 1ffff1003b6a0de5 R09: 000000000000000c
      R10: ffff8801db5073f0 R11: 0000000000000020 R12: 1ffff1003b6a0eb6
      R13: ffff8801b1067ae0 R14: 00000000000001f8 R15: dffffc0000000000
       queue_work_on+0x16a/0x1c0 kernel/workqueue.c:1488
       queue_work include/linux/workqueue.h:488 [inline]
       schedule_work include/linux/workqueue.h:546 [inline]
       idletimer_tg_expired+0x44/0x60 net/netfilter/xt_IDLETIMER.c:116
       call_timer_fn+0x228/0x820 kernel/time/timer.c:1326
       expire_timers kernel/time/timer.c:1363 [inline]
       __run_timers+0x7ee/0xb70 kernel/time/timer.c:1666
       run_timer_softirq+0x4c/0x70 kernel/time/timer.c:1692
       __do_softirq+0x2d7/0xb85 kernel/softirq.c:285
       invoke_softirq kernel/softirq.c:365 [inline]
       irq_exit+0x1cc/0x200 kernel/softirq.c:405
       exiting_irq arch/x86/include/asm/apic.h:541 [inline]
       smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052
       apic_timer_interrupt+0xa9/0xb0 arch/x86/entry/entry_64.S:829
       </IRQ>
      RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:777 [inline]
      RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
      RIP: 0010:_raw_spin_unlock_irqrestore+0x5e/0xba kernel/locking/spinlock.c:184
      RSP: 0018:ffff8801c20173c8 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff12
      RAX: dffffc0000000000 RBX: 0000000000000282 RCX: 0000000000000006
      RDX: 1ffffffff0d592cd RSI: 1ffff10035d68d23 RDI: 0000000000000282
      RBP: ffff8801c20173d8 R08: 1ffff10038402e47 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff8820e5c8
      R13: ffff8801b1067ad8 R14: ffff8801aea7c268 R15: ffff8801aea7c278
       __debug_object_init+0x235/0x1040 lib/debugobjects.c:378
       debug_object_init+0x17/0x20 lib/debugobjects.c:391
       __init_work+0x2b/0x60 kernel/workqueue.c:506
       idletimer_tg_create net/netfilter/xt_IDLETIMER.c:152 [inline]
       idletimer_tg_checkentry+0x691/0xb00 net/netfilter/xt_IDLETIMER.c:213
       xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:850
       check_target net/ipv6/netfilter/ip6_tables.c:533 [inline]
       find_check_entry.isra.7+0x935/0xcf0 net/ipv6/netfilter/ip6_tables.c:575
       translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:744
       do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline]
       do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1686
       nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
       nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
       ipv6_setsockopt+0x10b/0x130 net/ipv6/ipv6_sockglue.c:927
       udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1422
       sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2976
       SYSC_setsockopt net/socket.c:1850 [inline]
       SyS_setsockopt+0x189/0x360 net/socket.c:1829
       do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287
      
      Fixes: 0902b469 ("netfilter: xtables: idletimer target implementation")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      cfc2c740
  2. 16 Feb, 2018 1 commit
  3. 14 Feb, 2018 15 commits
    • Paolo Abeni's avatar
      netfilter: nat: cope with negative port range · db57ccf0
      Paolo Abeni authored
      syzbot reported a division by 0 bug in the netfilter nat code:
      
      divide error: 0000 [#1] SMP KASAN
      Dumping ftrace buffer:
          (ftrace buffer empty)
      Modules linked in:
      CPU: 1 PID: 4168 Comm: syzkaller034710 Not tainted 4.16.0-rc1+ #309
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
      Google 01/01/2011
      RIP: 0010:nf_nat_l4proto_unique_tuple+0x291/0x530
      net/netfilter/nf_nat_proto_common.c:88
      RSP: 0018:ffff8801b2466778 EFLAGS: 00010246
      RAX: 000000000000f153 RBX: ffff8801b2466dd8 RCX: ffff8801b2466c7c
      RDX: 0000000000000000 RSI: ffff8801b2466c58 RDI: ffff8801db5293ac
      RBP: ffff8801b24667d8 R08: ffff8801b8ba6dc0 R09: ffffffff88af5900
      R10: ffff8801b24666f0 R11: 0000000000000000 R12: 000000002990f153
      R13: 0000000000000001 R14: 0000000000000000 R15: ffff8801b2466c7c
      FS:  00000000017e3880(0000) GS:ffff8801db500000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000208fdfe4 CR3: 00000001b5340002 CR4: 00000000001606e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
        dccp_unique_tuple+0x40/0x50 net/netfilter/nf_nat_proto_dccp.c:30
        get_unique_tuple+0xc28/0x1c10 net/netfilter/nf_nat_core.c:362
        nf_nat_setup_info+0x1c2/0xe00 net/netfilter/nf_nat_core.c:406
        nf_nat_redirect_ipv6+0x306/0x730 net/netfilter/nf_nat_redirect.c:124
        redirect_tg6+0x7f/0xb0 net/netfilter/xt_REDIRECT.c:34
        ip6t_do_table+0xc2a/0x1a30 net/ipv6/netfilter/ip6_tables.c:365
        ip6table_nat_do_chain+0x65/0x80 net/ipv6/netfilter/ip6table_nat.c:41
        nf_nat_ipv6_fn+0x594/0xa80 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c:302
        nf_nat_ipv6_local_fn+0x33/0x5d0
      net/ipv6/netfilter/nf_nat_l3proto_ipv6.c:407
        ip6table_nat_local_fn+0x2c/0x40 net/ipv6/netfilter/ip6table_nat.c:69
        nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline]
        nf_hook_slow+0xba/0x1a0 net/netfilter/core.c:483
        nf_hook include/linux/netfilter.h:243 [inline]
        NF_HOOK include/linux/netfilter.h:286 [inline]
        ip6_xmit+0x10ec/0x2260 net/ipv6/ip6_output.c:277
        inet6_csk_xmit+0x2fc/0x580 net/ipv6/inet6_connection_sock.c:139
        dccp_transmit_skb+0x9ac/0x10f0 net/dccp/output.c:142
        dccp_connect+0x369/0x670 net/dccp/output.c:564
        dccp_v6_connect+0xe17/0x1bf0 net/dccp/ipv6.c:946
        __inet_stream_connect+0x2d4/0xf00 net/ipv4/af_inet.c:620
        inet_stream_connect+0x58/0xa0 net/ipv4/af_inet.c:684
        SYSC_connect+0x213/0x4a0 net/socket.c:1639
        SyS_connect+0x24/0x30 net/socket.c:1620
        do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287
        entry_SYSCALL_64_after_hwframe+0x26/0x9b
      RIP: 0033:0x441c69
      RSP: 002b:00007ffe50cc0be8 EFLAGS: 00000217 ORIG_RAX: 000000000000002a
      RAX: ffffffffffffffda RBX: ffffffffffffffff RCX: 0000000000441c69
      RDX: 000000000000001c RSI: 00000000208fdfe4 RDI: 0000000000000003
      RBP: 00000000006cc018 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000538 R11: 0000000000000217 R12: 0000000000403590
      R13: 0000000000403620 R14: 0000000000000000 R15: 0000000000000000
      Code: 48 89 f0 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 46 02 00 00 48 8b
      45 c8 44 0f b7 20 e8 88 97 04 fd 31 d2 41 0f b7 c4 4c 89 f9 <41> f7 f6 48
      c1 e9 03 48 b8 00 00 00 00 00 fc ff df 0f b6 0c 01
      RIP: nf_nat_l4proto_unique_tuple+0x291/0x530
      net/netfilter/nf_nat_proto_common.c:88 RSP: ffff8801b2466778
      
      The problem is that currently we don't have any check on the
      configured port range. A port range == -1 triggers the bug, while
      other negative values may require a very long time to complete the
      following loop.
      
      This commit addresses the issue swapping the two ends on negative
      ranges. The check is performed in nf_nat_l4proto_unique_tuple() since
      the nft nat loads the port values from nft registers at runtime.
      
      v1 -> v2: use the correct 'Fixes' tag
      v2 -> v3: update commit message, drop unneeded READ_ONCE()
      
      Fixes: 5b1158e9 ("[NETFILTER]: Add NAT support for nf_conntrack")
      Reported-by: syzbot+8012e198bd037f4871e5@syzkaller.appspotmail.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      db57ccf0
    • Paolo Abeni's avatar
      netfilter: x_tables: fix missing timer initialization in xt_LED · 10414014
      Paolo Abeni authored
      syzbot reported that xt_LED may try to use the ledinternal->timer
      without previously initializing it:
      
      ------------[ cut here ]------------
      kernel BUG at kernel/time/timer.c:958!
      invalid opcode: 0000 [#1] SMP KASAN
      Dumping ftrace buffer:
          (ftrace buffer empty)
      Modules linked in:
      CPU: 1 PID: 1826 Comm: kworker/1:2 Not tainted 4.15.0+ #306
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
      Google 01/01/2011
      Workqueue: ipv6_addrconf addrconf_dad_work
      RIP: 0010:__mod_timer kernel/time/timer.c:958 [inline]
      RIP: 0010:mod_timer+0x7d6/0x13c0 kernel/time/timer.c:1102
      RSP: 0018:ffff8801d24fe9f8 EFLAGS: 00010293
      RAX: ffff8801d25246c0 RBX: ffff8801aec6cb50 RCX: ffffffff816052c6
      RDX: 0000000000000000 RSI: 00000000fffbd14b RDI: ffff8801aec6cb68
      RBP: ffff8801d24fec98 R08: 0000000000000000 R09: 1ffff1003a49fd6c
      R10: ffff8801d24feb28 R11: 0000000000000005 R12: dffffc0000000000
      R13: ffff8801d24fec70 R14: 00000000fffbd14b R15: ffff8801af608f90
      FS:  0000000000000000(0000) GS:ffff8801db500000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000206d6fd0 CR3: 0000000006a22001 CR4: 00000000001606e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
        led_tg+0x1db/0x2e0 net/netfilter/xt_LED.c:75
        ip6t_do_table+0xc2a/0x1a30 net/ipv6/netfilter/ip6_tables.c:365
        ip6table_raw_hook+0x65/0x80 net/ipv6/netfilter/ip6table_raw.c:42
        nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline]
        nf_hook_slow+0xba/0x1a0 net/netfilter/core.c:483
        nf_hook.constprop.27+0x3f6/0x830 include/linux/netfilter.h:243
        NF_HOOK include/linux/netfilter.h:286 [inline]
        ndisc_send_skb+0xa51/0x1370 net/ipv6/ndisc.c:491
        ndisc_send_ns+0x38a/0x870 net/ipv6/ndisc.c:633
        addrconf_dad_work+0xb9e/0x1320 net/ipv6/addrconf.c:4008
        process_one_work+0xbbf/0x1af0 kernel/workqueue.c:2113
        worker_thread+0x223/0x1990 kernel/workqueue.c:2247
        kthread+0x33c/0x400 kernel/kthread.c:238
        ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:429
      Code: 85 2a 0b 00 00 4d 8b 3c 24 4d 85 ff 75 9f 4c 8b bd 60 fd ff ff e8 bb
      57 10 00 65 ff 0d 94 9a a1 7e e9 d9 fc ff ff e8 aa 57 10 00 <0f> 0b e8 a3
      57 10 00 e9 14 fb ff ff e8 99 57 10 00 4c 89 bd 70
      RIP: __mod_timer kernel/time/timer.c:958 [inline] RSP: ffff8801d24fe9f8
      RIP: mod_timer+0x7d6/0x13c0 kernel/time/timer.c:1102 RSP: ffff8801d24fe9f8
      ---[ end trace f661ab06f5dd8b3d ]---
      
      The ledinternal struct can be shared between several different
      xt_LED targets, but the related timer is currently initialized only
      if the first target requires it. Fix it by unconditionally
      initializing the timer struct.
      
      v1 -> v2: call del_timer_sync() unconditionally, too.
      
      Fixes: 268cb38e ("netfilter: x_tables: add LED trigger target")
      Reported-by: syzbot+10c98dc5725c6c8fc7fb@syzkaller.appspotmail.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      10414014
    • Zhu Lingshan's avatar
      .gitignore: ignore ASN.1 auto generated files · d682026d
      Zhu Lingshan authored
      when build kernel with default configure, files:
      
      generatenet/ipv4/netfilter/nf_nat_snmp_basic-asn1.c
      net/ipv4/netfilter/nf_nat_snmp_basic-asn1.h
      
      will be automatically generated by ASN.1 compiler, so
      No need to track them in git, it's better to ignore them.
      Signed-off-by: default avatarZhu Lingshan <lszhu@suse.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      d682026d
    • Florian Westphal's avatar
    • Florian Westphal's avatar
      netfilter: x_tables: use pr ratelimiting in matches/targets · c08e5e1e
      Florian Westphal authored
      all of these print simple error message - use single pr_ratelimit call.
      checkpatch complains about lines > 80 but this would require splitting
      several "literals" over multiple lines which is worse.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c08e5e1e
    • Florian Westphal's avatar
    • Florian Westphal's avatar
      netfilter: bridge: use pr ratelimiting · 7ecbf103
      Florian Westphal authored
      ebt_among still uses pr_err -- these errors indicate ebtables tool bug,
      not a usage error.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      7ecbf103
    • Florian Westphal's avatar
      netfilter: xt_set: use pr ratelimiting · c82b31c5
      Florian Westphal authored
      also convert this to info for consistency.
      These errors are informational message to user, given iptables doesn't
      have netlink extack equivalent.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c82b31c5
    • Florian Westphal's avatar
      netfilter: xt_NFQUEUE: use pr ratelimiting · e016c5e4
      Florian Westphal authored
      switch this to info, since these aren't really errors.
      We only use printk because we cannot report meaningful errors
      in the xtables framework.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      e016c5e4
    • Florian Westphal's avatar
      netfilter: xt_CT: use pr ratelimiting · 11f7aee2
      Florian Westphal authored
      checkpatch complains about line > 80 but this would require splitting
      "literal" over two lines which is worse.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      11f7aee2
    • Florian Westphal's avatar
      netfilter: x_tables: use pr ratelimiting in xt core · 1b6cd671
      Florian Westphal authored
      most messages are converted to info, since they occur in response to
      wrong usage.
      
      Size mismatch however is a real error (xtables ABI bug) that should not
      occur.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      1b6cd671
    • Florian Westphal's avatar
      netfilter: x_tables: remove pr_info where possible · 0cc9501f
      Florian Westphal authored
      remove several pr_info messages that cannot be triggered with iptables,
      the check is only to ensure input is sane.
      
      iptables(8) already prints error messages in these cases.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      0cc9501f
    • Cong Wang's avatar
      netfilter: ipt_CLUSTERIP: fix a refcount bug in clusterip_config_find_get() · db93a363
      Cong Wang authored
      In clusterip_config_find_get() we hold RCU read lock so it could
      run concurrently with clusterip_config_entry_put(), as a result,
      the refcnt could go back to 1 from 0, which leads to a double
      list_del()... Just replace refcount_inc() with
      refcount_inc_not_zero(), as for c->refcount.
      
      Fixes: d73f33b1 ("netfilter: CLUSTERIP: RCU conversion")
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: Florian Westphal <fw@strlen.de>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      db93a363
    • Florian Westphal's avatar
      netfilter: add back stackpointer size checks · 57ebd808
      Florian Westphal authored
      The rationale for removing the check is only correct for rulesets
      generated by ip(6)tables.
      
      In iptables, a jump can only occur to a user-defined chain, i.e.
      because we size the stack based on number of user-defined chains we
      cannot exceed stack size.
      
      However, the underlying binary format has no such restriction,
      and the validation step only ensures that the jump target is a
      valid rule start point.
      
      IOW, its possible to build a rule blob that has no user-defined
      chains but does contain a jump.
      
      If this happens, no jump stack gets allocated and crash occurs
      because no jumpstack was allocated.
      
      Fixes: 7814b6ec ("netfilter: xtables: don't save/restore jumpstack offset")
      Reported-by: syzbot+e783f671527912cd9403@syzkaller.appspotmail.com
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      57ebd808
    • Paolo Abeni's avatar
      netfilter: drop outermost socket lock in getsockopt() · 01ea306f
      Paolo Abeni authored
      The Syzbot reported a possible deadlock in the netfilter area caused by
      rtnl lock, xt lock and socket lock being acquired with a different order
      on different code paths, leading to the following backtrace:
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      
      ======================================================
      WARNING: possible circular locking dependency detected
      4.15.0+ #301 Not tainted
      ------------------------------------------------------
      syzkaller233489/4179 is trying to acquire lock:
        (rtnl_mutex){+.+.}, at: [<0000000048e996fd>] rtnl_lock+0x17/0x20
      net/core/rtnetlink.c:74
      
      but task is already holding lock:
        (&xt[i].mutex){+.+.}, at: [<00000000328553a2>]
      xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1041
      
      which lock already depends on the new lock.
      ===
      
      Since commit 3f34cfae1230 ("netfilter: on sockopt() acquire sock lock
      only in the required scope"), we already acquire the socket lock in
      the innermost scope, where needed. In such commit I forgot to remove
      the outer-most socket lock from the getsockopt() path, this commit
      addresses the issues dropping it now.
      
      v1 -> v2: fix bad subj, added relavant 'fixes' tag
      
      Fixes: 22265a5c ("netfilter: xt_TEE: resolve oif using netdevice notifiers")
      Fixes: 202f59af ("netfilter: ipt_CLUSTERIP: do not hold dev")
      Fixes: 3f34cfae1230 ("netfilter: on sockopt() acquire sock lock only in the required scope")
      Reported-by: syzbot+ddde1c7b7ff7442d7f2d@syzkaller.appspotmail.com
      Suggested-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      01ea306f
  4. 08 Feb, 2018 13 commits
  5. 07 Feb, 2018 10 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · 4d80ecdb
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for you net tree, they
      are:
      
      1) Restore __GFP_NORETRY in xt_table allocations to mitigate effects of
         large memory allocation requests, from Michal Hocko.
      
      2) Release IPv6 fragment queue in case of error in fragmentation header,
         this is a follow up to amend patch 83f1999c, from Subash Abhinov
         Kasiviswanathan.
      
      3) Flowtable infrastructure depends on NETFILTER_INGRESS as it registers
         a hook for each flowtable, reported by John Crispin.
      
      4) Missing initialization of info->priv in xt_cgroup version 1, from
         Cong Wang.
      
      5) Give a chance to garbage collector to run after scheduling flowtable
         cleanup.
      
      6) Releasing flowtable content on nft_flow_offload module removal is
         not required at all, there is not dependencies between this module
         and flowtables, remove it.
      
      7) Fix missing xt_rateest_mutex grabbing for hash insertions, also from
         Cong Wang.
      
      8) Move nf_flow_table_cleanup() routine to flowtable core, this patch is
         a dependency for the next patch in this list.
      
      9) Flowtable resources are not properly released on removal from the
         control plane. Fix this resource leak by scheduling removal of all
         entries and explicit call to the garbage collector.
      
      10) nf_ct_nat_offset() declaration is dead code, this function prototype
          is not used anywhere, remove it. From Taehee Yoo.
      
      11) Fix another flowtable resource leak on entry insertion failures,
          this patch also fixes a possible use-after-free. Patch from Felix
          Fietkau.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d80ecdb
    • Felix Fietkau's avatar
      netfilter: nf_flow_offload: fix use-after-free and a resource leak · 0ff90b6c
      Felix Fietkau authored
      flow_offload_del frees the flow, so all associated resource must be
      freed before.
      
      Since the ct entry in struct flow_offload_entry was allocated by
      flow_offload_alloc, it should be freed by flow_offload_free to take care
      of the error handling path when flow_offload_add fails.
      
      While at it, make flow_offload_del static, since it should never be
      called directly, only from the gc step
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      0ff90b6c
    • Taehee Yoo's avatar
      netfilter: remove useless prototype · d8ed9600
      Taehee Yoo authored
      prototype nf_ct_nat_offset is not used anymore.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      d8ed9600
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · a2e5790d
      Linus Torvalds authored
      Merge misc updates from Andrew Morton:
      
       - kasan updates
      
       - procfs
      
       - lib/bitmap updates
      
       - other lib/ updates
      
       - checkpatch tweaks
      
       - rapidio
      
       - ubsan
      
       - pipe fixes and cleanups
      
       - lots of other misc bits
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
        Documentation/sysctl/user.txt: fix typo
        MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns
        MAINTAINERS: update various PALM patterns
        MAINTAINERS: update "ARM/OXNAS platform support" patterns
        MAINTAINERS: update Cortina/Gemini patterns
        MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern
        MAINTAINERS: remove ANDROID ION pattern
        mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors
        mm: docs: fix parameter names mismatch
        mm: docs: fixup punctuation
        pipe: read buffer limits atomically
        pipe: simplify round_pipe_size()
        pipe: reject F_SETPIPE_SZ with size over UINT_MAX
        pipe: fix off-by-one error when checking buffer limits
        pipe: actually allow root to exceed the pipe buffer limits
        pipe, sysctl: remove pipe_proc_fn()
        pipe, sysctl: drop 'min' parameter from pipe-max-size converter
        kasan: rework Kconfig settings
        crash_dump: is_kdump_kernel can be boolean
        kernel/mutex: mutex_is_locked can be boolean
        ...
      a2e5790d
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ab2d92ad
      Linus Torvalds authored
      Pull scheduler updates from Ingo Molnar:
      
       - membarrier updates (Mathieu Desnoyers)
      
       - SMP balancing optimizations (Mel Gorman)
      
       - stats update optimizations (Peter Zijlstra)
      
       - RT scheduler race fixes (Steven Rostedt)
      
       - misc fixes and updates
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: Use a recently used CPU as an idle candidate and the basis for SIS
        sched/fair: Do not migrate if the prev_cpu is idle
        sched/fair: Restructure wake_affine*() to return a CPU id
        sched/fair: Remove unnecessary parameters from wake_affine_idle()
        sched/rt: Make update_curr_rt() more accurate
        sched/rt: Up the root domain ref count when passing it around via IPIs
        sched/rt: Use container_of() to get root domain in rto_push_irq_work_func()
        sched/core: Optimize update_stats_*()
        sched/core: Optimize ttwu_stat()
        membarrier/selftest: Test private expedited sync core command
        membarrier/arm64: Provide core serializing command
        membarrier/x86: Provide core serializing command
        membarrier: Provide core serializing command, *_SYNC_CORE
        lockin/x86: Implement sync_core_before_usermode()
        locking: Introduce sync_core_before_usermode()
        membarrier/selftest: Test global expedited command
        membarrier: Provide GLOBAL_EXPEDITED command
        membarrier: Document scheduler barrier requirements
        powerpc, membarrier: Skip memory barrier in switch_mm()
        membarrier/selftest: Test private expedited command
      ab2d92ad
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4b0dda4f
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Tooling fixes, plus add missing interval sampling to certain x86 PEBS
        events"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Add trace/beauty/generated/ into .gitignore
        perf trace: Fix call-graph output
        x86/events/intel/ds: Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS
        perf record: Fix period option handling
        perf evsel: Fix period/freq terms setup
        tools headers: Synchoronize x86 features UAPI headers
        tools headers: Synchronize uapi/linux/sched.h
        tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h
        tooling headers: Synchronize updated s390 kvm UAPI headers
        tools headers: Synchronize sound/asound.h
      4b0dda4f
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b3250aab
      Linus Torvalds authored
      Pull locking fixlets from Ingo Molnar:
       "An endianness fix and a jump labels branch hint update"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/qrwlock: include asm/byteorder.h as needed
        jump_label: Add branch hints to static_branch_{un,}likely()
      b3250aab
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 0dc400f4
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix error path in netdevsim, from Jakub Kicinski.
      
       2) Default values listed in tcp_wmem and tcp_rmem documentation were
          inaccurate, from Tonghao Zhang.
      
       3) Fix route leaks in SCTP, both for ipv4 and ipv6. From Alexey Kodanev
          and Tommi Rantala.
      
       4) Fix "MASK < Y" meant to be "MASK << Y" in xgbe driver, from Wolfram
          Sang.
      
       5) Use after free in u32_destroy_key(), from Paolo Abeni.
      
       6) Fix two TX issues in be2net driver, from Suredh Reddy.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (25 commits)
        be2net: Handle transmit completion errors in Lancer
        be2net: Fix HW stall issue in Lancer
        RDS: IB: Fix null pointer issue
        nfp: fix kdoc warnings on nested structures
        sample/bpf: fix erspan metadata
        net: erspan: fix erspan config overwrite
        net: erspan: fix metadata extraction
        cls_u32: fix use after free in u32_destroy_key()
        net: amd-xgbe: fix comparison to bitshift when dealing with a mask
        net: phy: Handle not having GPIO enabled in the kernel
        ibmvnic: fix empty firmware version and errors cleanup
        sctp: fix dst refcnt leak in sctp_v4_get_dst
        sctp: fix dst refcnt leak in sctp_v6_get_dst()
        dwc-xlgmac: remove Jie Deng as co-maintainer
        doc: Change the min default value of tcp_wmem/tcp_rmem.
        samples/bpf: use bpf_set_link_xdp_fd
        libbpf: add missing SPDX-License-Identifier
        libbpf: add error reporting in XDP
        libbpf: add function to setup XDP
        tools: add netlink.h and if_link.h in tools uapi
        ...
      0dc400f4
    • Kangmin Park's avatar
      60c3e026
    • Joe Perches's avatar
      MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns · c1dad9ad
      Joe Perches authored
      Commit 32173741 ("tty: serial: msm: Move header file into driver")
      removed the .h file, update the patterns.
      
      Link: http://lkml.kernel.org/r/2b7478bc4c35ab3ac6b06b4edd3b645a8c34a4a2.1517147485.git.joe@perches.comSigned-off-by: default avatarJoe Perches <joe@perches.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Andy Gross <andy.gross@linaro.org>
      Cc: David Brown <david.brown@linaro.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c1dad9ad