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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.4-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.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 342e91578eb6909529bc7095964cd44b9c057c4e Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
Date: Thu, 16 Mar 2017 15:26:52 -0700
Subject: selinux: Remove unnecessary check of array base in selinux_set_mapping()

From: Matthias Kaehlcke <mka@xxxxxxxxxxxx>

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]) {

Signed-off-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
Signed-off-by: Paul Moore <paul@xxxxxxxxxxxxxx>
Cc: Nathan Chancellor <natechancellor@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 security/selinux/ss/services.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -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 mka@xxxxxxxxxxxx are

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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]