public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Subodh Nijsure <subodh.nijsure@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Subodh Nijsure <snijsure@grid-net.com>
Subject: Re: [PATCH 1/1]  Add security.selinux XATTR support for the UBIFS. Also fix couple of bugs in UBIFS extended attribute storage.
Date: Fri, 14 Oct 2011 17:29:30 +0300	[thread overview]
Message-ID: <1318602578.12351.146.camel@sauron> (raw)
In-Reply-To: <1318359142-26759-1-git-send-email-subodh.nijsure@gmail.com>

On Tue, 2011-10-11 at 11:52 -0700, Subodh Nijsure wrote:
> From: Subodh Nijsure <snijsure@grid-net.com>
> 
> TESTING: Tested on MX25, MX28 based platforms using Micron MT29F2G08ABAEAH4 NAND
>          With these change we are able to label UBIFS filesystem with security.selinux
>          and run system with selinux enabled.
> 
> Signed-off-by: Subodh Nijsure <snijsure@grid-net.com>

Did not have time to actually review your code, but would you please
amend it a little and make it be of the same style as UBIFS code. I'll
take a deeper look later.
 
> +static void ubifs_init_security(struct dentry *dentry, struct inode *inode,
> +		struct inode *dir)
See how we align the second line with tabs and then few spaces if
needed. Change globally please.

> +{
> +	int err;
> +	char *name;
> +	void *value = NULL;
> +	size_t len = 0;
> +	struct ubifs_inode *dir_ui = ubifs_inode(dir);
> +	const struct qstr *qname = &dentry->d_name;
> +
> +	mutex_lock(&dir_ui->ui_mutex);
> +	mutex_lock(&dentry->d_inode->i_mutex);
> +	err = security_inode_init_security(inode, dir, qname, &name, &value,
> +		&len);
ditto.

> +	if (err) {
> +		if (err == -EOPNOTSUPP)
> +			return;
> +		ubifs_err("unable to retrieve security context, error %d", err);
> +		mutex_unlock(&dentry->d_inode->i_mutex);
> +		mutex_unlock(&dir_ui->ui_mutex);
> +		return;
> +	}
> +
> +	if (strncmp(name, "selinux", strlen("selinux")) == 0) {
> +		kfree(name);
> +		name = kstrdup("security.selinux", GFP_NOFS);
> +		if (!name) {
> +			ubifs_err("unable to set security context %.*s error",
> +				dentry->d_name.len, dentry->d_name.name);
Ditto.

And many other dittos for the same kind of thing.

Could you try the integck as well and check that it passes?

-- 
Best Regards,
Artem Bityutskiy

      reply	other threads:[~2011-10-14 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 18:52 [PATCH 1/1] Add security.selinux XATTR support for the UBIFS. Also fix couple of bugs in UBIFS extended attribute storage Subodh Nijsure
2011-10-14 14:29 ` Artem Bityutskiy [this message]

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=1318602578.12351.146.camel@sauron \
    --to=dedekind1@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=snijsure@grid-net.com \
    --cc=subodh.nijsure@gmail.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