]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Apr 2018 13:09:29 +0000 (15:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Apr 2018 13:09:29 +0000 (15:09 +0200)
added patches:
cpumask-add-helper-cpumask_available.patch
dm-ioctl-remove-double-parentheses.patch
fs-compat-remove-warning-from-compatible_ioctl.patch
genirq-use-cpumask_available-for-check-of-cpumask-variable.patch
input-mousedev-fix-implicit-conversion-warning.patch
netfilter-nf_nat_h323-fix-logical-not-parentheses-warning.patch
pci-make-pci_rom_address_mask-a-32-bit-constant.patch
selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch

queue-4.4/cpumask-add-helper-cpumask_available.patch [new file with mode: 0644]
queue-4.4/dm-ioctl-remove-double-parentheses.patch [new file with mode: 0644]
queue-4.4/fs-compat-remove-warning-from-compatible_ioctl.patch [new file with mode: 0644]
queue-4.4/genirq-use-cpumask_available-for-check-of-cpumask-variable.patch [new file with mode: 0644]
queue-4.4/input-mousedev-fix-implicit-conversion-warning.patch [new file with mode: 0644]
queue-4.4/netfilter-nf_nat_h323-fix-logical-not-parentheses-warning.patch [new file with mode: 0644]
queue-4.4/pci-make-pci_rom_address_mask-a-32-bit-constant.patch [new file with mode: 0644]
queue-4.4/selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/cpumask-add-helper-cpumask_available.patch b/queue-4.4/cpumask-add-helper-cpumask_available.patch
new file mode 100644 (file)
index 0000000..da11c20
--- /dev/null
@@ -0,0 +1,66 @@
+From f7e30f01a9e221067bb4b579e3cfc25cd2617467 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Wed, 12 Apr 2017 11:20:29 -0700
+Subject: cpumask: Add helper cpumask_available()
+
+From: Matthias Kaehlcke <mka@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@chromium.org>
+Cc: Grant Grundler <grundler@chromium.org>
+Cc: Rusty Russell <rusty@rustcorp.com.au>
+Cc: Greg Hackmann <ghackmann@google.com>
+Cc: Michael Davidson <md@google.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Link: http://lkml.kernel.org/r/20170412182030.83657-1-mka@chromium.org
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/cpumask.h |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/include/linux/cpumask.h
++++ b/include/linux/cpumask.h
+@@ -661,6 +661,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];
+@@ -701,6 +706,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,
diff --git a/queue-4.4/dm-ioctl-remove-double-parentheses.patch b/queue-4.4/dm-ioctl-remove-double-parentheses.patch
new file mode 100644 (file)
index 0000000..c05cfb8
--- /dev/null
@@ -0,0 +1,40 @@
+From e36215d87f301f9567c8c99fd34e6c3521a94ddf Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Mon, 17 Apr 2017 11:05:03 -0700
+Subject: dm ioctl: remove double parentheses
+
+From: Matthias Kaehlcke <mka@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@chromium.org>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@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
+@@ -1773,12 +1773,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;
+       }
diff --git a/queue-4.4/fs-compat-remove-warning-from-compatible_ioctl.patch b/queue-4.4/fs-compat-remove-warning-from-compatible_ioctl.patch
new file mode 100644 (file)
index 0000000..5b3c673
--- /dev/null
@@ -0,0 +1,36 @@
+From 9280cdd6fe5b8287a726d24cc1d558b96c8491d7 Mon Sep 17 00:00:00 2001
+From: Mark Charlebois <charlebm@gmail.com>
+Date: Fri, 28 Apr 2017 15:15:12 -0700
+Subject: fs: compat: Remove warning from COMPATIBLE_IOCTL
+
+From: Mark Charlebois <charlebm@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@gmail.com>
+Signed-off-by: Mark Charlebois <charlebm@gmail.com>
+Signed-off-by: Behan Webster <behanw@converseincode.com>
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/compat_ioctl.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/compat_ioctl.c
++++ b/fs/compat_ioctl.c
+@@ -811,7 +811,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
diff --git a/queue-4.4/genirq-use-cpumask_available-for-check-of-cpumask-variable.patch b/queue-4.4/genirq-use-cpumask_available-for-check-of-cpumask-variable.patch
new file mode 100644 (file)
index 0000000..5bb4860
--- /dev/null
@@ -0,0 +1,41 @@
+From d170fe7dd992b313d4851ae5ab77ee7a51ed8c72 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@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@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@chromium.org>
+Cc: Grant Grundler <grundler@chromium.org>
+Cc: Rusty Russell <rusty@rustcorp.com.au>
+Cc: Greg Hackmann <ghackmann@google.com>
+Cc: Michael Davidson <md@google.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Link: http://lkml.kernel.org/r/20170412182030.83657-2-mka@chromium.org
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/irq/manage.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/irq/manage.c
++++ b/kernel/irq/manage.c
+@@ -836,7 +836,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;
diff --git a/queue-4.4/input-mousedev-fix-implicit-conversion-warning.patch b/queue-4.4/input-mousedev-fix-implicit-conversion-warning.patch
new file mode 100644 (file)
index 0000000..e2a6a47
--- /dev/null
@@ -0,0 +1,144 @@
+From dae1a432ab1fe79ae53129ededeaece35a2dc14d Mon Sep 17 00:00:00 2001
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+Date: Sat, 24 Jun 2017 22:50:12 -0700
+Subject: Input: mousedev - fix implicit conversion warning
+
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+
+commit dae1a432ab1fe79ae53129ededeaece35a2dc14d upstream.
+
+Clang warns:
+
+drivers/input/mousedev.c:653:63: error: implicit conversion from 'int'
+to 'signed char' changes value from 200 to -56
+[-Wconstant-conversion]
+  client->ps2[1] = 0x60; client->ps2[2] = 3; client->ps2[3] = 200;
+                                                            ~ ^~~
+As the PS2 data is really a stream of bytes, let's switch to using u8 type
+for it, which silences this warning.
+
+Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mousedev.c |   62 +++++++++++++++++++++++++----------------------
+ 1 file changed, 34 insertions(+), 28 deletions(-)
+
+--- a/drivers/input/mousedev.c
++++ b/drivers/input/mousedev.c
+@@ -15,6 +15,7 @@
+ #define MOUSEDEV_MINORS               31
+ #define MOUSEDEV_MIX          63
++#include <linux/bitops.h>
+ #include <linux/sched.h>
+ #include <linux/slab.h>
+ #include <linux/poll.h>
+@@ -103,7 +104,7 @@ struct mousedev_client {
+       spinlock_t packet_lock;
+       int pos_x, pos_y;
+-      signed char ps2[6];
++      u8 ps2[6];
+       unsigned char ready, buffer, bufsiz;
+       unsigned char imexseq, impsseq;
+       enum mousedev_emul mode;
+@@ -291,11 +292,10 @@ static void mousedev_notify_readers(stru
+               }
+               client->pos_x += packet->dx;
+-              client->pos_x = client->pos_x < 0 ?
+-                      0 : (client->pos_x >= xres ? xres : client->pos_x);
++              client->pos_x = clamp_val(client->pos_x, 0, xres);
++
+               client->pos_y += packet->dy;
+-              client->pos_y = client->pos_y < 0 ?
+-                      0 : (client->pos_y >= yres ? yres : client->pos_y);
++              client->pos_y = clamp_val(client->pos_y, 0, yres);
+               p->dx += packet->dx;
+               p->dy += packet->dy;
+@@ -571,44 +571,50 @@ static int mousedev_open(struct inode *i
+       return error;
+ }
+-static inline int mousedev_limit_delta(int delta, int limit)
+-{
+-      return delta > limit ? limit : (delta < -limit ? -limit : delta);
+-}
+-
+-static void mousedev_packet(struct mousedev_client *client,
+-                          signed char *ps2_data)
++static void mousedev_packet(struct mousedev_client *client, u8 *ps2_data)
+ {
+       struct mousedev_motion *p = &client->packets[client->tail];
++      s8 dx, dy, dz;
++
++      dx = clamp_val(p->dx, -127, 127);
++      p->dx -= dx;
++
++      dy = clamp_val(p->dy, -127, 127);
++      p->dy -= dy;
+-      ps2_data[0] = 0x08 |
+-              ((p->dx < 0) << 4) | ((p->dy < 0) << 5) | (p->buttons & 0x07);
+-      ps2_data[1] = mousedev_limit_delta(p->dx, 127);
+-      ps2_data[2] = mousedev_limit_delta(p->dy, 127);
+-      p->dx -= ps2_data[1];
+-      p->dy -= ps2_data[2];
++      ps2_data[0] = BIT(3);
++      ps2_data[0] |= ((dx & BIT(7)) >> 3) | ((dy & BIT(7)) >> 2);
++      ps2_data[0] |= p->buttons & 0x07;
++      ps2_data[1] = dx;
++      ps2_data[2] = dy;
+       switch (client->mode) {
+       case MOUSEDEV_EMUL_EXPS:
+-              ps2_data[3] = mousedev_limit_delta(p->dz, 7);
+-              p->dz -= ps2_data[3];
+-              ps2_data[3] = (ps2_data[3] & 0x0f) | ((p->buttons & 0x18) << 1);
++              dz = clamp_val(p->dz, -7, 7);
++              p->dz -= dz;
++
++              ps2_data[3] = (dz & 0x0f) | ((p->buttons & 0x18) << 1);
+               client->bufsiz = 4;
+               break;
+       case MOUSEDEV_EMUL_IMPS:
+-              ps2_data[0] |=
+-                      ((p->buttons & 0x10) >> 3) | ((p->buttons & 0x08) >> 1);
+-              ps2_data[3] = mousedev_limit_delta(p->dz, 127);
+-              p->dz -= ps2_data[3];
++              dz = clamp_val(p->dz, -127, 127);
++              p->dz -= dz;
++
++              ps2_data[0] |= ((p->buttons & 0x10) >> 3) |
++                             ((p->buttons & 0x08) >> 1);
++              ps2_data[3] = dz;
++
+               client->bufsiz = 4;
+               break;
+       case MOUSEDEV_EMUL_PS2:
+       default:
+-              ps2_data[0] |=
+-                      ((p->buttons & 0x10) >> 3) | ((p->buttons & 0x08) >> 1);
+               p->dz = 0;
++
++              ps2_data[0] |= ((p->buttons & 0x10) >> 3) |
++                             ((p->buttons & 0x08) >> 1);
++
+               client->bufsiz = 3;
+               break;
+       }
+@@ -714,7 +720,7 @@ static ssize_t mousedev_read(struct file
+ {
+       struct mousedev_client *client = file->private_data;
+       struct mousedev *mousedev = client->mousedev;
+-      signed char data[sizeof(client->ps2)];
++      u8 data[sizeof(client->ps2)];
+       int retval = 0;
+       if (!client->ready && !client->buffer && mousedev->exist &&
diff --git a/queue-4.4/netfilter-nf_nat_h323-fix-logical-not-parentheses-warning.patch b/queue-4.4/netfilter-nf_nat_h323-fix-logical-not-parentheses-warning.patch
new file mode 100644 (file)
index 0000000..9c67a37
--- /dev/null
@@ -0,0 +1,145 @@
+From eee6ebbac18a189ef33d25ea9b8bcae176515e49 Mon Sep 17 00:00:00 2001
+From: Nick Desaulniers <ndesaulniers@google.com>
+Date: Fri, 11 Aug 2017 11:16:07 -0700
+Subject: netfilter: nf_nat_h323: fix logical-not-parentheses warning
+
+From: Nick Desaulniers <ndesaulniers@google.com>
+
+commit eee6ebbac18a189ef33d25ea9b8bcae176515e49 upstream.
+
+Clang produces the following warning:
+
+net/ipv4/netfilter/nf_nat_h323.c:553:6: error:
+logical not is only applied to the left hand side of this comparison
+  [-Werror,-Wlogical-not-parentheses]
+if (!set_h225_addr(skb, protoff, data, dataoff, taddr,
+    ^
+add parentheses after the '!' to evaluate the comparison first
+add parentheses around left hand side expression to silence this warning
+
+There's not necessarily a bug here, but it's cleaner to return early,
+ex:
+
+if (x)
+  return
+...
+
+rather than:
+
+if (x == 0)
+  ...
+else
+  return
+
+Also added a return code check that seemed to be missing in one
+instance.
+
+Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/ipv4/netfilter/nf_nat_h323.c |   57 ++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 27 deletions(-)
+
+--- a/net/ipv4/netfilter/nf_nat_h323.c
++++ b/net/ipv4/netfilter/nf_nat_h323.c
+@@ -252,16 +252,16 @@ static int nat_rtp_rtcp(struct sk_buff *
+       if (set_h245_addr(skb, protoff, data, dataoff, taddr,
+                         &ct->tuplehash[!dir].tuple.dst.u3,
+                         htons((port & htons(1)) ? nated_port + 1 :
+-                                                  nated_port)) == 0) {
+-              /* Save ports */
+-              info->rtp_port[i][dir] = rtp_port;
+-              info->rtp_port[i][!dir] = htons(nated_port);
+-      } else {
++                                                  nated_port))) {
+               nf_ct_unexpect_related(rtp_exp);
+               nf_ct_unexpect_related(rtcp_exp);
+               return -1;
+       }
++      /* Save ports */
++      info->rtp_port[i][dir] = rtp_port;
++      info->rtp_port[i][!dir] = htons(nated_port);
++
+       /* Success */
+       pr_debug("nf_nat_h323: expect RTP %pI4:%hu->%pI4:%hu\n",
+                &rtp_exp->tuple.src.u3.ip,
+@@ -370,15 +370,15 @@ static int nat_h245(struct sk_buff *skb,
+       /* Modify signal */
+       if (set_h225_addr(skb, protoff, data, dataoff, taddr,
+                         &ct->tuplehash[!dir].tuple.dst.u3,
+-                        htons(nated_port)) == 0) {
+-              /* Save ports */
+-              info->sig_port[dir] = port;
+-              info->sig_port[!dir] = htons(nated_port);
+-      } else {
++                        htons(nated_port))) {
+               nf_ct_unexpect_related(exp);
+               return -1;
+       }
++      /* Save ports */
++      info->sig_port[dir] = port;
++      info->sig_port[!dir] = htons(nated_port);
++
+       pr_debug("nf_nat_q931: expect H.245 %pI4:%hu->%pI4:%hu\n",
+                &exp->tuple.src.u3.ip,
+                ntohs(exp->tuple.src.u.tcp.port),
+@@ -462,24 +462,27 @@ static int nat_q931(struct sk_buff *skb,
+       /* Modify signal */
+       if (set_h225_addr(skb, protoff, data, 0, &taddr[idx],
+                         &ct->tuplehash[!dir].tuple.dst.u3,
+-                        htons(nated_port)) == 0) {
+-              /* Save ports */
+-              info->sig_port[dir] = port;
+-              info->sig_port[!dir] = htons(nated_port);
+-
+-              /* Fix for Gnomemeeting */
+-              if (idx > 0 &&
+-                  get_h225_addr(ct, *data, &taddr[0], &addr, &port) &&
+-                  (ntohl(addr.ip) & 0xff000000) == 0x7f000000) {
+-                      set_h225_addr(skb, protoff, data, 0, &taddr[0],
+-                                    &ct->tuplehash[!dir].tuple.dst.u3,
+-                                    info->sig_port[!dir]);
+-              }
+-      } else {
++                        htons(nated_port))) {
+               nf_ct_unexpect_related(exp);
+               return -1;
+       }
++      /* Save ports */
++      info->sig_port[dir] = port;
++      info->sig_port[!dir] = htons(nated_port);
++
++      /* Fix for Gnomemeeting */
++      if (idx > 0 &&
++          get_h225_addr(ct, *data, &taddr[0], &addr, &port) &&
++          (ntohl(addr.ip) & 0xff000000) == 0x7f000000) {
++              if (set_h225_addr(skb, protoff, data, 0, &taddr[0],
++                                &ct->tuplehash[!dir].tuple.dst.u3,
++                                info->sig_port[!dir])) {
++                      nf_ct_unexpect_related(exp);
++                      return -1;
++              }
++      }
++
+       /* Success */
+       pr_debug("nf_nat_ras: expect Q.931 %pI4:%hu->%pI4:%hu\n",
+                &exp->tuple.src.u3.ip,
+@@ -550,9 +553,9 @@ static int nat_callforwarding(struct sk_
+       }
+       /* Modify signal */
+-      if (!set_h225_addr(skb, protoff, data, dataoff, taddr,
+-                         &ct->tuplehash[!dir].tuple.dst.u3,
+-                         htons(nated_port)) == 0) {
++      if (set_h225_addr(skb, protoff, data, dataoff, taddr,
++                        &ct->tuplehash[!dir].tuple.dst.u3,
++                        htons(nated_port))) {
+               nf_ct_unexpect_related(exp);
+               return -1;
+       }
diff --git a/queue-4.4/pci-make-pci_rom_address_mask-a-32-bit-constant.patch b/queue-4.4/pci-make-pci_rom_address_mask-a-32-bit-constant.patch
new file mode 100644 (file)
index 0000000..5bb3c90
--- /dev/null
@@ -0,0 +1,60 @@
+From 76dc52684d0f72971d9f6cc7d5ae198061b715bd Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@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@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@chromium.org>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@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
+@@ -230,7 +230,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 */
diff --git a/queue-4.4/selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch b/queue-4.4/selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch
new file mode 100644 (file)
index 0000000..ea735a6
--- /dev/null
@@ -0,0 +1,39 @@
+From 342e91578eb6909529bc7095964cd44b9c057c4e Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@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@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@chromium.org>
+Signed-off-by: Paul Moore <paul@paul-moore.com>
+Cc: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@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++;
index 04764d728247e59c123e42e9a5212a2641e2c249..ce8a9ac1fd7e4730a64ab3c22c5529afdc7ae099 100644 (file)
@@ -11,3 +11,11 @@ usb-gadget-f_hid-fix-prevent-accessing-released-memory.patch
 kprobes-x86-fix-to-set-rwx-bits-correctly-before-releasing-trampoline.patch
 acpi-pci-irq-remove-redundant-check-for-null-string-pointer.patch
 writeback-fix-the-wrong-congested-state-variable-definition.patch
+pci-make-pci_rom_address_mask-a-32-bit-constant.patch
+dm-ioctl-remove-double-parentheses.patch
+input-mousedev-fix-implicit-conversion-warning.patch
+netfilter-nf_nat_h323-fix-logical-not-parentheses-warning.patch
+genirq-use-cpumask_available-for-check-of-cpumask-variable.patch
+cpumask-add-helper-cpumask_available.patch
+selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch
+fs-compat-remove-warning-from-compatible_ioctl.patch