[PATCH 0/4] os/log: fixes for timestamps and malicious devices

Daniel Kurtz djkurtz at chromium.org
Wed Apr 18 02:51:49 PDT 2012


Input drivers like to prepend the device name to logging messages using
LogVHdrMessageVerb().  The current implementation of this function used the
output of a snprintf() as the format string of another snprintf().  This is a
big no-no, as a device name containing format strings could cause "Bad Things"
to happen.

This patchset also cleans up how and when timestamps are appended to messages.
There was a subtle bug when using LogVWrite() directly that could cause a
timestamps written to the logfile to not correspond to the message on the 
same line.

Daniel Kurtz (4):
  os/log: trivial cleanups
  os/xprintf: add Xvscnprintf and Xscnprintf
  os/log: only write timestamp if a message is actually written to
    logfile
  os/log: refactor logging

 include/Xprintf.h |   12 ++++++
 os/log.c          |  105 +++++++++++++++++++++++++----------------------------
 os/xprintf.c      |   44 ++++++++++++++++++++++
 3 files changed, 106 insertions(+), 55 deletions(-)

-- 
1.7.7.3



More information about the xorg-devel mailing list