From: Christoph Hellwig <hch@infradead.org>
To: David Graziano <david.graziano@rockwellcollins.com>
Cc: golbi@mat.uni.torun.pl, michal.wronski@gmail.com,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, sds@tycho.nsa.gov,
seth.forshee@canonical.com, ebiederm@xmission.com,
agruenba@redhat.com
Subject: Re: [PATCH 1/1 V2] mqueue: Implment generic xattr support
Date: Wed, 9 Nov 2016 08:48:54 -0800 [thread overview]
Message-ID: <20161109164854.GA27562@infradead.org> (raw)
In-Reply-To: <1478551587-33892-1-git-send-email-david.graziano@rockwellcollins.com>
> +/*
> + * Callback for security_inode_init_security() for acquiring xattrs.
> + */
> +static int mqueue_initxattrs(struct inode *inode,
> + const struct xattr *xattr_array,
> + void *fs_info)
> +{
> + struct mqueue_inode_info *info = MQUEUE_I(inode);
> + const struct xattr *xattr;
> + struct simple_xattr *new_xattr;
> + size_t len;
> +
> + for (xattr = xattr_array; xattr->name != NULL; xattr++) {
> + new_xattr = simple_xattr_alloc(xattr->value, xattr->value_len);
> + if (!new_xattr)
> + return -ENOMEM;
> + len = strlen(xattr->name) + 1;
> + new_xattr->name = kmalloc(XATTR_SECURITY_PREFIX_LEN + len,
> + GFP_KERNEL);
> + if (!new_xattr->name) {
> + kfree(new_xattr);
> + return -ENOMEM;
> + }
> +
> + memcpy(new_xattr->name, XATTR_SECURITY_PREFIX,
> + XATTR_SECURITY_PREFIX_LEN);
> + memcpy(new_xattr->name + XATTR_SECURITY_PREFIX_LEN,
> + xattr->name, len);
> +
> + simple_xattr_list_add(&info->xattrs, new_xattr);
> + }
> +
> + return 0;
> +}
This is a 1:1 copy of the shmem code, we rally should consolidate it
into a single place first, as people will want it for whatever virtual
fs they care about sooner or later.
next prev parent reply other threads:[~2016-11-09 16:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 20:46 David Graziano
2016-11-07 21:45 ` James Morris
2016-11-07 22:23 ` Paul Moore
2016-11-09 16:25 ` David Graziano
2016-11-09 22:25 ` Paul Moore
2016-11-28 20:04 ` David Graziano
2016-12-05 15:37 ` Paul Moore
2016-12-05 16:15 ` David Graziano
2016-12-05 23:12 ` Paul Moore
2016-12-08 15:16 ` David Graziano
2016-11-09 16:48 ` Christoph Hellwig [this message]
2016-11-09 22:29 ` Paul Moore
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=20161109164854.GA27562@infradead.org \
--to=hch@infradead.org \
--cc=agruenba@redhat.com \
--cc=david.graziano@rockwellcollins.com \
--cc=ebiederm@xmission.com \
--cc=golbi@mat.uni.torun.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=michal.wronski@gmail.com \
--cc=sds@tycho.nsa.gov \
--cc=seth.forshee@canonical.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
all inboxes | Powered by JetHome®