RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 589613 - unify string representation of NULL in vsprintf.c
Summary: unify string representation of NULL in vsprintf.c
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.0
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Dave Anderson
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2010-11-11 15:43:50 UTC
Target Upstream Version:
Embargoed:


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
inclusion.

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
2.6.32-28.el6.x86_64
[root@dell-pesc430-03 ~]# gcc test.c 
[root@dell-pesc430-03 ~]# ./a.out 
(nil)

[root@dell-pesc430-03 ~]# uname -r
2.6.32-29.el6.x86_64
[root@dell-pesc430-03 ~]# gcc test.c 
[root@dell-pesc430-03 ~]# ./a.out 
(nil)

test.c:
#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);
	va_end(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.