From: Tetsuo Handa on
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Arnd Bergmann on
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Tetsuo Handa on
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(a)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(a)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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Arnd Bergmann on
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: James Morris on
On Thu, 8 Jul 2010, Tetsuo Handa wrote:

> >From d0fdb09cdc8ef46151d330a9fc285de86306fa65 Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel(a)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(a)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(a)namei.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/