Re: [PATCH 1/5] WIP: Add syscall unlinkat_s (currently x86* only)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 02, 2015 at 06:05:09PM +0100, Alexander Holler wrote:
> +	if (inode) {
> +		// TODO:
> +		// if (inode is file and 's' flag is set)
> +		// 	secure = true;
> +		if (!secure)
> +			iput(inode);	/* truncate the inode here */
> +		else {
> +			struct super_block *sb = inode->i_sb;
> +			if (sb->s_op->set_secure_delete)
> +				sb->s_op->set_secure_delete(sb, true);
> +			// TODO: We should fail if secure isn't supported,
> +			// look up how that's possible here.
> +			iput(inode);	/* truncate the inode here */
> +			// TODO: check if sb is still valid after the inode is gone
> +			sync_filesystem(sb);
> +			if (sb->s_op->set_secure_delete)
> +				sb->s_op->set_secure_delete(sb, false);
> +		}

Charming.  Now, what exactly happens if two such syscalls overlap in time?
Moroever, what makes you equate unlink() with inode removal?  What happens
if you race e.g. with stat(2) on the same thing?  Or if there's an opened
file over that sucker, for that matter?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux