1. 12 Jan, 2012 33 commits
    • Julia Lawall's avatar
      drivers/usb/class/cdc-acm.c: clear dangling pointer · 30234e26
      Julia Lawall authored
      commit e7c8e860 upstream.
      
      On some failures, the country_code field of an acm structure is freed
      without freeing the acm structure itself.  Elsewhere, operations including
      memcpy and kfree are performed on the country_code field.  The patch sets
      the country_code field to NULL when it is freed, and likewise sets the
      country_code_size field to 0.
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Acked-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      30234e26
    • Jan Kara's avatar
      udf: Fix deadlock when converting file from in-ICB one to normal one · 9e9f6a20
      Jan Kara authored
      commit d2eb8c35 upstream.
      
      During BKL removal in 2.6.38, conversion of files from in-ICB format to normal
      format got broken. We call ->writepage with i_data_sem held but udf_get_block()
      also acquires i_data_sem thus creating A-A deadlock.
      
      We fix the problem by dropping i_data_sem before calling ->writepage() which is
      safe since i_mutex still protects us against any changes in the file. Also fix
      pagelock - i_data_sem lock inversion in udf_expand_file_adinicb() by dropping
      i_data_sem before calling find_or_create_page().
      Reported-by: default avatarMatthias Matiak <netzpython@mail-on.us>
      Tested-by: default avatarMatthias Matiak <netzpython@mail-on.us>
      Reviewed-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9e9f6a20
    • Li Zefan's avatar
      cgroup: fix to allow mounting a hierarchy by name · 62cf6918
      Li Zefan authored
      commit 0d19ea86 upstream.
      
      If we mount a hierarchy with a specified name, the name is unique,
      and we can use it to mount the hierarchy without specifying its
      set of subsystem names. This feature is documented is
      Documentation/cgroups/cgroups.txt section 2.3
      
      Here's an example:
      
      	# mount -t cgroup -o cpuset,name=myhier xxx /cgroup1
      	# mount -t cgroup -o name=myhier xxx /cgroup2
      
      But it was broken by commit 32a8cf23
      (cgroup: make the mount options parsing more accurate)
      
      This fixes the regression.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      62cf6918
    • Claudio Scordino's avatar
      atmel_serial: fix spinlock lockup in RS485 code · b71bb829
      Claudio Scordino authored
      commit dbf1115d upstream.
      
      Patch to fix a spinlock lockup in the driver that sometimes happens when the
      tasklet starts.
      Signed-off-by: default avatarClaudio Scordino <claudio@evidence.eu.com>
      Signed-off-by: default avatarDave Bender <codehero@gmail.com>
      Tested-by: default avatarDave Bender <codehero@gmail.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b71bb829
    • Sarah Sharp's avatar
      usbfs: Fix oops related to user namespace conversion. · 7f35a694
      Sarah Sharp authored
      commit 1b41c832 upstream.
      
      When running the Point Grey "flycap" program for their USB 3.0 camera
      (which was running as a USB 2.0 device for some reason), I trigger this
      oops whenever I try to open a video stream:
      
      Dec 15 16:48:34 puck kernel: [ 1798.715559] BUG: unable to handle kernel NULL pointer dereference at           (null)
      Dec 15 16:48:34 puck kernel: [ 1798.719153] IP: [<ffffffff8147841e>] free_async+0x1e/0x70
      Dec 15 16:48:34 puck kernel: [ 1798.720991] PGD 6f833067 PUD 6fc56067 PMD 0
      Dec 15 16:48:34 puck kernel: [ 1798.722815] Oops: 0002 [#1] SMP
      Dec 15 16:48:34 puck kernel: [ 1798.724627] CPU 0
      Dec 15 16:48:34 puck kernel: [ 1798.724636] Modules linked in: ecryptfs encrypted_keys sha1_generic trusted binfmt_misc sha256_generic aesni_intel cryptd aes_x86_64 aes_generic parport_pc dm_crypt ppdev joydev snd_hda_codec_hdmi snd_hda_codec_conexant arc4 iwlwifi snd_hda_intel snd_hda_codec snd_hwdep snd_pcm thinkpad_acpi mac80211 snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer btusb uvcvideo snd_seq_device bluetooth videodev psmouse snd v4l2_compat_ioctl32 serio_raw tpm_tis cfg80211 tpm tpm_bios nvram soundcore snd_page_alloc lp parport i915 xhci_hcd ahci libahci drm_kms_helper drm sdhci_pci sdhci e1000e i2c_algo_bit video
      Dec 15 16:48:34 puck kernel: [ 1798.734212]
      Dec 15 16:48:34 puck kernel: [ 1798.736162] Pid: 2713, comm: FlyCap2 Not tainted 3.2.0-rc5+ #28 LENOVO 4286CTO/4286CTO
      Dec 15 16:48:34 puck kernel: [ 1798.738148] RIP: 0010:[<ffffffff8147841e>]  [<ffffffff8147841e>] free_async+0x1e/0x70
      Dec 15 16:48:34 puck kernel: [ 1798.740134] RSP: 0018:ffff88005715fd78  EFLAGS: 00010296
      Dec 15 16:48:34 puck kernel: [ 1798.742118] RAX: 00000000fffffff4 RBX: ffff88006fe8f900 RCX: 0000000000004118
      Dec 15 16:48:34 puck kernel: [ 1798.744116] RDX: 0000000001000000 RSI: 0000000000016390 RDI: 0000000000000000
      Dec 15 16:48:34 puck kernel: [ 1798.746087] RBP: ffff88005715fd88 R08: 0000000000000000 R09: ffffffff8146f22e
      Dec 15 16:48:34 puck kernel: [ 1798.748018] R10: ffff88006e520ac0 R11: 0000000000000001 R12: ffff88005715fe28
      Dec 15 16:48:34 puck kernel: [ 1798.749916] R13: ffff88005d31df00 R14: ffff88006fe8f900 R15: 00007f688c995cb8
      Dec 15 16:48:34 puck kernel: [ 1798.751785] FS:  00007f68a366da40(0000) GS:ffff880100200000(0000) knlGS:0000000000000000
      Dec 15 16:48:34 puck kernel: [ 1798.753659] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      Dec 15 16:48:34 puck kernel: [ 1798.755509] CR2: 0000000000000000 CR3: 00000000706bb000 CR4: 00000000000406f0
      Dec 15 16:48:34 puck kernel: [ 1798.757334] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      Dec 15 16:48:34 puck kernel: [ 1798.759124] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Dec 15 16:48:34 puck kernel: [ 1798.760871] Process FlyCap2 (pid: 2713, threadinfo ffff88005715e000, task ffff88006c675b80)
      Dec 15 16:48:34 puck kernel: [ 1798.762605] Stack:
      Dec 15 16:48:34 puck kernel: [ 1798.764297]  ffff88005715fe28 0000000000000000 ffff88005715fe08 ffffffff81479058
      Dec 15 16:48:34 puck kernel: [ 1798.766020]  0000000000000000 ffffea0000004000 ffff880000004118 0000000000000000
      Dec 15 16:48:34 puck kernel: [ 1798.767750]  ffff880000000001 ffff88006e520ac0 fffffff46fd81180 0000000000000000
      Dec 15 16:48:34 puck kernel: [ 1798.769472] Call Trace:
      Dec 15 16:48:34 puck kernel: [ 1798.771147]  [<ffffffff81479058>] proc_do_submiturb+0x778/0xa00
      Dec 15 16:48:34 puck kernel: [ 1798.772798]  [<ffffffff8147a5fd>] usbdev_do_ioctl+0x24d/0x1200
      Dec 15 16:48:34 puck kernel: [ 1798.774410]  [<ffffffff8147b5de>] usbdev_ioctl+0xe/0x20
      Dec 15 16:48:34 puck kernel: [ 1798.775975]  [<ffffffff81189259>] do_vfs_ioctl+0x99/0x600
      Dec 15 16:48:34 puck kernel: [ 1798.777534]  [<ffffffff81189851>] sys_ioctl+0x91/0xa0
      Dec 15 16:48:34 puck kernel: [ 1798.779088]  [<ffffffff816247c2>] system_call_fastpath+0x16/0x1b
      ec 15 16:48:34 puck kernel: [ 1798.780634] Code: 51 ff ff ff e9 29 ff ff ff 0f 1f 40 00 55 48 89 e5 53 48 83 ec 08 66 66 66 66 90 48 89 fb 48 8b 7f 18 e8 a6 ea c0 ff 4
      8 8b 7b 20 <f0> ff 0f 0f 94 c0 84 c0 74 05 e8 d3 99 c1 ff 48 8b 43 40 48 8b
      Dec 15 16:48:34 puck kernel: [ 1798.783970] RIP  [<ffffffff8147841e>] free_async+0x1e/0x70
      Dec 15 16:48:34 puck kernel: [ 1798.785630]  RSP <ffff88005715fd78>
      Dec 15 16:48:34 puck kernel: [ 1798.787274] CR2: 0000000000000000
      Dec 15 16:48:34 puck kernel: [ 1798.794728] ---[ end trace 52894d3355f88d19 ]---
      
      markup_oops.pl says the oops is in put_cred:
      
       ffffffff81478401:      48 89 e5                mov    %rsp,%rbp
       ffffffff81478404:      53                      push   %rbx
       ffffffff81478405:      48 83 ec 08             sub    $0x8,%rsp
       ffffffff81478409:      e8 f2 c0 1a 00          callq  ffffffff81624500 <mcount>
       ffffffff8147840e:      48 89 fb                mov    %rdi,%rbx   |  %ebx => ffff88006fe8f900
              put_pid(as->pid);
       ffffffff81478411:      48 8b 7f 18             mov    0x18(%rdi),%rdi
       ffffffff81478415:      e8 a6 ea c0 ff          callq  ffffffff81086ec0 <put_pid>
              put_cred(as->cred);
       ffffffff8147841a:      48 8b 7b 20             mov    0x20(%rbx),%rdi |  %edi => 0  %ebx = ffff88006fe8f900
        */
       static inline int atomic_dec_and_test(atomic_t *v)
       {
              unsigned char c;
      
              asm volatile(LOCK_PREFIX "decl %0; sete %1"
      *ffffffff8147841e:      f0 ff 0f                lock decl (%rdi)   |  %edi = 0 <--- faulting instruction
       ffffffff81478421:      0f 94 c0                sete   %al
       static inline void put_cred(const struct cred *_cred)
       {
              struct cred *cred = (struct cred *) _cred;
      
              validate_creds(cred);
              if (atomic_dec_and_test(&(cred)->usage))
       ffffffff81478424:      84 c0                   test   %al,%al
       ffffffff81478426:      74 05                   je     ffffffff8147842d <free_async+0x2d>
                      __put_cred(cred);
       ffffffff81478428:      e8 d3 99 c1 ff          callq  ffffffff81091e00 <__put_cred>
              kfree(as->urb->transfer_buffer);
       ffffffff8147842d:      48 8b 43 40             mov    0x40(%rbx),%rax
       ffffffff81478431:      48 8b 78 68             mov    0x68(%rax),%rdi
       ffffffff81478435:      e8 a6 e1 ce ff          callq  ffffffff811665e0 <kfree>
              kfree(as->urb->setup_packet);
       ffffffff8147843a:      48 8b 43 40             mov    0x40(%rbx),%rax
       ffffffff8147843e:      48 8b b8 90 00 00 00    mov    0x90(%rax),%rdi
       ffffffff81478445:      e8 96 e1 ce ff          callq  ffffffff811665e0 <kfree>
              usb_free_urb(as->urb);
       ffffffff8147844a:      48 8b 7b 40             mov    0x40(%rbx),%rdi
       ffffffff8147844e:      e8 0d 6b ff ff          callq  ffffffff8146ef60 <usb_free_urb>
      
      This bug seems to have been introduced by commit
      d178bc3a "user namespace: usb: make usb
      urbs user namespace aware (v2)"
      
      I'm not sure if this is right fix, but it does stop the oops.
      
      Unfortunately, the Point Grey software still refuses to work, but it's a
      closed source app, so I can't fix it.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7f35a694
    • Alan Stern's avatar
      USB: update documentation for usbmon · 170b209a
      Alan Stern authored
      commit d8cae98c upstream.
      
      The documentation for usbmon is out of date; the usbfs "devices" file
      now exists in /sys/kernel/debug/usb rather than /proc/bus/usb.  This
      patch (as1505) updates the documentation accordingly, and also
      mentions that the necessary information can be found by running lsusb.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Pete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      170b209a
    • K. Y. Srinivasan's avatar
      Drivers:hv: Fix a bug in vmbus_driver_unregister() · d1883e70
      K. Y. Srinivasan authored
      commit 8f257a14 upstream.
      
      The function vmbus_exists() was introduced recently to deal with cases where
      the vmbus driver failed to initialize and yet other Hyper-V drivers attempted
      to register with the vmbus bus driver. This patch introduced a bug where
      vmbus_driver_unregister() would fail to unregister the driver. This patch
      fixes the problem.
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarFuzhou Chen <fuzhouch@microsoft.com>
      Cc: Sasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d1883e70
    • K. Y. Srinivasan's avatar
      drivers: hv: Don't OOPS when you cannot init vmbus · 32eef9ed
      K. Y. Srinivasan authored
      commit cf6a2eac upstream.
      
      The hv vmbus driver was causing an OOPS since it was trying to register drivers
      on top of the bus even if initialization of the bus has failed for some
      reason (such as the odd chance someone would run a hv enabled kernel in a
      non-hv environment).
      Signed-off-by: default avatarSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      32eef9ed
    • Jan Kara's avatar
      ext3: Don't warn from writepage when readonly inode is spotted after error · 0558681f
      Jan Kara authored
      commit 33c104d4 upstream.
      
      WARN_ON_ONCE(IS_RDONLY(inode)) tends to trip when filesystem hits error and is
      remounted read-only. This unnecessarily scares users (well, they should be
      scared because of filesystem error, but the stack trace distracts them from the
      right source of their fear ;-). We could as well just remove the WARN_ON but
      it's not hard to fix it to not trip on filesystem with errors and not use more
      cycles in the common case so that's what we do.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0558681f
    • Jeff Mahoney's avatar
      reiserfs: Force inode evictions before umount to avoid crash · 04e06ee5
      Jeff Mahoney authored
      commit a9e36da6 upstream.
      
      This patch fixes a crash in reiserfs_delete_xattrs during umount.
      
      When shrink_dcache_for_umount clears the dcache from
      generic_shutdown_super, delayed evictions are forced to disk. If an
      evicted inode has extended attributes associated with it, it will
      need to walk the xattr tree to locate and remove them.
      
      But since shrink_dcache_for_umount will BUG if it encounters active
      dentries, the xattr tree must be released before it's called or it will
      crash during every umount.
      
      This patch forces the evictions to occur before generic_shutdown_super
      by calling shrink_dcache_sb first. The additional evictions caused
      by the removal of each associated xattr file and dir will be automatically
      handled as they're added to the LRU list.
      
      CC: reiserfs-devel@vger.kernel.org
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04e06ee5
    • Jan Kara's avatar
      reiserfs: Fix quota mount option parsing · e75c11ac
      Jan Kara authored
      commit a06d789b upstream.
      
      When jqfmt mount option is not specified on remount, we mistakenly clear
      s_jquota_fmt value stored in superblock. Fix the problem.
      
      CC: reiserfs-devel@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e75c11ac
    • Boaz Harrosh's avatar
      ore: FIX breakage when MISC_FILESYSTEMS is not set · 88e02818
      Boaz Harrosh authored
      commit 831c2dc5 upstream.
      
      As Reported by Randy Dunlap
      
      When MISC_FILESYSTEMS is not enabled and NFS4.1 is:
      
      fs/built-in.o: In function `objio_alloc_io_state':
      objio_osd.c:(.text+0xcb525): undefined reference to `ore_get_rw_state'
      fs/built-in.o: In function `_write_done':
      objio_osd.c:(.text+0xcb58d): undefined reference to `ore_check_io'
      fs/built-in.o: In function `_read_done':
      ...
      
      When MISC_FILESYSTEMS, which is more of a GUI thing then anything else,
      is not selected. exofs/Kconfig is never examined during Kconfig,
      and it can not do it's magic stuff to automatically select everything
      needed.
      
      We must split exofs/Kconfig in two. The ore one is always included.
      And the exofs one is left in it's old place in the menu.
      Reported-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      88e02818
    • Boaz Harrosh's avatar
      ore: Must support none-PAGE-aligned IO · 673a3083
      Boaz Harrosh authored
      commit 724577ca upstream.
      
      NFS might send us offsets that are not PAGE aligned. So
      we must read in the reminder of the first/last pages, in cases
      we need it for Parity calculations.
      
      We only add an sg segments to read the partial page. But
      we don't mark it as read=true because it is a lock-for-write
      page.
      
      TODO: In some cases (IO spans a single unit) we can just
      adjust the raid_unit offset/length, but this is left for
      later Kernels.
      Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      673a3083
    • Boaz Harrosh's avatar
      ore: fix BUG_ON, too few sgs when reading · 0889c179
      Boaz Harrosh authored
      commit 361aba56 upstream.
      
      When reading RAID5 files, in rare cases, we calculated too
      few sg segments. There should be two extra for the beginning
      and end partial units.
      
      Also "too few sg segments" should not be a BUG_ON there is
      all the mechanics in place to handle it, as a short read.
      So just return -ENOMEM and the rest of the code will gracefully
      split the IO.
      Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0889c179
    • Boaz Harrosh's avatar
      ore: Fix crash in case of an IO error. · 68848527
      Boaz Harrosh authored
      commit ffefb8ea upstream.
      
      The users of ore_check_io() expect the reported device
      (In case of error) to be indexed relative to the passed-in
      ore_components table, and not the logical dev index.
      
      This causes a crash inside objlayoutdriver in case of
      an IO error.
      Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      68848527
    • Steven Rostedt's avatar
      perf: Fix parsing of __print_flags() in TP_printk() · 92341529
      Steven Rostedt authored
      commit 49908a1b upstream.
      
      A update is made to the sched:sched_switch event that adds some
      logic to the first parameter of the __print_flags() that shows the
      state of tasks. This change cause perf to fail parsing the flags.
      
      A simple fix is needed to have the parser be able to process ops
      within the argument.
      Reported-by: default avatarAndrew Vagin <avagin@openvz.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      92341529
    • Johannes Berg's avatar
      iwlagn: fix (remove) use of PAGE_SIZE · 0b58bf99
      Johannes Berg authored
      commit 10667136 upstream.
      
      The ICT code erroneously uses PAGE_SIZE. The bug
      is that PAGE_SIZE isn't necessarily 4096, so on
      such platforms this code will not work correctly
      as we'll try to attempt to read an index in the
      table that the device never wrote, it always has
      4096-byte pages.
      
      Additionally, the manual alignment code here is
      unnecessary -- Documentation/DMA-API-HOWTO.txt
      states:
        The cpu return address and the DMA bus master address are both
        guaranteed to be aligned to the smallest PAGE_SIZE order which
        is greater than or equal to the requested size.  This invariant
        exists (for example) to guarantee that if you allocate a chunk
        which is smaller than or equal to 64 kilobytes, the extent of the
        buffer you receive will not cross a 64K boundary.
      
      Just use appropriate new constants and get rid of
      the alignment code.
      
      Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0b58bf99
    • Johannes Berg's avatar
      iwlagn: fix TID use bug · 01b366aa
      Johannes Berg authored
      commit 9a215e40 upstream.
      
      The driver everywhere uses max TID count as 9,
      which is wrong, it should be 8.
      
      I think the reason it uses 9 here is off-by-one
      confusion by whoever wrote this. We do use the
      value IWL_MAX_TID_COUNT for "not QoS/no TID"
      but that is completely correct even if it is 8
      and not 9 since 0-7 are only valid.
      
      As a side effect, this fixes the following bug:
      
       Open BA session requested for 00:23:cd:16:8a:7e tid 8
       ------------[ cut here ]------------
       kernel BUG at drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h:350!
       ...
      
      when you do
      echo "tx start 8" > /sys/kernel/debug/ieee80211/*/*/*/*/agg_status
      Reported-by: default avatarNikolay Martynov <mar.kolya@gmail.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      01b366aa
    • Eli Cohen's avatar
      IB/uverbs: Protect QP multicast list · 585ea9bc
      Eli Cohen authored
      commit e214a0fe upstream.
      
      Userspace verbs multicast attach/detach operations on a QP are done
      while holding the rwsem of the QP for reading.  That's not sufficient
      since a reader lock allows more than one reader to acquire the
      lock.  However, multicast attach/detach does list manipulation that
      can corrupt the list if multiple threads run in parallel.
      
      Fix this by acquiring the rwsem as a writer to serialize attach/detach
      operations.  Add idr_write_qp() and put_qp_write() to encapsulate
      this.
      
      This fixes oops seen when running applications that perform multicast
      joins/leaves.
      
      Reported by: Mike Dubman <miked@mellanox.com>
      Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      585ea9bc
    • Ram Vepa's avatar
      IB/qib: Fix a possible data corruption when receiving packets · 0d878668
      Ram Vepa authored
      commit eddfb675 upstream.
      
      Prevent a receive data corruption by ensuring that the write to update
      the rcvhdrheadn register to generate an interrupt is at the very end
      of the receive processing.
      Signed-off-by: default avatarRamkrishna Vepa <ram.vepa@qlogic.com>
      Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@qlogic.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0d878668
    • Li Zhong's avatar
      powerpc: Fix unpaired probe_hcall_entry and probe_hcall_exit · ddcf85d7
      Li Zhong authored
      commit e4f387d8 upstream.
      
      Unpaired calling of probe_hcall_entry and probe_hcall_exit might happen
      as following, which could cause incorrect preempt count.
      
      __trace_hcall_entry => trace_hcall_entry -> probe_hcall_entry =>
      get_cpu_var => preempt_disable
      
      __trace_hcall_exit => trace_hcall_exit -> probe_hcall_exit =>
      put_cpu_var => preempt_enable
      
      where:
      A => B and A -> B means A calls B, but
      => means A will call B through function name, and B will definitely be
      called.
      -> means A will call B through function pointer, so B might not be
      called if the function pointer is not set.
      
      So error happens when only one of probe_hcall_entry and probe_hcall_exit
      get called during a hcall.
      
      This patch tries to move the preempt count operations from
      probe_hcall_entry and probe_hcall_exit to its callers.
      Reported-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarLi Zhong <zhong@linux.vnet.ibm.com>
      Tested-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ddcf85d7
    • Anton Blanchard's avatar
      powerpc/time: Handle wrapping of decrementer · 8e04782a
      Anton Blanchard authored
      commit 37fb9a02 upstream.
      
      When re-enabling interrupts we have code to handle edge sensitive
      decrementers by resetting the decrementer to 1 whenever it is negative.
      If interrupts were disabled long enough that the decrementer wrapped to
      positive we do nothing. This means interrupts can be delayed for a long
      time until it finally goes negative again.
      
      While we hope interrupts are never be disabled long enough for the
      decrementer to go positive, we have a very good test team that can
      drive any kernel into the ground. The softlockup data we get back
      from these fails could be seconds in the future, completely missing
      the cause of the lockup.
      
      We already keep track of the timebase of the next event so use that
      to work out if we should trigger a decrementer exception.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8e04782a
    • Pontus Fuchs's avatar
      wl12xx: Restore testmode ABI · f92fed3f
      Pontus Fuchs authored
      commit 3f176494 upstream.
      
      Commit 80900d01 accidently broke
      the ABI for testmode commands. Restore the ABI again.
      Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
      Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f92fed3f
    • Pontus Fuchs's avatar
      wl12xx: Check buffer bound when processing nvs data · 67d3bda6
      Pontus Fuchs authored
      commit f6efe96e upstream.
      
      An nvs with malformed contents could cause the processing of the
      calibration data to read beyond the end of the buffer. Prevent this
      from happening by adding bound checking.
      Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
      Reviewed-by: default avatarLuciano Coelho <coelho@ti.com>
      Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      67d3bda6
    • Pontus Fuchs's avatar
      wl12xx: Validate FEM index from ini file and FW · 240ecc4a
      Pontus Fuchs authored
      commit 2131d3c2 upstream.
      
      Check for out of bound FEM index to prevent reading beyond ini
      memory end.
      Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
      Reviewed-by: default avatarLuciano Coelho <coelho@ti.com>
      Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      240ecc4a
    • Rafał Miłecki's avatar
      bcma: support for suspend and resume · 618bbbe7
      Rafał Miłecki authored
      commit 775ab521 upstream.
      
      bcma used to lock up machine without enabling PCI or initializing CC.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      618bbbe7
    • Andres Salomon's avatar
      libertas: clean up scan thread handling · dd4f146b
      Andres Salomon authored
      commit afbca95f upstream.
      
      The libertas scan thread expects priv->scan_req to be non-NULL.  In theory,
      it should always be set.  In practice, we've seen the following oops:
      
      [ 8363.067444] Unable to handle kernel NULL pointer dereference at virtual address 00000004
      [ 8363.067490] pgd = c0004000
      [ 8363.078393] [00000004] *pgd=00000000
      [ 8363.086711] Internal error: Oops: 17 [#1] PREEMPT
      [ 8363.091375] Modules linked in: fuse libertas_sdio libertas psmouse mousedev ov7670 mmp_camera joydev videobuf2_core videobuf2_dma_sg videobuf2_memops [last unloaded: scsi_wait_scan]
      [ 8363.107490] CPU: 0    Not tainted  (3.0.0-gf7ccc69 #671)
      [ 8363.112799] PC is at lbs_scan_worker+0x108/0x5a4 [libertas]
      [ 8363.118326] LR is at 0x0
      [ 8363.120836] pc : [<bf03a854>]    lr : [<00000000>]    psr: 60000113
      [ 8363.120845] sp : ee66bf48  ip : 00000000  fp : 00000000
      [ 8363.120845] r10: ee2c2088  r9 : c04e2efc  r8 : eef97005
      [ 8363.132231] r7 : eee0716f  r6 : ee2c02c0  r5 : ee2c2088  r4 : eee07160
      [ 8363.137419] r3 : 00000000  r2 : a0000113  r1 : 00000001  r0 : eee07160
      [ 8363.143896] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      [ 8363.157630] Control: 10c5387d  Table: 2e754019  DAC: 00000015
      [ 8363.163334] Process kworker/u:1 (pid: 25, stack limit = 0xee66a2f8)
      
      While I've not found a smoking gun, there are two places that raised red flags
      for me.  The first is in _internal_start_scan, when we queue up a scan; we
      first queue the worker, and then set priv->scan_req.  There's theoretically
      a 50mS delay which should be plenty, but doing things that way just seems
      racy (and not in the good way).
      
      The second is in the scan worker thread itself.  Depending on the state of
      priv->scan_channel, we cancel pending scan runs and then requeue a run in
      300mS.  We then send the scan command down to the hardware, sleep, and if
      we get scan results for all the desired channels, we set priv->scan_req to
      NULL.  However, it that's happened in less than 300mS, what happens with
      the pending scan run?
      
      This patch addresses both of those concerns.  With the patch applied, we
      have not seen the oops in the past two weeks.
      Signed-off-by: default avatarAndres Salomon <dilinger@queued.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      dd4f146b
    • Benjamin Herrenschmidt's avatar
      offb: Fix bug in calculating requested vram size · 69236e60
      Benjamin Herrenschmidt authored
      commit c055fe07 upstream.
      
      We used to try to request 8 times more vram than needed, which would
      fail if the card has a too small BAR (observed with qemu & kvm).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      69236e60
    • Benjamin Herrenschmidt's avatar
      offb: Fix setting of the pseudo-palette for >8bpp · dfedad61
      Benjamin Herrenschmidt authored
      commit 1bb0b7d2 upstream.
      
      When using a >8bpp framebuffer, offb advertises truecolor, not directcolor,
      and doesn't touch the color map even if it has a corresponding access method
      for the real hardware.
      
      Thus it needs to set the pseudo-palette with all 3 components of the color,
      like other truecolor framebuffers, not with copies of the color index like
      a directcolor framebuffer would do.
      
      This went unnoticed for a long time because it's pretty hard to get offb
      to kick in with anything but 8bpp (old BootX under MacOS will do that and
      qemu does it).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      dfedad61
    • Larry Finger's avatar
      rt2800usb: Move ID out of unknown · 2289fb57
      Larry Finger authored
      commit 3f81f8f1 upstream.
      
      Testing on the openSUSE wireless forum has shown that a Linksys
      WUSB54GC v3 with USB ID 1737:0077 works with rt2800usb when the ID is
      written to /sys/.../new_id. This ID can therefore be moved out of UNKNOWN.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2289fb57
    • Neil Horman's avatar
      firmware: Fix an oops on reading fw_priv->fw in sysfs loading file · a5a0cdd6
      Neil Horman authored
      commit eea915bb upstream.
      
      This oops was reported recently:
      firmware_loading_store+0xf9/0x17b
      dev_attr_store+0x20/0x22
      sysfs_write_file+0x101/0x134
      vfs_write+0xac/0xf3
      sys_write+0x4a/0x6e
      system_call_fastpath+0x16/0x1b
      
      The complete backtrace was unfortunately not captured, but details can be found
      here:
      https://bugzilla.redhat.com/show_bug.cgi?id=769920
      
      The cause is fairly clear.
      
      Its caused by the fact that firmware_loading_store has a case 0 in its
      switch statement that reads and writes the fw_priv->fw poniter without the
      protection of the fw_lock mutex.  since there is a window between the time that
      _request_firmware sets fw_priv->fw to NULL and the time the corresponding sysfs
      file is unregistered, its possible for a user space application to race in, and
      write a zero to the loading file, causing a NULL dereference in
      firmware_loading_store.  Fix it by extending the protection of the fw_lock mutex
      to cover all of the firware_loading_store function.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a5a0cdd6
    • Joe Perches's avatar
      Documentation: Update stable address · 17079770
      Joe Perches authored
      commit 2eb7f204 upstream.
      
      The Japanese/Korean/Chinese versions still need updating.
      
      Also, the stable kernel 2.6.x.y descriptions are out of date
      and should be updated as well.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      17079770
    • Joe Perches's avatar
      MAINTAINERS: stable: Update address · 13e864be
      Joe Perches authored
      commit bc7a2f3a upstream.
      
      The old address hasn't worked since the great intrusion of August 2011.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      13e864be
  2. 04 Jan, 2012 7 commits