lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <47619007.2070206@redhat.com>
Date:	Thu, 13 Dec 2007 14:03:19 -0600
From:	Eric Sandeen <sandeen@...hat.com>
To:	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH, RFC] - issue warning when bad inode found via ext3_lookup

I have a hand-crafted bad filesystem image which has a corrupted directory
entry:

[root@...de ~]# ls mnt/Picture
LINKS_20  OBEN_20  VORNE_20  VORN_LINKS_20  VORN_RECHTS_20
[root@...de ~]# ls mnt/Picture/VORN_LINKS_20 
ls: cannot access mnt/Picture/VORN_LINKS_20: No such file or directory
[root@...de ~]# stat mnt/Picture/VORN_LINKS_20 
stat: cannot stat `mnt/Picture/VORN_LINKS_20': No such file or directory
[root@...de ~]# ls -l mnt/Picture
ls: cannot access mnt/Picture/VORN_LINKS_20: No such file or directory
total 8
drwxr-xr-x 2 root root 1024 2007-09-04 13:36 LINKS_20
drwxr-xr-x 2 root root 1024 2007-09-04 13:36 OBEN_20
drwxr-xr-x 2 root root 1024 2007-09-04 13:36 VORNE_20
d????????? ? ?    ?       ?                ? VORN_LINKS_20
drwxr-xr-x 2 root root 1024 2007-09-04 13:36 VORN_RECHTS_20

e2fsck also knows it's corrupted:
Pass 2: Checking directory structure
Entry 'VORN_LINKS_20' in /Picture (2049) has deleted/unused inode 13.  Clear? no

Entry 'VORN_LINKS_20' in /Picture (2049) has an incorrect filetype (was 2, should be 1).
Fix? no

Pass 3: Checking directory connectivity
Unconnected directory inode 2053 (/Picture/???)

BUT there are no kernel messages anywhere.

I think the below makes sense; I don't think there are any instances where an
inode found via a filename passed to ext3_lookup should be returning a bad inode
without warning; NFS may pass in a stale filehandle which also makes a bad inode, 
but that shouldn't go through lookup...

Comments?  (if it looks good I'll resubmit for ext*_lookup)

Signed-off-by: Eric Sandeen <sandeen@...hat.com>

---

Index: linux-2.6.24-rc3/fs/ext3/namei.c
===================================================================
--- linux-2.6.24-rc3.orig/fs/ext3/namei.c
+++ linux-2.6.24-rc3/fs/ext3/namei.c
@@ -1049,6 +1049,10 @@ static struct dentry *ext3_lookup(struct
 			return ERR_PTR(-EACCES);
 
 		if (is_bad_inode(inode)) {
+			ext3_warning(inode->i_sb, __FUNCTION__,
+				   "bad inode %lu for file %s in dir #%lu",
+				   inode->i_ino, dentry->d_name.name,
+				   dir->i_ino);
 			iput(inode);
 			return ERR_PTR(-ENOENT);
 		}

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ