lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1my62xde6.fsf@fess.ebiederm.org>
Date:	Fri, 14 Aug 2009 15:02:25 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Casey Schaufler <casey@...aufler-ca.com>
Cc:	"David P. Quigley" <dpquigl@...ho.nsa.gov>, jmorris@...ei.org,
	Stephen Smalley <sds@...ho.nsa.gov>, gregkh@...a.de,
	linux-kernel@...r.kernel.org,
	linux-security-module@...r.kernel.org, selinux@...ho.nsa.gov
Subject: Re: [PATCH] Security/sysfs: Enable security xattrs to be set on sysfs files, directories, and symlinks.


>From a long term maintenance perspective I have to say I like Casey's
version that doesn't require any magic security module compression
hooks to implement this.

>From an implementation point of view Stephen's comments seem accurate.

Is there any debate that Casey's version will get the job done?

If not the only real question is how do we store xattrs efficiently for
in memory filesystems.  

Let me propose a different xattr compression scheme instead of making
the security module responsible for compression.

How about we have:
struct sysfs_xattr *sysfs_store_xattr(const char *name, const void *value, size_t size);
void sysfs_release_xattr(struct sysfs_xattr *xattr);

Where sysfs_xattr looks something like:
struct sysfs_xattr {
       struct hlist_node list;
       atomic_t count;
       const char *name;
       const void *value;
       size_t size;
}

And then at the end of of what is today s_iattr we have something like:
struct sysfs_xattr *xattrs[2];


The key point here is that sysfs_store_xattr will look to see in a
hash table to see if another inode/dentry has already stored the
specified xattr and if so increment the count of sysfs_xattr count
and return it.

My design assumption is that the set of xattrs that people want to
apply to filesystems is small.

By optimizing for a small number of distinct xattrs we keep the
storage size small (even for those filesystems who want to label
everything), and we keep the generality by not making storage of
xattrs a security module responsibility.

Does that sound like it will work?

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ