Bug 589613 - unify string representation of NULL in vsprintf.c
Summary: unify string representation of NULL in vsprintf.c
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Dave Anderson
QA Contact: Red Hat Kernel QE team
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-06 14:49 UTC by Dan Horák
Modified: 2010-11-11 15:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-11-11 15:43:50 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Dan Horák 2010-05-06 14:49:20 UTC
Consider applying upstream commit 0f4f81dce93774a447da3ceb98cce193ef84a3fa that unifies the string representation of NULL in vsprintf.c to (null)

Comment 2 RHEL Program Management 2010-05-06 16:09:20 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 4 Aristeu Rozanski 2010-05-25 17:43:45 UTC
Patch(es) available on kernel-2.6.32-29.el6

Comment 7 Petr Beňas 2010-06-10 12:38:06 UTC
I am not probably triggering the bug correctly...

[root@dell-pesc430-03 ~]# uname -r
[root@dell-pesc430-03 ~]# gcc test.c 
[root@dell-pesc430-03 ~]# ./a.out 

[root@dell-pesc430-03 ~]# uname -r
[root@dell-pesc430-03 ~]# gcc test.c 
[root@dell-pesc430-03 ~]# ./a.out 

#include <stdio.h>
#include <stdarg.h>

void vout (char * str, char * fmt, ...);

int main()
	char str[100];

	vout(str, "%p", NULL);
	printf("%s\n", str);
	return 0;

void vout (char * str, char * fmt, ...)
	va_list args;

	va_start(args, fmt);
	vsprintf(str, fmt, args);

Comment 8 Dan Horák 2010-06-10 12:48:31 UTC
It's about kernel internal implementation of vsprintf() not the user-space one from glibc so in my opinion you need to prepare a kernel module.

Comment 9 Dave Anderson 2010-06-10 13:23:04 UTC
The changes were made to a kernel library file, which would require
that either a base kernel function, or a kernel module function, pass
a NULL string into one of the functions that would return a string
containing "(null)" instead of "<NULL>".  

But writing a kernel module that does something like that seems a bit
of overkill...  

If you just take the kernel src.rpm file, do an "rpmbuild -bp kernel.spec",
and then simply inspect the "linux-2.6.32.noarch/lib/vsprintf.c" file,
you can verify that the two former instances of "<NULL>" that were in
the string() and vbin_printf() functions have been replaced with "(null)".

Comment 10 Petr Beňas 2010-06-14 09:47:28 UTC
VERIFIED Sanity only. 2.6.32-29 src code changed according the patch.
2.6.32-29 /lib/vsprintf.c:
 553  if ((unsigned long)s < PAGE_SIZE)
 554          s = "(null)";
1446  if ((unsigned long)save_str > (unsigned long)-PAGE_SIZE
1447                  || (unsigned long)save_str < PAGE_SIZE)
1448          save_str = "(null)";

Comment 11 releng-rhel@redhat.com 2010-11-11 15:43:50 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.