* [PATCH 18/18] vfs: make no_llseek the default [not found] <1278538820-1392-1-git-send-email-arnd@arndb.de> @ 2010-07-07 21:40 ` Arnd Bergmann 2010-07-08 11:25 ` Tetsuo Handa 0 siblings, 1 reply; 6+ messages in thread From: Arnd Bergmann @ 2010-07-07 21:40 UTC (permalink / raw) To: linux-kernel Cc: John Kacur, Frederic Weisbecker, Arnd Bergmann, Christoph Hellwig, Christoph Hellwig, Al Viro, linux-fsdevel All file operations now have an explicit .llseek operation pointer, so we can change the default action for future code. This makes changes the default from default_llseek to no_llseek, which always returns -ESPIPE if a user tries to seek on a file without a .llseek operation. The name of the default_llseek function remains unchanged, if anyone thinks we should change it, please speak up. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Christoph Hellwig <hch@infradead.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org --- fs/read_write.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 31c0be7..d2ed19a 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -156,7 +156,6 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin) fn = no_llseek; if (file->f_mode & FMODE_LSEEK) { - fn = default_llseek; if (file->f_op && file->f_op->llseek) fn = file->f_op->llseek; } -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 18/18] vfs: make no_llseek the default 2010-07-07 21:40 ` [PATCH 18/18] vfs: make no_llseek the default Arnd Bergmann @ 2010-07-08 11:25 ` Tetsuo Handa 2010-07-08 12:08 ` Arnd Bergmann 0 siblings, 1 reply; 6+ messages in thread From: Tetsuo Handa @ 2010-07-08 11:25 UTC (permalink / raw) To: arnd; +Cc: linux-kernel, linux-fsdevel, linux-security-module Hello. Arnd Bergmann wrote: > All file operations now have an explicit .llseek > operation pointer, so we can change the default > action for future code. I saw patch for SELinux and IMA, but not for TOMOYO. TOMOYO has static const struct file_operations tomoyo_operations without .llseek operation pointer. TOMOYO does not deal offset pointer. Thus seek operation makes no sense. But returning -ESPIPE for seek operation might break some applications. What should I do for TOMOYO? Regards. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 18/18] vfs: make no_llseek the default 2010-07-08 11:25 ` Tetsuo Handa @ 2010-07-08 12:08 ` Arnd Bergmann 2010-07-08 12:57 ` Tetsuo Handa 0 siblings, 1 reply; 6+ messages in thread From: Arnd Bergmann @ 2010-07-08 12:08 UTC (permalink / raw) To: Tetsuo Handa; +Cc: linux-kernel, linux-fsdevel, linux-security-module On Thursday 08 July 2010, Tetsuo Handa wrote: > Hello. > > Arnd Bergmann wrote: > > All file operations now have an explicit .llseek > > operation pointer, so we can change the default > > action for future code. > > I saw patch for SELinux and IMA, but not for TOMOYO. > TOMOYO has > > static const struct file_operations tomoyo_operations > > without .llseek operation pointer. > > TOMOYO does not deal offset pointer. Thus seek operation makes > no sense. But returning -ESPIPE for seek operation might break > some applications. What should I do for TOMOYO? The semantic patch (16/18 in this series) had detected that case, so I did not have to manually create a patch as for selinux and ima. The behaviour you want is noop_llseek, which is what gets used when the semantic patch is applied. If you wish, you can do the patch yourself and add .llseek = noop_llseek to the file operations in your tree. Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 18/18] vfs: make no_llseek the default 2010-07-08 12:08 ` Arnd Bergmann @ 2010-07-08 12:57 ` Tetsuo Handa 2010-07-08 13:18 ` Arnd Bergmann 2010-07-08 22:55 ` James Morris 0 siblings, 2 replies; 6+ messages in thread From: Tetsuo Handa @ 2010-07-08 12:57 UTC (permalink / raw) To: arnd, jmorris; +Cc: linux-kernel, linux-fsdevel, linux-security-module Arnd Bergmann wrote: > The behaviour you want is noop_llseek, which is what gets used > when the semantic patch is applied. If you wish, you can > do the patch yourself and add .llseek = noop_llseek to the file > operations in your tree. I see. [PATCH 16/18] ( http://lkml.org/lkml/2010/7/7/258 ) contains a line security/tomoyo/common.c | 1 + but no change in the patch. Patch was too large? Anyway, that part is no longer in security/tomoyo/common.c and is now security/tomoyo/securityfs_if.c . James, please apply below patch. ---------- >From d0fdb09cdc8ef46151d330a9fc285de86306fa65 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Date: Thu, 8 Jul 2010 21:38:05 +0900 Subject: [PATCH] TOMOYO: Explicitly set file_operations->llseek pointer. TOMOYO does not deal offset pointer. Thus seek operation makes no sense. Changing default seek operation from default_llseek() to no_llseek() might break some applications. Thus, explicitly set noop_llseek(). Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> --- security/tomoyo/securityfs_if.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/security/tomoyo/securityfs_if.c b/security/tomoyo/securityfs_if.c index 9967c1c..e43d555 100644 --- a/security/tomoyo/securityfs_if.c +++ b/security/tomoyo/securityfs_if.c @@ -95,6 +95,7 @@ static const struct file_operations tomoyo_operations = { .poll = tomoyo_poll, .read = tomoyo_read, .write = tomoyo_write, + .llseek = noop_llseek, }; /** -- 1.6.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 18/18] vfs: make no_llseek the default 2010-07-08 12:57 ` Tetsuo Handa @ 2010-07-08 13:18 ` Arnd Bergmann 2010-07-08 22:55 ` James Morris 1 sibling, 0 replies; 6+ messages in thread From: Arnd Bergmann @ 2010-07-08 13:18 UTC (permalink / raw) To: Tetsuo Handa Cc: jmorris, linux-kernel, linux-fsdevel, linux-security-module, John Kacur, Christoph Hellwig, Frederic Weisbecker, Ingo Molnar, Julia Lawall On Thursday 08 July 2010, Tetsuo Handa wrote: > I see. [PATCH 16/18] ( http://lkml.org/lkml/2010/7/7/258 ) contains a line > > security/tomoyo/common.c | 1 + > > but no change in the patch. Patch was too large? Yes, the total patch is almost 200kb, which I considered too large. I explained this in the changelog. In retrospect, I probably should have sent it all anyway, because the changelog is already very long and a few other people did not realize this either because they did only read the patch but not the changelog. As I mentioned to Boaz Harrosh, the full patch is available on http://git.kernel.org/?p=linux/kernel/git/arnd/bkl.git;a=patch;h=dc731e01d2a08eb66ae08c226c97aa0cb8cf7b7f and I'll send it out completely if I send out the series again. I first want to make sure we have consensus on the semantic patch though. In particular, I want to be sure everyone agrees on the following questions: - should we kill default_llseek in favour of a more generic generic_file_llseek that also covers special files? - if not, should default_llseek get renamed to something else? - should I bother adding .llseek=no_llseek if we make that the default in the next step anyway? - should I drop all the automatically generated comments? - Do I need to split this patch up into per-maintainer chunks and send them through the individual trees, or do we just apply the semantic patch treewide at the end of the merge window? Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 18/18] vfs: make no_llseek the default 2010-07-08 12:57 ` Tetsuo Handa 2010-07-08 13:18 ` Arnd Bergmann @ 2010-07-08 22:55 ` James Morris 1 sibling, 0 replies; 6+ messages in thread From: James Morris @ 2010-07-08 22:55 UTC (permalink / raw) To: Tetsuo Handa; +Cc: arnd, linux-kernel, linux-fsdevel, linux-security-module On Thu, 8 Jul 2010, Tetsuo Handa wrote: > >From d0fdb09cdc8ef46151d330a9fc285de86306fa65 Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > Date: Thu, 8 Jul 2010 21:38:05 +0900 > Subject: [PATCH] TOMOYO: Explicitly set file_operations->llseek pointer. > > TOMOYO does not deal offset pointer. Thus seek operation makes > no sense. Changing default seek operation from default_llseek() > to no_llseek() might break some applications. Thus, explicitly > set noop_llseek(). > > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next -- James Morris <jmorris@namei.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-07-08 22:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1278538820-1392-1-git-send-email-arnd@arndb.de>
2010-07-07 21:40 ` [PATCH 18/18] vfs: make no_llseek the default Arnd Bergmann
2010-07-08 11:25 ` Tetsuo Handa
2010-07-08 12:08 ` Arnd Bergmann
2010-07-08 12:57 ` Tetsuo Handa
2010-07-08 13:18 ` Arnd Bergmann
2010-07-08 22:55 ` James Morris
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).