| To: | xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx> |
|---|---|
| Subject: | [PATCH] prevent panic during log recovery due to bogus operation header length |
| From: | Lachlan McIlroy <lachlan@xxxxxxx> |
| Date: | Wed, 12 Dec 2007 18:07:47 +1100 |
| Reply-to: | lachlan@xxxxxxx |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Thunderbird 2.0.0.9 (X11/20071031) |
A problem was reported where a system panicked in log recovery due to a corrupt log record. The cause of the corruption is not known but this change will at least prevent a crash for this specific scenario. Log recovery definitely needs some more work in this area. Lachlan --- fs/xfs/xfs_log_recover.c_1.332 2007-12-12 17:14:57.000000000 +1100
+++ fs/xfs/xfs_log_recover.c 2007-12-12 17:15:42.000000000 +1100
@@ -2912,7 +2912,12 @@ xlog_recover_process_data(
xlog_recover_new_tid(&rhash[hash], tid,
be64_to_cpu(rhead->h_lsn));
} else {
- ASSERT(dp + be32_to_cpu(ohead->oh_len) <= lp);
+ if (dp + be32_to_cpu(ohead->oh_len) > lp) {
+ xlog_warn(
+ "XFS: xlog_recover_process_data: bad length");
+ ASSERT(0);
+ return (XFS_ERROR(EIO));
+ }
flags = ohead->oh_flags & ~XLOG_END_TRANS;
if (flags & XLOG_WAS_CONT_TRANS)
flags &= ~XLOG_CONTINUE_TRANS;
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] make inode reclaim synchronise with xfs_iflush_done(), Lachlan McIlroy |
|---|---|
| Next by Date: | [PATCH] make xfs_idestroy() wait for log I/O to complete, Lachlan McIlroy |
| Previous by Thread: | [PATCH] make inode reclaim synchronise with xfs_iflush_done(), Lachlan McIlroy |
| Next by Thread: | Re: [PATCH] prevent panic during log recovery due to bogus operation header length, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |