From: Casey Schaufler <casey@schaufler-ca.com>
To: Rob MacKinnon <c4blem0nkey@gmail.com>
Cc: Andreas Gruenbacher <agruen@suse.de>,
Stephen Smalley <sds@tycho.nsa.gov>,
rob.mackinnon@gmail.com, hpa@zytor.com, hugh@veritas.com,
linux-kernel@vger.kernel.org, casey@schaufler-ca.com
Subject: Re: tmpfs support of xattrs?
Date: Mon, 27 Oct 2008 22:51:45 -0700 [thread overview]
Message-ID: <4906A871.6010501@schaufler-ca.com> (raw)
In-Reply-To: <49062EC0.4040809@gmail.com>
Rob MacKinnon wrote:
> Andreas Gruenbacher wrote:
>
>> On Monday, 27 October 2008 21:25:31 Stephen Smalley wrote:
>>
>>> Looks like a bug in Smack's implementation of the inode_listsecurity
>>> hook to me. Did you mean to enable Smack in your kernel config?
>>>
>> Yes, there is at least one bug there; this kernel is broken. You may want to
>> try booting with a kernel command line option like "security=none", which
>> *should* turn smack off.
>>
>> Andreas
>>
>
> All,
>
> Indeed the kernel cmdline option security=none did disable smack. So
> atleast that works. Thank you all for helping me track this down. I can
> now return to updating packages (some of which have been waiting
> patiently for this to be cleared up)! Though I will be looking forward
> to this feature working as it was intended. ;) Let me know if there is
> a bug # assigned and I'll quietly return to lurking... ;
It looks like a trivial fix and the patch is here. I have just started
testing it myself, but if I don't send it now it will be Wednesday before
I do. No sign-off because I haven't verified it, but I would be delighted
if you would pass judgement on its efficacy. Thank you.
----
diff -uprN -X linux-2.6/Documentation/dontdiff linux-2.6/security/smack/smack_lsm.c linux-smack/security/smack/smack_lsm.c
--- linux-2.6/security/smack/smack_lsm.c 2008-10-26 17:37:08.000000000 -0700
+++ linux-smack/security/smack/smack_lsm.c 2008-10-26 19:11:23.000000000 -0700
@@ -763,13 +763,11 @@ static int smack_inode_getsecurity(const
static int smack_inode_listsecurity(struct inode *inode, char *buffer,
size_t buffer_size)
{
- int len = strlen(XATTR_NAME_SMACK);
+ int len = sizeof(XATTR_NAME_SMACK);
- if (buffer != NULL && len <= buffer_size) {
+ if (buffer != NULL && len <= buffer_size)
memcpy(buffer, XATTR_NAME_SMACK, len);
- return len;
- }
- return -EINVAL;
+ return len;
}
/**
next prev parent reply other threads:[~2008-10-28 5:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-25 8:49 tmpfs support of xattrs? Rob MacKinnon
2008-10-25 21:59 ` H. Peter Anvin
2008-10-26 12:26 ` Hugh Dickins
2008-10-26 13:25 ` Andreas Gruenbacher
2008-10-27 20:14 ` Rob MacKinnon
2008-10-27 20:25 ` Stephen Smalley
2008-10-27 20:53 ` Andreas Gruenbacher
2008-10-27 21:12 ` Rob MacKinnon
2008-10-28 5:51 ` Casey Schaufler [this message]
2008-10-29 15:15 ` [PATCH] smack inode_listsecurity fix Casey Schaufler
2008-10-29 15:56 ` tmpfs support of xattrs? Rob MacKinnon
2008-10-29 16:12 ` Casey Schaufler
2008-10-27 21:00 ` Rob MacKinnon
2008-10-27 21:54 ` Casey Schaufler
-- strict thread matches above, loose matches on Subject: below --
2008-10-25 8:27 Rob MacKinnon
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=4906A871.6010501@schaufler-ca.com \
--to=casey@schaufler-ca.com \
--cc=agruen@suse.de \
--cc=c4blem0nkey@gmail.com \
--cc=hpa@zytor.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.mackinnon@gmail.com \
--cc=sds@tycho.nsa.gov \
/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