<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security, branch v5.8</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=v5.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-07-08T06:27:57Z</updated>
<entry>
<title>integrity/ima: switch to using __kernel_read</title>
<updated>2020-07-08T06:27:57Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-05-08T06:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a1f9b1c0439db47ea10418b8ee7092a0d970cc2d'/>
<id>urn:sha1:a1f9b1c0439db47ea10418b8ee7092a0d970cc2d</id>
<content type='text'>
__kernel_read has a bunch of additional sanity checks, and this moves
the set_fs out of non-core code.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>Merge tag 'fixes-v5.8-rc3-a' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security</title>
<updated>2020-06-30T19:21:53Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-06-30T19:21:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=615bc218d628d90a3afebcfa772aa41865acd301'/>
<id>urn:sha1:615bc218d628d90a3afebcfa772aa41865acd301</id>
<content type='text'>
Pull security subsystem fixes from James Morris:
 "Two simple fixes for v5.8:

   - Fix hook iteration and default value for inode_copy_up_xattr
     (KP Singh)

   - Fix the key_permission LSM hook function type (Sami Tolvanen)"

* tag 'fixes-v5.8-rc3-a' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  security: Fix hook iteration and default value for inode_copy_up_xattr
  security: fix the key_permission LSM hook function type
</content>
</entry>
<entry>
<title>ima: extend boot_aggregate with kernel measurements</title>
<updated>2020-06-25T00:47:24Z</updated>
<author>
<name>Maurizio Drocco</name>
<email>maurizio.drocco@ibm.com</email>
</author>
<published>2020-06-23T15:57:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=20c59ce010f84300f6c655d32db2610d3433f85c'/>
<id>urn:sha1:20c59ce010f84300f6c655d32db2610d3433f85c</id>
<content type='text'>
Registers 8-9 are used to store measurements of the kernel and its
command line (e.g., grub2 bootloader with tpm module enabled). IMA
should include them in the boot aggregate. Registers 8-9 should be
only included in non-SHA1 digests to avoid ambiguity.

Signed-off-by: Maurizio Drocco &lt;maurizio.drocco@ibm.com&gt;
Reviewed-by: Bruno Meneguele &lt;bmeneg@redhat.com&gt;
Tested-by: Bruno Meneguele &lt;bmeneg@redhat.com&gt;  (TPM 1.2, TPM 2.0)
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>security: Fix hook iteration and default value for inode_copy_up_xattr</title>
<updated>2020-06-23T23:39:23Z</updated>
<author>
<name>KP Singh</name>
<email>kpsingh@google.com</email>
</author>
<published>2020-06-21T22:21:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23e390cdbe6f85827a43d38f9288dcd3066fa376'/>
<id>urn:sha1:23e390cdbe6f85827a43d38f9288dcd3066fa376</id>
<content type='text'>
inode_copy_up_xattr returns 0 to indicate the acceptance of the xattr
and 1 to reject it. If the LSM does not know about the xattr, it's
expected to return -EOPNOTSUPP, which is the correct default value for
this hook. BPF LSM, currently, uses 0 as the default value and thereby
falsely allows all overlay fs xattributes to be copied up.

The iteration logic is also updated from the "bail-on-fail"
call_int_hook to continue on the non-decisive -EOPNOTSUPP and bail out
on other values.

Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks")
Signed-off-by: KP Singh &lt;kpsingh@google.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'selinux-pr-20200621' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux</title>
<updated>2020-06-21T22:41:24Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-06-21T22:41:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=817d914d17651c188f28a284261ff6091d80ad2c'/>
<id>urn:sha1:817d914d17651c188f28a284261ff6091d80ad2c</id>
<content type='text'>
Pull SELinux fixes from Paul Moore:
 "Three small patches to fix problems in the SELinux code, all found via
  clang.

  Two patches fix potential double-free conditions and one fixes an
  undefined return value"

* tag 'selinux-pr-20200621' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
  selinux: fix undefined return of cond_evaluate_expr
  selinux: fix a double free in cond_read_node()/cond_read_list()
  selinux: fix double free
</content>
</entry>
<entry>
<title>selinux: fix undefined return of cond_evaluate_expr</title>
<updated>2020-06-17T21:36:40Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2020-06-17T12:40:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8231b0b9c322c894594fb42eb0eb9f93544a6acc'/>
<id>urn:sha1:8231b0b9c322c894594fb42eb0eb9f93544a6acc</id>
<content type='text'>
clang static analysis reports an undefined return

security/selinux/ss/conditional.c:79:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
        return s[0];
        ^~~~~~~~~~~

static int cond_evaluate_expr( ...
{
	u32 i;
	int s[COND_EXPR_MAXDEPTH];

	for (i = 0; i &lt; expr-&gt;len; i++)
	  ...

	return s[0];

When expr-&gt;len is 0, the loop which sets s[0] never runs.

So return -1 if the loop never runs.

Cc: stable@vger.kernel.org
Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Acked-by: Stephen Smalley &lt;stephen.smalley.work@gmail.com&gt;
Signed-off-by: Paul Moore &lt;paul@paul-moore.com&gt;
</content>
</entry>
<entry>
<title>selinux: fix a double free in cond_read_node()/cond_read_list()</title>
<updated>2020-06-17T00:25:19Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2020-06-15T20:45:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa449a7965a6172a89d48844c313708962216f1f'/>
<id>urn:sha1:aa449a7965a6172a89d48844c313708962216f1f</id>
<content type='text'>
Clang static analysis reports this double free error

security/selinux/ss/conditional.c:139:2: warning: Attempt to free released memory [unix.Malloc]
        kfree(node-&gt;expr.nodes);
        ^~~~~~~~~~~~~~~~~~~~~~~

When cond_read_node fails, it calls cond_node_destroy which frees the
node but does not poison the entry in the node list.  So when it
returns to its caller cond_read_list, cond_read_list deletes the
partial list.  The latest entry in the list will be deleted twice.

So instead of freeing the node in cond_read_node, let list freeing in
code_read_list handle the freeing the problem node along with all of the
earlier nodes.

Because cond_read_node no longer does any error handling, the goto's
the error case are redundant.  Instead just return the error code.

Cc: stable@vger.kernel.org
Fixes: 60abd3181db2 ("selinux: convert cond_list to array")
Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Reviewed-by: Ondrej Mosnacek &lt;omosnace@redhat.com&gt;
[PM: subject line tweaks]
Signed-off-by: Paul Moore &lt;paul@paul-moore.com&gt;
</content>
</entry>
<entry>
<title>ima: Replace zero-length array with flexible-array</title>
<updated>2020-06-16T04:08:32Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-05-28T14:35:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb492c627a61b5630d5e6d9f6cfecbcd60611e05'/>
<id>urn:sha1:eb492c627a61b5630d5e6d9f6cfecbcd60611e05</id>
<content type='text'>
There is a regular need in the kernel to provide a way to declare having a
dynamically sized set of trailing elements in a structure. Kernel code should
always use “flexible array members”[1] for these cases. The older style of
one-element or zero-length arrays should no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://github.com/KSPP/linux/issues/21

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux</title>
<updated>2020-06-14T18:39:31Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-06-14T18:39:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4a87b197c1da6b16608d5110709e0b3308e25dcd'/>
<id>urn:sha1:4a87b197c1da6b16608d5110709e0b3308e25dcd</id>
<content type='text'>
Pull SafeSetID update from Micah Morton:
 "Add additional LSM hooks for SafeSetID

  SafeSetID is capable of making allow/deny decisions for set*uid calls
  on a system, and we want to add similar functionality for set*gid
  calls.

  The work to do that is not yet complete, so probably won't make it in
  for v5.8, but we are looking to get this simple patch in for v5.8
  since we have it ready.

  We are planning on the rest of the work for extending the SafeSetID
  LSM being merged during the v5.9 merge window"

* tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux:
  security: Add LSM hooks to set*gid syscalls
</content>
</entry>
<entry>
<title>security: Add LSM hooks to set*gid syscalls</title>
<updated>2020-06-14T17:52:02Z</updated>
<author>
<name>Thomas Cedeno</name>
<email>thomascedeno@google.com</email>
</author>
<published>2020-06-09T17:22:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=39030e1351aa1aa7443bb2da24426573077c83da'/>
<id>urn:sha1:39030e1351aa1aa7443bb2da24426573077c83da</id>
<content type='text'>
The SafeSetID LSM uses the security_task_fix_setuid hook to filter
set*uid() syscalls according to its configured security policy. In
preparation for adding analagous support in the LSM for set*gid()
syscalls, we add the requisite hook here. Tested by putting print
statements in the security_task_fix_setgid hook and seeing them get hit
during kernel boot.

Signed-off-by: Thomas Cedeno &lt;thomascedeno@google.com&gt;
Signed-off-by: Micah Morton &lt;mortonm@chromium.org&gt;
</content>
</entry>
</feed>
