<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/security/selinux/ss/conditional.c, branch linux-4.4.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2015-11-24T18:44:32+00:00</updated>
<entry>
<title>selinux: fix bug in conditional rules handling</title>
<updated>2015-11-24T18:44:32+00:00</updated>
<author>
<name>Stephen Smalley</name>
<email>sds@tycho.nsa.gov</email>
</author>
<published>2015-11-23T21:07:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f3bef67992e8698897b584616535803887c4a73e'/>
<id>urn:sha1:f3bef67992e8698897b584616535803887c4a73e</id>
<content type='text'>
commit fa1aa143ac4a ("selinux: extended permissions for ioctls")
introduced a bug into the handling of conditional rules, skipping the
processing entirely when the caller does not provide an extended
permissions (xperms) structure.  Access checks from userspace using
/sys/fs/selinux/access do not include such a structure since that
interface does not presently expose extended permission information.
As a result, conditional rules were being ignored entirely on userspace
access requests, producing denials when access was allowed by
conditional rules in the policy.  Fix the bug by only skipping
computation of extended permissions in this situation, not the entire
conditional rules processing.

Reported-by: Laurent Bigonville &lt;bigon@debian.org&gt;
Signed-off-by: Stephen Smalley &lt;sds@tycho.nsa.gov&gt;
[PM: fixed long lines in patch description]
Cc: stable@vger.kernel.org # 4.3
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
</content>
</entry>
<entry>
<title>selinux: extended permissions for ioctls</title>
<updated>2015-07-13T17:31:58+00:00</updated>
<author>
<name>Jeff Vander Stoep</name>
<email>jeffv@google.com</email>
</author>
<published>2015-07-10T21:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fa1aa143ac4a682c7f5fd52a3cf05f5a6fe44a0a'/>
<id>urn:sha1:fa1aa143ac4a682c7f5fd52a3cf05f5a6fe44a0a</id>
<content type='text'>
Add extended permissions logic to selinux. Extended permissions
provides additional permissions in 256 bit increments. Extend the
generic ioctl permission check to use the extended permissions for
per-command filtering. Source/target/class sets including the ioctl
permission may additionally include a set of commands. Example:

allowxperm &lt;source&gt; &lt;target&gt;:&lt;class&gt; ioctl unpriv_app_socket_cmds
auditallowxperm &lt;source&gt; &lt;target&gt;:&lt;class&gt; ioctl priv_gpu_cmds

Where unpriv_app_socket_cmds and priv_gpu_cmds are macros
representing commonly granted sets of ioctl commands.

When ioctl commands are omitted only the permissions are checked.
This feature is intended to provide finer granularity for the ioctl
permission that may be too imprecise. For example, the same driver
may use ioctls to provide important and benign functionality such as
driver version or socket type as well as dangerous capabilities such
as debugging features, read/write/execute to physical memory or
access to sensitive data. Per-command filtering provides a mechanism
to reduce the attack surface of the kernel, and limit applications
to the subset of commands required.

The format of the policy binary has been modified to include ioctl
commands, and the policy version number has been incremented to
POLICYDB_VERSION_XPERMS_IOCTL=30 to account for the format
change.

The extended permissions logic is deliberately generic to allow
components to be reused e.g. netlink filters

Signed-off-by: Jeff Vander Stoep &lt;jeffv@google.com&gt;
Acked-by: Nick Kralevich &lt;nnk@google.com&gt;
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
</content>
</entry>
<entry>
<title>selinux: fix a possible memory leak in cond_read_node()</title>
<updated>2014-06-19T18:56:59+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2014-06-14T16:19:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e51f9cbfa04a92b40e7f9c1e76c8ecbff534a22'/>
<id>urn:sha1:6e51f9cbfa04a92b40e7f9c1e76c8ecbff534a22</id>
<content type='text'>
The cond_read_node() should free the given node on error path as it's
not linked to p-&gt;cond_list yet.  This is done via cond_node_destroy()
but it's not called when next_entry() fails before the expr loop.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
</content>
</entry>
<entry>
<title>selinux: simple cleanup for cond_read_node()</title>
<updated>2014-06-19T18:53:15+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2014-06-14T16:19:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f004afe60db5b98f2b981978fde8a0d4c6298c5d'/>
<id>urn:sha1:f004afe60db5b98f2b981978fde8a0d4c6298c5d</id>
<content type='text'>
The node-&gt;cur_state and len can be read in a single call of next_entry().
And setting len before reading is a dead write so can be eliminated.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
(Minor tweak to the length parameter in the call to next_entry())
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
</content>
</entry>
<entry>
<title>selinux: Casting (void *) value returned by kmalloc is useless</title>
<updated>2011-12-19T00:23:56+00:00</updated>
<author>
<name>Thomas Meyer</name>
<email>thomas@m3y3r.de</email>
</author>
<published>2011-11-17T22:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2ff6fa8fafd6fa94029fa0558a6b85956930f1f5'/>
<id>urn:sha1:2ff6fa8fafd6fa94029fa0558a6b85956930f1f5</id>
<content type='text'>
The semantic patch that makes this change is available
in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.

Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>selinux: sparse fix: fix several warnings in the security server code</title>
<updated>2011-09-09T23:56:32+00:00</updated>
<author>
<name>James Morris</name>
<email>jmorris@namei.org</email>
</author>
<published>2011-08-30T02:52:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b98a5857c3fa86cb0a7e5f893643491a8b5b425'/>
<id>urn:sha1:7b98a5857c3fa86cb0a7e5f893643491a8b5b425</id>
<content type='text'>
Fix several sparse warnings in the SELinux security server code.

Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>selinux: return -ENOMEM when memory allocation fails</title>
<updated>2011-01-24T00:35:47+00:00</updated>
<author>
<name>Davidlohr Bueso</name>
<email>dave@gnu.org</email>
</author>
<published>2011-01-21T15:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3ac285ff23cd6e1bc402b6db836521bce006eb89'/>
<id>urn:sha1:3ac285ff23cd6e1bc402b6db836521bce006eb89</id>
<content type='text'>
Return -ENOMEM when memory allocation fails in cond_init_bool_indexes,
correctly propagating error code to caller.

Signed-off-by: Davidlohr Bueso &lt;dave@gnu.org&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>selinux: convert part of the sym_val_to_name array to use flex_array</title>
<updated>2010-11-30T22:28:58+00:00</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-11-29T20:47:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac76c05becb6beedbb458d0827d3deaa6f479a72'/>
<id>urn:sha1:ac76c05becb6beedbb458d0827d3deaa6f479a72</id>
<content type='text'>
The sym_val_to_name type array can be quite large as it grows linearly with
the number of types.  With known policies having over 5k types these
allocations are growing large enough that they are likely to fail.  Convert
those to flex_array so no allocation is larger than PAGE_SIZE

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
</content>
</entry>
<entry>
<title>SELinux: allow userspace to read policy back out of the kernel</title>
<updated>2010-10-20T23:12:58+00:00</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-10-13T21:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cee74f47a6baba0ac457e87687fdcf0abd599f0a'/>
<id>urn:sha1:cee74f47a6baba0ac457e87687fdcf0abd599f0a</id>
<content type='text'>
There is interest in being able to see what the actual policy is that was
loaded into the kernel.  The patch creates a new selinuxfs file
/selinux/policy which can be read by userspace.  The actual policy that is
loaded into the kernel will be written back out to userspace.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>selinux: fix error codes in cond_read_bool()</title>
<updated>2010-08-02T05:35:04+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-06-12T18:56:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=338437f6a09861cdf76e1396ed5fa6dee9c7cabe'/>
<id>urn:sha1:338437f6a09861cdf76e1396ed5fa6dee9c7cabe</id>
<content type='text'>
The original code always returned -1 (-EPERM) on error.  The new code
returns either -ENOMEM, or -EINVAL or it propagates the error codes from
lower level functions next_entry() or hashtab_insert().

next_entry() returns -EINVAL.
hashtab_insert() returns -EINVAL, -EEXIST, or -ENOMEM.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Acked-by:  Stephen D. Smalley &lt;sds@tycho.nsa.gov&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
</feed>
