1. 05 9月, 2013 1 次提交
    • N
      fcoe: ensure that skb placed on the fip_recv_list are unshared · c0866286
      Neil Horman 提交于
      Recently had this Oops reported to me on the 3.10 kernel:
      
      [  807.554955] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      [  807.562799] IP: [<ffffffff814e6fc7>] skb_dequeue+0x47/0x70
      [  807.568296] PGD 20c889067 PUD 20c8b8067 PMD 0
      [  807.572769] Oops: 0002 [#1] SMP
      [  807.655597] Hardware name: Dell Inc. PowerEdge R415/0DDT2D, BIOS 1.8.6 12/06/2011
      [  807.663079] Workqueue: events fcoe_ctlr_recv_work [libfcoe]
      [  807.668656] task: ffff88020b42a160 ti: ffff88020ae6c000 task.ti: ffff88020ae6c000
      [  807.676126] RIP: 0010:[<ffffffff814e6fc7>]  [<ffffffff814e6fc7>] skb_dequeue+0x47/0x70
      [  807.684046] RSP: 0000:ffff88020ae6dd70  EFLAGS: 00010097
      [  807.689349] RAX: 0000000000000246 RBX: ffff8801d04d6700 RCX: 0000000000000000
      [  807.696474] RDX: 0000000000000000 RSI: 0000000000000246 RDI: ffff88020df26434
      [  807.703598] RBP: ffff88020ae6dd88 R08: 00000000000173e0 R09: ffff880216e173e0
      [  807.710723] R10: ffffffff814e5897 R11: ffffea0007413580 R12: ffff88020df26420
      [  807.717847] R13: ffff88020df26434 R14: 0000000000000004 R15: ffff8801d04c42ce
      [  807.724972] FS:  00007fdaab6048c0(0000) GS:ffff880216e00000(0000) knlGS:0000000000000000
      [  807.733049] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [  807.738785] CR2: 0000000000000008 CR3: 000000020cbc9000 CR4: 00000000000006f0
      [  807.745910] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  807.753033] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [  807.760156] Stack:
      [  807.762162]  ffff8801d04d6700 0000000000000001 ffff88020df26400 ffff88020ae6de20
      [  807.769586]  ffffffffa0444409 ffff88020b046a00 ffff88020ae6dde8 ffffffff810105be
      [  807.777008]  ffff88020b42a868 0000000000000000 ffff88020df264a8 ffff88020df26348
      [  807.784431] Call Trace:
      [  807.786885]  [<ffffffffa0444409>] fcoe_ctlr_recv_work+0x59/0x9a0 [libfcoe]
      [  807.793755]  [<ffffffff810105be>] ? __switch_to+0x13e/0x4a0
      [  807.799324]  [<ffffffff8107d0e6>] process_one_work+0x176/0x420
      [  807.805151]  [<ffffffff8107dd0b>] worker_thread+0x11b/0x3a0
      [  807.810717]  [<ffffffff8107dbf0>] ? rescuer_thread+0x350/0x350
      [  807.816545]  [<ffffffff810842b0>] kthread+0xc0/0xd0
      [  807.821416]  [<ffffffff810841f0>] ? insert_kthread_work+0x40/0x40
      [  807.827503]  [<ffffffff8160ce2c>] ret_from_fork+0x7c/0xb0
      [  807.832897]  [<ffffffff810841f0>] ? insert_kthread_work+0x40/0x40
      [  807.858500] RIP  [<ffffffff814e6fc7>] skb_dequeue+0x47/0x70
      [  807.864076]  RSP <ffff88020ae6dd70>
      [  807.867558] CR2: 0000000000000008
      
      Looks like the root cause is the fact that the packet recieve function
      fcoe_ctlr_recv enqueues the skb to a sk_buff_head_list prior to ensuring that
      the skb is unshared.  This can happen when multiple packet listeners recieve an
      skb, as the deliver_skb function just increments skb->users for each handler.
      As a result, having multiple users of a single skb results in multiple
      manipulators of its methods, implying list corruption, and the oops recorded
      above.
      
      The fix is pretty easy, just make sure that we clone the skb if its got multiple
      users with the skb_share_check function, like other protocols do.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      c0866286
  2. 10 7月, 2013 1 次提交
    • M
      fcoe: Stop fc_rport_priv structure leak · d17efa00
      Mark Rustad 提交于
      When repeatedly doing rmmod and modprobe on the ixgbe
      driver while FCoE is active in a VN2VN configuration,
      memory leaks would be discovered by kmemleak with the
      following backtrace:
      
      unreferenced object 0xffff88003d076000 (size 1024):
        comm "kworker/0:3", pid 2998, jiffies 4295436448 (age 1015.332s)
        hex dump (first 32 bytes):
          48 8a fe 6f 00 88 ff ff 00 00 00 00 00 00 00 00  H..o............
          01 00 00 00 02 00 00 00 7b ac 87 21 1b 00 00 10  ........{..!....
        backtrace:
          [<ffffffff814b308b>] kmemleak_alloc+0x5b/0xc0
          [<ffffffff8115c6e8>] __kmalloc+0xd8/0x1b0
          [<ffffffffa0216638>] fc_rport_create+0x48/0x1f0 [libfc]
          [<ffffffffa023cd86>] fcoe_ctlr_vn_add.isra.10+0x56/0x1a0 [libfcoe]
          [<ffffffffa023f440>] fcoe_ctlr_vn_recv+0x8b0/0xab0 [libfcoe]
          [<ffffffffa023fb06>] fcoe_ctlr_recv_work+0x4c6/0xf60 [libfcoe]
          [<ffffffff81067404>] process_one_work+0x1e4/0x4d0
          [<ffffffff81068def>] worker_thread+0x10f/0x380
          [<ffffffff8107019a>] kthread+0xea/0xf0
          [<ffffffff814d32ec>] ret_from_fork+0x7c/0xb0
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      This patch stops the leak of the fc_rport_priv structure.
      Signed-off-by: NMark Rustad <mark.d.rustad@intel.com>
      Tested-by: NJack Morgan <jack.morgan@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      d17efa00
  3. 11 5月, 2013 1 次提交
  4. 30 4月, 2013 1 次提交
  5. 26 3月, 2013 3 次提交
  6. 20 2月, 2013 1 次提交
  7. 12 2月, 2013 1 次提交
  8. 18 12月, 2012 1 次提交
    • A
      random32: rename random32 to prandom · 496f2f93
      Akinobu Mita 提交于
      This renames all random32 functions to have 'prandom_' prefix as follows:
      
        void prandom_seed(u32 seed);	/* rename from srandom32() */
        u32 prandom_u32(void);		/* rename from random32() */
        void prandom_seed_state(struct rnd_state *state, u64 seed);
        				/* rename from prandom32_seed() */
        u32 prandom_u32_state(struct rnd_state *state);
        				/* rename from prandom32() */
      
      The purpose of this renaming is to prevent some kernel developers from
      assuming that prandom32() and random32() might imply that only
      prandom32() was the one using a pseudo-random number generator by
      prandom32's "p", and the result may be a very embarassing security
      exposure.  This concern was expressed by Theodore Ts'o.
      
      And furthermore, I'm going to introduce new functions for getting the
      requested number of pseudo-random bytes.  If I continue to use both
      prandom32 and random32 prefixes for these functions, the confusion
      is getting worse.
      
      As a result of this renaming, "prandom_" is the common prefix for
      pseudo-random number library.
      
      Currently, srandom32() and random32() are preserved because it is
      difficult to rename too many users at once.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      496f2f93
  9. 15 12月, 2012 1 次提交
    • R
      fcoe: Use the fcoe_sysfs control interface · 435c8667
      Robert Love 提交于
      This patch adds support for the new fcoe_sysfs
      control interface to fcoe.ko. It keeps the deprecated
      interface in tact and therefore either the legacy
      or the new control interfaces can be used. A mixed mode
      is not supported. A user must either use the new
      interfaces or the old ones, but not both.
      
      The fcoe_ctlr's link state is now driven by both the
      netdev link state as well as the fcoe_ctlr_device's
      enabled attribute. The link must be up and the
      fcoe_ctlr_device must be enabled before the FCoE
      Controller starts discovery or login.
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      435c8667
  10. 20 7月, 2012 1 次提交
  11. 23 5月, 2012 1 次提交
    • R
      [SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs · 8d55e507
      Robert Love 提交于
      This patch has the SW FCoE driver and the bnx2fc
      driver make use of the new fcoe_sysfs API added
      earlier in this patch series.
      
      After this patch a fcoe_ctlr_device is allocated with
      private data in this order.
      
      +------------------+   +------------------+
      | fcoe_ctlr_device |   | fcoe_ctlr_device |
      +------------------+   +------------------+
      | fcoe_ctlr        |   | fcoe_ctlr        |
      +------------------+   +------------------+
      | fcoe_interface   |   | bnx2fc_interface |
      +------------------+   +------------------+
      
      libfcoe also takes part in this new model since it
      discovers and manages fcoe_fcf instances. The memory
      allocation is different for FCFs. I didn't want to
      impact libfcoe's fcoe_fcf processing, so this patch
      creates fcoe_fcf_device instances for each discovered
      fcoe_fcf. The two are paired using a (void * priv)
      member of the fcoe_ctlr_device. This allows libfcoe
      to continue maintaining its list of fcoe_fcf instances
      and simply attaches and detaches them from existing
      or new fcoe_fcf_device instances.
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Tested-by: NRoss Brattain <ross.b.brattain@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      8d55e507
  12. 10 5月, 2012 1 次提交
  13. 28 3月, 2012 2 次提交
  14. 15 12月, 2011 1 次提交
  15. 25 5月, 2011 1 次提交
  16. 01 5月, 2011 1 次提交
  17. 31 3月, 2011 1 次提交
  18. 13 2月, 2011 3 次提交
  19. 22 12月, 2010 8 次提交
  20. 26 10月, 2010 1 次提交
  21. 28 7月, 2010 8 次提交