1. 20 1月, 2011 1 次提交
    • C
      drm/i915: Initialise ring vfuncs for old DRI paths · e8616b6c
      Chris Wilson 提交于
      We weren't setting up the vfunc table when initialising the old DRI
      ringbuffer, leading to such OOPSes as:
      
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<(null)>] (null)
      PGD 10c441067 PUD 1185e5067 PMD 0
      Oops: 0010 [#1] PREEMPT SMP
      last sysfs file: /sys/class/dmi/id/chassis_asset_tag
      CPU 3
      Modules linked in: i915 drm_kms_helper drm fb fbdev i2c_algo_bit
      cfbcopyarea video backlight output cfbimgblt cfbfillrect autofs4 ipv6
      nfs lockd fscache nfs_acl auth_rpcgss sunrpc coretemp hwmon_vid mousedev
      usbhid hid option usb_wwan snd_hda_codec_via asus_atk0110 atl1e
      usbserial snd_hda_intel snd_hda_codec firmware_class snd_hwdep snd_pcm
      snd_seq snd_timer snd_seq_device processor parport_pc thermal snd
      thermal_sys parport 8250_pnp button rng_core rtc_cmos shpchp hwmon
      rtc_core ehci_hcd pci_hotplug uhci_hcd soundcore tpm_tis i2c_i801
      rtc_lib tpm serio_raw snd_page_alloc tpm_bios i2c_core usbcore psmouse
      intel_agp sg pcspkr sr_mod evdev cdrom ext3 jbd mbcache dm_mod sd_mod
      ata_piix libata scsi_mod unix
      Jan 18 15:49:29 lithui kernel:
      Pid: 3605, comm: Xorg Not tainted 2.6.36.2 #5 P5KPL-CM/System Product
      Name
      RIP: 0010:[<0000000000000000>]  [<(null)>] (null)
      RSP: 0018:ffff8801150d1d40  EFLAGS: 00010202
      RAX: 000000000001ffff RBX: ffff88011a011b00 RCX: 000000000001a704
      RDX: ffff880118566028 RSI: ffff880118566028 RDI: ffff880117876800
      RBP: ffff8801150d1d48 R08: ffff8801195fe300 R09: 00000000c0086444
      R10: 0000000000000001 R11: 0000000000003206 R12: ffff880117876800
      R13: ffff880118566000 R14: ffff880117876820 R15: ffff8801150d1df8
      FS:  00007f1038d456e0(0000) GS:ffff880001780000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 00000001187e7000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process Xorg (pid: 3605, threadinfo ffff8801150d0000, task
      ffff88011b016e40)
      Stack:
      ffffffffa043b8e6 ffff8801150d1d98 ffffffffa041768b dead000000000000
      <0> 0000000000000048 00007f1023f2a000 0000000000000044 0000000000000008
      <0> ffff88010d26bd80 ffff880117876800 ffff8801150d1df8 ffff8801150d1ea8
      Call Trace:
      [<ffffffffa043b8e6>] ? intel_ring_advance+0x16/0x20 [i915]
      [<ffffffffa041768b>] i915_irq_emit+0x15b/0x240 [i915]
      [<ffffffffa03ea7b1>] drm_ioctl+0x1f1/0x460 [drm]
      [<ffffffffa0417530>] ? i915_irq_emit+0x0/0x240 [i915]
      [<ffffffff810dd8f1>] ? do_sync_read+0xd1/0x120
      [<ffffffff81025b1f>] ? do_page_fault+0x1df/0x3d0
      [<ffffffff810ed5c7>] do_vfs_ioctl+0x97/0x550
      [<ffffffff8115c2ea>] ? security_file_permission+0x7a/0x90
      [<ffffffff810edb19>] sys_ioctl+0x99/0xa0
      [<ffffffff810024ab>] system_call_fastpath+0x16/0x1b
      Code:  Bad RIP value.
      RIP  [<(null)>] (null)
      RSP <ffff8801150d1d40>
      CR2: 0000000000000000
      Reported-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Tested-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29153
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=23172Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@kernel.org
      e8616b6c
  2. 19 1月, 2011 1 次提交
  3. 18 1月, 2011 25 次提交
  4. 17 1月, 2011 13 次提交
    • A
      mtd: mtdpart: disallow reading OOB past the end of the partition · 154bf89f
      Artem Bityutskiy 提交于
      This patch fixes the mtdpart bug which allows users reading OOB past the
      end of the partition. This happens because 'part_read_oob()' allows reading
      multiple OOB areas in one go, and mtdparts does not validate the OOB
      length in the request.
      
      Although there is such check in 'nand_do_read_oob()' in nand_base.c, but
      it checks that we do not read past the flash chip, not the partition,
      because in nand_base.c we work with the whole chip (e.g., mtd->size
      in nand_base.c is the size of the whole chip). So this check cannot
      be done correctly in nand_base.c and should be instead done in mtdparts.c.
      
      This problem was reported by Jason Liu <r64343@freescale.com> and reproduced
      with nandsim:
      
      $ modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 \
                         fourth_id_byte=0x15 parts=0x400,0x400
      $ modprobe nandsim mtd_oobtest.ko dev=0
      $ dmesg
      = snip =
      mtd_oobtest: attempting to read past end of device
      mtd_oobtest: an error is expected...
      mtd_oobtest: error: read past end of device
      = snip =
      mtd_oobtest: finished with 2 errors
      Reported-by: NJason Liu <liu.h.jason@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      154bf89f
    • N
      fs: fix address space warnings in ioctl_fiemap() · ecf5632d
      Namhyung Kim 提交于
      The fi_extents_start field of struct fiemap_extent_info is a
      user pointer but was not marked as __user. This makes sparse
      emit following warnings:
      
        CHECK   fs/ioctl.c
      fs/ioctl.c:114:26: warning: incorrect type in argument 1 (different address spaces)
      fs/ioctl.c:114:26:    expected void [noderef] <asn:1>*dst
      fs/ioctl.c:114:26:    got struct fiemap_extent *[assigned] dest
      fs/ioctl.c:202:14: warning: incorrect type in argument 1 (different address spaces)
      fs/ioctl.c:202:14:    expected void const volatile [noderef] <asn:1>*<noident>
      fs/ioctl.c:202:14:    got struct fiemap_extent *[assigned] fi_extents_start
      fs/ioctl.c:212:27: warning: incorrect type in argument 1 (different address spaces)
      fs/ioctl.c:212:27:    expected void [noderef] <asn:1>*dst
      fs/ioctl.c:212:27:    got char *<noident>
      
      Also add 'ufiemap' variable to eliminate unnecessary casts.
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ecf5632d
    • N
      aio: check return value of create_workqueue() · 27eaa1c9
      Namhyung Kim 提交于
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      27eaa1c9
    • D
      hpfs_setattr error case avoids unlock_kernel · 274052ef
      Dr. David Alan Gilbert 提交于
      This fixed a case that 'sparse' spotted where hpfs_setattr has an error return
      that didn't go through it's path that unlocks.
      
      This is against git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
      version 6313e3c2.
      
      Build tested only, I don't have an hpfs file system to test.
      
      Dave
      Signed-off-by: NDr. David Alan Gilbert <linux@treblig.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      274052ef
    • N
      compat: copy missing fields in compat_statfs64 to user · e0bb6bda
      Namhyung Kim 提交于
      f_flags and f_spare fields were not copied to userspace when
      compat_sys_[f]statfs64 called.
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e0bb6bda
    • N
      compat: update comment of compat statfs syscalls · 974d879e
      Namhyung Kim 提交于
      The commit 7ed1ee61 ("Take statfs variants to fs/statfs.c")
      separates out statfs syscalls from fs/open.c. Thus the comment
      should be changed also.
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Cc: Jiri Kosina <trivial@kernel.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      974d879e
    • N
      compat: remove unnecessary assignment in compat_rw_copy_check_uvector() · 6a5640f1
      Namhyung Kim 提交于
      *@ret_pointer is initialized to @fast_pointer thus the assignment is
      redundant.
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6a5640f1
    • R
      fs: FS_POSIX_ACL does not depend on BLOCK · 16ebe911
      Randy Dunlap 提交于
      - Fix a kconfig unmet dependency warning.
      - Remove the comment that identifies which filesystems use POSIX ACL
        utility routines.
      - Move the FS_POSIX_ACL symbol outside of the BLOCK symbol if/endif block
        because its functions do not depend on BLOCK and some of the filesystems
        that use it do not depend on BLOCK.
      
      warning: (GENERIC_ACL && JFFS2_FS_POSIX_ACL && NFSD_V4 && NFS_ACL_SUPPORT && 9P_FS_POSIX_ACL) selects FS_POSIX_ACL which has unmet direct dependencies (BLOCK)
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      16ebe911
    • S
      fs: Remove unlikely() from fget_light() · 3bc0ba43
      Steven Rostedt 提交于
      There's an unlikely() in fget_light() that assumes the file ref count
      will be 1. Running the annotate branch profiler on a desktop that is
      performing daily tasks (running firefox, evolution, xchat and is also part
      of a distcc farm), it shows that the ref count is not 1 that often.
      
       correct incorrect      %    Function                  File              Line
       ------- ---------      -    --------                  ----              ----
      1035099358 6209599193  85    fget_light              file_table.c         315
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      3bc0ba43
    • S
      fs: Remove unlikely() from fput_light() · c2b3e74b
      Steven Rostedt 提交于
      In fput_light(), there's an unlikely(fput_needed), which running on
      my normal desktop doing firefox, xchat, evolution and part of my distcc farm,
      and running the annotate branch profiler shows that the unlikely is not
      very unlikely.
      
       correct incorrect  %        Function             File              Line
       ------- ---------  -        --------             ----              ----
             0       48 100 fput_light                file.h               26
      115828710 897415279  88 fput_light              file.h               26
      865271179 5286128445  85 fput_light             file.h               26
      19568539  8923664  31 fput_light                file.h               26
      12353677  3562279  22 fput_light                file.h               26
        267691    67062  20 fput_light                file.h               26
      15014853   348172   2 fput_light                file.h               26
        209258      205   0 fput_light                file.h               26
       1364164        0   0 fput_light                file.h               26
      
      Which gives 1032903812 times it was correct and 6203351846 times it was
      incorrect, or 85% incorrect.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c2b3e74b
    • C
      fallocate should be a file operation · 2fe17c10
      Christoph Hellwig 提交于
      Currently all filesystems except XFS implement fallocate asynchronously,
      while XFS forced a commit.  Both of these are suboptimal - in case of O_SYNC
      I/O we really want our allocation on disk, especially for the !KEEP_SIZE
      case where we actually grow the file with user-visible zeroes.  On the
      other hand always commiting the transaction is a bad idea for fast-path
      uses of fallocate like for example in recent Samba versions.   Given
      that block allocation is a data plane operation anyway change it from
      an inode operation to a file operation so that we have the file structure
      available that lets us check for O_SYNC.
      
      This also includes moving the code around for a few of the filesystems,
      and remove the already unnedded S_ISDIR checks given that we only wire
      up fallocate for regular files.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2fe17c10
    • C
      make the feature checks in ->fallocate future proof · 64c23e86
      Christoph Hellwig 提交于
      Instead of various home grown checks that might need updates for new
      flags just check for any bit outside the mask of the features supported
      by the filesystem.  This makes the check future proof for any newly
      added flag.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      64c23e86
    • Y
      staging: smbfs building fix · eb745dbc
      Yang Ruirui 提交于
      Building error for smbfs:
      
      drivers/staging/smbfs/dir.c:286: error: static declaration of 'smbfs_dentry_operations' follows non-static declaration
      drivers/staging/smbfs/proto.h:42: error: previous declaration of 'smbfs_dentry_operations' was here
      drivers/staging/smbfs/dir.c:294: error: static declaration of 'smbfs_dentry_operations_case' follows non-static declaration
      drivers/staging/smbfs/proto.h:41: error: previous declaration of 'smbfs_dentry_operations_case' was here
      make[3]: *** [drivers/staging/smbfs/dir.o] Error 1
      make[2]: *** [drivers/staging/smbfs] Error 2
      make[1]: *** [drivers/staging] Error 2
      make[1]: *** Waiting for unfinished jobs....
      
      Fix it by removing static keywords
      Signed-off-by: NYang Ruirui <ruirui.r.yang@tieto.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      eb745dbc