1. 28 10月, 2010 12 次提交
  2. 27 10月, 2010 5 次提交
    • V
      drivers/char/hpet.c: fix information leak to userland · dae512ed
      Vasiliy Kulikov 提交于
      Structure info is copied to userland with some padding fields unitialized.
      It leads to leaking of stack memory.
      
      [akpm@linux-foundation.org: remove now-unneeded zeroing of info->hi_ireqfreq]
      Signed-off-by: NVasiliy Kulikov <segooon@gmail.com>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dae512ed
    • J
      hpet: fix style problems · 0ca01763
      Jaswinder Singh Rajput 提交于
      Fix the following style problems:
      
      WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
      WARNING: Use #include <linux/io.h> instead of <asm/io.h>
      ERROR: code indent should use tabs where possible
      ERROR: do not initialise statics to 0 or NULL
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0ca01763
    • C
      hpet: fix unwanted interrupt due to stale irq status bit · 96e9694d
      Clemens Ladisch 提交于
      Jaswinder Singh Rajput wrote:
      > By executing Documentation/timers/hpet_example.c
      >
      > for polling, I requested for 3 iterations but it seems iteration work
      > for only 2 as first expired time is always very small.
      >
      > # ./hpet_example poll /dev/hpet 10 3
      > -hpet: executing poll
      > hpet_poll: info.hi_flags 0x0
      > hpet_poll: expired time = 0x13
      > hpet_poll: revents = 0x1
      > hpet_poll: data 0x1
      > hpet_poll: expired time = 0x1868c
      > hpet_poll: revents = 0x1
      > hpet_poll: data 0x1
      > hpet_poll: expired time = 0x18645
      > hpet_poll: revents = 0x1
      > hpet_poll: data 0x1
      
      Clearing the HPET interrupt enable bit disables interrupt generation
      but does not disable the timer, so the interrupt status bit will still
      be set when the timer elapses.  If another interrupt arrives before
      the timer has been correctly programmed (due to some other device on
      the same interrupt line, or CONFIG_DEBUG_SHIRQ), this results in an
      extra unwanted interrupt event because the status bit is likely to be
      set from comparator matches that happened before the device was opened.
      
      Therefore, we have to ensure that the interrupt status bit is and
      stays cleared until we actually program the timer.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Reported-by: NJaswinder Singh Rajput <jaswinderlinux@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Bob Picco <bpicco@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96e9694d
    • J
      hpet: unmap unused I/O space · a56d5318
      Jiri Slaby 提交于
      When the initialization code in hpet finds a memory resource and does not
      find an IRQ, it does not unmap the memory resource previously mapped.
      
      There are buggy BIOSes which report resources exactly like this and what
      is worse the memory region bases point to normal RAM.  This normally would
      not matter since the space is not touched.  But when PAT is turned on,
      ioremap causes the page to be uncached and sets this bit in page->flags.
      
      Then when the page is about to be used by the allocator, it is reported
      as:
      
      BUG: Bad page state in process md5sum  pfn:3ed00
      page:ffffea0000dbd800 count:0 mapcount:0 mapping:(null) index:0x0
      page flags: 0x20000001000000(uncached)
      Pid: 7956, comm: md5sum Not tainted 2.6.34-12-desktop #1
      Call Trace:
       [<ffffffff810df851>] bad_page+0xb1/0x100
       [<ffffffff810dfa45>] prep_new_page+0x1a5/0x1c0
       [<ffffffff810dfe01>] get_page_from_freelist+0x3a1/0x640
       [<ffffffff810e01af>] __alloc_pages_nodemask+0x10f/0x6b0
      ...
      
      In this particular case:
      
      1) HPET returns 3ed00000 as memory region base, but it is not in
      reserved ranges reported by the BIOS (excerpt):
       BIOS-e820: 0000000000100000 - 00000000af6cf000 (usable)
       BIOS-e820: 00000000af6cf000 - 00000000afdcf000 (reserved)
      
      2) there is no IRQ resource reported by HPET method. On the other
      hand, the Intel HPET specs (1.0a) says (3.2.5.1):
      _CRS (
        // Report 1K of memory consumed by this Timer Block
        memory range consumed
        // Optional: only used if BIOS allocates Interrupts [1]
        IRQs consumed
      )
      
      [1] For case where Timer Block is configured to consume IRQ0/IRQ8 AND
      Legacy 8254/Legacy RTC hardware still exists, the device objects
      associated with 8254 & RTC devices should not report IRQ0/IRQ8 as
      "consumed resources".
      
      So in theory we should check whether if it is the case and use those
      interrupts instead.
      
      Anyway the address reported by the BIOS here is bogus, so non-presence
      of IRQ doesn't mean the "optional" part in point 2).
      
      Since I got no reply previously, fix this by simply unmapping the space
      when IRQ is not found and memory region was mapped previously.  It would
      be probably more safe to walk the resources again and unmap appropriately
      depending on type.  But as we now use only ioremap for both 2 memory
      resource types, it is not necessarily needed right now.
      
      Addresses https://bugzilla.novell.com/show_bug.cgi?id=629908Reported-by: NOlaf Hering <olaf@aepfle.de>
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a56d5318
    • E
      ipmi: proper spinlock initialization · de5e2ddf
      Eric Dumazet 提交于
      Unloading ipmi module can trigger following error.  (if
      CONFIG_DEBUG_SPINLOCK=y)
      
      [ 9633.779590] BUG: spinlock bad magic on CPU#1, rmmod/7170
      [ 9633.779606]  lock: f41f5414, .magic: 00000000, .owner:
      <none>/-1, .owner_cpu: 0
      [ 9633.779626] Pid: 7170, comm: rmmod Not tainted
      2.6.36-rc7-11474-gb71eb1e-dirty #328
      [ 9633.779644] Call Trace:
      [ 9633.779657]  [<c13921cc>] ? printk+0x18/0x1c
      [ 9633.779672]  [<c11a1f33>] spin_bug+0xa3/0xf0
      [ 9633.779685]  [<c11a1ffd>] do_raw_spin_lock+0x7d/0x160
      [ 9633.779702]  [<c1131537>] ? release_sysfs_dirent+0x47/0xb0
      [ 9633.779718]  [<c1131b78>] ? sysfs_addrm_finish+0xa8/0xd0
      [ 9633.779734]  [<c1394bac>] _raw_spin_lock_irqsave+0xc/0x20
      [ 9633.779752]  [<f99d93da>] cleanup_one_si+0x6a/0x200 [ipmi_si]
      [ 9633.779768]  [<c11305b2>] ? sysfs_hash_and_remove+0x72/0x80
      [ 9633.779786]  [<f99dcf26>] ipmi_pnp_remove+0xd/0xf [ipmi_si]
      [ 9633.779802]  [<c11f622b>] pnp_device_remove+0x1b/0x40
      
      Fix this by initializing spinlocks in a smi_info_alloc() helper function,
      right after memory allocation and clearing.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: NDavid Miller <davem@davemloft.net>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Acked-by: NCorey Minyard <cminyard@mvista.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      de5e2ddf
  3. 26 10月, 2010 1 次提交
  4. 25 10月, 2010 1 次提交
    • H
      [S390] hvc_iucv: do not call iucv_unregister if iucv_register failed · c77f7cf7
      Hendrik Brueckner 提交于
      If the iucv_register() functions fails, the error recovery calls
      iucv_unregister() which might cause the following stack backtrace:
      
      	(<0000000000100ab2> show_trace+0xee/0x144)
      	<00000000004f1842> panic+0xb6/0x248
      	<00000000001010a6> die+0x15a/0x16c
      	<000000000011d936> do_no_context+0xa6/0xe4
      	<00000000004f84dc> do_protection_exception+0x2e8/0x3a4
      	<0000000000113afc> pgm_exit+0x0/0x14
      	<00000000004e786e> iucv_unregister+0x5a/0x17c
      	(<00000000004e785e> iucv_unregister+0x4a/0x17c)
      	<000000000076de74> hvc_iucv_init+0x228/0x5dc
      	<00000000001000c2> do_one_initcall+0x3e/0x19c
      	<00000000007524a2> kernel_init+0x28e/0x404
      	<0000000000105dd6> kernel_thread_starter+0x6/0xc
      	<0000000000105dd0> kernel_thread_starter+0x0/0xc
      
      Remove the call to iucv_unregister() and remove the goto label
      as unregistering is the last step in the hvc_iucv initialization.
      If iucv_register() fails, simply clean up hvc terminals and free
      resources.
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      c77f7cf7
  5. 23 10月, 2010 10 次提交
  6. 22 10月, 2010 1 次提交
  7. 21 10月, 2010 10 次提交