public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	safford@watson.ibm.com, serue@linux.vnet.ibm.com,
	sailer@watson.ibm.com, zohar@us.ibm.com,
	debora@linux.vnet.ibm.com, srajiv@linux.vnet.ibm.com
Subject: Re: [Patch 5/5]integrity: IMA as an integrity service provider
Date: Thu, 17 Jul 2008 09:56:50 +1000 (EST)	[thread overview]
Message-ID: <Xine.LNX.4.64.0807170947470.3212@us.intercode.com.au> (raw)
In-Reply-To: <1216238733.5886.30.camel@localhost.localdomain>

On Wed, 16 Jul 2008, Mimi Zohar wrote:


> +static ssize_t ima_show_htable_value(char __user *buf, size_t count,
> +				     loff_t *ppos, atomic_t *val)
> +{
> +	char tmpbuf[TMPBUFLEN];
> +	ssize_t len;
> +
> +	len = scnprintf(tmpbuf, TMPBUFLEN, "%i\n", atomic_read(val));
> +	return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
> +}
> +
> +static ssize_t ima_show_htable_violations(struct file *filp,
> +					  char __user *buf,
> +					  size_t count, loff_t *ppos)
> +{
> +	return ima_show_htable_value(buf, count, ppos, &ima_htable.violations);
> +}


ima_htable.violations is an atomic_long_t and is not safe to pass 
to ima_show_htable_value.  Did you check for compilation warnings?

> +void ima_add_violation(struct inode *inode, const unsigned char *fname,
> +                      char *op, char *cause)
> +{
> +       int result;
> +
> +       /* can overflow, only indicator */
> +       atomic_inc(&ima_htable.violations);

This also generates a warning.  You probably want atomic_long_inc().


- James
-- 
James Morris
<jmorris@namei.org>

  reply	other threads:[~2008-07-17  0:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080707192529.489789904@linux.vnet.ibm.com>
2008-07-07 21:56 ` [PATCH 1/5] integrity: TPM cleanup Mimi Zohar
2008-07-08  1:33   ` James Morris
2008-07-08 12:01     ` Mimi Zohar
2008-07-15 23:13   ` James Morris
2008-07-16 20:04     ` Mimi Zohar
2008-07-16 20:04     ` [Patch 1/5]integrity: " Mimi Zohar
2008-07-16 20:05     ` [Patch 2/5]integrity: TPM internel kernel interface Mimi Zohar
2008-07-16 20:05     ` [Patch 3/5] integrity: special fs magic Mimi Zohar
2008-07-16 20:05     ` [PATCH 4/5]integrity: Linux Integrity Module(LIM) Mimi Zohar
2008-07-16 20:05     ` [Patch 5/5]integrity: IMA as an integrity service provider Mimi Zohar
2008-07-16 23:56       ` James Morris [this message]
2008-07-17 21:54         ` Mimi Zohar
2008-07-22 15:08           ` James Morris
2008-07-07 21:56 ` [PATCH 2/5] integrity: TPM internel kernel interface Mimi Zohar
2008-07-07 21:56 ` [PATCH 3/5] integrity: special fs magic Mimi Zohar
2008-07-07 21:57 ` [PATCH 4/5] integrity: Linux Integrity Module(LIM) Mimi Zohar
2008-07-08  1:31   ` James Morris
2008-07-08 12:04     ` Mimi Zohar
2008-07-07 21:57 ` [PATCH 5/5] integrity: IMA as an integrity service provider Mimi Zohar
2008-07-07 22:03 ` LTP IMA path Mimi Zohar

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=Xine.LNX.4.64.0807170947470.3212@us.intercode.com.au \
    --to=jmorris@namei.org \
    --cc=akpm@linux-foundation.org \
    --cc=debora@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=safford@watson.ibm.com \
    --cc=sailer@watson.ibm.com \
    --cc=serue@linux.vnet.ibm.com \
    --cc=srajiv@linux.vnet.ibm.com \
    --cc=zohar@linux.vnet.ibm.com \
    --cc=zohar@us.ibm.com \
    /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