]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
autosel patches for 3.18
authorSasha Levin (Microsoft) <sashal@kernel.org>
Wed, 17 Apr 2019 14:52:41 +0000 (10:52 -0400)
committerSasha Levin (Microsoft) <sashal@kernel.org>
Wed, 17 Apr 2019 14:52:41 +0000 (10:52 -0400)
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
26 files changed:
queue-3.18/9p-do-not-trust-pdu-content-for-stat-item-size.patch [new file with mode: 0644]
queue-3.18/9p-locks-add-mount-option-for-lock-retry-interval.patch [new file with mode: 0644]
queue-3.18/acpi-sbs-fix-gpe-storm-on-recent-macbookpro-s.patch [new file with mode: 0644]
queue-3.18/alsa-echoaudio-add-a-check-for-ioremap_nocache.patch [new file with mode: 0644]
queue-3.18/alsa-opl3-fix-mismatch-between-snd_opl3_drum_switch-.patch [new file with mode: 0644]
queue-3.18/alsa-sb8-add-a-check-for-request_region.patch [new file with mode: 0644]
queue-3.18/appletalk-fix-use-after-free-in-atalk_proc_exit.patch [new file with mode: 0644]
queue-3.18/arm-samsung-limit-samsung_pm_check-config-option-to-.patch [new file with mode: 0644]
queue-3.18/ext4-report-real-fs-size-after-failed-resize.patch [new file with mode: 0644]
queue-3.18/fix-incorrect-error-code-mapping-for-objectid_not_fo.patch [new file with mode: 0644]
queue-3.18/ib-mlx4-fix-race-condition-between-catas-error-reset.patch [new file with mode: 0644]
queue-3.18/include-linux-swap.h-use-offsetof-instead-of-custom-.patch [new file with mode: 0644]
queue-3.18/iommu-dmar-fix-buffer-overflow-during-pci-bus-notifi.patch [new file with mode: 0644]
queue-3.18/iommu-vt-d-check-capability-before-disabling-protect.patch [new file with mode: 0644]
queue-3.18/lib-div64.c-off-by-one-in-shift.patch [new file with mode: 0644]
queue-3.18/mmc-davinci-remove-extraneous-__init-annotation.patch [new file with mode: 0644]
queue-3.18/perf-core-restore-mmap-record-type-correctly.patch [new file with mode: 0644]
queue-3.18/perf-tests-fix-a-memory-leak-in-test__perf_evsel__tp.patch [new file with mode: 0644]
queue-3.18/perf-top-fix-error-handling-in-cmd_top.patch [new file with mode: 0644]
queue-3.18/rsi-improve-kernel-thread-handling-to-fix-kernel-pan.patch [new file with mode: 0644]
queue-3.18/serial-uartps-console_setup-can-t-be-placed-to-init-.patch [new file with mode: 0644]
queue-3.18/series
queue-3.18/thermal-int340x_thermal-fix-mode-setting.patch [new file with mode: 0644]
queue-3.18/tools-power-turbostat-return-the-exit-status-of-a-co.patch [new file with mode: 0644]
queue-3.18/x86-cpu-cyrix-use-correct-macros-for-cyrix-calls-on-.patch [new file with mode: 0644]
queue-3.18/x86-hpet-prevent-potential-null-pointer-dereference.patch [new file with mode: 0644]

diff --git a/queue-3.18/9p-do-not-trust-pdu-content-for-stat-item-size.patch b/queue-3.18/9p-do-not-trust-pdu-content-for-stat-item-size.patch
new file mode 100644 (file)
index 0000000..419bbf2
--- /dev/null
@@ -0,0 +1,75 @@
+From 4e8ec529785f3eeaa61f6be48e845286ef04a1d7 Mon Sep 17 00:00:00 2001
+From: Gertjan Halkes <gertjan@google.com>
+Date: Wed, 5 Sep 2018 15:41:29 +0900
+Subject: 9p: do not trust pdu content for stat item size
+
+[ Upstream commit 2803cf4379ed252894f046cb8812a48db35294e3 ]
+
+v9fs_dir_readdir() could deadloop if a struct was sent with a size set
+to -2
+
+Link: http://lkml.kernel.org/r/1536134432-11997-1-git-send-email-asmadeus@codewreck.org
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88021
+Signed-off-by: Gertjan Halkes <gertjan@google.com>
+Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/9p/vfs_dir.c   | 8 +++-----
+ net/9p/protocol.c | 3 ++-
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
+index cfe4cf6486af..fa7d1c3536e6 100644
+--- a/fs/9p/vfs_dir.c
++++ b/fs/9p/vfs_dir.c
+@@ -104,7 +104,6 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
+       int err = 0;
+       struct p9_fid *fid;
+       int buflen;
+-      int reclen = 0;
+       struct p9_rdir *rdir;
+       p9_debug(P9_DEBUG_VFS, "name %pD\n", file);
+@@ -129,11 +128,10 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
+               while (rdir->head < rdir->tail) {
+                       err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
+                                         rdir->tail - rdir->head, &st);
+-                      if (err) {
++                      if (err <= 0) {
+                               p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
+                               return -EIO;
+                       }
+-                      reclen = st.size+2;
+                       over = !dir_emit(ctx, st.name, strlen(st.name),
+                                        v9fs_qid2ino(&st.qid), dt_type(&st));
+@@ -141,8 +139,8 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
+                       if (over)
+                               return 0;
+-                      rdir->head += reclen;
+-                      ctx->pos += reclen;
++                      rdir->head += err;
++                      ctx->pos += err;
+               }
+       }
+ }
+diff --git a/net/9p/protocol.c b/net/9p/protocol.c
+index bceb6999614f..66613837b287 100644
+--- a/net/9p/protocol.c
++++ b/net/9p/protocol.c
+@@ -578,9 +578,10 @@ int p9stat_read(struct p9_client *clnt, char *buf, int len, struct p9_wstat *st)
+       if (ret) {
+               p9_debug(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
+               trace_9p_protocol_dump(clnt, &fake_pdu);
++              return ret;
+       }
+-      return ret;
++      return fake_pdu.offset;
+ }
+ EXPORT_SYMBOL(p9stat_read);
+-- 
+2.19.1
+
diff --git a/queue-3.18/9p-locks-add-mount-option-for-lock-retry-interval.patch b/queue-3.18/9p-locks-add-mount-option-for-lock-retry-interval.patch
new file mode 100644 (file)
index 0000000..9ee37bc
--- /dev/null
@@ -0,0 +1,121 @@
+From 2e8d9d7794bbd5116bde6dfe1f655e9d0990c6ae Mon Sep 17 00:00:00 2001
+From: Dinu-Razvan Chis-Serban <justcsdr@gmail.com>
+Date: Wed, 5 Sep 2018 16:44:12 +0900
+Subject: 9p locks: add mount option for lock retry interval
+
+[ Upstream commit 5e172f75e51e3de1b4274146d9b990f803cb5c2a ]
+
+The default P9_LOCK_TIMEOUT can be too long for some users exporting
+a local file system to a guest VM (30s), make this configurable at
+mount time.
+
+Link: http://lkml.kernel.org/r/1536295827-3181-1-git-send-email-asmadeus@codewreck.org
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195727
+Signed-off-by: Dinu-Razvan Chis-Serban <justcsdr@gmail.com>
+Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/9p/v9fs.c     | 21 +++++++++++++++++++++
+ fs/9p/v9fs.h     |  1 +
+ fs/9p/vfs_file.c |  6 +++++-
+ 3 files changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
+index 6894b085f0ee..4f02d1db6e27 100644
+--- a/fs/9p/v9fs.c
++++ b/fs/9p/v9fs.c
+@@ -59,6 +59,8 @@ enum {
+       Opt_cache_loose, Opt_fscache, Opt_mmap,
+       /* Access options */
+       Opt_access, Opt_posixacl,
++      /* Lock timeout option */
++      Opt_locktimeout,
+       /* Error token */
+       Opt_err
+ };
+@@ -78,6 +80,7 @@ static const match_table_t tokens = {
+       {Opt_cachetag, "cachetag=%s"},
+       {Opt_access, "access=%s"},
+       {Opt_posixacl, "posixacl"},
++      {Opt_locktimeout, "locktimeout=%u"},
+       {Opt_err, NULL}
+ };
+@@ -126,6 +129,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
+ #ifdef CONFIG_9P_FSCACHE
+       v9ses->cachetag = NULL;
+ #endif
++      v9ses->session_lock_timeout = P9_LOCK_TIMEOUT;
+       if (!opts)
+               return 0;
+@@ -298,6 +302,23 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
+ #endif
+                       break;
++              case Opt_locktimeout:
++                      r = match_int(&args[0], &option);
++                      if (r < 0) {
++                              p9_debug(P9_DEBUG_ERROR,
++                                       "integer field, but no integer?\n");
++                              ret = r;
++                              continue;
++                      }
++                      if (option < 1) {
++                              p9_debug(P9_DEBUG_ERROR,
++                                       "locktimeout must be a greater than zero integer.\n");
++                              ret = -EINVAL;
++                              continue;
++                      }
++                      v9ses->session_lock_timeout = (long)option * HZ;
++                      break;
++
+               default:
+                       continue;
+               }
+diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
+index 099c7712631c..5e748e716b36 100644
+--- a/fs/9p/v9fs.h
++++ b/fs/9p/v9fs.h
+@@ -117,6 +117,7 @@ struct v9fs_session_info {
+       struct list_head slist; /* list of sessions registered with v9fs */
+       struct backing_dev_info bdi;
+       struct rw_semaphore rename_sem;
++      long session_lock_timeout; /* retry interval for blocking locks */
+ };
+ /* cache_validity flags */
+diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
+index 5594505e6e73..1d32409e5a19 100644
+--- a/fs/9p/vfs_file.c
++++ b/fs/9p/vfs_file.c
+@@ -152,6 +152,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
+       uint8_t status;
+       int res = 0;
+       unsigned char fl_type;
++      struct v9fs_session_info *v9ses;
+       fid = filp->private_data;
+       BUG_ON(fid == NULL);
+@@ -187,6 +188,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
+       if (IS_SETLKW(cmd))
+               flock.flags = P9_LOCK_FLAGS_BLOCK;
++      v9ses = v9fs_inode2v9ses(file_inode(filp));
++
+       /*
+        * if its a blocked request and we get P9_LOCK_BLOCKED as the status
+        * for lock request, keep on trying
+@@ -200,7 +203,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
+                       break;
+               if (status == P9_LOCK_BLOCKED && !IS_SETLKW(cmd))
+                       break;
+-              if (schedule_timeout_interruptible(P9_LOCK_TIMEOUT) != 0)
++              if (schedule_timeout_interruptible(v9ses->session_lock_timeout)
++                              != 0)
+                       break;
+       }
+-- 
+2.19.1
+
diff --git a/queue-3.18/acpi-sbs-fix-gpe-storm-on-recent-macbookpro-s.patch b/queue-3.18/acpi-sbs-fix-gpe-storm-on-recent-macbookpro-s.patch
new file mode 100644 (file)
index 0000000..9cb9491
--- /dev/null
@@ -0,0 +1,54 @@
+From cf63a323aaac4189451c5c4a37bbdc1f96f1b8c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ronald=20Tschal=C3=A4r?= <ronald@innovation.ch>
+Date: Sun, 30 Sep 2018 19:52:51 -0700
+Subject: ACPI / SBS: Fix GPE storm on recent MacBookPro's
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[ Upstream commit ca1721c5bee77105829cbd7baab8ee0eab85b06d ]
+
+On Apple machines, plugging-in or unplugging the power triggers a GPE
+for the EC. Since these machines expose an SBS device, this GPE ends
+up triggering the acpi_sbs_callback(). This in turn tries to get the
+status of the SBS charger. However, on MBP13,* and MBP14,* machines,
+performing the smbus-read operation to get the charger's status triggers
+the EC's GPE again. The result is an endless re-triggering and handling
+of that GPE, consuming significant CPU resources (> 50% in irq).
+
+In the end this is quite similar to commit 3031cddea633 (ACPI / SBS:
+Don't assume the existence of an SBS charger), except that on the above
+machines a status of all 1's is returned. And like there, we just want
+ignore the charger here.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=198169
+Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/acpi/sbs.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
+index f23179e84128..0c268600a334 100644
+--- a/drivers/acpi/sbs.c
++++ b/drivers/acpi/sbs.c
+@@ -439,9 +439,13 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs)
+       /*
+        * The spec requires that bit 4 always be 1. If it's not set, assume
+-       * that the implementation doesn't support an SBS charger
++       * that the implementation doesn't support an SBS charger.
++       *
++       * And on some MacBooks a status of 0xffff is always returned, no
++       * matter whether the charger is plugged in or not, which is also
++       * wrong, so ignore the SBS charger for those too.
+        */
+-      if (!((status >> 4) & 0x1))
++      if (!((status >> 4) & 0x1) || status == 0xffff)
+               return -ENODEV;
+       sbs->charger_present = (status >> 15) & 0x1;
+-- 
+2.19.1
+
diff --git a/queue-3.18/alsa-echoaudio-add-a-check-for-ioremap_nocache.patch b/queue-3.18/alsa-echoaudio-add-a-check-for-ioremap_nocache.patch
new file mode 100644 (file)
index 0000000..13e572b
--- /dev/null
@@ -0,0 +1,36 @@
+From 21fec2c20bf11d993bbd1979cb3a808a45d8d225 Mon Sep 17 00:00:00 2001
+From: Kangjie Lu <kjlu@umn.edu>
+Date: Thu, 14 Mar 2019 22:58:29 -0500
+Subject: ALSA: echoaudio: add a check for ioremap_nocache
+
+[ Upstream commit 6ade657d6125ec3ec07f95fa51e28138aef6208f ]
+
+In case ioremap_nocache fails, the fix releases chip and returns
+an error code upstream to avoid NULL pointer dereference.
+
+Signed-off-by: Kangjie Lu <kjlu@umn.edu>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/echoaudio/echoaudio.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
+index 3a1fe2c79b4a..c07bf03a07bc 100644
+--- a/sound/pci/echoaudio/echoaudio.c
++++ b/sound/pci/echoaudio/echoaudio.c
+@@ -1990,6 +1990,11 @@ static int snd_echo_create(struct snd_card *card,
+       }
+       chip->dsp_registers = (volatile u32 __iomem *)
+               ioremap_nocache(chip->dsp_registers_phys, sz);
++      if (!chip->dsp_registers) {
++              dev_err(chip->card->dev, "ioremap failed\n");
++              snd_echo_free(chip);
++              return -ENOMEM;
++      }
+       if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
+                       KBUILD_MODNAME, chip)) {
+-- 
+2.19.1
+
diff --git a/queue-3.18/alsa-opl3-fix-mismatch-between-snd_opl3_drum_switch-.patch b/queue-3.18/alsa-opl3-fix-mismatch-between-snd_opl3_drum_switch-.patch
new file mode 100644 (file)
index 0000000..4e66851
--- /dev/null
@@ -0,0 +1,39 @@
+From 702e4e4405d2b90d9cbf89047347fce6272e9e56 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Sun, 17 Mar 2019 23:21:24 +0000
+Subject: ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and
+ declaration
+
+[ Upstream commit b4748e7ab731e436cf5db4786358ada5dd2db6dd ]
+
+The function snd_opl3_drum_switch declaration in the header file
+has the order of the two arguments on_off and vel swapped when
+compared to the definition arguments of vel and on_off.  Fix this
+by swapping them around to match the definition.
+
+This error predates the git history, so no idea when this error
+was introduced.
+
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/drivers/opl3/opl3_voice.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/drivers/opl3/opl3_voice.h b/sound/drivers/opl3/opl3_voice.h
+index a371c075ac87..e26702559f61 100644
+--- a/sound/drivers/opl3/opl3_voice.h
++++ b/sound/drivers/opl3/opl3_voice.h
+@@ -41,7 +41,7 @@ void snd_opl3_timer_func(unsigned long data);
+ /* Prototypes for opl3_drums.c */
+ void snd_opl3_load_drums(struct snd_opl3 *opl3);
+-void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
++void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off, struct snd_midi_channel *chan);
+ /* Prototypes for opl3_oss.c */
+ #ifdef CONFIG_SND_SEQUENCER_OSS
+-- 
+2.19.1
+
diff --git a/queue-3.18/alsa-sb8-add-a-check-for-request_region.patch b/queue-3.18/alsa-sb8-add-a-check-for-request_region.patch
new file mode 100644 (file)
index 0000000..0e58c12
--- /dev/null
@@ -0,0 +1,35 @@
+From beab01e2d947c096199b9184db9562c7d4a23350 Mon Sep 17 00:00:00 2001
+From: Kangjie Lu <kjlu@umn.edu>
+Date: Thu, 14 Mar 2019 23:04:14 -0500
+Subject: ALSA: sb8: add a check for request_region
+
+[ Upstream commit dcd0feac9bab901d5739de51b3f69840851f8919 ]
+
+In case request_region fails, the fix returns an error code to
+avoid NULL pointer dereference.
+
+Signed-off-by: Kangjie Lu <kjlu@umn.edu>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/isa/sb/sb8.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
+index 6c32b3aa34af..938262d3aa7b 100644
+--- a/sound/isa/sb/sb8.c
++++ b/sound/isa/sb/sb8.c
+@@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
+       /* block the 0x388 port to avoid PnP conflicts */
+       acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
++      if (!acard->fm_res) {
++              err = -EBUSY;
++              goto _err;
++      }
+       if (port[dev] != SNDRV_AUTO_PORT) {
+               if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
+-- 
+2.19.1
+
diff --git a/queue-3.18/appletalk-fix-use-after-free-in-atalk_proc_exit.patch b/queue-3.18/appletalk-fix-use-after-free-in-atalk_proc_exit.patch
new file mode 100644 (file)
index 0000000..ee0380e
--- /dev/null
@@ -0,0 +1,216 @@
+From 17109b1f6dd6319f648de97cdd4f2f594c7ac58a Mon Sep 17 00:00:00 2001
+From: YueHaibing <yuehaibing@huawei.com>
+Date: Fri, 1 Mar 2019 10:57:57 +0800
+Subject: appletalk: Fix use-after-free in atalk_proc_exit
+
+[ Upstream commit 6377f787aeb945cae7abbb6474798de129e1f3ac ]
+
+KASAN report this:
+
+BUG: KASAN: use-after-free in pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
+Read of size 8 at addr ffff8881f41fe5b0 by task syz-executor.0/2806
+
+CPU: 0 PID: 2806 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45
+Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
+Call Trace:
+ __dump_stack lib/dump_stack.c:77 [inline]
+ dump_stack+0xfa/0x1ce lib/dump_stack.c:113
+ print_address_description+0x65/0x270 mm/kasan/report.c:187
+ kasan_report+0x149/0x18d mm/kasan/report.c:317
+ pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
+ remove_proc_entry+0xe8/0x420 fs/proc/generic.c:667
+ atalk_proc_exit+0x18/0x820 [appletalk]
+ atalk_exit+0xf/0x5a [appletalk]
+ __do_sys_delete_module kernel/module.c:1018 [inline]
+ __se_sys_delete_module kernel/module.c:961 [inline]
+ __x64_sys_delete_module+0x3dc/0x5e0 kernel/module.c:961
+ do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+RIP: 0033:0x462e99
+Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
+RSP: 002b:00007fb2de6b9c58 EFLAGS: 00000246 ORIG_RAX: 00000000000000b0
+RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462e99
+RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200001c0
+RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
+R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb2de6ba6bc
+R13: 00000000004bccaa R14: 00000000006f6bc8 R15: 00000000ffffffff
+
+Allocated by task 2806:
+ set_track mm/kasan/common.c:85 [inline]
+ __kasan_kmalloc.constprop.3+0xa0/0xd0 mm/kasan/common.c:496
+ slab_post_alloc_hook mm/slab.h:444 [inline]
+ slab_alloc_node mm/slub.c:2739 [inline]
+ slab_alloc mm/slub.c:2747 [inline]
+ kmem_cache_alloc+0xcf/0x250 mm/slub.c:2752
+ kmem_cache_zalloc include/linux/slab.h:730 [inline]
+ __proc_create+0x30f/0xa20 fs/proc/generic.c:408
+ proc_mkdir_data+0x47/0x190 fs/proc/generic.c:469
+ 0xffffffffc10c01bb
+ 0xffffffffc10c0166
+ do_one_initcall+0xfa/0x5ca init/main.c:887
+ do_init_module+0x204/0x5f6 kernel/module.c:3460
+ load_module+0x66b2/0x8570 kernel/module.c:3808
+ __do_sys_finit_module+0x238/0x2a0 kernel/module.c:3902
+ do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+
+Freed by task 2806:
+ set_track mm/kasan/common.c:85 [inline]
+ __kasan_slab_free+0x130/0x180 mm/kasan/common.c:458
+ slab_free_hook mm/slub.c:1409 [inline]
+ slab_free_freelist_hook mm/slub.c:1436 [inline]
+ slab_free mm/slub.c:2986 [inline]
+ kmem_cache_free+0xa6/0x2a0 mm/slub.c:3002
+ pde_put+0x6e/0x80 fs/proc/generic.c:647
+ remove_proc_entry+0x1d3/0x420 fs/proc/generic.c:684
+ 0xffffffffc10c031c
+ 0xffffffffc10c0166
+ do_one_initcall+0xfa/0x5ca init/main.c:887
+ do_init_module+0x204/0x5f6 kernel/module.c:3460
+ load_module+0x66b2/0x8570 kernel/module.c:3808
+ __do_sys_finit_module+0x238/0x2a0 kernel/module.c:3902
+ do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+
+The buggy address belongs to the object at ffff8881f41fe500
+ which belongs to the cache proc_dir_entry of size 256
+The buggy address is located 176 bytes inside of
+ 256-byte region [ffff8881f41fe500, ffff8881f41fe600)
+The buggy address belongs to the page:
+page:ffffea0007d07f80 count:1 mapcount:0 mapping:ffff8881f6e69a00 index:0x0
+flags: 0x2fffc0000000200(slab)
+raw: 02fffc0000000200 dead000000000100 dead000000000200 ffff8881f6e69a00
+raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000
+page dumped because: kasan: bad access detected
+
+Memory state around the buggy address:
+ ffff8881f41fe480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
+ ffff8881f41fe500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+>ffff8881f41fe580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+                                     ^
+ ffff8881f41fe600: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
+ ffff8881f41fe680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+
+It should check the return value of atalk_proc_init fails,
+otherwise atalk_exit will trgger use-after-free in pde_subdir_find
+while unload the module.This patch fix error cleanup path of atalk_init
+
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: YueHaibing <yuehaibing@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/atalk.h            |  2 +-
+ net/appletalk/atalk_proc.c       |  2 +-
+ net/appletalk/ddp.c              | 37 ++++++++++++++++++++++++++------
+ net/appletalk/sysctl_net_atalk.c |  5 ++++-
+ 4 files changed, 37 insertions(+), 9 deletions(-)
+
+diff --git a/include/linux/atalk.h b/include/linux/atalk.h
+index 73fd8b7e9534..716d53799d1f 100644
+--- a/include/linux/atalk.h
++++ b/include/linux/atalk.h
+@@ -150,7 +150,7 @@ extern int sysctl_aarp_retransmit_limit;
+ extern int sysctl_aarp_resolve_time;
+ #ifdef CONFIG_SYSCTL
+-extern void atalk_register_sysctl(void);
++extern int atalk_register_sysctl(void);
+ extern void atalk_unregister_sysctl(void);
+ #else
+ #define atalk_register_sysctl()               do { } while(0)
+diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
+index af46bc49e1e9..b5f84f428aa6 100644
+--- a/net/appletalk/atalk_proc.c
++++ b/net/appletalk/atalk_proc.c
+@@ -293,7 +293,7 @@ int __init atalk_proc_init(void)
+       goto out;
+ }
+-void __exit atalk_proc_exit(void)
++void atalk_proc_exit(void)
+ {
+       remove_proc_entry("interface", atalk_proc_dir);
+       remove_proc_entry("route", atalk_proc_dir);
+diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
+index c00897f65a31..276a09d7c537 100644
+--- a/net/appletalk/ddp.c
++++ b/net/appletalk/ddp.c
+@@ -1913,12 +1913,16 @@ static const char atalk_err_snap[] __initconst =
+ /* Called by proto.c on kernel start up */
+ static int __init atalk_init(void)
+ {
+-      int rc = proto_register(&ddp_proto, 0);
++      int rc;
+-      if (rc != 0)
++      rc = proto_register(&ddp_proto, 0);
++      if (rc)
+               goto out;
+-      (void)sock_register(&atalk_family_ops);
++      rc = sock_register(&atalk_family_ops);
++      if (rc)
++              goto out_proto;
++
+       ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv);
+       if (!ddp_dl)
+               printk(atalk_err_snap);
+@@ -1926,12 +1930,33 @@ static int __init atalk_init(void)
+       dev_add_pack(&ltalk_packet_type);
+       dev_add_pack(&ppptalk_packet_type);
+-      register_netdevice_notifier(&ddp_notifier);
++      rc = register_netdevice_notifier(&ddp_notifier);
++      if (rc)
++              goto out_sock;
++
+       aarp_proto_init();
+-      atalk_proc_init();
+-      atalk_register_sysctl();
++      rc = atalk_proc_init();
++      if (rc)
++              goto out_aarp;
++
++      rc = atalk_register_sysctl();
++      if (rc)
++              goto out_proc;
+ out:
+       return rc;
++out_proc:
++      atalk_proc_exit();
++out_aarp:
++      aarp_cleanup_module();
++      unregister_netdevice_notifier(&ddp_notifier);
++out_sock:
++      dev_remove_pack(&ppptalk_packet_type);
++      dev_remove_pack(&ltalk_packet_type);
++      unregister_snap_client(ddp_dl);
++      sock_unregister(PF_APPLETALK);
++out_proto:
++      proto_unregister(&ddp_proto);
++      goto out;
+ }
+ module_init(atalk_init);
+diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
+index ebb864361f7a..4e6042e0fcac 100644
+--- a/net/appletalk/sysctl_net_atalk.c
++++ b/net/appletalk/sysctl_net_atalk.c
+@@ -44,9 +44,12 @@ static struct ctl_table atalk_table[] = {
+ static struct ctl_table_header *atalk_table_header;
+-void atalk_register_sysctl(void)
++int __init atalk_register_sysctl(void)
+ {
+       atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table);
++      if (!atalk_table_header)
++              return -ENOMEM;
++      return 0;
+ }
+ void atalk_unregister_sysctl(void)
+-- 
+2.19.1
+
diff --git a/queue-3.18/arm-samsung-limit-samsung_pm_check-config-option-to-.patch b/queue-3.18/arm-samsung-limit-samsung_pm_check-config-option-to-.patch
new file mode 100644 (file)
index 0000000..cea07ee
--- /dev/null
@@ -0,0 +1,59 @@
+From 4be7756caf61d2efb3c7d22da9040fb5cf727925 Mon Sep 17 00:00:00 2001
+From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
+Date: Fri, 28 Sep 2018 15:32:46 +0200
+Subject: ARM: samsung: Limit SAMSUNG_PM_CHECK config option to non-Exynos
+ platforms
+
+[ Upstream commit 6862fdf2201ab67cd962dbf0643d37db909f4860 ]
+
+"S3C2410 PM Suspend Memory CRC" feature (controlled by
+SAMSUNG_PM_CHECK config option) is incompatible with highmem
+(uses phys_to_virt() instead of proper mapping) which is used by
+the majority of Exynos boards. The issue manifests itself in OOPS
+on affected boards, i.e. on Odroid-U3 I got the following one:
+
+Unable to handle kernel paging request at virtual address f0000000
+pgd = 1c0f9bb4
+[f0000000] *pgd=00000000
+Internal error: Oops: 5 [#1] PREEMPT SMP ARM
+[<c0458034>] (crc32_le) from [<c0121f8c>] (s3c_pm_makecheck+0x34/0x54)
+[<c0121f8c>] (s3c_pm_makecheck) from [<c0121efc>] (s3c_pm_run_res+0x74/0x8c)
+[<c0121efc>] (s3c_pm_run_res) from [<c0121ecc>] (s3c_pm_run_res+0x44/0x8c)
+[<c0121ecc>] (s3c_pm_run_res) from [<c01210b8>] (exynos_suspend_enter+0x64/0x148)
+[<c01210b8>] (exynos_suspend_enter) from [<c018893c>] (suspend_devices_and_enter+0x9ec/0xe74)
+[<c018893c>] (suspend_devices_and_enter) from [<c0189534>] (pm_suspend+0x770/0xc04)
+[<c0189534>] (pm_suspend) from [<c0186ce8>] (state_store+0x6c/0xcc)
+[<c0186ce8>] (state_store) from [<c09db434>] (kobj_attr_store+0x14/0x20)
+[<c09db434>] (kobj_attr_store) from [<c02fa63c>] (sysfs_kf_write+0x4c/0x50)
+[<c02fa63c>] (sysfs_kf_write) from [<c02f97a4>] (kernfs_fop_write+0xfc/0x1e4)
+[<c02f97a4>] (kernfs_fop_write) from [<c027b198>] (__vfs_write+0x2c/0x140)
+[<c027b198>] (__vfs_write) from [<c027b418>] (vfs_write+0xa4/0x160)
+[<c027b418>] (vfs_write) from [<c027b5d8>] (ksys_write+0x40/0x8c)
+[<c027b5d8>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
+
+Add PLAT_S3C24XX, ARCH_S3C64XX and ARCH_S5PV210 dependencies to
+SAMSUNG_PM_CHECK config option to hide it on Exynos platforms.
+
+Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
+Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/plat-samsung/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
+index 9bd2776e7d05..2c3cf321f933 100644
+--- a/arch/arm/plat-samsung/Kconfig
++++ b/arch/arm/plat-samsung/Kconfig
+@@ -287,7 +287,7 @@ config S3C_PM_DEBUG_LED_SMDK
+ config SAMSUNG_PM_CHECK
+       bool "S3C2410 PM Suspend Memory CRC"
+-      depends on PM
++      depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210)
+       select CRC32
+       help
+         Enable the PM code's memory area checksum over sleep. This option
+-- 
+2.19.1
+
diff --git a/queue-3.18/ext4-report-real-fs-size-after-failed-resize.patch b/queue-3.18/ext4-report-real-fs-size-after-failed-resize.patch
new file mode 100644 (file)
index 0000000..6b87688
--- /dev/null
@@ -0,0 +1,42 @@
+From ef0733c30d92f8ea39cbf3c5a804e6421130ebae Mon Sep 17 00:00:00 2001
+From: Lukas Czerner <lczerner@redhat.com>
+Date: Fri, 15 Mar 2019 00:22:28 -0400
+Subject: ext4: report real fs size after failed resize
+
+[ Upstream commit 6c7328400e0488f7d49e19e02290ba343b6811b2 ]
+
+Currently when the file system resize using ext4_resize_fs() fails it
+will report into log that "resized filesystem to <requested block
+count>".  However this may not be true in the case of failure.  Use the
+current block count as returned by ext4_blocks_count() to report the
+block count.
+
+Additionally, report a warning that "error occurred during file system
+resize"
+
+Signed-off-by: Lukas Czerner <lczerner@redhat.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ext4/resize.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
+index 96372539dc06..196b9d3fa3b9 100644
+--- a/fs/ext4/resize.c
++++ b/fs/ext4/resize.c
+@@ -2042,6 +2042,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
+               free_flex_gd(flex_gd);
+       if (resize_inode != NULL)
+               iput(resize_inode);
+-      ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count);
++      if (err)
++              ext4_warning(sb, "error (%d) occurred during "
++                           "file system resize", err);
++      ext4_msg(sb, KERN_INFO, "resized filesystem to %llu",
++               ext4_blocks_count(es));
+       return err;
+ }
+-- 
+2.19.1
+
diff --git a/queue-3.18/fix-incorrect-error-code-mapping-for-objectid_not_fo.patch b/queue-3.18/fix-incorrect-error-code-mapping-for-objectid_not_fo.patch
new file mode 100644 (file)
index 0000000..7496fff
--- /dev/null
@@ -0,0 +1,40 @@
+From eaf9c626e95181c1bc1dde95f56714bc4b2d02cc Mon Sep 17 00:00:00 2001
+From: Steve French <stfrench@microsoft.com>
+Date: Sun, 17 Mar 2019 15:58:38 -0500
+Subject: fix incorrect error code mapping for OBJECTID_NOT_FOUND
+
+[ Upstream commit 85f9987b236cf46e06ffdb5c225cf1f3c0acb789 ]
+
+It was mapped to EIO which can be confusing when user space
+queries for an object GUID for an object for which the server
+file system doesn't support (or hasn't saved one).
+
+As Amir Goldstein suggested this is similar to ENOATTR
+(equivalently ENODATA in Linux errno definitions) so
+changing NT STATUS code mapping for OBJECTID_NOT_FOUND
+to ENODATA.
+
+Signed-off-by: Steve French <stfrench@microsoft.com>
+CC: Amir Goldstein <amir73il@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/cifs/smb2maperror.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
+index 98c25b969ab8..7e93d5706bf6 100644
+--- a/fs/cifs/smb2maperror.c
++++ b/fs/cifs/smb2maperror.c
+@@ -1034,7 +1034,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
+       {STATUS_UNFINISHED_CONTEXT_DELETED, -EIO,
+       "STATUS_UNFINISHED_CONTEXT_DELETED"},
+       {STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"},
+-      {STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"},
++      /* Note that ENOATTTR and ENODATA are the same errno */
++      {STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"},
+       {STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"},
+       {STATUS_WRONG_CREDENTIAL_HANDLE, -EIO,
+       "STATUS_WRONG_CREDENTIAL_HANDLE"},
+-- 
+2.19.1
+
diff --git a/queue-3.18/ib-mlx4-fix-race-condition-between-catas-error-reset.patch b/queue-3.18/ib-mlx4-fix-race-condition-between-catas-error-reset.patch
new file mode 100644 (file)
index 0000000..62b2e48
--- /dev/null
@@ -0,0 +1,39 @@
+From 7a23453c8b8376ed0ffabd1260f77461cdacc014 Mon Sep 17 00:00:00 2001
+From: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Date: Wed, 6 Mar 2019 19:17:56 +0200
+Subject: IB/mlx4: Fix race condition between catas error reset and aliasguid
+ flows
+
+[ Upstream commit 587443e7773e150ae29e643ee8f41a1eed226565 ]
+
+Code review revealed a race condition which could allow the catas error
+flow to interrupt the alias guid query post mechanism at random points.
+Thiis is fixed by doing cancel_delayed_work_sync() instead of
+cancel_delayed_work() during the alias guid mechanism destroy flow.
+
+Fixes: a0c64a17aba8 ("mlx4: Add alias_guid mechanism")
+Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c
+index 0eb141c41416..fb60229bf191 100644
+--- a/drivers/infiniband/hw/mlx4/alias_GUID.c
++++ b/drivers/infiniband/hw/mlx4/alias_GUID.c
+@@ -579,8 +579,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)
+       unsigned long flags;
+       for (i = 0 ; i < dev->num_ports; i++) {
+-              cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work);
+               det = &sriov->alias_guid.ports_guid[i];
++              cancel_delayed_work_sync(&det->alias_guid_work);
+               spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags);
+               while (!list_empty(&det->cb_list)) {
+                       cb_ctx = list_entry(det->cb_list.next,
+-- 
+2.19.1
+
diff --git a/queue-3.18/include-linux-swap.h-use-offsetof-instead-of-custom-.patch b/queue-3.18/include-linux-swap.h-use-offsetof-instead-of-custom-.patch
new file mode 100644 (file)
index 0000000..e788fc0
--- /dev/null
@@ -0,0 +1,59 @@
+From 0b951c55bf181f06f803ee4d045c84fd1dee0834 Mon Sep 17 00:00:00 2001
+From: Pi-Hsun Shih <pihsun@chromium.org>
+Date: Wed, 13 Mar 2019 11:44:33 -0700
+Subject: include/linux/swap.h: use offsetof() instead of custom __swapoffset
+ macro
+
+[ Upstream commit a4046c06be50a4f01d435aa7fe57514818e6cc82 ]
+
+Use offsetof() to calculate offset of a field to take advantage of
+compiler built-in version when possible, and avoid UBSAN warning when
+compiling with Clang:
+
+  UBSAN: Undefined behaviour in mm/swapfile.c:3010:38
+  member access within null pointer of type 'union swap_header'
+  CPU: 6 PID: 1833 Comm: swapon Tainted: G S                4.19.23 #43
+  Call trace:
+   dump_backtrace+0x0/0x194
+   show_stack+0x20/0x2c
+   __dump_stack+0x20/0x28
+   dump_stack+0x70/0x94
+   ubsan_epilogue+0x14/0x44
+   ubsan_type_mismatch_common+0xf4/0xfc
+   __ubsan_handle_type_mismatch_v1+0x34/0x54
+   __se_sys_swapon+0x654/0x1084
+   __arm64_sys_swapon+0x1c/0x24
+   el0_svc_common+0xa8/0x150
+   el0_svc_compat_handler+0x2c/0x38
+   el0_svc_compat+0x8/0x18
+
+Link: http://lkml.kernel.org/r/20190312081902.223764-1-pihsun@chromium.org
+Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
+Acked-by: Michal Hocko <mhocko@suse.com>
+Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/swap.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/linux/swap.h b/include/linux/swap.h
+index 1dc0e886227d..054cddb52482 100644
+--- a/include/linux/swap.h
++++ b/include/linux/swap.h
+@@ -143,9 +143,9 @@ struct swap_extent {
+ /*
+  * Max bad pages in the new format..
+  */
+-#define __swapoffset(x) ((unsigned long)&((union swap_header *)0)->x)
+ #define MAX_SWAP_BADPAGES \
+-      ((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int))
++      ((offsetof(union swap_header, magic.magic) - \
++        offsetof(union swap_header, info.badpages)) / sizeof(int))
+ enum {
+       SWP_USED        = (1 << 0),     /* is slot in swap_info[] used? */
+-- 
+2.19.1
+
diff --git a/queue-3.18/iommu-dmar-fix-buffer-overflow-during-pci-bus-notifi.patch b/queue-3.18/iommu-dmar-fix-buffer-overflow-during-pci-bus-notifi.patch
new file mode 100644 (file)
index 0000000..cf565c2
--- /dev/null
@@ -0,0 +1,87 @@
+From e6092c54edca092dacd55d8b61be909974797e69 Mon Sep 17 00:00:00 2001
+From: Julia Cartwright <julia@ni.com>
+Date: Wed, 20 Feb 2019 16:46:31 +0000
+Subject: iommu/dmar: Fix buffer overflow during PCI bus notification
+
+[ Upstream commit cffaaf0c816238c45cd2d06913476c83eb50f682 ]
+
+Commit 57384592c433 ("iommu/vt-d: Store bus information in RMRR PCI
+device path") changed the type of the path data, however, the change in
+path type was not reflected in size calculations.  Update to use the
+correct type and prevent a buffer overflow.
+
+This bug manifests in systems with deep PCI hierarchies, and can lead to
+an overflow of the static allocated buffer (dmar_pci_notify_info_buf),
+or can lead to overflow of slab-allocated data.
+
+   BUG: KASAN: global-out-of-bounds in dmar_alloc_pci_notify_info+0x1d5/0x2e0
+   Write of size 1 at addr ffffffff90445d80 by task swapper/0/1
+   CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W       4.14.87-rt49-02406-gd0a0e96 #1
+   Call Trace:
+    ? dump_stack+0x46/0x59
+    ? print_address_description+0x1df/0x290
+    ? dmar_alloc_pci_notify_info+0x1d5/0x2e0
+    ? kasan_report+0x256/0x340
+    ? dmar_alloc_pci_notify_info+0x1d5/0x2e0
+    ? e820__memblock_setup+0xb0/0xb0
+    ? dmar_dev_scope_init+0x424/0x48f
+    ? __down_write_common+0x1ec/0x230
+    ? dmar_dev_scope_init+0x48f/0x48f
+    ? dmar_free_unused_resources+0x109/0x109
+    ? cpumask_next+0x16/0x20
+    ? __kmem_cache_create+0x392/0x430
+    ? kmem_cache_create+0x135/0x2f0
+    ? e820__memblock_setup+0xb0/0xb0
+    ? intel_iommu_init+0x170/0x1848
+    ? _raw_spin_unlock_irqrestore+0x32/0x60
+    ? migrate_enable+0x27a/0x5b0
+    ? sched_setattr+0x20/0x20
+    ? migrate_disable+0x1fc/0x380
+    ? task_rq_lock+0x170/0x170
+    ? try_to_run_init_process+0x40/0x40
+    ? locks_remove_file+0x85/0x2f0
+    ? dev_prepare_static_identity_mapping+0x78/0x78
+    ? rt_spin_unlock+0x39/0x50
+    ? lockref_put_or_lock+0x2a/0x40
+    ? dput+0x128/0x2f0
+    ? __rcu_read_unlock+0x66/0x80
+    ? __fput+0x250/0x300
+    ? __rcu_read_lock+0x1b/0x30
+    ? mntput_no_expire+0x38/0x290
+    ? e820__memblock_setup+0xb0/0xb0
+    ? pci_iommu_init+0x25/0x63
+    ? pci_iommu_init+0x25/0x63
+    ? do_one_initcall+0x7e/0x1c0
+    ? initcall_blacklisted+0x120/0x120
+    ? kernel_init_freeable+0x27b/0x307
+    ? rest_init+0xd0/0xd0
+    ? kernel_init+0xf/0x120
+    ? rest_init+0xd0/0xd0
+    ? ret_from_fork+0x1f/0x40
+   The buggy address belongs to the variable:
+    dmar_pci_notify_info_buf+0x40/0x60
+
+Fixes: 57384592c433 ("iommu/vt-d: Store bus information in RMRR PCI device path")
+Signed-off-by: Julia Cartwright <julia@ni.com>
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iommu/dmar.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
+index 6b78e131f6dd..f6a42ea14ef1 100644
+--- a/drivers/iommu/dmar.c
++++ b/drivers/iommu/dmar.c
+@@ -134,7 +134,7 @@ dmar_alloc_pci_notify_info(struct pci_dev *dev, unsigned long event)
+               for (tmp = dev; tmp; tmp = tmp->bus->self)
+                       level++;
+-      size = sizeof(*info) + level * sizeof(struct acpi_dmar_pci_path);
++      size = sizeof(*info) + level * sizeof(info->path[0]);
+       if (size <= sizeof(dmar_pci_notify_info_buf)) {
+               info = (struct dmar_pci_notify_info *)dmar_pci_notify_info_buf;
+       } else {
+-- 
+2.19.1
+
diff --git a/queue-3.18/iommu-vt-d-check-capability-before-disabling-protect.patch b/queue-3.18/iommu-vt-d-check-capability-before-disabling-protect.patch
new file mode 100644 (file)
index 0000000..c9c681a
--- /dev/null
@@ -0,0 +1,40 @@
+From 2625c920ca63041da234247caf3ff9247cb6309b Mon Sep 17 00:00:00 2001
+From: Lu Baolu <baolu.lu@linux.intel.com>
+Date: Wed, 20 Mar 2019 09:58:33 +0800
+Subject: iommu/vt-d: Check capability before disabling protected memory
+
+[ Upstream commit 5bb71fc790a88d063507dc5d445ab8b14e845591 ]
+
+The spec states in 10.4.16 that the Protected Memory Enable
+Register should be treated as read-only for implementations
+not supporting protected memory regions (PLMR and PHMR fields
+reported as Clear in the Capability register).
+
+Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
+Cc: mark gross <mgross@intel.com>
+Suggested-by: Ashok Raj <ashok.raj@intel.com>
+Fixes: f8bab73515ca5 ("intel-iommu: PMEN support")
+Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iommu/intel-iommu.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
+index 2068cb59f7ed..b1966269f26a 100644
+--- a/drivers/iommu/intel-iommu.c
++++ b/drivers/iommu/intel-iommu.c
+@@ -1402,6 +1402,9 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu)
+       u32 pmen;
+       unsigned long flags;
++      if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap))
++              return;
++
+       raw_spin_lock_irqsave(&iommu->register_lock, flags);
+       pmen = readl(iommu->reg + DMAR_PMEN_REG);
+       pmen &= ~DMA_PMEN_EPM;
+-- 
+2.19.1
+
diff --git a/queue-3.18/lib-div64.c-off-by-one-in-shift.patch b/queue-3.18/lib-div64.c-off-by-one-in-shift.patch
new file mode 100644 (file)
index 0000000..44622c3
--- /dev/null
@@ -0,0 +1,52 @@
+From dd59dac3d4d81e5d9469bd20d48fe55e8cbd53a2 Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Thu, 7 Mar 2019 16:28:18 -0800
+Subject: lib/div64.c: off by one in shift
+
+[ Upstream commit cdc94a37493135e355dfc0b0e086d84e3eadb50d ]
+
+fls counts bits starting from 1 to 32 (returns 0 for zero argument).  If
+we add 1 we shift right one bit more and loose precision from divisor,
+what cause function incorect results with some numbers.
+
+Corrected code was tested in user-space, see bugzilla:
+   https://bugzilla.kernel.org/show_bug.cgi?id=202391
+
+Link: http://lkml.kernel.org/r/1548686944-11891-1-git-send-email-sgruszka@redhat.com
+Fixes: 658716d19f8f ("div64_u64(): improve precision on 32bit platforms")
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Reported-by: Siarhei Volkau <lis8215@gmail.com>
+Tested-by: Siarhei Volkau <lis8215@gmail.com>
+Acked-by: Oleg Nesterov <oleg@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ lib/div64.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/div64.c b/lib/div64.c
+index 4382ad77777e..ce76dc3d674e 100644
+--- a/lib/div64.c
++++ b/lib/div64.c
+@@ -100,7 +100,7 @@ u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
+               quot = div_u64_rem(dividend, divisor, &rem32);
+               *remainder = rem32;
+       } else {
+-              int n = 1 + fls(high);
++              int n = fls(high);
+               quot = div_u64(dividend >> n, divisor >> n);
+               if (quot != 0)
+@@ -138,7 +138,7 @@ u64 div64_u64(u64 dividend, u64 divisor)
+       if (high == 0) {
+               quot = div_u64(dividend, divisor);
+       } else {
+-              int n = 1 + fls(high);
++              int n = fls(high);
+               quot = div_u64(dividend >> n, divisor >> n);
+               if (quot != 0)
+-- 
+2.19.1
+
diff --git a/queue-3.18/mmc-davinci-remove-extraneous-__init-annotation.patch b/queue-3.18/mmc-davinci-remove-extraneous-__init-annotation.patch
new file mode 100644 (file)
index 0000000..dc8ffc1
--- /dev/null
@@ -0,0 +1,40 @@
+From 6732877548b2592609bafcc3384c3ff444b65907 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 7 Mar 2019 11:10:11 +0100
+Subject: mmc: davinci: remove extraneous __init annotation
+
+[ Upstream commit 9ce58dd7d9da3ca0d7cb8c9568f1c6f4746da65a ]
+
+Building with clang finds a mistaken __init tag:
+
+WARNING: vmlinux.o(.text+0x5e4250): Section mismatch in reference from the function davinci_mmcsd_probe() to the function .init.text:init_mmcsd_host()
+The function davinci_mmcsd_probe() references
+the function __init init_mmcsd_host().
+This is often because davinci_mmcsd_probe lacks a __init
+annotation or the annotation of init_mmcsd_host is wrong.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Wolfram Sang <wsa@the-dreams.de>
+Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/mmc/host/davinci_mmc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
+index 5d4c5e0fba2f..7e154a8213e2 100644
+--- a/drivers/mmc/host/davinci_mmc.c
++++ b/drivers/mmc/host/davinci_mmc.c
+@@ -1147,7 +1147,7 @@ static inline void mmc_davinci_cpufreq_deregister(struct mmc_davinci_host *host)
+ {
+ }
+ #endif
+-static void __init init_mmcsd_host(struct mmc_davinci_host *host)
++static void init_mmcsd_host(struct mmc_davinci_host *host)
+ {
+       mmc_davinci_reset_ctrl(host, 1);
+-- 
+2.19.1
+
diff --git a/queue-3.18/perf-core-restore-mmap-record-type-correctly.patch b/queue-3.18/perf-core-restore-mmap-record-type-correctly.patch
new file mode 100644 (file)
index 0000000..5f3c6ef
--- /dev/null
@@ -0,0 +1,61 @@
+From e13f6d70c30ef419854b6b7569488ef87f930301 Mon Sep 17 00:00:00 2001
+From: Stephane Eranian <eranian@google.com>
+Date: Thu, 7 Mar 2019 10:52:33 -0800
+Subject: perf/core: Restore mmap record type correctly
+
+[ Upstream commit d9c1bb2f6a2157b38e8eb63af437cb22701d31ee ]
+
+On mmap(), perf_events generates a RECORD_MMAP record and then checks
+which events are interested in this record. There are currently 2
+versions of mmap records: RECORD_MMAP and RECORD_MMAP2. MMAP2 is larger.
+The event configuration controls which version the user level tool
+accepts.
+
+If the event->attr.mmap2=1 field then MMAP2 record is returned.  The
+perf_event_mmap_output() takes care of this. It checks attr->mmap2 and
+corrects the record fields before putting it in the sampling buffer of
+the event.  At the end the function restores the modified MMAP record
+fields.
+
+The problem is that the function restores the size but not the type.
+Thus, if a subsequent event only accepts MMAP type, then it would
+instead receive an MMAP2 record with a size of MMAP record.
+
+This patch fixes the problem by restoring the record type on exit.
+
+Signed-off-by: Stephane Eranian <eranian@google.com>
+Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Andi Kleen <ak@linux.intel.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Kan Liang <kan.liang@linux.intel.com>
+Fixes: 13d7a2410fa6 ("perf: Add attr->mmap2 attribute to an event")
+Link: http://lkml.kernel.org/r/20190307185233.225521-1-eranian@google.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/events/core.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/kernel/events/core.c b/kernel/events/core.c
+index fd8dea2b36ec..41d83a9aacaf 100644
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -5533,6 +5533,7 @@ static void perf_event_mmap_output(struct perf_event *event,
+       struct perf_output_handle handle;
+       struct perf_sample_data sample;
+       int size = mmap_event->event_id.header.size;
++      u32 type = mmap_event->event_id.header.type;
+       int ret;
+       if (!perf_event_mmap_match(event, data))
+@@ -5576,6 +5577,7 @@ static void perf_event_mmap_output(struct perf_event *event,
+       perf_output_end(&handle);
+ out:
+       mmap_event->event_id.header.size = size;
++      mmap_event->event_id.header.type = type;
+ }
+ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
+-- 
+2.19.1
+
diff --git a/queue-3.18/perf-tests-fix-a-memory-leak-in-test__perf_evsel__tp.patch b/queue-3.18/perf-tests-fix-a-memory-leak-in-test__perf_evsel__tp.patch
new file mode 100644 (file)
index 0000000..e5ffff2
--- /dev/null
@@ -0,0 +1,59 @@
+From 5725e0ce26611fba96257f3d691f8bed428d6fc6 Mon Sep 17 00:00:00 2001
+From: Changbin Du <changbin.du@gmail.com>
+Date: Sat, 16 Mar 2019 16:05:56 +0800
+Subject: perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test()
+
+[ Upstream commit d982b33133284fa7efa0e52ae06b88f9be3ea764 ]
+
+  =================================================================
+  ==20875==ERROR: LeakSanitizer: detected memory leaks
+
+  Direct leak of 1160 byte(s) in 1 object(s) allocated from:
+      #0 0x7f1b6fc84138 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee138)
+      #1 0x55bd50005599 in zalloc util/util.h:23
+      #2 0x55bd500068f5 in perf_evsel__newtp_idx util/evsel.c:327
+      #3 0x55bd4ff810fc in perf_evsel__newtp /home/work/linux/tools/perf/util/evsel.h:216
+      #4 0x55bd4ff81608 in test__perf_evsel__tp_sched_test tests/evsel-tp-sched.c:69
+      #5 0x55bd4ff528e6 in run_test tests/builtin-test.c:358
+      #6 0x55bd4ff52baf in test_and_print tests/builtin-test.c:388
+      #7 0x55bd4ff543fe in __cmd_test tests/builtin-test.c:583
+      #8 0x55bd4ff5572f in cmd_test tests/builtin-test.c:722
+      #9 0x55bd4ffc4087 in run_builtin /home/changbin/work/linux/tools/perf/perf.c:302
+      #10 0x55bd4ffc45c6 in handle_internal_command /home/changbin/work/linux/tools/perf/perf.c:354
+      #11 0x55bd4ffc49ca in run_argv /home/changbin/work/linux/tools/perf/perf.c:398
+      #12 0x55bd4ffc5138 in main /home/changbin/work/linux/tools/perf/perf.c:520
+      #13 0x7f1b6e34809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
+
+  Indirect leak of 19 byte(s) in 1 object(s) allocated from:
+      #0 0x7f1b6fc83f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30)
+      #1 0x7f1b6e3ac30f in vasprintf (/lib/x86_64-linux-gnu/libc.so.6+0x8830f)
+
+Signed-off-by: Changbin Du <changbin.du@gmail.com>
+Reviewed-by: Jiri Olsa <jolsa@kernel.org>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields")
+Link: http://lkml.kernel.org/r/20190316080556.3075-17-changbin.du@gmail.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/perf/tests/evsel-tp-sched.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
+index 5ce11eac4dd3..959bdb4a79ad 100644
+--- a/tools/perf/tests/evsel-tp-sched.c
++++ b/tools/perf/tests/evsel-tp-sched.c
+@@ -78,5 +78,6 @@ int test__perf_evsel__tp_sched_test(void)
+       if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
+               ret = -1;
++      perf_evsel__delete(evsel);
+       return ret;
+ }
+-- 
+2.19.1
+
diff --git a/queue-3.18/perf-top-fix-error-handling-in-cmd_top.patch b/queue-3.18/perf-top-fix-error-handling-in-cmd_top.patch
new file mode 100644 (file)
index 0000000..b5ddaa4
--- /dev/null
@@ -0,0 +1,43 @@
+From 4835e4a81038bdf70395cda374c437222e487a13 Mon Sep 17 00:00:00 2001
+From: Changbin Du <changbin.du@gmail.com>
+Date: Sat, 16 Mar 2019 16:05:48 +0800
+Subject: perf top: Fix error handling in cmd_top()
+
+[ Upstream commit 70c819e4bf1c5f492768b399d898d458ccdad2b6 ]
+
+We should go to the cleanup path, to avoid leaks, detected using gcc's
+ASan.
+
+Signed-off-by: Changbin Du <changbin.du@gmail.com>
+Reviewed-by: Jiri Olsa <jolsa@kernel.org>
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Link: http://lkml.kernel.org/r/20190316080556.3075-9-changbin.du@gmail.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/perf/builtin-top.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
+index c5b9c3f01d85..ea02883c3405 100644
+--- a/tools/perf/builtin-top.c
++++ b/tools/perf/builtin-top.c
+@@ -1256,8 +1256,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
+       symbol_conf.priv_size = sizeof(struct annotation);
+       symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
+-      if (symbol__init(NULL) < 0)
+-              return -1;
++      status = symbol__init(NULL);
++      if (status < 0)
++              goto out_delete_evlist;
+       sort__setup_elide(stdout);
+-- 
+2.19.1
+
diff --git a/queue-3.18/rsi-improve-kernel-thread-handling-to-fix-kernel-pan.patch b/queue-3.18/rsi-improve-kernel-thread-handling-to-fix-kernel-pan.patch
new file mode 100644 (file)
index 0000000..e7c1d1d
--- /dev/null
@@ -0,0 +1,61 @@
+From 398932b4769d1cb64189e4e96443d8c129a488cf Mon Sep 17 00:00:00 2001
+From: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
+Date: Mon, 27 Aug 2018 17:05:15 +0530
+Subject: rsi: improve kernel thread handling to fix kernel panic
+
+[ Upstream commit 4c62764d0fc21a34ffc44eec1210038c3a2e4473 ]
+
+While running regressions, observed below kernel panic when sdio disconnect
+called. This is because of, kthread_stop() is taking care of
+wait_for_completion() by default. When wait_for_completion triggered
+in kthread_stop and as it was done already, giving kernel panic.
+Hence, removing redundant wait_for_completion() from rsi_kill_thread().
+
+... skipping ...
+BUG: unable to handle kernel NULL pointer dereference at           (null)
+IP: [<ffffffff810a63df>] exit_creds+0x1f/0x50
+PGD 0
+Oops: 0002 [#1] SMP
+CPU: 0 PID: 6502 Comm: rmmod Tainted: G  OE   4.15.9-Generic #154-Ubuntu
+Hardware name: Dell Inc. Edge Gateway 3003/ , BIOS 01.00.00 04/17/2017
+Stack:
+ffff88007392e600 ffff880075847dc0 ffffffff8108160a 0000000000000000
+ffff88007392e600 ffff880075847de8 ffffffff810a484b ffff880076127000
+ffff88003cd3a800 ffff880074f12a00 ffff880075847e28 ffffffffc09bed15
+Call Trace:
+[<ffffffff8108160a>] __put_task_struct+0x5a/0x140
+[<ffffffff810a484b>] kthread_stop+0x10b/0x110
+[<ffffffffc09bed15>] rsi_disconnect+0x2f5/0x300 [ven_rsi_sdio]
+[<ffffffff81578bcb>] ? __pm_runtime_resume+0x5b/0x80
+[<ffffffff816f0918>] sdio_bus_remove+0x38/0x100
+[<ffffffff8156cc64>] __device_release_driver+0xa4/0x150
+[<ffffffff8156d7a5>] driver_detach+0xb5/0xc0
+[<ffffffff8156c6c5>] bus_remove_driver+0x55/0xd0
+[<ffffffff8156dfbc>] driver_unregister+0x2c/0x50
+[<ffffffff816f0b8a>] sdio_unregister_driver+0x1a/0x20
+[<ffffffffc09bf0f5>] rsi_module_exit+0x15/0x30 [ven_rsi_sdio]
+[<ffffffff8110cad8>] SyS_delete_module+0x1b8/0x210
+[<ffffffff81851dc8>] entry_SYSCALL_64_fastpath+0x1c/0xbb
+
+Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/rsi/rsi_common.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/net/wireless/rsi/rsi_common.h b/drivers/net/wireless/rsi/rsi_common.h
+index d3fbe33d2324..a13f08fd8690 100644
+--- a/drivers/net/wireless/rsi/rsi_common.h
++++ b/drivers/net/wireless/rsi/rsi_common.h
+@@ -75,7 +75,6 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)
+       atomic_inc(&handle->thread_done);
+       rsi_set_event(&handle->event);
+-      wait_for_completion(&handle->completion);
+       return kthread_stop(handle->task);
+ }
+-- 
+2.19.1
+
diff --git a/queue-3.18/serial-uartps-console_setup-can-t-be-placed-to-init-.patch b/queue-3.18/serial-uartps-console_setup-can-t-be-placed-to-init-.patch
new file mode 100644 (file)
index 0000000..812970c
--- /dev/null
@@ -0,0 +1,36 @@
+From 4d7e5064d7f8e934f853c557dba14fb20ae7661a Mon Sep 17 00:00:00 2001
+From: Michal Simek <michal.simek@xilinx.com>
+Date: Mon, 3 Sep 2018 15:10:49 +0200
+Subject: serial: uartps: console_setup() can't be placed to init section
+
+[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
+
+When console device is rebinded, console_setup() is called again.
+But marking it as __init means that function will be clear after boot is
+complete. If console device is binded again console_setup() is not found
+and error "Unable to handle kernel paging request at virtual address"
+is reported.
+
+Signed-off-by: Michal Simek <michal.simek@xilinx.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/serial/xilinx_uartps.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
+index df28ef14382b..892446cc28fa 100644
+--- a/drivers/tty/serial/xilinx_uartps.c
++++ b/drivers/tty/serial/xilinx_uartps.c
+@@ -1120,7 +1120,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
+  *
+  * Return: 0 on success, negative errno otherwise.
+  */
+-static int __init cdns_uart_console_setup(struct console *co, char *options)
++static int cdns_uart_console_setup(struct console *co, char *options)
+ {
+       struct uart_port *port = &cdns_uart_port[co->index];
+       int baud = 9600;
+-- 
+2.19.1
+
index 9eacf6a79aedd346663dc0068324c9f52404d60b..2b2feb845c79f12a8d6691e341c462ac0b08a56b 100644 (file)
@@ -58,3 +58,28 @@ sched-fair-do-not-re-read-h_load_next-during-hierarchical-load-calculation.patch
 xtensa-fix-return_address.patch
 pci-add-function-1-dma-alias-quirk-for-marvell-9170-sata-controller.patch
 string-drop-__must_check-from-strscpy-and-restore-strscpy-usages-in-cgroup.patch
+perf-core-restore-mmap-record-type-correctly.patch
+ext4-report-real-fs-size-after-failed-resize.patch
+alsa-echoaudio-add-a-check-for-ioremap_nocache.patch
+alsa-sb8-add-a-check-for-request_region.patch
+ib-mlx4-fix-race-condition-between-catas-error-reset.patch
+mmc-davinci-remove-extraneous-__init-annotation.patch
+alsa-opl3-fix-mismatch-between-snd_opl3_drum_switch-.patch
+thermal-int340x_thermal-fix-mode-setting.patch
+tools-power-turbostat-return-the-exit-status-of-a-co.patch
+perf-top-fix-error-handling-in-cmd_top.patch
+perf-tests-fix-a-memory-leak-in-test__perf_evsel__tp.patch
+x86-hpet-prevent-potential-null-pointer-dereference.patch
+x86-cpu-cyrix-use-correct-macros-for-cyrix-calls-on-.patch
+iommu-vt-d-check-capability-before-disabling-protect.patch
+fix-incorrect-error-code-mapping-for-objectid_not_fo.patch
+rsi-improve-kernel-thread-handling-to-fix-kernel-pan.patch
+9p-do-not-trust-pdu-content-for-stat-item-size.patch
+9p-locks-add-mount-option-for-lock-retry-interval.patch
+serial-uartps-console_setup-can-t-be-placed-to-init-.patch
+arm-samsung-limit-samsung_pm_check-config-option-to-.patch
+acpi-sbs-fix-gpe-storm-on-recent-macbookpro-s.patch
+iommu-dmar-fix-buffer-overflow-during-pci-bus-notifi.patch
+appletalk-fix-use-after-free-in-atalk_proc_exit.patch
+lib-div64.c-off-by-one-in-shift.patch
+include-linux-swap.h-use-offsetof-instead-of-custom-.patch
diff --git a/queue-3.18/thermal-int340x_thermal-fix-mode-setting.patch b/queue-3.18/thermal-int340x_thermal-fix-mode-setting.patch
new file mode 100644 (file)
index 0000000..651562c
--- /dev/null
@@ -0,0 +1,40 @@
+From ebbed3eda199f3e76d2769fda3d0a5152490cdc3 Mon Sep 17 00:00:00 2001
+From: Matthew Garrett <matthewgarrett@google.com>
+Date: Wed, 10 Oct 2018 01:30:07 -0700
+Subject: thermal/int340x_thermal: fix mode setting
+
+[ Upstream commit 396ee4d0cd52c13b3f6421b8d324d65da5e7e409 ]
+
+int3400 only pushes the UUID into the firmware when the mode is flipped
+to "enable". The current code only exposes the mode flag if the firmware
+supports the PASSIVE_1 UUID, which not all machines do. Remove the
+restriction.
+
+Signed-off-by: Matthew Garrett <mjg59@google.com>
+Signed-off-by: Zhang Rui <rui.zhang@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/thermal/int340x_thermal/int3400_thermal.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c
+index edc1cce117ba..7b96b20e939a 100644
+--- a/drivers/thermal/int340x_thermal/int3400_thermal.c
++++ b/drivers/thermal/int340x_thermal/int3400_thermal.c
+@@ -208,10 +208,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)
+       platform_set_drvdata(pdev, priv);
+-      if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) {
+-              int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
+-              int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
+-      }
++      int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
++      int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
++
+       priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
+                                               priv, &int3400_thermal_ops,
+                                               &int3400_thermal_params, 0, 0);
+-- 
+2.19.1
+
diff --git a/queue-3.18/tools-power-turbostat-return-the-exit-status-of-a-co.patch b/queue-3.18/tools-power-turbostat-return-the-exit-status-of-a-co.patch
new file mode 100644 (file)
index 0000000..76c2557
--- /dev/null
@@ -0,0 +1,37 @@
+From d5a578d463b87d8a33b6baf508d3125cc1d728b0 Mon Sep 17 00:00:00 2001
+From: David Arcari <darcari@redhat.com>
+Date: Tue, 12 Feb 2019 09:34:39 -0500
+Subject: tools/power turbostat: return the exit status of a command
+
+[ Upstream commit 2a95496634a017c19641f26f00907af75b962f01 ]
+
+turbostat failed to return a non-zero exit status even though the
+supplied command (turbostat <command>) failed.  Currently when turbostat
+forks a command it returns zero instead of the actual exit status of the
+command.  Modify the code to return the exit status.
+
+Signed-off-by: David Arcari <darcari@redhat.com>
+Acked-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/power/x86/turbostat/turbostat.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
+index f771e09eef33..06e1bf9bf1a8 100644
+--- a/tools/power/x86/turbostat/turbostat.c
++++ b/tools/power/x86/turbostat/turbostat.c
+@@ -2347,6 +2347,9 @@ int fork_it(char **argv)
+               signal(SIGQUIT, SIG_IGN);
+               if (waitpid(child_pid, &status, 0) == -1)
+                       err(status, "waitpid");
++
++              if (WIFEXITED(status))
++                      status = WEXITSTATUS(status);
+       }
+       /*
+        * n.b. fork_it() does not check for errors from for_all_cpus()
+-- 
+2.19.1
+
diff --git a/queue-3.18/x86-cpu-cyrix-use-correct-macros-for-cyrix-calls-on-.patch b/queue-3.18/x86-cpu-cyrix-use-correct-macros-for-cyrix-calls-on-.patch
new file mode 100644 (file)
index 0000000..616616e
--- /dev/null
@@ -0,0 +1,108 @@
+From 618d09194352bae727623eae94ee59758ce28b0a Mon Sep 17 00:00:00 2001
+From: Matthew Whitehead <tedheadster@gmail.com>
+Date: Thu, 14 Mar 2019 16:46:00 -0400
+Subject: x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
+
+[ Upstream commit 18fb053f9b827bd98cfc64f2a35df8ab19745a1d ]
+
+There are comments in processor-cyrix.h advising you to _not_ make calls
+using the deprecated macros in this style:
+
+  setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
+
+This is because it expands the macro into a non-functioning calling
+sequence. The calling order must be:
+
+  outb(CX86_CCR2, 0x22);
+  inb(0x23);
+
+From the comments:
+
+ * When using the old macros a line like
+ *   setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
+ * gets expanded to:
+ *  do {
+ *    outb((CX86_CCR2), 0x22);
+ *    outb((({
+ *        outb((CX86_CCR2), 0x22);
+ *        inb(0x23);
+ *    }) | 0x88), 0x23);
+ *  } while (0);
+
+The new macros fix this problem, so use them instead. Tested on an
+actual Geode processor.
+
+Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: luto@kernel.org
+Link: https://lkml.kernel.org/r/1552596361-8967-2-git-send-email-tedheadster@gmail.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/kernel/cpu/cyrix.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
+index aaf152e79637..0007827196a4 100644
+--- a/arch/x86/kernel/cpu/cyrix.c
++++ b/arch/x86/kernel/cpu/cyrix.c
+@@ -120,7 +120,7 @@ static void set_cx86_reorder(void)
+       setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
+       /* Load/Store Serialize to mem access disable (=reorder it) */
+-      setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
++      setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
+       /* set load/store serialize from 1GB to 4GB */
+       ccr3 |= 0xe0;
+       setCx86(CX86_CCR3, ccr3);
+@@ -131,11 +131,11 @@ static void set_cx86_memwb(void)
+       printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
+       /* CCR2 bit 2: unlock NW bit */
+-      setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
++      setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
+       /* set 'Not Write-through' */
+       write_cr0(read_cr0() | X86_CR0_NW);
+       /* CCR2 bit 2: lock NW bit and set WT1 */
+-      setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
++      setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
+ }
+ /*
+@@ -149,14 +149,14 @@ static void geode_configure(void)
+       local_irq_save(flags);
+       /* Suspend on halt power saving and enable #SUSP pin */
+-      setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
++      setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
+       ccr3 = getCx86(CX86_CCR3);
+       setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);       /* enable MAPEN */
+       /* FPU fast, DTE cache, Mem bypass */
+-      setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
++      setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
+       setCx86(CX86_CCR3, ccr3);                       /* disable MAPEN */
+       set_cx86_memwb();
+@@ -291,7 +291,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
+               /* GXm supports extended cpuid levels 'ala' AMD */
+               if (c->cpuid_level == 2) {
+                       /* Enable cxMMX extensions (GX1 Datasheet 54) */
+-                      setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
++                      setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
+                       /*
+                        * GXm : 0x30 ... 0x5f GXm  datasheet 51
+@@ -314,7 +314,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
+               if (dir1 > 7) {
+                       dir0_msn++;  /* M II */
+                       /* Enable MMX extensions (App note 108) */
+-                      setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
++                      setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
+               } else {
+                       /* A 6x86MX - it has the bug. */
+                       set_cpu_bug(c, X86_BUG_COMA);
+-- 
+2.19.1
+
diff --git a/queue-3.18/x86-hpet-prevent-potential-null-pointer-dereference.patch b/queue-3.18/x86-hpet-prevent-potential-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..d20dc66
--- /dev/null
@@ -0,0 +1,43 @@
+From b9fe9aaab410fbf09dd2e2882def72ae1d8764ee Mon Sep 17 00:00:00 2001
+From: Aditya Pakki <pakki001@umn.edu>
+Date: Mon, 18 Mar 2019 21:19:56 -0500
+Subject: x86/hpet: Prevent potential NULL pointer dereference
+
+[ Upstream commit 2e84f116afca3719c9d0a1a78b47b48f75fd5724 ]
+
+hpet_virt_address may be NULL when ioremap_nocache fail, but the code lacks
+a check.
+
+Add a check to prevent NULL pointer dereference.
+
+Signed-off-by: Aditya Pakki <pakki001@umn.edu>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: kjlu@umn.edu
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Kees Cook <keescook@chromium.org>
+Cc: Joe Perches <joe@perches.com>
+Cc: Nicolai Stange <nstange@suse.de>
+Cc: Roland Dreier <roland@purestorage.com>
+Link: https://lkml.kernel.org/r/20190319021958.17275-1-pakki001@umn.edu
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/kernel/hpet.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
+index 319bcb9372fe..3e9c5725732f 100644
+--- a/arch/x86/kernel/hpet.c
++++ b/arch/x86/kernel/hpet.c
+@@ -799,6 +799,8 @@ int __init hpet_enable(void)
+               return 0;
+       hpet_set_mapping();
++      if (!hpet_virt_address)
++              return 0;
+       /*
+        * Read the period and check for a sane value:
+-- 
+2.19.1
+