<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/video/fbcmap.c, branch master</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>video: move fbdev to drivers/video/fbdev</title>
<updated>2014-04-17T05:10:19+00:00</updated>
<author>
<name>Tomi Valkeinen</name>
<email>tomi.valkeinen@ti.com</email>
</author>
<published>2014-02-13T13:31:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=f7018c21350204c4cf628462f229d44d03545254'/>
<id>f7018c21350204c4cf628462f229d44d03545254</id>
<content type='text'>
The drivers/video directory is a mess. It contains generic video related
files, directories for backlight, console, linux logo, lots of fbdev
device drivers, fbdev framework files.

Make some order into the chaos by creating drivers/video/fbdev
directory, and move all fbdev related files there.

No functionality is changed, although I guess it is possible that some
subtle Makefile build order related issue could be created by this
patch.

Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Acked-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Rob Clark &lt;robdclark@gmail.com&gt;
Acked-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The drivers/video directory is a mess. It contains generic video related
files, directories for backlight, console, linux logo, lots of fbdev
device drivers, fbdev framework files.

Make some order into the chaos by creating drivers/video/fbdev
directory, and move all fbdev related files there.

No functionality is changed, although I guess it is possible that some
subtle Makefile build order related issue could be created by this
patch.

Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Acked-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Rob Clark &lt;robdclark@gmail.com&gt;
Acked-by: Jingoo Han &lt;jg1.han@samsung.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers: video: fbcmap: remove the redundency and incorrect checkings</title>
<updated>2013-08-30T08:41:24+00:00</updated>
<author>
<name>Chen Gang</name>
<email>gang.chen@asianux.com</email>
</author>
<published>2013-08-20T02:33:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9bb40585c9d934db3585e1f422e2ffb1dd5e9631'/>
<id>9bb40585c9d934db3585e1f422e2ffb1dd5e9631</id>
<content type='text'>
fb_set_cmap() already checks the parameters, so need remove the
redundancy checking.

This redundancy checking is also incorrect, the related warning:

  drivers/video/fbcmap.c:288:2: warning: comparison of unsigned expression &lt; 0 is always false [-Wtype-limits]

Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fb_set_cmap() already checks the parameters, so need remove the
redundancy checking.

This redundancy checking is also incorrect, the related warning:

  drivers/video/fbcmap.c:288:2: warning: comparison of unsigned expression &lt; 0 is always false [-Wtype-limits]

Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>framebuffer: fix fbcmap.c kernel-doc warning</title>
<updated>2010-11-26T06:05:08+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2010-11-26T05:20:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=22a95949d03548cb346d81d71ce6c64dc273f421'/>
<id>22a95949d03548cb346d81d71ce6c64dc273f421</id>
<content type='text'>
Fix kernel-doc warning in fbcmap.c:

Warning(drivers/video/fbcmap.c:92): No description found for parameter 'flags'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix kernel-doc warning in fbcmap.c:

Warning(drivers/video/fbcmap.c:92): No description found for parameter 'flags'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fbcmap: integer overflow bug</title>
<updated>2010-11-17T05:55:45+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-11-16T09:11:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1e7c7804884fc5751e3872f13498fd533325f8b2'/>
<id>1e7c7804884fc5751e3872f13498fd533325f8b2</id>
<content type='text'>
There is an integer overflow in fb_set_user_cmap() because cmap-&gt;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-&gt;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-&gt;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: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is an integer overflow in fb_set_user_cmap() because cmap-&gt;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-&gt;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-&gt;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: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fbcmap: cleanup white space in fb_alloc_cmap()</title>
<updated>2010-11-17T05:55:43+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-11-13T10:06:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=c353103de8795358af1584088aa471571decb307'/>
<id>c353103de8795358af1584088aa471571decb307</id>
<content type='text'>
checkpatch.pl and Andrew Morton both complained about the indenting in
fb_alloc_cmap()

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
checkpatch.pl and Andrew Morton both complained about the indenting in
fb_alloc_cmap()

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fbmem: don't call copy_from/to_user() with mutex held</title>
<updated>2009-02-05T20:56:46+00:00</updated>
<author>
<name>Andrea Righi</name>
<email>righi.andrea@gmail.com</email>
</author>
<published>2009-02-04T23:12:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1f5e31d7e55ac7fbd4ec5e5b20c8868b0e4564c9'/>
<id>1f5e31d7e55ac7fbd4ec5e5b20c8868b0e4564c9</id>
<content type='text'>
Avoid calling copy_from/to_user() with fb_info-&gt;lock mutex held in fbmem
ioctl().

fb_mmap() is called under mm-&gt;mmap_sem (A) held, that also acquires
fb_info-&gt;lock (B); fb_ioctl() takes fb_info-&gt;lock (B) and does
copy_from/to_user() that might acquire mm-&gt;mmap_sem (A), causing a
deadlock.

NOTE: it doesn't push down the fb_info-&gt;lock in each own driver's
fb_ioctl(), so there are still potential deadlocks elsewhere.

Signed-off-by: Andrea Righi &lt;righi.andrea@gmail.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Cc: Johannes Weiner &lt;hannes@saeurebad.de&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@wp.pl&gt;
Cc: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid calling copy_from/to_user() with fb_info-&gt;lock mutex held in fbmem
ioctl().

fb_mmap() is called under mm-&gt;mmap_sem (A) held, that also acquires
fb_info-&gt;lock (B); fb_ioctl() takes fb_info-&gt;lock (B) and does
copy_from/to_user() that might acquire mm-&gt;mmap_sem (A), causing a
deadlock.

NOTE: it doesn't push down the fb_info-&gt;lock in each own driver's
fb_ioctl(), so there are still potential deadlocks elsewhere.

Signed-off-by: Andrea Righi &lt;righi.andrea@gmail.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Cc: Johannes Weiner &lt;hannes@saeurebad.de&gt;
Cc: Krzysztof Helt &lt;krzysztof.h1@wp.pl&gt;
Cc: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fbdev: change asm/uaccess.h to linux/uaccess.h</title>
<updated>2007-10-16T16:43:17+00:00</updated>
<author>
<name>Krzysztof Helt</name>
<email>krzysztof.h1@wp.pl</email>
</author>
<published>2007-10-16T08:29:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=84902b7af642c86a518c17629c0dbe705a4b6d14'/>
<id>84902b7af642c86a518c17629c0dbe705a4b6d14</id>
<content type='text'>
This patch replaces &lt;asm/uaccess.h&gt; with &lt;linux/uaccess.h&gt; after the
checkpatch.pl hint.  The include of &lt;asm/uaccess.h&gt; is removed if the driver
does not use it.

Signed-off-by: Krzysztof Helt &lt;krzysztof.h1@wp.pl&gt;
Signed-off-by: Antonino Daplas &lt;adaplas@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces &lt;asm/uaccess.h&gt; with &lt;linux/uaccess.h&gt; after the
checkpatch.pl hint.  The include of &lt;asm/uaccess.h&gt; is removed if the driver
does not use it.

Signed-off-by: Krzysztof Helt &lt;krzysztof.h1@wp.pl&gt;
Signed-off-by: Antonino Daplas &lt;adaplas@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] fbcmap.c: mark structs const or __read_mostly</title>
<updated>2006-12-08T16:29:05+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2006-12-08T10:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=adf6b206546414fd006098d027e81f2b576ea2aa'/>
<id>adf6b206546414fd006098d027e81f2b576ea2aa</id>
<content type='text'>
- Mark the default colormaps read-only, as nobody should be allowed to
  modify them

- Additionally mark color values as __read_mostly since they will only be
  modified (very seldom) by fb_invert_cmaps()

- Add named C99-initializers in fb_cmap structs and use the ARRAY_SIZE()
  macro

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Acked-by: James Simmons &lt;jsimmons@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Mark the default colormaps read-only, as nobody should be allowed to
  modify them

- Additionally mark color values as __read_mostly since they will only be
  modified (very seldom) by fb_invert_cmaps()

- Add named C99-initializers in fb_cmap structs and use the ARRAY_SIZE()
  macro

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Acked-by: James Simmons &lt;jsimmons@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] vt: Remove VT-specific declarations and definitions from tty.h</title>
<updated>2006-07-10T20:24:16+00:00</updated>
<author>
<name>Jon Smirl</name>
<email>jonsmir@gmail.com</email>
</author>
<published>2006-07-10T11:44:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a8f340e394ff30b79ab5b03c67ab4c94b2ac3646'/>
<id>a8f340e394ff30b79ab5b03c67ab4c94b2ac3646</id>
<content type='text'>
MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a
function of the VT layer than the TTY one.  Moving these to vt.h and vt_kern.h
allows all of the framebuffer and VT console drivers to remove their
dependency on tty.h.

[akpm@osdl.org: fix alpha build]
Signed-off-by: Jon Smirl &lt;jonsmir@gmail.com&gt;
Signed-off-by: Antonino Daplas &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a
function of the VT layer than the TTY one.  Moving these to vt.h and vt_kern.h
allows all of the framebuffer and VT console drivers to remove their
dependency on tty.h.

[akpm@osdl.org: fix alpha build]
Signed-off-by: Jon Smirl &lt;jonsmir@gmail.com&gt;
Signed-off-by: Antonino Daplas &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] framebuffer: cmap-setting return values</title>
<updated>2006-03-27T16:44:56+00:00</updated>
<author>
<name>Alan Curry</name>
<email>pacman@TheWorld.com</email>
</author>
<published>2006-03-27T09:17:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=db77ec270d00098ff4fbf15f62f4506f6efb25d2'/>
<id>db77ec270d00098ff4fbf15f62f4506f6efb25d2</id>
<content type='text'>
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: Alan Curry &lt;pacman@TheWorld.com&gt;
Cc: "Antonino A. Daplas" &lt;adaplas@pol.net&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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: Alan Curry &lt;pacman@TheWorld.com&gt;
Cc: "Antonino A. Daplas" &lt;adaplas@pol.net&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
