<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security/smack, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/security/smack?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/security/smack?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-09-07T21:34:07Z</updated>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security</title>
<updated>2013-09-07T21:34:07Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-09-07T21:34:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=11c7b03d42a847db90862d0f9d8be6ce9b2f0553'/>
<id>urn:sha1:11c7b03d42a847db90862d0f9d8be6ce9b2f0553</id>
<content type='text'>
Pull security subsystem updates from James Morris:
 "Nothing major for this kernel, just maintenance updates"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (21 commits)
  apparmor: add the ability to report a sha1 hash of loaded policy
  apparmor: export set of capabilities supported by the apparmor module
  apparmor: add the profile introspection file to interface
  apparmor: add an optional profile attachment string for profiles
  apparmor: add interface files for profiles and namespaces
  apparmor: allow setting any profile into the unconfined state
  apparmor: make free_profile available outside of policy.c
  apparmor: rework namespace free path
  apparmor: update how unconfined is handled
  apparmor: change how profile replacement update is done
  apparmor: convert profile lists to RCU based locking
  apparmor: provide base for multiple profiles to be replaced at once
  apparmor: add a features/policy dir to interface
  apparmor: enable users to query whether apparmor is enabled
  apparmor: remove minimum size check for vmalloc()
  Smack: parse multiple rules per write to load2, up to PAGE_SIZE-1 bytes
  Smack: network label match fix
  security: smack: add a hash table to quicken smk_find_entry()
  security: smack: fix memleak in smk_write_rules_list()
  xattr: Constify -&gt;name member of "struct xattr".
  ...
</content>
</entry>
<entry>
<title>Merge branch 'smack-for-3.12' of git://git.gitorious.org/smack-next/kernel into ra-next</title>
<updated>2013-08-22T16:50:12Z</updated>
<author>
<name>James Morris</name>
<email>james.l.morris@oracle.com</email>
</author>
<published>2013-08-22T16:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=73203361468894c3c017bfbdd9ddcbb468039604'/>
<id>urn:sha1:73203361468894c3c017bfbdd9ddcbb468039604</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Smack: parse multiple rules per write to load2, up to PAGE_SIZE-1 bytes</title>
<updated>2013-08-12T18:51:40Z</updated>
<author>
<name>Rafal Krypa</name>
<email>r.krypa@samsung.com</email>
</author>
<published>2013-08-09T09:47:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=10289b0f738e8b301969f2288c4942455f1b1e59'/>
<id>urn:sha1:10289b0f738e8b301969f2288c4942455f1b1e59</id>
<content type='text'>
Smack interface for loading rules has always parsed only single rule from
data written to it. This requires user program to call one write() per
each rule it wants to load.
This change makes it possible to write multiple rules, separated by new
line character. Smack will load at most PAGE_SIZE-1 characters and properly
return number of processed bytes. In case when user buffer is larger, it
will be additionally truncated. All characters after last \n will not get
parsed to avoid partial rule near input buffer boundary.

Signed-off-by: Rafal Krypa &lt;r.krypa@samsung.com&gt;
</content>
</entry>
<entry>
<title>Smack: IPv6 casting error fix for 3.11</title>
<updated>2013-08-06T10:53:54Z</updated>
<author>
<name>Casey Schaufler</name>
<email>casey@schaufler-ca.com</email>
</author>
<published>2013-08-05T20:21:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6ea062475a9a2ea6e1394487fa0e51b3459957d1'/>
<id>urn:sha1:6ea062475a9a2ea6e1394487fa0e51b3459957d1</id>
<content type='text'>
The original implementation of the Smack IPv6 port based
local controls works most of the time using a sockaddr as
a temporary variable, but not always as it overflows in
some circumstances. The correct data is a sockaddr_in6.
A struct sockaddr isn't as large as a struct sockaddr_in6.
There would need to be casting one way or the other. This
patch gets it the right way.

Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
</entry>
<entry>
<title>Smack: network label match fix</title>
<updated>2013-08-02T03:04:02Z</updated>
<author>
<name>Casey Schaufler</name>
<email>casey@schaufler-ca.com</email>
</author>
<published>2013-06-28T20:47:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=677264e8fb73ea35a508700e19ce76c527576d1c'/>
<id>urn:sha1:677264e8fb73ea35a508700e19ce76c527576d1c</id>
<content type='text'>
The Smack code that matches incoming CIPSO tags with Smack labels
reaches through the NetLabel interfaces and compares the network
data with the CIPSO header associated with a Smack label. This was
done in a ill advised attempt to optimize performance. It works
so long as the categories fit in a single capset, but this isn't
always the case.

This patch changes the Smack code to use the appropriate NetLabel
interfaces to compare the incoming CIPSO header with the CIPSO
header associated with a label. It will always match the CIPSO
headers correctly.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Signed-off-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
</content>
</entry>
<entry>
<title>security: smack: add a hash table to quicken smk_find_entry()</title>
<updated>2013-08-01T23:55:20Z</updated>
<author>
<name>Tomasz Stanislawski</name>
<email>t.stanislaws@samsung.com</email>
</author>
<published>2013-06-11T12:55:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4d7cf4a1f49f76f4069114ee08be75cd68c37c5a'/>
<id>urn:sha1:4d7cf4a1f49f76f4069114ee08be75cd68c37c5a</id>
<content type='text'>
Accepted for the smack-next tree after changing the number of
slots from 128 to 16.

This patch adds a hash table to quicken searching of a smack label by its name.

Basically, the patch improves performance of SMACK initialization.  Parsing of
rules involves translation from a string to a smack_known (aka label) entity
which is done in smk_find_entry().

The current implementation of the function iterates over a global list of
smack_known resulting in O(N) complexity for smk_find_entry().  The total
complexity of SMACK initialization becomes O(rules * labels).  Therefore it
scales quadratically with a complexity of a system.

Applying the patch reduced the complexity of smk_find_entry() to O(1) as long
as number of label is in hundreds. If the number of labels is increased please
update SMACK_HASH_SLOTS constant defined in security/smack/smack.h. Introducing
the configuration of this constant with Kconfig or cmdline might be a good
idea.

The size of the hash table was adjusted experimentally.  The rule set used by
TIZEN contains circa 17K rules for 500 labels.  The table above contains
results of SMACK initialization using 'time smackctl apply' bash command.
The 'Ref' is a kernel without this patch applied. The consecutive values
refers to value of SMACK_HASH_SLOTS.  Every measurement was repeated three
times to reduce noise.

     |  Ref  |   1   |   2   |   4   |   8   |   16  |   32  |   64  |  128  |  256  |  512
--------------------------------------------------------------------------------------------
Run1 | 1.156 | 1.096 | 0.883 | 0.764 | 0.692 | 0.667 | 0.649 | 0.633 | 0.634 | 0.629 | 0.620
Run2 | 1.156 | 1.111 | 0.885 | 0.764 | 0.694 | 0.661 | 0.649 | 0.651 | 0.634 | 0.638 | 0.623
Run3 | 1.160 | 1.107 | 0.886 | 0.764 | 0.694 | 0.671 | 0.661 | 0.638 | 0.631 | 0.624 | 0.638
AVG  | 1.157 | 1.105 | 0.885 | 0.764 | 0.693 | 0.666 | 0.653 | 0.641 | 0.633 | 0.630 | 0.627

Surprisingly, a single hlist is slightly faster than a double-linked list.
The speed-up saturates near 64 slots.  Therefore I chose value 128 to provide
some margin if more labels were used.
It looks that IO becomes a new bottleneck.

Signed-off-by: Tomasz Stanislawski &lt;t.stanislaws@samsung.com&gt;
</content>
</entry>
<entry>
<title>security: smack: fix memleak in smk_write_rules_list()</title>
<updated>2013-08-01T19:57:24Z</updated>
<author>
<name>Tomasz Stanislawski</name>
<email>t.stanislaws@samsung.com</email>
</author>
<published>2013-06-06T07:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=470043ba995a79a274a5db306856975002a06f19'/>
<id>urn:sha1:470043ba995a79a274a5db306856975002a06f19</id>
<content type='text'>
The smack_parsed_rule structure is allocated.  If a rule is successfully
installed then the last reference to the object is lost.  This patch fixes this
leak. Moreover smack_parsed_rule is allocated on stack because it no longer
needed ofter smk_write_rules_list() is finished.

Signed-off-by: Tomasz Stanislawski &lt;t.stanislaws@samsung.com&gt;
</content>
</entry>
<entry>
<title>xattr: Constify -&gt;name member of "struct xattr".</title>
<updated>2013-07-25T09:30:03Z</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2013-07-24T20:44:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9548906b2bb7ff09e12c013a55d669bef2c8e121'/>
<id>urn:sha1:9548906b2bb7ff09e12c013a55d669bef2c8e121</id>
<content type='text'>
Since everybody sets kstrdup()ed constant string to "struct xattr"-&gt;name but
nobody modifies "struct xattr"-&gt;name , we can omit kstrdup() and its failure
checking by constifying -&gt;name member of "struct xattr".

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Reviewed-by: Joel Becker &lt;jlbec@evilplan.org&gt; [ocfs2]
Acked-by: Serge E. Hallyn &lt;serge.hallyn@ubuntu.com&gt;
Acked-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Acked-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
Reviewed-by: Paul Moore &lt;paul@paul-moore.com&gt;
Tested-by: Paul Moore &lt;paul@paul-moore.com&gt;
Acked-by: Eric Paris &lt;eparis@redhat.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'nfs-for-3.11-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs</title>
<updated>2013-07-09T19:09:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-07-09T19:09:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=be0c5d8c0bb0023e11f5c6d38e90f7b0f24edb64'/>
<id>urn:sha1:be0c5d8c0bb0023e11f5c6d38e90f7b0f24edb64</id>
<content type='text'>
Pull NFS client updates from Trond Myklebust:
 "Feature highlights include:
   - Add basic client support for NFSv4.2
   - Add basic client support for Labeled NFS (selinux for NFSv4.2)
   - Fix the use of credentials in NFSv4.1 stateful operations, and add
     support for NFSv4.1 state protection.

  Bugfix highlights:
   - Fix another NFSv4 open state recovery race
   - Fix an NFSv4.1 back channel session regression
   - Various rpc_pipefs races
   - Fix another issue with NFSv3 auth negotiation

  Please note that Labeled NFS does require some additional support from
  the security subsystem.  The relevant changesets have all been
  reviewed and acked by James Morris."

* tag 'nfs-for-3.11-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (54 commits)
  NFS: Set NFS_CS_MIGRATION for NFSv4 mounts
  NFSv4.1 Refactor nfs4_init_session and nfs4_init_channel_attrs
  nfs: have NFSv3 try server-specified auth flavors in turn
  nfs: have nfs_mount fake up a auth_flavs list when the server didn't provide it
  nfs: move server_authlist into nfs_try_mount_request
  nfs: refactor "need_mount" code out of nfs_try_mount
  SUNRPC: PipeFS MOUNT notification optimization for dying clients
  SUNRPC: split client creation routine into setup and registration
  SUNRPC: fix races on PipeFS UMOUNT notifications
  SUNRPC: fix races on PipeFS MOUNT notifications
  NFSv4.1 use pnfs_device maxcount for the objectlayout gdia_maxcount
  NFSv4.1 use pnfs_device maxcount for the blocklayout gdia_maxcount
  NFSv4.1 Fix gdia_maxcount calculation to fit in ca_maxresponsesize
  NFS: Improve legacy idmapping fallback
  NFSv4.1 end back channel session draining
  NFS: Apply v4.1 capabilities to v4.2
  NFSv4.1: Clean up layout segment comparison helper names
  NFSv4.1: layout segment comparison helpers should take 'const' parameters
  NFSv4: Move the DNS resolver into the NFSv4 module
  rpc_pipefs: only set rpc_dentry_ops if d_op isn't already set
  ...
</content>
</entry>
<entry>
<title>Security: Add Hook to test if the particular xattr is part of a MAC model.</title>
<updated>2013-06-08T20:20:11Z</updated>
<author>
<name>David Quigley</name>
<email>dpquigl@davequigley.com</email>
</author>
<published>2013-05-22T16:50:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=746df9b59c8a5f162c907796c7295d3c4c0d8995'/>
<id>urn:sha1:746df9b59c8a5f162c907796c7295d3c4c0d8995</id>
<content type='text'>
The interface to request security labels from user space is the xattr
interface. When requesting the security label from an NFS server it is
important to make sure the requested xattr actually is a MAC label. This allows
us to make sure that we get the desired semantics from the attribute instead of
something else such as capabilities or a time based LSM.

Acked-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: James Morris &lt;james.l.morris@oracle.com&gt;
Signed-off-by: Matthew N. Dodd &lt;Matthew.Dodd@sparta.com&gt;
Signed-off-by: Miguel Rodel Felipe &lt;Rodel_FM@dsi.a-star.edu.sg&gt;
Signed-off-by: Phua Eu Gene &lt;PHUA_Eu_Gene@dsi.a-star.edu.sg&gt;
Signed-off-by: Khin Mi Mi Aung &lt;Mi_Mi_AUNG@dsi.a-star.edu.sg&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
</feed>
