From: Mimi Zohar on
On Wed, 2010-07-07 at 23:40 +0200, Arnd Bergmann wrote:
> The default for llseek will change to no_llseek,
> so securityfs users need to add explicit .llseek
> assignments. Since we're dealing with regular
> files from a VFS perspective, use generic_file_llseek.
>
> Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
> Cc: Mimi Zohar <zohar(a)us.ibm.com>
> Cc: James Morris <jmorris(a)namei.org>
> Cc: linux-security-module(a)vger.kernel.org

As both the 'violations' and 'runtime_measurement_counts' are single
values and 'policy' doesn't support read, this patch doesn't hurt, but
adding .llseek is probably unnecessary.

thanks,

Mimi

> ---
> security/integrity/ima/ima_fs.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c
> index 8fe736a..ef21b96 100644
> --- a/security/integrity/ima/ima_fs.c
> +++ b/security/integrity/ima/ima_fs.c
> @@ -45,7 +45,8 @@ static ssize_t ima_show_htable_violations(struct file *filp,
> }
>
> static const struct file_operations ima_htable_violations_ops = {
> - .read = ima_show_htable_violations
> + .read = ima_show_htable_violations,
> + .llseek = generic_file_llseek,
> };
>
> static ssize_t ima_show_measurements_count(struct file *filp,
> @@ -57,7 +58,8 @@ static ssize_t ima_show_measurements_count(struct file *filp,
> }
>
> static const struct file_operations ima_measurements_count_ops = {
> - .read = ima_show_measurements_count
> + .read = ima_show_measurements_count,
> + .llseek = generic_file_llseek,
> };
>
> /* returns pointer to hlist_node */
> @@ -319,7 +321,8 @@ static int ima_release_policy(struct inode *inode, struct file *file)
> static const struct file_operations ima_measure_policy_ops = {
> .open = ima_open_policy,
> .write = ima_write_policy,
> - .release = ima_release_policy
> + .release = ima_release_policy,
> + .llseek = generic_file_llseek,
> };
>
> int __init ima_fs_init(void)


--
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, Mimi Zohar wrote:
> On Wed, 2010-07-07 at 23:40 +0200, Arnd Bergmann wrote:
> > The default for llseek will change to no_llseek,
> > so securityfs users need to add explicit .llseek
> > assignments. Since we're dealing with regular
> > files from a VFS perspective, use generic_file_llseek.
>
> As both the 'violations' and 'runtime_measurement_counts' are single
> values and 'policy' doesn't support read, this patch doesn't hurt, but
> adding .llseek is probably unnecessary.

Ok, thanks for the confirmation.

Are you applying the patch in your tree, or should I keep it in my
series?

Note that while it may not be necessary to add these specific .llseek
operations, the reason I'm doing it is because I want to provably
have a .llseek operation in every file_operation in the kernel before
the default gets changed.

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: Mimi Zohar on
On Thu, 2010-07-08 at 15:00 +0200, Arnd Bergmann wrote:
> On Thursday 08 July 2010, Mimi Zohar wrote:
> > On Wed, 2010-07-07 at 23:40 +0200, Arnd Bergmann wrote:
> > > The default for llseek will change to no_llseek,
> > > so securityfs users need to add explicit .llseek
> > > assignments. Since we're dealing with regular
> > > files from a VFS perspective, use generic_file_llseek.
> >
> > As both the 'violations' and 'runtime_measurement_counts' are single
> > values and 'policy' doesn't support read, this patch doesn't hurt, but
> > adding .llseek is probably unnecessary.
>
> Ok, thanks for the confirmation.
>
> Are you applying the patch in your tree, or should I keep it in my
> series?

I'll leave that up to James.

> Note that while it may not be necessary to add these specific .llseek
> operations, the reason I'm doing it is because I want to provably
> have a .llseek operation in every file_operation in the kernel before
> the default gets changed.
>
> Arnd

Thanks for the clarification.

Mimi

--
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, Mimi Zohar wrote:

> On Thu, 2010-07-08 at 15:00 +0200, Arnd Bergmann wrote:
> > On Thursday 08 July 2010, Mimi Zohar wrote:
> > > On Wed, 2010-07-07 at 23:40 +0200, Arnd Bergmann wrote:
> > > > The default for llseek will change to no_llseek,
> > > > so securityfs users need to add explicit .llseek
> > > > assignments. Since we're dealing with regular
> > > > files from a VFS perspective, use generic_file_llseek.
> > >
> > > As both the 'violations' and 'runtime_measurement_counts' are single
> > > values and 'policy' doesn't support read, this patch doesn't hurt, but
> > > adding .llseek is probably unnecessary.
> >
> > Ok, thanks for the confirmation.
> >
> > Are you applying the patch in your tree, or should I keep it in my
> > series?
>
> I'll leave that up to James.

I can take the patches, depends on what Arnd thinks is best.

>
> > Note that while it may not be necessary to add these specific .llseek
> > operations, the reason I'm doing it is because I want to provably
> > have a .llseek operation in every file_operation in the kernel before
> > the default gets changed.
> >
> > Arnd
>
> Thanks for the clarification.
>
> Mimi
>

--
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/
From: Arnd Bergmann on
On Friday 09 July 2010, James Morris wrote:
> On Thu, 8 Jul 2010, Mimi Zohar wrote:
> >
> > I'll leave that up to James.
>
> I can take the patches, depends on what Arnd thinks is best.

I'd prefer you to take it. I'll work out with Frederic what we
do with the remaining patches, but ideally all maintainer
should just take their bits from this series, there are no
interdependencies except for the last two patches.

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/