summaryrefslogtreecommitdiff
path: root/src/fc
AgeCommit message (Collapse)Author
2014-05-12CVE-2014-0210: unvalidated length fields in fs_read_list_info()Alan Coopersmith
fs_read_list_info() parses a reply from the font server. The reply contains a number of additional data items with embedded length or count fields, none of which are validated. This can cause out of bound reads when looping over these items in the reply. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-05-12CVE-2014-0210: unvalidated length fields in fs_read_list()Alan Coopersmith
fs_read_list() parses a reply from the font server. The reply contains a list of strings with embedded length fields, none of which are validated. This can cause out of bound reads when looping over the strings in the reply. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-05-12CVE-2014-0210: unvalidated length fields in fs_read_glyphs()Alan Coopersmith
fs_read_glyphs() parses a reply from the font server. The reply contains embedded length fields, none of which are validated. This can cause out of bound reads when looping over the glyph bitmaps in the reply. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0210: unvalidated length fields in fs_read_extent_info()Alan Coopersmith
Looping over the extents in the reply could go past the end of the reply buffer if the reply indicated more extents than could fit in the specified reply length. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0211: integer overflow in fs_alloc_glyphs()Alan Coopersmith
fs_alloc_glyphs() is a malloc wrapper used by the font code. It contains a classic integer overflow in the malloc() call, which can cause memory corruption. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0211: integer overflow in fs_read_extent_info()Alan Coopersmith
fs_read_extent_info() parses a reply from the font server. The reply contains a 32bit number of elements field which is used to calculate a buffer length. There is an integer overflow in this calculation which can lead to memory corruption. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0210: unvalidated length fields in fs_read_query_info()Alan Coopersmith
fs_read_query_info() parses a reply from the font server. The reply contains embedded length fields, none of which are validated. This can cause out of bound reads in either fs_read_query_info() or in _fs_convert_props() which it calls to parse the fsPropInfo in the reply. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0211: Integer overflow in fs_get_reply/_fs_start_readAlan Coopersmith
fs_get_reply() would take any reply size, multiply it by 4 and pass to _fs_start_read. If that size was bigger than the current reply buffer size, _fs_start_read would add it to the existing buffer size plus the buffer size increment constant and realloc the buffer to that result. This math could overflow, causing the code to allocate a smaller buffer than the amount it was about to read into that buffer from the network. It could also succeed, allowing the remote font server to cause massive allocations in the X server, possibly using up all the address space in a 32-bit X server, allowing the triggering of other bugs in code that fails to handle malloc failure properly. This patch protects against both problems, by disconnecting any font server trying to feed us more than (the somewhat arbitrary) 64 mb in a single reply. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0210: unvalidated lengths when reading replies from font serverAlan Coopersmith
Functions to handle replies to font server requests were casting replies from the generic form to reply specific structs without first checking that the reply was at least as long as the struct being cast to. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-05-12CVE-2014-0210: unvalidated length in _fs_recv_conn_setup()Alan Coopersmith
The connection setup reply from the font server can include a list of alternate servers to contact if this font server stops working. The reply specifies a total size of all the font server names, and then provides a list of names. _fs_recv_conn_setup() allocated the specified total size for copying the names to, but didn't check to make sure it wasn't copying more data to that buffer than the size it had allocated. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-04-24fs_send_open_font needs to allow namelen of 0 when FontReopen is setAlan Coopersmith
When _fs_load_glyphs calls fs_send_open_font with FontReopen set, it passes a NULL name and namelen of 0, since fs_send_open_font is going to reuse the previous name. This overly restrictive check was added in XFree86 4.3.99.12: http://cvsweb.xfree86.org/cvsweb/xc/lib/font/fc/fserve.c.diff?r1=3.23&r2=3.24 http://cvsweb.xfree86.org/cvsweb/xc/lib/font/fc/fserve.c?rev=3.24&content-type=text/vnd.viewcvs-markup Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-04-23Clean up warnings when src/fc is built with -DDEBUGAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-04-23Allow enabling src/fc DEBUG helpers via CPPFLAGSAlan Coopersmith
Instead of editing fsio.h to turn on debugging logs, just add -DDEBUG to CPPFLAGS when building. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-01-29Warning fixes.Keith Packard
Many const char issues. One extra 'i' declared in ScaleFont; we can just use the same 'i' as exists at the top level scope. Also ignore bad-function-cast in ftfuncs.c and bitscale.c because we're casting the return value from floor or ceil from double to int. As floor and ceil are kinda designed to generate integer results, it's pretty clear that we're doing what we want and that the compiler is generating noise. I'm not sure why bad-function-cast is ever a good warning to turn on, but I'll leave that for another day. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2014-01-08Initialize (unused) data field in fsListCataloguesReq before sending it.Alan Coopersmith
Quiets cppcheck 1.63 warning: [fc/fserve.c:2972]: (error) Uninitialized variable: lcreq Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2013-06-24Require ANSI C89 pre-processor, drop pre-C89 token pasting supportAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-16Replace deprecated Automake INCLUDES variable with AM_CPPFLAGSAlan Coopersmith
Excerpt https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html - Support for the long-deprecated INCLUDES variable will be removed altogether in Automake 1.14. The AM_CPPFLAGS variable should be used instead. This variable was deprecated in Automake releases prior to 1.10, which is the current minimum level required to build X. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-24If socket is interrupted with signal EINTR, re-attempt read.Arvind Umrao
If socket is getting interrupted with signal EINTR, we should keep socket in progress state. I have borrowed following code from socket write _fs_flush():line274 . I have done exactly same at _fs_fill(). Socket write will not close the connection and re attempt to read buffer. Signed-off-by: Arvind Umrao <arvind.umrao@oracle.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-11Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-16Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-06Purge cvs tags.Jesse Adkins
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2009-02-06Avoid sending uninitialized padding data over the network.Peter Astrand
Besides cluttering Valgrind output, this might also be an information leak. Signed-off-by: Peter Astrand <astrand@cendio.se> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-29Janitor: make distcheck and .gitignorePaulo Cesar Pereira de Andrade
Distribute ChangeLog but not autogen.sh. Use a single toplevel .gitignore file, instead of one per subdirectory.
2009-01-20Drop OS/2 supportAdam Jackson
2009-01-20xalloc -> malloc, etc.Adam Jackson
2009-01-20Remove printer font support.Adam Jackson
Xprint is just insidious, isn't it.
2008-12-04Pad CreateAC packets with 0 auths to workaround xfs bugAlan Coopersmith
Versions of xfs before commit 3fe28a31a2974287acc182c7c9bfd68d94ea6292 will reject CreateAC packets with 0 auths unless they claim to have at least 4 bytes of authentication data that isn't actually read.
2008-11-04Don't clobber CFLAGS in configureJulien Cristau
This lets the user set CFLAGS when running make.
2008-08-28Retry font server connections faster.Adam Jackson
2008-03-09nuke RCS IdsMatthieu Herrb
2007-06-07Dead code cull from fontserver code.Adam Jackson
2007-06-07Warning cleanup.Adam Jackson
2006-07-13renamed: .cvsignore -> .gitignoreAlan Coopersmith
2006-02-21Don't crash when we receive an FS_Error from the font server (GuillemDaniel Stone
Jover).
2005-11-08See ChangeLog entry 2005-11-07 for details.XORG-6_8_99_902Kean Johnson
2005-07-09Include config.h in every source file to make sure necessary options areKeith Packard
found when building in the modular tree
2005-07-09Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directoryKeith Packard
2005-07-08config.h includes to fix modular build.Adam Jackson
2005-07-03Change include dir now that public headers are referenced byKevin E Martin
<X11/fonts/*.h>
2005-07-03Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.Daniel Stone
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings. Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>.
2005-07-02Add suitable .cvsignore filesKeith Packard
2005-07-01Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.Daniel Stone
2005-06-09Replace <X11/transport.c> with <X11/Xtrans/transport.c>Alexander Gottwald
2005-06-09Replace <X11/Xtrans.h> with <X11/Xtrans/Xtrans.h>XORG-6_8_99_11Alexander Gottwald
Copy Xtrans.h to exports/include/X11/Xtrans only
2005-05-27Reference X11/fonts header files using X11/fonts/ prefix.XORG-6_8_99_9XORG-6_8_99_10Josh Triplett
2005-05-27Add Xfont.Josh Triplett
2004-11-15Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 AddedXORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_1Alexander Gottwald
mingw (Win32) port
2004-04-23Merging XORG-CURRENT into trunkEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich