From: "Theodore Ts'o" <tytso@MIT.EDU>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>,
Eric Sandeen <sandeen@redhat.com>,
linux-ext4@vger.kernel.org, Eugene Teo <eugeneteo@kernel.sg>
Subject: [PATCH 4/4] ext3: Avoid printk floods in the face of directory corruption
Date: Sat, 13 Sep 2008 11:32:51 -0400 [thread overview]
Message-ID: <1221319971-29879-4-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1221319971-29879-3-git-send-email-tytso@mit.edu>
Note: some people thinks this represents a security bug, since it
might make the system go away while it is printing a large number of
console messages, especially if a serial console is involved. Hence,
it has been assigned CVE-2008-3528, but it requires that the attacker
either has physical access to your machine to insert a USB disk with a
corrupted filesystem image (at which point why not just hit the power
button), or is otherwise able to convince the system administrator to
mount an arbitrary filesystem image (at which point why not just
include a setuid shell or world-writable hard disk device file or some
such). Me, I think they're just being silly.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Cc: Eugene Teo <eugeneteo@kernel.sg>
---
fs/ext3/dir.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index 42c5391..283938a 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -102,6 +102,7 @@ static int ext3_readdir(struct file * filp,
int err;
struct inode *inode = filp->f_path.dentry->d_inode;
int ret = 0;
+ int dir_has_error = 0;
sb = inode->i_sb;
@@ -148,9 +149,12 @@ static int ext3_readdir(struct file * filp,
* of recovering data when there's a bad sector
*/
if (!bh) {
- ext3_error (sb, "ext3_readdir",
- "directory #%lu contains a hole at offset %lu",
- inode->i_ino, (unsigned long)filp->f_pos);
+ if (!dir_has_error) {
+ ext3_error(sb, __func__, "directory #%lu "
+ "contains a hole at offset %lld",
+ inode->i_ino, filp->f_pos);
+ dir_has_error = 1;
+ }
/* corrupt size? Maybe no more blocks to read */
if (filp->f_pos > inode->i_blocks << 9)
break;
--
1.5.6.1.205.ge2c7.dirty
next prev parent reply other threads:[~2008-09-13 15:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-13 15:32 [PATCH 1/4] ext3: Fix ext3_dx_readdir hash collision handling Theodore Ts'o
2008-09-13 15:32 ` [PATCH 2/4] ext3: truncate block allocated on a failed ext3_write_begin Theodore Ts'o
2008-09-13 15:32 ` [PATCH 3/4] ext2: Avoid printk floods in the face of directory corruption Theodore Ts'o
2008-09-13 15:32 ` Theodore Ts'o [this message]
2008-09-18 0:57 ` [PATCH 4/4] ext3: " Eugene Teo
2008-09-17 19:25 ` [PATCH 3/4] ext2: " Andrew Morton
2008-09-17 19:30 ` Eric Sandeen
2008-09-18 9:46 ` Eugene Teo
2008-09-17 19:22 ` [PATCH 2/4] ext3: truncate block allocated on a failed ext3_write_begin Andrew Morton
2008-09-18 7:03 ` Aneesh Kumar K.V
2008-09-17 19:19 ` [PATCH 1/4] ext3: Fix ext3_dx_readdir hash collision handling Andrew Morton
2008-10-01 22:37 ` Theodore Tso
2008-10-01 23:33 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1221319971-29879-4-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=akpm@linux-foundation.org \
--cc=eugeneteo@kernel.sg \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).