1. 30 11月, 2007 11 次提交
    • E
      proc: remove races from proc_id_readdir() · 19fd4bb2
      Eric W. Biederman 提交于
      Oleg noticed that the call of task_pid_nr_ns() in proc_pid_readdir
      is racy with respect to tasks exiting.
      
      After a bit of examination it also appears that the call itself
      is completely unnecessary.
      
      So to fix the problem this patch modifies next_tgid() to return
      both a tgid and the task struct in question.
      
      A structure is introduced to return these values because it is
      slightly cleaner and easier to optimize, and the resulting code
      is a little shorter.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      19fd4bb2
    • O
      wait_task_stopped(): don't use task_pid_nr_ns() lockless · c8950783
      Oleg Nesterov 提交于
      wait_task_stopped(WNOWAIT) does task_pid_nr_ns() without tasklist/rcu lock,
      we can read an already freed memory.  Use the cached pid_t value.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Looks-good-to: Roland McGrath <roland@redhat.com>
      Acked-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c8950783
    • A
      proc: fix NULL ->i_fop oops · c2319540
      Alexey Dobriyan 提交于
      proc_kill_inodes() can clear ->i_fop in the middle of vfs_readdir resulting in
      NULL dereference during "file->f_op->readdir(file, buf, filler)".
      
      The solution is to remove proc_kill_inodes() completely:
      
      a) we don't have tricky modules implementing their tricky readdir hooks which
         could keeping this revoke from hell.
      
      b) In a situation when module is gone but PDE still alive, standard
         readdir will return only "." and "..", because pde->next was cleared by
         remove_proc_entry().
      
      c) the race proc_kill_inode() destined to prevent is not completely
         fixed, just race window made smaller, because vfs_readdir() is run
         without sb_lock held and without file_list_lock held.  Effectively,
         ->i_fop is cleared at random moment, which can't fix properly anything.
      
      BUG: unable to handle kernel NULL pointer dereference at virtual address 00000018
      printing eip: c1061205 *pdpt = 0000000005b22001 *pde = 0000000000000000
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: foo af_packet ipv6 cpufreq_ondemand loop serio_raw sr_mod k8temp cdrom hwmon amd_rng
      Pid: 2033, comm: find Not tainted (2.6.24-rc1-b1d08ac0 #2)
      EIP: 0060:[<c1061205>] EFLAGS: 00010246 CPU: 0
      EIP is at vfs_readdir+0x47/0x74
      EAX: c6b6a780 EBX: 00000000 ECX: c1061040 EDX: c5decf94
      ESI: c6b6a780 EDI: fffffffe EBP: c9797c54 ESP: c5decf78
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      Process find (pid: 2033, ti=c5dec000 task=c64bba90 task.ti=c5dec000)
      Stack: c5decf94 c1061040 fffffff7 0805ffbc 00000000 c6b6a780 c1061295 0805ffbc
             00000000 00000400 00000000 00000004 0805ffbc 4588eff4 c5dec000 c10026ba
             00000004 0805ffbc 00000400 0805ffbc 4588eff4 bfdc6c70 000000dc 0000007b
      Call Trace:
       [<c1061040>] filldir64+0x0/0xc5
       [<c1061295>] sys_getdents64+0x63/0xa5
       [<c10026ba>] sysenter_past_esp+0x5f/0x85
       =======================
      Code: 49 83 78 18 00 74 43 8d 6b 74 bf fe ff ff ff 89 e8 e8 b8 c0 12 00 f6 83 2c 01 00 00 10 75 22 8b 5e 10 8b 4c 24 04 89 f0 8b 14 24 <ff> 53 18 f6 46 1a 04 89 c7 75 0b 8b 56 0c 8b 46 08 e8 c8 66 00
      EIP: [<c1061205>] vfs_readdir+0x47/0x74 SS:ESP 0068:c5decf78
      
      hch: "Nice, getting rid of this is a very good step formwards.
            Unfortunately we have another copy of this junk in
            security/selinux/selinuxfs.c:sel_remove_entries() which would need the
            same treatment."
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c2319540
    • Z
      PNP: increase the maximum number of resources · a7839e96
      Zhao Yakui 提交于
      On some systems the number of resources(IO,MEM) returnedy by PNP device is
      greater than the PNP constant, for example motherboard devices.  It brings
      that some resources can't be reserved and resource confilicts.  This will
      cause PCI resources are assigned wrongly in some systems, and cause hang.
      This is a regression since we deleted ACPI motherboard driver and use PNP
      system driver.
      
      [akpm@linux-foundation.org: fix text and coding-style a bit]
      Signed-off-by: NLi Shaohua <shaohua.li@intel.com>
      Signed-off-by: NZhao Yakui <yakui.zhao@intel.com>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Thomas Renninger <trenn@suse.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a7839e96
    • J
      xen: mask _PAGE_PCD from ptes · 2c80b01b
      Jeremy Fitzhardinge 提交于
      _PAGE_PCD maps a page with caching disabled, which is typically used for
      mapping harware registers.  Xen never allows it to be set on a mapping, and
      unprivileged guests never need it since they can't see the real underlying
      hardware.  However, some uncached mappings are made early when probing the
      (non-existent) APIC, and its OK to mask off the PCD flag in these cases.
      
      This became necessary because Xen started checking for this bit, rather
      than silently masking it off.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2c80b01b
    • W
      UML: build fix · c06869d6
      WANG Cong 提交于
      include/asm-um/arch points to the non-existed include/asm-i386 directory.
      Signed-off-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Cc: Jeff Dike <jdike@karaya.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c06869d6
    • M
      Fix boot problem with iSeries lacking hugepage support · ba72cb8c
      Mel Gorman 提交于
      Ordinarily the size of a pageblock is determined at compile-time based on the
      hugepage size. On PPC64, the hugepage size is determined at runtime based on
      what is supported by the machine. With legacy machines such as iSeries that
      do not support hugepages, HPAGE_SHIFT is 0. This results in pageblock_order
      being set to -PAGE_SHIFT and a crash results shortly afterwards.
      
      This patch adds a function to select a sensible value for pageblock order by
      default when HUGETLB_PAGE_SIZE_VARIABLE is set. It checks that HPAGE_SHIFT
      is a sensible value before using the hugepage size; if it is not MAX_ORDER-1
      is used.
      
      This is a fix for 2.6.24.
      
      Credit goes to Stephen Rothwell for identifying the bug and testing candidate
      patches.  Additional credit goes to Andy Whitcroft for spotting a problem
      with respects to IA-64 before releasing. Additional credit to David Gibson
      for testing with the libhugetlbfs test suite.
      Signed-off-by: NMel Gorman <mel@csn.ul.ie>
      Tested-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ba72cb8c
    • G
      ps3fb: video memory size cleanups · ee592a5b
      Geert Uytterhoeven 提交于
      - Limit video memory size to avoid crossing a 256 MiB boundary in IOIF space.
      - Pass the actual amount of video memory used to lv1_gpu_memory_allocate().
      Signed-off-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ee592a5b
    • G
      ps3: prefix all ps3-specific kernel modules with `ps3-' · 24828550
      Geert Uytterhoeven 提交于
      - vuart.ko -> ps3-vuart.ko
      - sys-manager.ko -> ps3-sys-manager.ko
      Signed-off-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      24828550
    • D
      atmel_spi: label GPIOs better · 65f97a56
      David Brownell 提交于
      Make the atmel_spi driver label GPIOs according to the device for which
      they're acting as a chipselect.  This way the debugfs dump of gpio state is
      more informative.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65f97a56
    • A
      update checkpatch.pl to version 0.12 · 8905a67c
      Andy Whitcroft 提交于
      This version brings a new terse output mode as well as many improvements to
      the unary detection and bare type regcognition.  It also brings the usual
      updates for false positives, though these seem to be slowing markedly
      now that the unary detector is no longer just putting its finger in the
      air and guessing.  Of note:
      
        - new --terse mode producing a single line per report
        - loosening of the block brace checks
        - new checks for enum/union/struch brace placements
        - hugely expanded "bare type" detection
        - checks for inline usage
        - better handling of already open comment blocks
        - handle patches which introduce or remove lines without newlines
      
      Andy Whitcroft (19):
            Version: 0.12
            style fixes as spotted by checkpatch
            add a --terse options of a single line of output per report
            block brace checks should only apply for single line blocks
            all new bare type detector
            check spacing for open braces with enum, union and struct
            check for LINUX_VERSION_CODE
            macros definition bracketing checks need to ignore -ve context
            clean up the mail-back mode, -q et al
            expand possible type matching to declarations
            allow const and sparse annotations on possible types
            handle possible types as regular types everywhere
            prefer plain inline over __inline__ and __inline
            all new open comment detection
            fix up conditional extraction for if assignment checks
            add const to the possible type matcher
            unary checks: a for loop is a conditional too
            possible types: detect function pointer definitions
            handle missind newlines at end of file, report addition
      Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8905a67c
  2. 29 11月, 2007 29 次提交