Skip to contentSkip to conversation

gobohide: avoid null pointer accesses

PATCH Felipe W Damasio 1 participant 1 message Aug 17, 2003 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Greetings,

Quoted 1 line · Lucas Correia Villa Real

Oops, sorry. 2.4.20 and/or 2.4.21.

Ok, things are much clearer now :)

But I still have some doubts..CC'ing LKML to see if any of those
hackers can help us.

Quoted 11 lines

int vfs_unlink(struct inode *dir, struct dentry *dentry)

{
	...
	down(&dir->i_zombie);
	error = may_delete(dir, dentry, 0);
	if (!error) {
		...
		if (!error) {
			if (dentry->d_inode && S_ISLNK (dentry->d_inode->i_mode))
				if (gobolinux_hide(dentry->d_inode->i_ino) > 0)
					gobolinux_inode_del(dentry->d_inode->i_ino)

Yeah, ok...but I still don't get when a dentry doesn't have a valid
d_inode why we don't return ENOENT like in sys_unlink:

slashes:

        error = !dentry->d_inode ? -ENOENT :
                S_ISDIR(dentry->d_inode->i_mode) ? -EISDIR : -ENOTDIR;


	Which, by the way, would be called _instead_ of calling vfs_unlink...so 

should we assume that the dentry _should_ have a valid dinode?

You said that the kernel oops'ed when unlinking a symlink in a NFS
partition, right?

Does anybody know if, in this case (a symlink inside a NFS partition),
the dentry really doesn't have a valid d_inode entry?

Thanks,

Felipe

Signature · 2 lines
It's most certainly GNU/Linux, not Linux. Read more at
http://www.gnu.org/gnu/why-gnu-linux.html