Skip to contentSkip to conversation

Patch "selinux: Remove unnecessary check of array base in selinux_set_mapping()" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Apr 3, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

selinux: Remove unnecessary check of array base in selinux_set_mapping()

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 342e91578eb6909529bc7095964cd44b9c057c4e Mon Sep 17 00:00:00 2001

From: Matthias Kaehlcke <[email protected]>
Date: Thu, 16 Mar 2017 15:26:52 -0700
Subject: selinux: Remove unnecessary check of array base in selinux_set_mapping()

From: Matthias Kaehlcke <[email protected]>

commit 342e91578eb6909529bc7095964cd44b9c057c4e upstream.

'perms' will never be NULL since it isn't a plain pointer but an array of u32 values.

This fixes the following warning when building with clang:

security/selinux/ss/services.c:158:16: error: address of array 'p_in->perms' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

                while (p_in->perms && p_in->perms[k]) {
---
 security/selinux/ss/services.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/ss/services.c +1 -1
@@ -155,7 +155,7 @@ static int selinux_set_mapping(struct po
 		}
 
 		k = 0;
-		while (p_in->perms && p_in->perms[k]) {
+		while (p_in->perms[k]) {
 			/* An empty permission string skips ahead */
 			if (!*p_in->perms[k]) {
 				k++;

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/dm-ioctl-remove-double-parentheses.patch queue-4.9/genirq-use-cpumask_available-for-check-of-cpumask-variable.patch queue-4.9/fs-compat-remove-warning-from-compatible_ioctl.patch queue-4.9/selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch queue-4.9/pci-make-pci_rom_address_mask-a-32-bit-constant.patch queue-4.9/cpumask-add-helper-cpumask_available.patch