Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 720551 - xfs_error_report() oops when passed-in mp is NULL
xfs_error_report() oops when passed-in mp is NULL
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.7
Unspecified Unspecified
urgent Severity high
: rc
: ---
Assigned To: Eric Sandeen
Boris Ranto
: Regression, ZStream
Depends On:
Blocks: 684637 727835
  Show dependency treegraph
 
Reported: 2011-07-11 23:04 EDT by Cui Chun
Modified: 2012-02-20 22:44 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Under some circumstances, error reports within the XFS file system could dereference a NULL pointer causing a kernel panic. This update fixes the NULL pointer dereference, and the kernel panic no longer occurs.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-20 22:44:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0150 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 5.8 kernel update 2012-02-21 02:35:24 EST

  None (edit)
Comment 1 Eric Sandeen 2011-07-11 23:31:11 EDT
So something has gone wrong in xfs_bmbt_insert(), and it called XFS_WANT_CORRUPTED_GOTO, which calls XFS_ERROR_REPORT() with a NULL value for mp.

Eventually this trickles down to xfs_cmn_err() which does:

printk(KERN_ALERT "Filesystem %s: " fmt "\n", (mp)->m_fsname, ## args);

but mp is null.  m_fsname is offset 0x118, so:

> > Unable to handle kernel NULL pointer dereference at 0000000000000118 RIP:  
is what we've hit.

upstream we test for null mp on a similar path:

        if (mp && mp->m_fsname) {
                printk("%sXFS (%s): %pV\n", level, mp->m_fsname, vaf);

but that's after a fairly significant logging rewrite, just testing for mp would be enough I think.

commit a496b81bc57ff2dc2242dfc087b1a0a0582b1447
Author: Dave Chinner <dchinner@redhat.com>
Date:   Fri Dec 17 17:14:47 2010 -0500

    [fs] xfs: remove cmn_err log buffer and lock

looks like it introduced this, since it went from:

-xfs_fs_vcmn_err(int level, xfs_mount_t *mp, char *fmt, va_list ap)
-{
-       if (mp != NULL) {
...
-               sprintf(newfmt, "Filesystem \"%s\": %s", mp->m_fsname, fmt);

to

+#define xfs_fs_cmn_err(lvl, mp, fmt, args...)  \
+       do { \
+               printk(lvl "Filesystem %s: " fmt "\n", (mp)->m_fsname, ## args); \
Comment 2 Eryu Guan 2011-07-12 02:05:38 EDT
This panic comes from xfstests 250(known issue on both rhel5 and rhel6), and I can reproduce it on -246 kernel, which doesn't contain patch "[fs] xfs: remove cmn_err log buffer and lock".

I think this is the rhel5 counterpart for bug 626244.
Comment 3 Qian Cai 2011-07-12 21:23:08 EDT
From developers:

The downside here is that some corruptions will oops when detected.  That's a regression.
Comment 5 Eric Sandeen 2011-07-13 14:26:14 EDT
sent to rhkernel-list on 07/13/2011
Comment 6 Eric Sandeen 2011-07-14 13:07:06 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Under some circumstances, error reports within the XFS filesystem may dereference a NULL pointer and oops.
Comment 9 Jarod Wilson 2011-08-23 10:05:47 EDT
Patch(es) available in kernel-2.6.18-282.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5
Detailed testing feedback is always welcomed.
Comment 10 Martin Prpič 2011-09-08 11:01:02 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Under some circumstances, error reports within the XFS filesystem may dereference a NULL pointer and oops.+Under some circumstances, error reports within the XFS file system could dereference a NULL pointer cause kernel panic. This update fixes the NULL pointer dereference, and kernel panic no longer occurs.
Comment 11 Eric Sandeen 2011-09-08 11:09:52 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Under some circumstances, error reports within the XFS file system could dereference a NULL pointer cause kernel panic. This update fixes the NULL pointer dereference, and kernel panic no longer occurs.+Under some circumstances, error reports within the XFS file system could dereference a NULL pointer causing a kernel panic. This update fixes the NULL pointer dereference, and the kernel panic no longer occurs.
Comment 14 errata-xmlrpc 2012-02-20 22:44:46 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0150.html

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