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=sum…
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 <stable(a)vger.kernel.org> know about it.
>From 342e91578eb6909529bc7095964cd44b9c057c4e Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka(a)chromium.org>
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(a)chromium.org>
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(a)chromium.org>
Signed-off-by: Paul Moore <paul(a)paul-moore.com>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
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(a)chromium.org 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
This is a note to let you know that I've just added the patch titled
PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant
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=sum…
The filename of the patch is:
pci-make-pci_rom_address_mask-a-32-bit-constant.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 <stable(a)vger.kernel.org> know about it.
>From 76dc52684d0f72971d9f6cc7d5ae198061b715bd Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka(a)chromium.org>
Date: Fri, 14 Apr 2017 13:38:02 -0700
Subject: PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant
From: Matthias Kaehlcke <mka(a)chromium.org>
commit 76dc52684d0f72971d9f6cc7d5ae198061b715bd upstream.
A 64-bit value is not needed since a PCI ROM address consists in 32 bits.
This fixes a clang warning about "implicit conversion from 'unsigned long'
to 'u32'".
Also remove now unnecessary casts to u32 from __pci_read_base() and
pci_std_update_resource().
Signed-off-by: Matthias Kaehlcke <mka(a)chromium.org>
Signed-off-by: Bjorn Helgaas <bhelgaas(a)google.com>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/pci/probe.c | 2 +-
drivers/pci/setup-res.c | 2 +-
include/uapi/linux/pci_regs.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -231,7 +231,7 @@ int __pci_read_base(struct pci_dev *dev,
res->flags |= IORESOURCE_ROM_ENABLE;
l64 = l & PCI_ROM_ADDRESS_MASK;
sz64 = sz & PCI_ROM_ADDRESS_MASK;
- mask64 = (u32)PCI_ROM_ADDRESS_MASK;
+ mask64 = PCI_ROM_ADDRESS_MASK;
}
if (res->flags & IORESOURCE_MEM_64) {
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -63,7 +63,7 @@ static void pci_std_update_resource(stru
mask = (u32)PCI_BASE_ADDRESS_IO_MASK;
new |= res->flags & ~PCI_BASE_ADDRESS_IO_MASK;
} else if (resno == PCI_ROM_RESOURCE) {
- mask = (u32)PCI_ROM_ADDRESS_MASK;
+ mask = PCI_ROM_ADDRESS_MASK;
} else {
mask = (u32)PCI_BASE_ADDRESS_MEM_MASK;
new |= res->flags & ~PCI_BASE_ADDRESS_MEM_MASK;
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -106,7 +106,7 @@
#define PCI_SUBSYSTEM_ID 0x2e
#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
#define PCI_ROM_ADDRESS_ENABLE 0x01
-#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
+#define PCI_ROM_ADDRESS_MASK (~0x7ffU)
#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
Patches currently in stable-queue which might be from mka(a)chromium.org 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
This is a note to let you know that I've just added the patch titled
genirq: Use cpumask_available() for check of cpumask variable
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=sum…
The filename of the patch is:
genirq-use-cpumask_available-for-check-of-cpumask-variable.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 <stable(a)vger.kernel.org> know about it.
>From d170fe7dd992b313d4851ae5ab77ee7a51ed8c72 Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka(a)chromium.org>
Date: Wed, 12 Apr 2017 11:20:30 -0700
Subject: genirq: Use cpumask_available() for check of cpumask variable
From: Matthias Kaehlcke <mka(a)chromium.org>
commit d170fe7dd992b313d4851ae5ab77ee7a51ed8c72 upstream.
This fixes the following clang warning when CONFIG_CPUMASK_OFFSTACK=n:
kernel/irq/manage.c:839:28: error: address of array
'desc->irq_common_data.affinity' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
Signed-off-by: Matthias Kaehlcke <mka(a)chromium.org>
Cc: Grant Grundler <grundler(a)chromium.org>
Cc: Rusty Russell <rusty(a)rustcorp.com.au>
Cc: Greg Hackmann <ghackmann(a)google.com>
Cc: Michael Davidson <md(a)google.com>
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Link: http://lkml.kernel.org/r/20170412182030.83657-2-mka@chromium.org
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
kernel/irq/manage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -850,7 +850,7 @@ irq_thread_check_affinity(struct irq_des
* This code is triggered unconditionally. Check the affinity
* mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
*/
- if (desc->irq_common_data.affinity)
+ if (cpumask_available(desc->irq_common_data.affinity))
cpumask_copy(mask, desc->irq_common_data.affinity);
else
valid = false;
Patches currently in stable-queue which might be from mka(a)chromium.org 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
This is a note to let you know that I've just added the patch titled
fs: compat: Remove warning from COMPATIBLE_IOCTL
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=sum…
The filename of the patch is:
fs-compat-remove-warning-from-compatible_ioctl.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 <stable(a)vger.kernel.org> know about it.
>From 9280cdd6fe5b8287a726d24cc1d558b96c8491d7 Mon Sep 17 00:00:00 2001
From: Mark Charlebois <charlebm(a)gmail.com>
Date: Fri, 28 Apr 2017 15:15:12 -0700
Subject: fs: compat: Remove warning from COMPATIBLE_IOCTL
From: Mark Charlebois <charlebm(a)gmail.com>
commit 9280cdd6fe5b8287a726d24cc1d558b96c8491d7 upstream.
cmd in COMPATIBLE_IOCTL is always a u32, so cast it so there isn't a
warning about an overflow in XFORM.
From: Mark Charlebois <charlebm(a)gmail.com>
Signed-off-by: Mark Charlebois <charlebm(a)gmail.com>
Signed-off-by: Behan Webster <behanw(a)converseincode.com>
Signed-off-by: Matthias Kaehlcke <mka(a)chromium.org>
Acked-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
fs/compat_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -833,7 +833,7 @@ static int compat_ioctl_preallocate(stru
*/
#define XFORM(i) (((i) ^ ((i) << 27) ^ ((i) << 17)) & 0xffffffff)
-#define COMPATIBLE_IOCTL(cmd) XFORM(cmd),
+#define COMPATIBLE_IOCTL(cmd) XFORM((u32)cmd),
/* ioctl should not be warned about even if it's not implemented.
Valid reasons to use this:
- It is implemented with ->compat_ioctl on some device, but programs
Patches currently in stable-queue which might be from charlebm(a)gmail.com are
queue-4.9/fs-compat-remove-warning-from-compatible_ioctl.patch
This is a note to let you know that I've just added the patch titled
dm ioctl: remove double parentheses
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=sum…
The filename of the patch is:
dm-ioctl-remove-double-parentheses.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 <stable(a)vger.kernel.org> know about it.
>From e36215d87f301f9567c8c99fd34e6c3521a94ddf Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka(a)chromium.org>
Date: Mon, 17 Apr 2017 11:05:03 -0700
Subject: dm ioctl: remove double parentheses
From: Matthias Kaehlcke <mka(a)chromium.org>
commit e36215d87f301f9567c8c99fd34e6c3521a94ddf upstream.
The extra pair of parantheses is not needed and causes clang to generate
warnings about the DM_DEV_CREATE_CMD comparison in validate_params().
Also remove another double parentheses that doesn't cause a warning.
Signed-off-by: Matthias Kaehlcke <mka(a)chromium.org>
Signed-off-by: Mike Snitzer <snitzer(a)redhat.com>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/md/dm-ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1777,12 +1777,12 @@ static int validate_params(uint cmd, str
cmd == DM_LIST_VERSIONS_CMD)
return 0;
- if ((cmd == DM_DEV_CREATE_CMD)) {
+ if (cmd == DM_DEV_CREATE_CMD) {
if (!*param->name) {
DMWARN("name not supplied when creating device");
return -EINVAL;
}
- } else if ((*param->uuid && *param->name)) {
+ } else if (*param->uuid && *param->name) {
DMWARN("only supply one of name or uuid, cmd(%u)", cmd);
return -EINVAL;
}
Patches currently in stable-queue which might be from mka(a)chromium.org 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
This is a note to let you know that I've just added the patch titled
cpumask: Add helper cpumask_available()
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=sum…
The filename of the patch is:
cpumask-add-helper-cpumask_available.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 <stable(a)vger.kernel.org> know about it.
>From f7e30f01a9e221067bb4b579e3cfc25cd2617467 Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka(a)chromium.org>
Date: Wed, 12 Apr 2017 11:20:29 -0700
Subject: cpumask: Add helper cpumask_available()
From: Matthias Kaehlcke <mka(a)chromium.org>
commit f7e30f01a9e221067bb4b579e3cfc25cd2617467 upstream.
With CONFIG_CPUMASK_OFFSTACK=y cpumask_var_t is a struct cpumask
pointer, otherwise a struct cpumask array with a single element.
Some code dealing with cpumasks needs to validate that a cpumask_var_t
is not a NULL pointer when CONFIG_CPUMASK_OFFSTACK=y. This is typically
done by performing the check always, regardless of the underlying type
of cpumask_var_t. This works in both cases, however clang raises a
warning like this when CONFIG_CPUMASK_OFFSTACK=n:
kernel/irq/manage.c:839:28: error: address of array
'desc->irq_common_data.affinity' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
Add the inline helper cpumask_available() which only performs the
pointer check if CONFIG_CPUMASK_OFFSTACK=y.
Signed-off-by: Matthias Kaehlcke <mka(a)chromium.org>
Cc: Grant Grundler <grundler(a)chromium.org>
Cc: Rusty Russell <rusty(a)rustcorp.com.au>
Cc: Greg Hackmann <ghackmann(a)google.com>
Cc: Michael Davidson <md(a)google.com>
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Link: http://lkml.kernel.org/r/20170412182030.83657-1-mka@chromium.org
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
include/linux/cpumask.h | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -680,6 +680,11 @@ void alloc_bootmem_cpumask_var(cpumask_v
void free_cpumask_var(cpumask_var_t mask);
void free_bootmem_cpumask_var(cpumask_var_t mask);
+static inline bool cpumask_available(cpumask_var_t mask)
+{
+ return mask != NULL;
+}
+
#else
typedef struct cpumask cpumask_var_t[1];
@@ -720,6 +725,11 @@ static inline void free_cpumask_var(cpum
static inline void free_bootmem_cpumask_var(cpumask_var_t mask)
{
}
+
+static inline bool cpumask_available(cpumask_var_t mask)
+{
+ return true;
+}
#endif /* CONFIG_CPUMASK_OFFSTACK */
/* It's common to want to use cpu_all_mask in struct member initializers,
Patches currently in stable-queue which might be from mka(a)chromium.org 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
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=sum…
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(a)vger.kernel.org> know about it.
>From 342e91578eb6909529bc7095964cd44b9c057c4e Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka(a)chromium.org>
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(a)chromium.org>
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(a)chromium.org>
Signed-off-by: Paul Moore <paul(a)paul-moore.com>
Cc: Nathan Chancellor <natechancellor(a)gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
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(a)chromium.org 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