1. 28 Oct, 2012 19 commits
  2. 22 Oct, 2012 2 commits
  3. 21 Oct, 2012 19 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.0.47 · e4965373
      Greg Kroah-Hartman authored
      e4965373
    • Maxim Kachur's avatar
      ALSA: emu10k1: add chip details for E-mu 1010 PCIe card · 87df253a
      Maxim Kachur authored
      commit 10f571d0 upstream.
      
      Add chip details for E-mu 1010 PCIe card. It has the same
      chip as found in E-mu 1010b but it uses different PCI id.
      Signed-off-by: default avatarMaxim Kachur <mcdebugger@duganet.ru>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87df253a
    • Takashi Iwai's avatar
    • Nikola Pajkovsky's avatar
      udf: fix retun value on error path in udf_load_logicalvol · b08d7dbc
      Nikola Pajkovsky authored
      commit 68766a2e upstream.
      
      In case we detect a problem and bail out, we fail to set "ret" to a
      nonzero value, and udf_load_logicalvol will mistakenly report success.
      Signed-off-by: default avatarNikola Pajkovsky <npajkovs@redhat.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b08d7dbc
    • Peter Huewe's avatar
      tpm: Propagate error from tpm_transmit to fix a timeout hang · 39a08852
      Peter Huewe authored
      commit abce9ac2 upstream.
      
      tpm_write calls tpm_transmit without checking the return value and
      assigns the return value unconditionally to chip->pending_data, even if
      it's an error value.
      This causes three bugs.
      
      So if we write to /dev/tpm0 with a tpm_param_size bigger than
      TPM_BUFSIZE=0x1000 (e.g. 0x100a)
      and a bufsize also bigger than TPM_BUFSIZE (e.g. 0x100a)
      tpm_transmit returns -E2BIG which is assigned to chip->pending_data as
      -7, but tpm_write returns that TPM_BUFSIZE bytes have been successfully
      been written to the TPM, altough this is not true (bug #1).
      
      As we did write more than than TPM_BUFSIZE bytes but tpm_write reports
      that only TPM_BUFSIZE bytes have been written the vfs tries to write
      the remaining bytes (in this case 10 bytes) to the tpm device driver via
      tpm_write which then blocks at
      
       /* cannot perform a write until the read has cleared
       either via tpm_read or a user_read_timer timeout */
       while (atomic_read(&chip->data_pending) != 0)
      	 msleep(TPM_TIMEOUT);
      
      for 60 seconds, since data_pending is -7 and nobody is able to
      read it (since tpm_read luckily checks if data_pending is greater than
      0) (#bug 2).
      
      After that the remaining bytes are written to the TPM which are
      interpreted by the tpm as a normal command. (bug #3)
      So if the last bytes of the command stream happen to be a e.g.
      tpm_force_clear this gets accidentally sent to the TPM.
      
      This patch fixes all three bugs, by propagating the error code of
      tpm_write and returning -E2BIG if the input buffer is too big,
      since the response from the tpm for a truncated value is bogus anyway.
      Moreover it returns -EBUSY to userspace if there is a response ready to be
      read.
      Signed-off-by: default avatarPeter Huewe <peter.huewe@infineon.com>
      Signed-off-by: default avatarKent Yoder <key@linux.vnet.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39a08852
    • H. Peter Anvin's avatar
      x86, random: Verify RDRAND functionality and allow it to be disabled · 8b9b3bf4
      H. Peter Anvin authored
      commit 49d859d7 upstream.
      
      If the CPU declares that RDRAND is available, go through a guranteed
      reseed sequence, and make sure that it is actually working (producing
      data.)   If it does not, disable the CPU feature flag.
      
      Allow RDRAND to be disabled on the command line (as opposed to at
      compile time) for a user who has special requirements with regards to
      random numbers.
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8b9b3bf4
    • H. Peter Anvin's avatar
      x86, random: Architectural inlines to get random integers with RDRAND · 5faf9fc3
      H. Peter Anvin authored
      commit 628c6246 upstream.
      
      Architectural inlines to get random ints and longs using the RDRAND
      instruction.
      
      Intel has introduced a new RDRAND instruction, a Digital Random Number
      Generator (DRNG), which is functionally an high bandwidth entropy
      source, cryptographic whitener, and integrity monitor all built into
      hardware.  This enables RDRAND to be used directly, bypassing the
      kernel random number pool.
      
      For technical documentation, see:
      
      http://software.intel.com/en-us/articles/download-the-latest-bull-mountain-software-implementation-guide/
      
      In this patch, this is *only* used for the nonblocking random number
      pool.  RDRAND is a nonblocking source, similar to our /dev/urandom,
      and is therefore not a direct replacement for /dev/random.  The
      architectural hooks presented in the previous patch only feed the
      kernel internal users, which only use the nonblocking pool, and so
      this is not a problem.
      
      Since this instruction is available in userspace, there is no reason
      to have a /dev/hw_rng device driver for the purpose of feeding rngd.
      This is especially so since RDRAND is a nonblocking source, and needs
      additional whitening and reduction (see the above technical
      documentation for details) in order to be of "pure entropy source"
      quality.
      
      The CONFIG_EXPERT compile-time option can be used to disable this use
      of RDRAND.
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Originally-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5faf9fc3
    • Jan Kara's avatar
      jbd: Fix assertion failure in commit code due to lacking transaction credits · b88ac13a
      Jan Kara authored
      commit 09e05d48 upstream.
      
      ext3 users of data=journal mode with blocksize < pagesize were occasionally
      hitting assertion failure in journal_commit_transaction() checking whether the
      transaction has at least as many credits reserved as buffers attached.  The
      core of the problem is that when a file gets truncated, buffers that still need
      checkpointing or that are attached to the committing transaction are left with
      buffer_mapped set. When this happens to buffers beyond i_size attached to a
      page stradding i_size, subsequent write extending the file will see these
      buffers and as they are mapped (but underlying blocks were freed) things go
      awry from here.
      
      The assertion failure just coincidentally (and in this case luckily as we would
      start corrupting filesystem) triggers due to journal_head not being properly
      cleaned up as well.
      
      Under some rare circumstances this bug could even hit data=ordered mode users.
      There the assertion won't trigger and we would end up corrupting the
      filesystem.
      
      We fix the problem by unmapping buffers if possible (in lots of cases we just
      need a buffer attached to a transaction as a place holder but it must not be
      written out anyway). And in one case, we just have to bite the bullet and wait
      for transaction commit to finish.
      Reviewed-by: default avatarJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b88ac13a
    • Egbert Eich's avatar
      drm/radeon: Don't destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy(). · cbdf1102
      Egbert Eich authored
      commit 08291847 upstream.
      
      radeon_i2c_fini() walks thru the list of I2C bus recs rdev->i2c_bus[]
      to destroy each of them.
      radeon_ext_tmds_enc_destroy() however also has code to destroy it's
      associated I2C bus rec which has been obtained by radeon_i2c_lookup()
      and is therefore also in the i2c_bus[] list.
      This causes a double free resulting in a kernel panic when unloading
      the radeon driver.
      Removing destroy code from radeon_ext_tmds_enc_destroy() fixes this
      problem.
      
      agd5f: fix compiler warning
      Signed-off-by: default avatarEgbert Eich <eich@suse.de>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cbdf1102
    • Jean-Christian de Rivaz's avatar
      Add CDC-ACM support for the CX93010-2x UCMxx USB Modem · 298d0427
      Jean-Christian de Rivaz authored
      commit e7d491a1 upstream.
      
      This USB V.92/V.32bis Controllered Modem have the USB vendor ID 0x0572
      and device ID 0x1340. It need the NO_UNION_NORMAL quirk to be recognized.
      
      Reference:
      http://www.conexant.com/servlets/DownloadServlet/DSH-201723-005.pdf?docid=1725&revid=5
      See idVendor and idProduct in table 6-1. Device Descriptors
      Signed-off-by: default avatarJean-Christian de Rivaz <jc@eclis.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      298d0427
    • Jan Engelhardt's avatar
      netfilter: xt_limit: have r->cost != 0 case work · dfd5603c
      Jan Engelhardt authored
      commit 82e6bfe2 upstream.
      
      Commit v2.6.19-rc1~1272^2~41 tells us that r->cost != 0 can happen when
      a running state is saved to userspace and then reinstated from there.
      
      Make sure that private xt_limit area is initialized with correct values.
      Otherwise, random matchings due to use of uninitialized memory.
      Signed-off-by: default avatarJan Engelhardt <jengelh@inai.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dfd5603c
    • Florian Westphal's avatar
      netfilter: limit, hashlimit: avoid duplicated inline · fb3c4ac3
      Florian Westphal authored
      commit 7a909ac7 upstream.
      
      credit_cap can be set to credit, which avoids inlining user2credits
      twice. Also, remove inline keyword and let compiler decide.
      
      old:
          684     192       0     876     36c net/netfilter/xt_limit.o
         4927     344      32    5303    14b7 net/netfilter/xt_hashlimit.o
      now:
          668     192       0     860     35c net/netfilter/xt_limit.o
         4793     344      32    5169    1431 net/netfilter/xt_hashlimit.o
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb3c4ac3
    • Pablo Neira Ayuso's avatar
      netfilter: nf_ct_expect: fix possible access to uninitialized timer · de07e511
      Pablo Neira Ayuso authored
      commit 2614f864 upstream.
      
      In __nf_ct_expect_check, the function refresh_timer returns 1
      if a matching expectation is found and its timer is successfully
      refreshed. This results in nf_ct_expect_related returning 0.
      Note that at this point:
      
      - the passed expectation is not inserted in the expectation table
        and its timer was not initialized, since we have refreshed one
        matching/existing expectation.
      
      - nf_ct_expect_alloc uses kmem_cache_alloc, so the expectation
        timer is in some undefined state just after the allocation,
        until it is appropriately initialized.
      
      This can be a problem for the SIP helper during the expectation
      addition:
      
       ...
       if (nf_ct_expect_related(rtp_exp) == 0) {
               if (nf_ct_expect_related(rtcp_exp) != 0)
                       nf_ct_unexpect_related(rtp_exp);
       ...
      
      Note that nf_ct_expect_related(rtp_exp) may return 0 for the timer refresh
      case that is detailed above. Then, if nf_ct_unexpect_related(rtcp_exp)
      returns != 0, nf_ct_unexpect_related(rtp_exp) is called, which does:
      
       spin_lock_bh(&nf_conntrack_lock);
       if (del_timer(&exp->timeout)) {
               nf_ct_unlink_expect(exp);
               nf_ct_expect_put(exp);
       }
       spin_unlock_bh(&nf_conntrack_lock);
      
      Note that del_timer always returns false if the timer has been
      initialized.  However, the timer was not initialized since setup_timer
      was not called, therefore, the expectation timer remains in some
      undefined state. If I'm not missing anything, this may lead to the
      removal an unexistent expectation.
      
      To fix this, the optimization that allows refreshing an expectation
      is removed. Now nf_conntrack_expect_related looks more consistent
      to me since it always add the expectation in case that it returns
      success.
      
      Thanks to Patrick McHardy for participating in the discussion of
      this patch.
      
      I think this may be the source of the problem described by:
      http://marc.info/?l=netfilter-devel&m=134073514719421&w=2Reported-by: default avatarRafal Fitt <rafalf@aplusc.com.pl>
      Acked-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      de07e511
    • Patrick McHardy's avatar
      netfilter: nf_nat_sip: fix via header translation with multiple parameters · 01f66df0
      Patrick McHardy authored
      commit f22eb25c upstream.
      
      Via-headers are parsed beginning at the first character after the Via-address.
      When the address is translated first and its length decreases, the offset to
      start parsing at is incorrect and header parameters might be missed.
      
      Update the offset after translating the Via-address to fix this.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      01f66df0
    • Lin Ming's avatar
      ipvs: fix oops on NAT reply in br_nf context · 4b552154
      Lin Ming authored
      commit 9e33ce45 upstream.
      
      IPVS should not reset skb->nf_bridge in FORWARD hook
      by calling nf_reset for NAT replies. It triggers oops in
      br_nf_forward_finish.
      
      [  579.781508] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
      [  579.781669] IP: [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112
      [  579.781792] PGD 218f9067 PUD 0
      [  579.781865] Oops: 0000 [#1] SMP
      [  579.781945] CPU 0
      [  579.781983] Modules linked in:
      [  579.782047]
      [  579.782080]
      [  579.782114] Pid: 4644, comm: qemu Tainted: G        W    3.5.0-rc5-00006-g95e69f9 #282 Hewlett-Packard  /30E8
      [  579.782300] RIP: 0010:[<ffffffff817b1ca5>]  [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112
      [  579.782455] RSP: 0018:ffff88007b003a98  EFLAGS: 00010287
      [  579.782541] RAX: 0000000000000008 RBX: ffff8800762ead00 RCX: 000000000001670a
      [  579.782653] RDX: 0000000000000000 RSI: 000000000000000a RDI: ffff8800762ead00
      [  579.782845] RBP: ffff88007b003ac8 R08: 0000000000016630 R09: ffff88007b003a90
      [  579.782957] R10: ffff88007b0038e8 R11: ffff88002da37540 R12: ffff88002da01a02
      [  579.783066] R13: ffff88002da01a80 R14: ffff88002d83c000 R15: ffff88002d82a000
      [  579.783177] FS:  0000000000000000(0000) GS:ffff88007b000000(0063) knlGS:00000000f62d1b70
      [  579.783306] CS:  0010 DS: 002b ES: 002b CR0: 000000008005003b
      [  579.783395] CR2: 0000000000000004 CR3: 00000000218fe000 CR4: 00000000000027f0
      [  579.783505] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  579.783684] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [  579.783795] Process qemu (pid: 4644, threadinfo ffff880021b20000, task ffff880021aba760)
      [  579.783919] Stack:
      [  579.783959]  ffff88007693cedc ffff8800762ead00 ffff88002da01a02 ffff8800762ead00
      [  579.784110]  ffff88002da01a02 ffff88002da01a80 ffff88007b003b18 ffffffff817b26c7
      [  579.784260]  ffff880080000000 ffffffff81ef59f0 ffff8800762ead00 ffffffff81ef58b0
      [  579.784477] Call Trace:
      [  579.784523]  <IRQ>
      [  579.784562]
      [  579.784603]  [<ffffffff817b26c7>] br_nf_forward_ip+0x275/0x2c8
      [  579.784707]  [<ffffffff81704b58>] nf_iterate+0x47/0x7d
      [  579.784797]  [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae
      [  579.784906]  [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102
      [  579.784995]  [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae
      [  579.785175]  [<ffffffff8187fa95>] ? _raw_write_unlock_bh+0x19/0x1b
      [  579.785179]  [<ffffffff817ac417>] __br_forward+0x97/0xa2
      [  579.785179]  [<ffffffff817ad366>] br_handle_frame_finish+0x1a6/0x257
      [  579.785179]  [<ffffffff817b2386>] br_nf_pre_routing_finish+0x26d/0x2cb
      [  579.785179]  [<ffffffff817b2cf0>] br_nf_pre_routing+0x55d/0x5c1
      [  579.785179]  [<ffffffff81704b58>] nf_iterate+0x47/0x7d
      [  579.785179]  [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44
      [  579.785179]  [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102
      [  579.785179]  [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44
      [  579.785179]  [<ffffffff81551525>] ? sky2_poll+0xb35/0xb54
      [  579.785179]  [<ffffffff817ad62a>] br_handle_frame+0x213/0x229
      [  579.785179]  [<ffffffff817ad417>] ? br_handle_frame_finish+0x257/0x257
      [  579.785179]  [<ffffffff816e3b47>] __netif_receive_skb+0x2b4/0x3f1
      [  579.785179]  [<ffffffff816e69fc>] process_backlog+0x99/0x1e2
      [  579.785179]  [<ffffffff816e6800>] net_rx_action+0xdf/0x242
      [  579.785179]  [<ffffffff8107e8a8>] __do_softirq+0xc1/0x1e0
      [  579.785179]  [<ffffffff8135a5ba>] ? trace_hardirqs_off_thunk+0x3a/0x6c
      [  579.785179]  [<ffffffff8188812c>] call_softirq+0x1c/0x30
      
      The steps to reproduce as follow,
      
      1. On Host1, setup brige br0(192.168.1.106)
      2. Boot a kvm guest(192.168.1.105) on Host1 and start httpd
      3. Start IPVS service on Host1
         ipvsadm -A -t 192.168.1.106:80 -s rr
         ipvsadm -a -t 192.168.1.106:80 -r 192.168.1.105:80 -m
      4. Run apache benchmark on Host2(192.168.1.101)
         ab -n 1000 http://192.168.1.106/
      
      ip_vs_reply4
        ip_vs_out
          handle_response
            ip_vs_notrack
              nf_reset()
              {
                skb->nf_bridge = NULL;
              }
      
      Actually, IPVS wants in this case just to replace nfct
      with untracked version. So replace the nf_reset(skb) call
      in ip_vs_notrack() with a nf_conntrack_put(skb->nfct) call.
      Signed-off-by: default avatarLin Ming <mlin@ss.pku.edu.cn>
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b552154
    • Pablo Neira Ayuso's avatar
      netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP expectation · 2b3e2b53
      Pablo Neira Ayuso authored
      commit 3f509c68 upstream.
      
      We're hitting bug while trying to reinsert an already existing
      expectation:
      
      kernel BUG at kernel/timer.c:895!
      invalid opcode: 0000 [#1] SMP
      [...]
      Call Trace:
       <IRQ>
       [<ffffffffa0069563>] nf_ct_expect_related_report+0x4a0/0x57a [nf_conntrack]
       [<ffffffff812d423a>] ? in4_pton+0x72/0x131
       [<ffffffffa00ca69e>] ip_nat_sdp_media+0xeb/0x185 [nf_nat_sip]
       [<ffffffffa00b5b9b>] set_expected_rtp_rtcp+0x32d/0x39b [nf_conntrack_sip]
       [<ffffffffa00b5f15>] process_sdp+0x30c/0x3ec [nf_conntrack_sip]
       [<ffffffff8103f1eb>] ? irq_exit+0x9a/0x9c
       [<ffffffffa00ca738>] ? ip_nat_sdp_media+0x185/0x185 [nf_nat_sip]
      
      We have to remove the RTP expectation if the RTCP expectation hits EBUSY
      since we keep trying with other ports until we succeed.
      Reported-by: default avatarRafal Fitt <rafalf@aplusc.com.pl>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2b3e2b53
    • Jozsef Kadlecsik's avatar
      netfilter: nf_ct_ipv4: packets with wrong ihl are invalid · 7e3cf6ea
      Jozsef Kadlecsik authored
      commit 07153c6e upstream.
      
      It was reported that the Linux kernel sometimes logs:
      
      klogd: [2629147.402413] kernel BUG at net / netfilter /
      nf_conntrack_proto_tcp.c: 447!
      klogd: [1072212.887368] kernel BUG at net / netfilter /
      nf_conntrack_proto_tcp.c: 392
      
      ipv4_get_l4proto() in nf_conntrack_l3proto_ipv4.c and tcp_error() in
      nf_conntrack_proto_tcp.c should catch malformed packets, so the errors
      at the indicated lines - TCP options parsing - should not happen.
      However, tcp_error() relies on the "dataoff" offset to the TCP header,
      calculated by ipv4_get_l4proto().  But ipv4_get_l4proto() does not check
      bogus ihl values in IPv4 packets, which then can slip through tcp_error()
      and get caught at the TCP options parsing routines.
      
      The patch fixes ipv4_get_l4proto() by invalidating packets with bogus
      ihl value.
      
      The patch closes netfilter bugzilla id 771.
      Signed-off-by: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7e3cf6ea
    • Pablo Neira Ayuso's avatar
      netfilter: nf_conntrack: fix racy timer handling with reliable events · 716362d0
      Pablo Neira Ayuso authored
      commit 5b423f6a upstream.
      
      Existing code assumes that del_timer returns true for alive conntrack
      entries. However, this is not true if reliable events are enabled.
      In that case, del_timer may return true for entries that were
      just inserted in the dying list. Note that packets / ctnetlink may
      hold references to conntrack entries that were just inserted to such
      list.
      
      This patch fixes the issue by adding an independent timer for
      event delivery. This increases the size of the ecache extension.
      Still we can revisit this later and use variable size extensions
      to allocate this area on demand.
      Tested-by: default avatarOliver Smith <olipro@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      716362d0
    • Julian Anastasov's avatar
      ipvs: fix oops in ip_vs_dst_event on rmmod · e3c41879
      Julian Anastasov authored
      commit 283283c4 upstream.
      
      	After commit 39f618b4 (3.4)
      "ipvs: reset ipvs pointer in netns" we can oops in
      ip_vs_dst_event on rmmod ip_vs because ip_vs_control_cleanup
      is called after the ipvs_core_ops subsys is unregistered and
      net->ipvs is NULL. Fix it by exiting early from ip_vs_dst_event
      if ipvs is NULL. It is safe because all services and dests
      for the net are already freed.
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3c41879