From: Eric Paris Date: Wed, 13 May 2009 16:50:40 +0000 (-0400) Subject: TPM: get_event_name stack corruption X-Git-Tag: v2.6.27.25~58 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01683de16233af7676146083f644c823ac5f246d;p=pandora-kernel.git TPM: get_event_name stack corruption commit fbaa58696cef848de818768783ef185bd3f05158 upstream. get_event_name uses sprintf to fill a buffer declared on the stack. It fills the buffer 2 bytes at a time. What the code doesn't take into account is that sprintf(buf, "%02x", data) actually writes 3 bytes. 2 bytes for the data and then it nul terminates the string. Since we declare buf to be 40 characters long and then we write 40 bytes of data into buf sprintf is going to write 41 characters. The fix is to leave room in buf for the nul terminator. Signed-off-by: Eric Paris Signed-off-by: James Morris Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed