linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] WIP: Add syscall unlinkat_s (currently x86* only)
Date: Tue, 03 Feb 2015 08:52:32 +0100	[thread overview]
Message-ID: <54D07E40.2060509@ahsoftware.de> (raw)
In-Reply-To: <20150203060542.GZ29656@ZenIV.linux.org.uk>

Am 03.02.2015 um 07:05 schrieb Al Viro:
> 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?

Sorry, but I first had to make breakfast after I've got angry about the 
usual arrogance of most Linux kernel maintainers.

I've already answered the first question.

Now to the second. That still might be a problem. But that's why this is 
a RFC, why there is a WIP (Work In Progress) before the patch, why I've 
written I've never looked at those sources before, why I've written they 
are imperfect and why I've written I have not spend much time on these 
patches. I've posted them to show how I think the problem might be 
solved. These patches evolved out of desperation that otherwise users 
have to wait another 30 years until they will be offered a way to really 
delete files.

If the removal is somehow scheduled then, of course, the secure flag has 
to be scheduled too.

Alexander Holler

  parent reply	other threads:[~2015-02-03  7:52 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 17:05 [PATCH 0/5] RFC: Offer a way for userspace to request real deletion of files Alexander Holler
2015-02-02 17:05 ` [PATCH 1/5] WIP: Add syscall unlinkat_s (currently x86* only) Alexander Holler
2015-02-03  6:05   ` Al Viro
2015-02-03  6:58     ` Alexander Holler
2015-02-03  7:56       ` Al Viro
2015-02-03  8:01         ` Alexander Holler
2015-02-03  8:10           ` Al Viro
2015-02-03  8:17             ` Alexander Holler
2015-02-03  8:51         ` Alexander Holler
2015-02-03  9:23           ` Alexander Holler
2015-02-03 12:48             ` Alexander Holler
2015-02-03 12:54               ` Alexander Holler
2015-02-03 17:48               ` Theodore Ts'o
2015-02-03 18:01                 ` Alexander Holler
2015-02-03 23:33                   ` Al Viro
2015-02-04  0:18                     ` Alex Elsayed
2015-02-04  4:16                     ` Andreas Dilger
2015-02-04 10:19                     ` Alexander Holler
2015-02-04 12:07                       ` Lukáš Czerner
2015-02-04 12:22                         ` Alexander Holler
2015-02-04 12:42                           ` Alexander Holler
2015-02-04 12:50                             ` Alexander Holler
2015-02-04 13:07                               ` Alexander Holler
2015-02-04 13:06                           ` Michael Kerrisk
2015-02-04 13:21                             ` Alexander Holler
2015-02-04 13:29                               ` Alexander Holler
2015-02-04 14:19                                 ` Alexander Holler
2015-02-04 15:00                                   ` Austin S Hemmelgarn
2015-02-04 14:52                               ` Lukáš Czerner
2015-02-04 16:12                                 ` Alexander Holler
2015-02-04 16:25                                   ` Lukáš Czerner
2015-02-04 16:45                                     ` Alexander Holler
2015-02-04 16:53                                       ` Alexander Holler
2015-02-04 19:33                                 ` Theodore Ts'o
2015-02-04 19:56                                   ` Alexander Holler
2015-02-03  7:58       ` Davidlohr Bueso
2015-02-03  7:52     ` Alexander Holler [this message]
2015-02-04  8:01   ` Michael Kerrisk
2015-02-02 17:05 ` [PATCH 2/5] WIP: fs: fat: support unlinkat_s() for secure deletion of files Alexander Holler
2015-02-02 17:05 ` [PATCH 3/5] WIP: fs: ext4: " Alexander Holler
2015-02-03 13:50   ` Lukáš Czerner
2015-02-03 14:50     ` Alexander Holler
2015-02-03 15:13       ` Alexander Holler
2015-02-03 15:24         ` Alexander Holler
2015-02-03 15:41       ` Lukáš Czerner
2015-02-03 15:46         ` Alexander Holler
2015-02-03 16:38         ` Alexander Holler
2015-02-03 18:50           ` Alexander Holler
2015-02-02 17:05 ` [PATCH 4/5] WIP: Add patch for coreutils to support unlinkat_s (x86_64 only) Alexander Holler
2015-02-02 17:05 ` [PATCH 5/5] WIP: Add test for unlinkat_s Alexander Holler
2015-02-03 15:15 ` [PATCH 0/5] RFC: Offer a way for userspace to request real deletion of files One Thousand Gnomes
2015-02-03 15:45   ` Alexander Holler
2015-02-04  8:01 ` Michael Kerrisk
2015-02-06 12:17 ` Alexander Holler
2015-02-07  5:56   ` Russ Dill
2015-03-02 10:03     ` Alexander Holler
2015-03-03 10:36       ` Alexander Holler

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=54D07E40.2060509@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).