<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security/security.c, branch v2.6.38</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.38</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.38'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2011-02-11T06:41:58Z</updated>
<entry>
<title>security: add cred argument to security_capable()</title>
<updated>2011-02-11T06:41:58Z</updated>
<author>
<name>Chris Wright</name>
<email>chrisw@sous-sol.org</email>
</author>
<published>2011-02-10T06:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6037b715d6fab139742c3df8851db4c823081561'/>
<id>urn:sha1:6037b715d6fab139742c3df8851db4c823081561</id>
<content type='text'>
Expand security_capable() to include cred, so that it can be usable in a
wider range of call sites.

Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin</title>
<updated>2011-01-07T16:56:33Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-01-07T16:56:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b4a45f5fe8078bfc10837dbd5b98735058bc4698'/>
<id>urn:sha1:b4a45f5fe8078bfc10837dbd5b98735058bc4698</id>
<content type='text'>
* 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin: (57 commits)
  fs: scale mntget/mntput
  fs: rename vfsmount counter helpers
  fs: implement faster dentry memcmp
  fs: prefetch inode data in dcache lookup
  fs: improve scalability of pseudo filesystems
  fs: dcache per-inode inode alias locking
  fs: dcache per-bucket dcache hash locking
  bit_spinlock: add required includes
  kernel: add bl_list
  xfs: provide simple rcu-walk ACL implementation
  btrfs: provide simple rcu-walk ACL implementation
  ext2,3,4: provide simple rcu-walk ACL implementation
  fs: provide simple rcu-walk generic_check_acl implementation
  fs: provide rcu-walk aware permission i_ops
  fs: rcu-walk aware d_revalidate method
  fs: cache optimise dentry and inode for rcu-walk
  fs: dcache reduce branches in lookup path
  fs: dcache remove d_mounted
  fs: fs_struct use seqlock
  fs: rcu-walk for path lookup
  ...
</content>
</entry>
<entry>
<title>fs: rcu-walk for path lookup</title>
<updated>2011-01-07T06:50:27Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=31e6b01f4183ff419a6d1f86177cbf4662347cec'/>
<id>urn:sha1:31e6b01f4183ff419a6d1f86177cbf4662347cec</id>
<content type='text'>
Perform common cases of path lookups without any stores or locking in the
ancestor dentry elements. This is called rcu-walk, as opposed to the current
algorithm which is a refcount based walk, or ref-walk.

This results in far fewer atomic operations on every path element,
significantly improving path lookup performance. It also avoids cacheline
bouncing on common dentries, significantly improving scalability.

The overall design is like this:
* LOOKUP_RCU is set in nd-&gt;flags, which distinguishes rcu-walk from ref-walk.
* Take the RCU lock for the entire path walk, starting with the acquiring
  of the starting path (eg. root/cwd/fd-path). So now dentry refcounts are
  not required for dentry persistence.
* synchronize_rcu is called when unregistering a filesystem, so we can
  access d_ops and i_ops during rcu-walk.
* Similarly take the vfsmount lock for the entire path walk. So now mnt
  refcounts are not required for persistence. Also we are free to perform mount
  lookups, and to assume dentry mount points and mount roots are stable up and
  down the path.
* Have a per-dentry seqlock to protect the dentry name, parent, and inode,
  so we can load this tuple atomically, and also check whether any of its
  members have changed.
* Dentry lookups (based on parent, candidate string tuple) recheck the parent
  sequence after the child is found in case anything changed in the parent
  during the path walk.
* inode is also RCU protected so we can load d_inode and use the inode for
  limited things.
* i_mode, i_uid, i_gid can be tested for exec permissions during path walk.
* i_op can be loaded.

When we reach the destination dentry, we lock it, recheck lookup sequence,
and increment its refcount and mountpoint refcount. RCU and vfsmount locks
are dropped. This is termed "dropping rcu-walk". If the dentry refcount does
not match, we can not drop rcu-walk gracefully at the current point in the
lokup, so instead return -ECHILD (for want of a better errno). This signals the
path walking code to re-do the entire lookup with a ref-walk.

Aside from the final dentry, there are other situations that may be encounted
where we cannot continue rcu-walk. In that case, we drop rcu-walk (ie. take
a reference on the last good dentry) and continue with a ref-walk. Again, if
we can drop rcu-walk gracefully, we return -ECHILD and do the whole lookup
using ref-walk. But it is very important that we can continue with ref-walk
for most cases, particularly to avoid the overhead of double lookups, and to
gain the scalability advantages on common path elements (like cwd and root).

The cases where rcu-walk cannot continue are:
* NULL dentry (ie. any uncached path element)
* parent with d_inode-&gt;i_op-&gt;permission or ACLs
* dentries with d_revalidate
* Following links

In future patches, permission checks and d_revalidate become rcu-walk aware. It
may be possible eventually to make following links rcu-walk aware.

Uncached path elements will always require dropping to ref-walk mode, at the
very least because i_mutex needs to be grabbed, and objects allocated.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
</entry>
<entry>
<title>af_unix: Avoid socket-&gt;sk NULL OOPS in stream connect security hooks.</title>
<updated>2011-01-05T23:38:53Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-01-05T23:38:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3610cda53f247e176bcbb7a7cca64bc53b12acdb'/>
<id>urn:sha1:3610cda53f247e176bcbb7a7cca64bc53b12acdb</id>
<content type='text'>
unix_release() can asynchornously set socket-&gt;sk to NULL, and
it does so without holding the unix_state_lock() on "other"
during stream connects.

However, the reverse mapping, sk-&gt;sk_socket, is only transitioned
to NULL under the unix_state_lock().

Therefore make the security hooks follow the reverse mapping instead
of the forward mapping.

Reported-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>capabilities/syslog: open code cap_syslog logic to fix build failure</title>
<updated>2010-11-15T23:40:01Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-11-15T23:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12b3052c3ee8f508b2c7ee4ddd63ed03423409d8'/>
<id>urn:sha1:12b3052c3ee8f508b2c7ee4ddd63ed03423409d8</id>
<content type='text'>
The addition of CONFIG_SECURITY_DMESG_RESTRICT resulted in a build
failure when CONFIG_PRINTK=n.  This is because the capabilities code
which used the new option was built even though the variable in question
didn't exist.

The patch here fixes this by moving the capabilities checks out of the
LSM and into the caller.  All (known) LSMs should have been calling the
capabilities hook already so it actually makes the code organization
better to eliminate the hook altogether.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ima-memory-use-fixes'</title>
<updated>2010-10-26T18:37:48Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-26T18:37:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9ba5375a8aae4aeea6be15df77e24707a429812'/>
<id>urn:sha1:f9ba5375a8aae4aeea6be15df77e24707a429812</id>
<content type='text'>
* ima-memory-use-fixes:
  IMA: fix the ToMToU logic
  IMA: explicit IMA i_flag to remove global lock on inode_delete
  IMA: drop refcnt from ima_iint_cache since it isn't needed
  IMA: only allocate iint when needed
  IMA: move read counter into struct inode
  IMA: use i_writecount rather than a private counter
  IMA: use inode-&gt;i_lock to protect read and write counters
  IMA: convert internal flags from long to char
  IMA: use unsigned int instead of long for counters
  IMA: drop the inode opencount since it isn't needed for operation
  IMA: use rbtree instead of radix tree for inode information cache
</content>
</entry>
<entry>
<title>IMA: only allocate iint when needed</title>
<updated>2010-10-26T18:37:18Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-10-25T18:42:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc7d2a3e66b40477270c3cbe3b89b47093276e7a'/>
<id>urn:sha1:bc7d2a3e66b40477270c3cbe3b89b47093276e7a</id>
<content type='text'>
IMA always allocates an integrity structure to hold information about
every inode, but only needed this structure to track the number of
readers and writers currently accessing a given inode.  Since that
information was moved into struct inode instead of the integrity struct
this patch stops allocating the integrity stucture until it is needed.
Thus greatly reducing memory usage.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>secmark: make secmark object handling generic</title>
<updated>2010-10-20T23:12:48Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-10-13T20:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2606fd1fa5710205b23ee859563502aa18362447'/>
<id>urn:sha1:2606fd1fa5710205b23ee859563502aa18362447</id>
<content type='text'>
Right now secmark has lots of direct selinux calls.  Use all LSM calls and
remove all SELinux specific knowledge.  The only SELinux specific knowledge
we leave is the mode.  The only point is to make sure that other LSMs at
least test this generic code before they assume it works.  (They may also
have to make changes if they do not represent labels as strings)

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: Paul Moore &lt;paul.moore@hp.com&gt;
Acked-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>security: remove unused parameter from security_task_setscheduler()</title>
<updated>2010-10-20T23:12:44Z</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2010-10-14T19:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0ae19811375031ae3b3fecc65b702a9c6e5cc28'/>
<id>urn:sha1:b0ae19811375031ae3b3fecc65b702a9c6e5cc28</id>
<content type='text'>
All security modules shouldn't change sched_param parameter of
security_task_setscheduler().  This is not only meaningless, but also
make a harmful result if caller pass a static variable.

This patch remove policy and sched_param parameter from
security_task_setscheduler() becuase none of security module is
using it.

Cc: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>LSM: Fix security_module_enable() error.</title>
<updated>2010-10-20T23:12:34Z</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2010-08-28T05:58:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=065d78a0603cc6f8d288e96dbf761b96984b634f'/>
<id>urn:sha1:065d78a0603cc6f8d288e96dbf761b96984b634f</id>
<content type='text'>
We can set default LSM module to DAC (which means "enable no LSM module").
If default LSM module was set to DAC, security_module_enable() must return 0
unless overridden via boot time parameter.

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Acked-by: Serge E. Hallyn &lt;serge@hallyn.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
</feed>
