1. 26 11月, 2010 1 次提交
  2. 17 11月, 2010 2 次提交
    • D
      fbcmap: integer overflow bug · 1e7c7804
      Dan Carpenter 提交于
      There is an integer overflow in fb_set_user_cmap() because cmap->len * 2
      can wrap.  It's basically harmless.  Your terminal will be messed up
      until you type reset.
      
      This patch does three things to fix the bug.
      
      First, it checks the return value of fb_copy_cmap() in fb_alloc_cmap().
      That is enough to fix address the overflow.
      
      Second it checks for the integer overflow in fb_set_user_cmap().
      
      Lastly I wanted to cap "cmap->len" in fb_set_user_cmap() much lower
      because it gets used to determine the size of allocation.  Unfortunately
      no one knows what the limit should be.  Instead what this patch does
      is makes the allocation happen with GFP_KERNEL instead of GFP_ATOMIC
      and lets the kmalloc() decide what values of cmap->len are reasonable.
      To do this, the patch introduces a function called fb_alloc_cmap_gfp()
      which is like fb_alloc_cmap() except that it takes a GFP flag.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      1e7c7804
    • D
      fbcmap: cleanup white space in fb_alloc_cmap() · c353103d
      Dan Carpenter 提交于
      checkpatch.pl and Andrew Morton both complained about the indenting in
      fb_alloc_cmap()
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      c353103d
  3. 06 2月, 2009 1 次提交
    • A
      fbmem: don't call copy_from/to_user() with mutex held · 1f5e31d7
      Andrea Righi 提交于
      Avoid calling copy_from/to_user() with fb_info->lock mutex held in fbmem
      ioctl().
      
      fb_mmap() is called under mm->mmap_sem (A) held, that also acquires
      fb_info->lock (B); fb_ioctl() takes fb_info->lock (B) and does
      copy_from/to_user() that might acquire mm->mmap_sem (A), causing a
      deadlock.
      
      NOTE: it doesn't push down the fb_info->lock in each own driver's
      fb_ioctl(), so there are still potential deadlocks elsewhere.
      Signed-off-by: NAndrea Righi <righi.andrea@gmail.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Johannes Weiner <hannes@saeurebad.de>
      Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
      Cc: Harvey Harrison <harvey.harrison@gmail.com>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1f5e31d7
  4. 17 10月, 2007 1 次提交
  5. 09 12月, 2006 1 次提交
  6. 11 7月, 2006 1 次提交
  7. 28 3月, 2006 1 次提交
    • A
      [PATCH] framebuffer: cmap-setting return values · db77ec27
      Alan Curry 提交于
      A set of 3 small bugfixes, all of which are related to bogus return values
      of fb colormap-setting functions.
      
      First, fb_alloc_cmap returns -1 if memory allocation fails. This is a hard
      condition to reproduce since you'd have to be really low on memory, but from
      studying the contexts in which it is called, I think this function should be
      returning a negative errno, and the -1 will be seen as an EPERM. Switching it
      to -ENOMEM makes sense.
      
      Second, the store_cmap function which is called for writes to
      /sys/class/graphics/fb0/color_map returns 0 for success, but it should be
      returning the count of bytes written since its return value ends up in
      userspace as the result of the write() syscall.
      
      Third, radeonfb returns 1 instead of a negative errno when FBIOPUTCMAP is
      called with an oversized colormap.  This is seen in userspace as a return
      value of 1 from the ioctl() syscall with errno left unchanged.  A more
      useful return value would be -EINVAL.
      Signed-off-by: NAlan Curry <pacman@TheWorld.com>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      db77ec27
  8. 28 7月, 2005 1 次提交
    • M
      [PATCH] fbdev: update info->cmap when setting cmap from user-/kernelspace. · 03e259a9
      Michal Januszewski 提交于
      The fb_info struct, as defined in include/linux/fb.h, contains an element
      that is supposed to hold the current color map:
        struct fb_cmap cmap;            /* Current cmap */
      
      This cmap is currently never updated when either fb_set_cmap() or
      fb_set_user_cmap() are called.  As a result, info->cmap contains the
      default cmap that was set by a device driver/fbcon and a userspace
      application using the FBIOGETCMAP ioctl will not always get the *currently*
      used color map.
      
      The patch fixes this by making sure the cmap is copied to info->cmap after
      it is set correctly.  It moves most of the code that is responsible for
      setting the cmap to fb_set_cmap() and out of fb_set_user_cmap() to avoid
      code-duplication.
      Signed-off-by: NMichal Januszewski <spock@gentoo.org>
      Cc: <linux-fbdev-devel@lists.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      03e259a9
  9. 01 5月, 2005 1 次提交
  10. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4