Re: [2.3.99-pre4-4,dget fixed] "Unlink of SHM id 8356095 failed (-13)."

From: Christoph Rohland (cr@sap.com)
Date: Fri Apr 07 2000 - 14:03:09 EST


Benjamin Redelings <bredelin@ucla.edu> writes:
>
> Unlink of SHM id 7897329 failed (-13).
> Unlink of SHM id 7930098 failed (-13).
> Unlink of SHM id 7078104 failed (-13).
> Unlink of SHM id 7110873 failed (-13).
> Unlink of SHM id 7143642 failed (-13).
> Unlink of SHM id 7176411 failed (-13).
> Unlink of SHM id 7209180 failed (-13).
> Unlink of SHM id 7241949 failed (-13).
> Unlink of SHM id 7274718 failed (-13).
> Unlink of SHM id 7307487 failed (-13).
> Unlink of SHM id 7405794 failed (-13).
> Unlink of SHM id 7438563 failed (-13).
> Unlink of SHM id 7471332 failed (-13).
> Unlink of SHM id 7504101 failed (-13).
> Unlink of SHM id 7536870 failed (-13).
> Unlink of SHM id 7569639 failed (-13).
> Unlink of SHM id 7602408 failed (-13).
> Unlink of SHM id 7635177 failed (-13).
> Unlink of SHM id 7667946 failed (-13).
> Unlink of SHM id 7700715 failed (-13).
> Unlink of SHM id 7733484 failed (-13).

The attached patch should fix that. There need to be some more checks
included which I will add later.

> 1. put dget around BOTH arguments to lookup_one in ipc/shm.c
Your calling dget on a string =8-0 ???

Greetings
                Christoph

-- 

--- make4-3/ipc/shm.c Mon Apr 3 13:07:26 2000 +++ make4-4/ipc/shm.c Thu Apr 6 18:58:33 2000 @@ -1227,10 +1227,19 @@ sprintf (name, SHM_FMT, id); lock_kernel(); dir = lock_parent(shm_sb->s_root); - dentry = lookup_one(name, dir); + dentry = lookup_one(name, dget(dir)); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { - error = vfs_unlink(dir->d_inode, dentry); + /* + * We have to do our own unlink to prevent the vfs + * permission check. The SYSV IPC layer has already + * checked the permissions which do not comply to the + * vfs rules. + */ + struct inode *inode = dir->d_inode; + down(&inode->i_zombie); + error = shm_unlink(inode, dentry); + up(&inode->i_zombie); dput(dentry); } unlock_dir(dir);

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:18 EST