<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Miloslav Trmač wrote:
<blockquote cite="mid:1221161260.17533.30.camel@amilo" type="cite">
  <pre wrap="">If the interface says "NUL-terminated string", any bytes after that are
not "actual data".</pre>
</blockquote>
Yes, that's correct. However, the function in question,
audit_log_n_untrustedstring() is not an interface accepting a null
terminated string, it accepts a count. The helper function on which it
is dependent, audit_string_contains_control(), disregards the length
parameter it is passed and thus audit_log_n_untrustedstring()
misbehaves as a consequence.<br>
<blockquote cite="mid:1221161260.17533.30.camel@amilo" type="cite">
  <blockquote type="cite">
    <pre wrap="">It would be wrong for the audit system to assume the memory block it
was pointed to only ever contained null terminated ascii strings,
especially when the memory block is terminated by virtue of an octet
count.
    </pre>
  </blockquote>
  <pre wrap=""><!---->Yes, that's why it was wrong to use audit_*string() for TTY input data.
And the 2/2 patch fixes it - at the source of the problem, not in an
unrelated function that was incorrectly used.
  </pre>
</blockquote>
This is true, but it's only part of the problem, the string functions
still need to be robust, even used inappropriately.<br>
<br>
<pre class="moz-signature" cols="72">-- 
John Dennis <a class="moz-txt-link-rfc2396E" href="mailto:jdennis@redhat.com"><jdennis@redhat.com></a>
</pre>
</body>
</html>