From 30f514a4aedd3840ff7fdf0f85fc3192d78fd1e0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 23 Jul 2019 12:24:53 +0200 Subject: [PATCH] 4.19-stable patches added patches: alsa-hda-realtek-apply-alc891-headset-fixup-to-one-dell-machine.patch alsa-hda-realtek-fixed-headphone-mic-can-t-record-on-dell-platform.patch alsa-seq-break-too-long-mutex-context-in-the-write-loop.patch asoc-dapm-adapt-for-debugfs-api-change.patch lib-scatterlist-fix-mapping-iterator-when-sg-offset-is-greater-than-page_size.patch media-coda-remove-unbalanced-and-unneeded-mutex-unlock.patch media-v4l2-test-type-instead-of-cfg-type-in-v4l2_ctrl_new_custom.patch media-videobuf2-core-prevent-size-alignment-wrapping-buffer-size-to-0.patch media-videobuf2-dma-sg-prevent-size-from-overflowing.patch nfsv4-handle-the-special-linux-file-open-access-mode.patch pnfs-fix-a-problem-where-we-gratuitously-start-doing-i-o-through-the-mds.patch pnfs-fix-a-typo-in-pnfs_update_layout.patch pnfs-flexfiles-fix-ptr_err-dereferences-in-ff_layout_track_ds_error.patch raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch --- ...91-headset-fixup-to-one-dell-machine.patch | 34 +++++++++ ...ne-mic-can-t-record-on-dell-platform.patch | 37 ++++++++++ ...long-mutex-context-in-the-write-loop.patch | 73 +++++++++++++++++++ ...oc-dapm-adapt-for-debugfs-api-change.patch | 72 ++++++++++++++++++ ...-sg-offset-is-greater-than-page_size.patch | 57 +++++++++++++++ ...unbalanced-and-unneeded-mutex-unlock.patch | 36 +++++++++ ...-of-cfg-type-in-v4l2_ctrl_new_custom.patch | 47 ++++++++++++ ...-alignment-wrapping-buffer-size-to-0.patch | 38 ++++++++++ ...dma-sg-prevent-size-from-overflowing.patch | 40 ++++++++++ ...-special-linux-file-open-access-mode.patch | 49 +++++++++++++ ...usly-start-doing-i-o-through-the-mds.patch | 33 +++++++++ ...nfs-fix-a-typo-in-pnfs_update_layout.patch | 32 ++++++++ ...ferences-in-ff_layout_track_ds_error.patch | 32 ++++++++ ...part-job-after-adding-journal-device.patch | 56 ++++++++++++++ queue-4.19/series | 14 ++++ 15 files changed, 650 insertions(+) create mode 100644 queue-4.19/alsa-hda-realtek-apply-alc891-headset-fixup-to-one-dell-machine.patch create mode 100644 queue-4.19/alsa-hda-realtek-fixed-headphone-mic-can-t-record-on-dell-platform.patch create mode 100644 queue-4.19/alsa-seq-break-too-long-mutex-context-in-the-write-loop.patch create mode 100644 queue-4.19/asoc-dapm-adapt-for-debugfs-api-change.patch create mode 100644 queue-4.19/lib-scatterlist-fix-mapping-iterator-when-sg-offset-is-greater-than-page_size.patch create mode 100644 queue-4.19/media-coda-remove-unbalanced-and-unneeded-mutex-unlock.patch create mode 100644 queue-4.19/media-v4l2-test-type-instead-of-cfg-type-in-v4l2_ctrl_new_custom.patch create mode 100644 queue-4.19/media-videobuf2-core-prevent-size-alignment-wrapping-buffer-size-to-0.patch create mode 100644 queue-4.19/media-videobuf2-dma-sg-prevent-size-from-overflowing.patch create mode 100644 queue-4.19/nfsv4-handle-the-special-linux-file-open-access-mode.patch create mode 100644 queue-4.19/pnfs-fix-a-problem-where-we-gratuitously-start-doing-i-o-through-the-mds.patch create mode 100644 queue-4.19/pnfs-fix-a-typo-in-pnfs_update_layout.patch create mode 100644 queue-4.19/pnfs-flexfiles-fix-ptr_err-dereferences-in-ff_layout_track_ds_error.patch create mode 100644 queue-4.19/raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch diff --git a/queue-4.19/alsa-hda-realtek-apply-alc891-headset-fixup-to-one-dell-machine.patch b/queue-4.19/alsa-hda-realtek-apply-alc891-headset-fixup-to-one-dell-machine.patch new file mode 100644 index 00000000000..c4bf10a9a5a --- /dev/null +++ b/queue-4.19/alsa-hda-realtek-apply-alc891-headset-fixup-to-one-dell-machine.patch @@ -0,0 +1,34 @@ +From 4b4e0e32e4b09274dbc9d173016c1a026f44608c Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Tue, 16 Jul 2019 15:21:34 +0800 +Subject: ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine + +From: Hui Wang + +commit 4b4e0e32e4b09274dbc9d173016c1a026f44608c upstream. + +Without this patch, the headset-mic and headphone-mic don't work. + +Cc: +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -8657,6 +8657,11 @@ static const struct snd_hda_pin_quirk al + {0x18, 0x01a19030}, + {0x1a, 0x01813040}, + {0x21, 0x01014020}), ++ SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, ++ {0x16, 0x01813030}, ++ {0x17, 0x02211010}, ++ {0x18, 0x01a19040}, ++ {0x21, 0x01014020}), + SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, + {0x14, 0x01014010}, + {0x18, 0x01a19020}, diff --git a/queue-4.19/alsa-hda-realtek-fixed-headphone-mic-can-t-record-on-dell-platform.patch b/queue-4.19/alsa-hda-realtek-fixed-headphone-mic-can-t-record-on-dell-platform.patch new file mode 100644 index 00000000000..eb1970575df --- /dev/null +++ b/queue-4.19/alsa-hda-realtek-fixed-headphone-mic-can-t-record-on-dell-platform.patch @@ -0,0 +1,37 @@ +From fbc571290d9f7bfe089c50f4ac4028dd98ebfe98 Mon Sep 17 00:00:00 2001 +From: Kailang Yang +Date: Mon, 15 Jul 2019 10:41:50 +0800 +Subject: ALSA: hda/realtek - Fixed Headphone Mic can't record on Dell platform + +From: Kailang Yang + +commit fbc571290d9f7bfe089c50f4ac4028dd98ebfe98 upstream. + +It assigned to wrong model. So, The headphone Mic can't work. + +Fixes: 3f640970a414 ("ALSA: hda - Fix headset mic detection problem for several Dell laptops") +Signed-off-by: Kailang Yang +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7518,9 +7518,12 @@ static const struct snd_hda_pin_quirk al + {0x12, 0x90a60130}, + {0x17, 0x90170110}, + {0x21, 0x03211020}), +- SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, ++ SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, + {0x14, 0x90170110}, + {0x21, 0x04211020}), ++ SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, ++ {0x14, 0x90170110}, ++ {0x21, 0x04211030}), + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC295_STANDARD_PINS, + {0x17, 0x21014020}, diff --git a/queue-4.19/alsa-seq-break-too-long-mutex-context-in-the-write-loop.patch b/queue-4.19/alsa-seq-break-too-long-mutex-context-in-the-write-loop.patch new file mode 100644 index 00000000000..e05601c61b1 --- /dev/null +++ b/queue-4.19/alsa-seq-break-too-long-mutex-context-in-the-write-loop.patch @@ -0,0 +1,73 @@ +From ede34f397ddb063b145b9e7d79c6026f819ded13 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 15 Jul 2019 22:50:27 +0200 +Subject: ALSA: seq: Break too long mutex context in the write loop + +From: Takashi Iwai + +commit ede34f397ddb063b145b9e7d79c6026f819ded13 upstream. + +The fix for the racy writes and ioctls to sequencer widened the +application of client->ioctl_mutex to the whole write loop. Although +it does unlock/relock for the lengthy operation like the event dup, +the loop keeps the ioctl_mutex for the whole time in other +situations. This may take quite long time if the user-space would +give a huge buffer, and this is a likely cause of some weird behavior +spotted by syzcaller fuzzer. + +This patch puts a simple workaround, just adding a mutex break in the +loop when a large number of events have been processed. This +shouldn't hit any performance drop because the threshold is set high +enough for usual operations. + +Fixes: 7bd800915677 ("ALSA: seq: More protection for concurrent write and ioctl races") +Reported-by: syzbot+97aae04ce27e39cbfca9@syzkaller.appspotmail.com +Reported-by: syzbot+4c595632b98bb8ffcc66@syzkaller.appspotmail.com +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/seq/seq_clientmgr.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -1004,7 +1004,7 @@ static ssize_t snd_seq_write(struct file + { + struct snd_seq_client *client = file->private_data; + int written = 0, len; +- int err; ++ int err, handled; + struct snd_seq_event event; + + if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT)) +@@ -1017,6 +1017,8 @@ static ssize_t snd_seq_write(struct file + if (!client->accept_output || client->pool == NULL) + return -ENXIO; + ++ repeat: ++ handled = 0; + /* allocate the pool now if the pool is not allocated yet */ + mutex_lock(&client->ioctl_mutex); + if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) { +@@ -1076,12 +1078,19 @@ static ssize_t snd_seq_write(struct file + 0, 0, &client->ioctl_mutex); + if (err < 0) + break; ++ handled++; + + __skip_event: + /* Update pointers and counts */ + count -= len; + buf += len; + written += len; ++ ++ /* let's have a coffee break if too many events are queued */ ++ if (++handled >= 200) { ++ mutex_unlock(&client->ioctl_mutex); ++ goto repeat; ++ } + } + + out: diff --git a/queue-4.19/asoc-dapm-adapt-for-debugfs-api-change.patch b/queue-4.19/asoc-dapm-adapt-for-debugfs-api-change.patch new file mode 100644 index 00000000000..1b311871b58 --- /dev/null +++ b/queue-4.19/asoc-dapm-adapt-for-debugfs-api-change.patch @@ -0,0 +1,72 @@ +From ceaea851b9ea75f9ea2bbefb53ff0d4b27cd5a6e Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Fri, 21 Jun 2019 12:33:57 +0100 +Subject: ASoC: dapm: Adapt for debugfs API change + +From: Mark Brown + +commit ceaea851b9ea75f9ea2bbefb53ff0d4b27cd5a6e upstream. + +Back in ff9fb72bc07705c (debugfs: return error values, not NULL) the +debugfs APIs were changed to return error pointers rather than NULL +pointers on error, breaking the error checking in ASoC. Update the +code to use IS_ERR() and log the codes that are returned as part of +the error messages. + +Fixes: ff9fb72bc07705c (debugfs: return error values, not NULL) +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/soc-dapm.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +--- a/sound/soc/soc-dapm.c ++++ b/sound/soc/soc-dapm.c +@@ -2139,23 +2139,25 @@ void snd_soc_dapm_debugfs_init(struct sn + { + struct dentry *d; + +- if (!parent) ++ if (!parent || IS_ERR(parent)) + return; + + dapm->debugfs_dapm = debugfs_create_dir("dapm", parent); + +- if (!dapm->debugfs_dapm) { ++ if (IS_ERR(dapm->debugfs_dapm)) { + dev_warn(dapm->dev, +- "ASoC: Failed to create DAPM debugfs directory\n"); ++ "ASoC: Failed to create DAPM debugfs directory %ld\n", ++ PTR_ERR(dapm->debugfs_dapm)); + return; + } + + d = debugfs_create_file("bias_level", 0444, + dapm->debugfs_dapm, dapm, + &dapm_bias_fops); +- if (!d) ++ if (IS_ERR(d)) + dev_warn(dapm->dev, +- "ASoC: Failed to create bias level debugfs file\n"); ++ "ASoC: Failed to create bias level debugfs file: %ld\n", ++ PTR_ERR(d)); + } + + static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w) +@@ -2169,10 +2171,10 @@ static void dapm_debugfs_add_widget(stru + d = debugfs_create_file(w->name, 0444, + dapm->debugfs_dapm, w, + &dapm_widget_power_fops); +- if (!d) ++ if (IS_ERR(d)) + dev_warn(w->dapm->dev, +- "ASoC: Failed to create %s debugfs file\n", +- w->name); ++ "ASoC: Failed to create %s debugfs file: %ld\n", ++ w->name, PTR_ERR(d)); + } + + static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) diff --git a/queue-4.19/lib-scatterlist-fix-mapping-iterator-when-sg-offset-is-greater-than-page_size.patch b/queue-4.19/lib-scatterlist-fix-mapping-iterator-when-sg-offset-is-greater-than-page_size.patch new file mode 100644 index 00000000000..e91bb34e3a9 --- /dev/null +++ b/queue-4.19/lib-scatterlist-fix-mapping-iterator-when-sg-offset-is-greater-than-page_size.patch @@ -0,0 +1,57 @@ +From aeb87246537a83c2aff482f3f34a2e0991e02cbc Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Mon, 24 Jun 2019 07:20:14 +0000 +Subject: lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE + +From: Christophe Leroy + +commit aeb87246537a83c2aff482f3f34a2e0991e02cbc upstream. + +All mapping iterator logic is based on the assumption that sg->offset +is always lower than PAGE_SIZE. + +But there are situations where sg->offset is such that the SG item +is on the second page. In that case sg_copy_to_buffer() fails +properly copying the data into the buffer. One of the reason is +that the data will be outside the kmapped area used to access that +data. + +This patch fixes the issue by adjusting the mapping iterator +offset and pgoffset fields such that offset is always lower than +PAGE_SIZE. + +Signed-off-by: Christophe Leroy +Fixes: 4225fc8555a9 ("lib/scatterlist: use page iterator in the mapping iterator") +Cc: stable@vger.kernel.org +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + lib/scatterlist.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/lib/scatterlist.c ++++ b/lib/scatterlist.c +@@ -652,17 +652,18 @@ static bool sg_miter_get_next_page(struc + { + if (!miter->__remaining) { + struct scatterlist *sg; +- unsigned long pgoffset; + + if (!__sg_page_iter_next(&miter->piter)) + return false; + + sg = miter->piter.sg; +- pgoffset = miter->piter.sg_pgoffset; + +- miter->__offset = pgoffset ? 0 : sg->offset; ++ miter->__offset = miter->piter.sg_pgoffset ? 0 : sg->offset; ++ miter->piter.sg_pgoffset += miter->__offset >> PAGE_SHIFT; ++ miter->__offset &= PAGE_SIZE - 1; + miter->__remaining = sg->offset + sg->length - +- (pgoffset << PAGE_SHIFT) - miter->__offset; ++ (miter->piter.sg_pgoffset << PAGE_SHIFT) - ++ miter->__offset; + miter->__remaining = min_t(unsigned long, miter->__remaining, + PAGE_SIZE - miter->__offset); + } diff --git a/queue-4.19/media-coda-remove-unbalanced-and-unneeded-mutex-unlock.patch b/queue-4.19/media-coda-remove-unbalanced-and-unneeded-mutex-unlock.patch new file mode 100644 index 00000000000..19dadd5b8b4 --- /dev/null +++ b/queue-4.19/media-coda-remove-unbalanced-and-unneeded-mutex-unlock.patch @@ -0,0 +1,36 @@ +From 766b9b168f6c75c350dd87c3e0bc6a9b322f0013 Mon Sep 17 00:00:00 2001 +From: Ezequiel Garcia +Date: Thu, 2 May 2019 18:00:43 -0400 +Subject: media: coda: Remove unbalanced and unneeded mutex unlock + +From: Ezequiel Garcia + +commit 766b9b168f6c75c350dd87c3e0bc6a9b322f0013 upstream. + +The mutex unlock in the threaded interrupt handler is not paired +with any mutex lock. Remove it. + +This bug has been here for a really long time, so it applies +to any stable repo. + +Reviewed-by: Philipp Zabel +Signed-off-by: Ezequiel Garcia +Signed-off-by: Hans Verkuil +Cc: stable@vger.kernel.org +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/platform/coda/coda-bit.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/media/platform/coda/coda-bit.c ++++ b/drivers/media/platform/coda/coda-bit.c +@@ -2309,7 +2309,6 @@ irqreturn_t coda_irq_handler(int irq, vo + if (ctx == NULL) { + v4l2_err(&dev->v4l2_dev, + "Instance released before the end of transaction\n"); +- mutex_unlock(&dev->coda_mutex); + return IRQ_HANDLED; + } + diff --git a/queue-4.19/media-v4l2-test-type-instead-of-cfg-type-in-v4l2_ctrl_new_custom.patch b/queue-4.19/media-v4l2-test-type-instead-of-cfg-type-in-v4l2_ctrl_new_custom.patch new file mode 100644 index 00000000000..2fa78bba1ba --- /dev/null +++ b/queue-4.19/media-v4l2-test-type-instead-of-cfg-type-in-v4l2_ctrl_new_custom.patch @@ -0,0 +1,47 @@ +From 07d89227a983df957a6a7c56f7c040cde9ac571f Mon Sep 17 00:00:00 2001 +From: Boris Brezillon +Date: Wed, 19 Jun 2019 05:21:33 -0400 +Subject: media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom() + +From: Boris Brezillon + +commit 07d89227a983df957a6a7c56f7c040cde9ac571f upstream. + +cfg->type can be overridden by v4l2_ctrl_fill() and the new value is +stored in the local type var. Fix the tests to use this local var. + +Fixes: 0996517cf8ea ("V4L/DVB: v4l2: Add new control handling framework") +Cc: +Signed-off-by: Boris Brezillon +[hverkuil-cisco@xs4all.nl: change to !qmenu and !qmenu_int (checkpatch)] +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/v4l2-core/v4l2-ctrls.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/media/v4l2-core/v4l2-ctrls.c ++++ b/drivers/media/v4l2-core/v4l2-ctrls.c +@@ -2249,16 +2249,15 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(s + v4l2_ctrl_fill(cfg->id, &name, &type, &min, &max, &step, + &def, &flags); + +- is_menu = (cfg->type == V4L2_CTRL_TYPE_MENU || +- cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU); ++ is_menu = (type == V4L2_CTRL_TYPE_MENU || ++ type == V4L2_CTRL_TYPE_INTEGER_MENU); + if (is_menu) + WARN_ON(step); + else + WARN_ON(cfg->menu_skip_mask); +- if (cfg->type == V4L2_CTRL_TYPE_MENU && qmenu == NULL) ++ if (type == V4L2_CTRL_TYPE_MENU && !qmenu) { + qmenu = v4l2_ctrl_get_menu(cfg->id); +- else if (cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU && +- qmenu_int == NULL) { ++ } else if (type == V4L2_CTRL_TYPE_INTEGER_MENU && !qmenu_int) { + handler_set_err(hdl, -EINVAL); + return NULL; + } diff --git a/queue-4.19/media-videobuf2-core-prevent-size-alignment-wrapping-buffer-size-to-0.patch b/queue-4.19/media-videobuf2-core-prevent-size-alignment-wrapping-buffer-size-to-0.patch new file mode 100644 index 00000000000..c7cc99428c8 --- /dev/null +++ b/queue-4.19/media-videobuf2-core-prevent-size-alignment-wrapping-buffer-size-to-0.patch @@ -0,0 +1,38 @@ +From defcdc5d89ced780fb45196d539d6570ec5b1ba5 Mon Sep 17 00:00:00 2001 +From: Sakari Ailus +Date: Wed, 12 Dec 2018 07:27:10 -0500 +Subject: media: videobuf2-core: Prevent size alignment wrapping buffer size to 0 + +From: Sakari Ailus + +commit defcdc5d89ced780fb45196d539d6570ec5b1ba5 upstream. + +PAGE_ALIGN() may wrap the buffer size around to 0. Prevent this by +checking that the aligned value is not smaller than the unaligned one. + +Note on backporting to stable: the file used to be under +drivers/media/v4l2-core, it was moved to the current location after 4.14. + +Signed-off-by: Sakari Ailus +Cc: stable@vger.kernel.org +Reviewed-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/common/videobuf2/videobuf2-core.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/media/common/videobuf2/videobuf2-core.c ++++ b/drivers/media/common/videobuf2/videobuf2-core.c +@@ -207,6 +207,10 @@ static int __vb2_buf_mem_alloc(struct vb + for (plane = 0; plane < vb->num_planes; ++plane) { + unsigned long size = PAGE_ALIGN(vb->planes[plane].length); + ++ /* Did it wrap around? */ ++ if (size < vb->planes[plane].length) ++ goto free; ++ + mem_priv = call_ptr_memop(vb, alloc, + q->alloc_devs[plane] ? : q->dev, + q->dma_attrs, size, q->dma_dir, q->gfp_flags); diff --git a/queue-4.19/media-videobuf2-dma-sg-prevent-size-from-overflowing.patch b/queue-4.19/media-videobuf2-dma-sg-prevent-size-from-overflowing.patch new file mode 100644 index 00000000000..f1cd52b2911 --- /dev/null +++ b/queue-4.19/media-videobuf2-dma-sg-prevent-size-from-overflowing.patch @@ -0,0 +1,40 @@ +From 14f28f5cea9e3998442de87846d1907a531b6748 Mon Sep 17 00:00:00 2001 +From: Sakari Ailus +Date: Wed, 12 Dec 2018 07:44:14 -0500 +Subject: media: videobuf2-dma-sg: Prevent size from overflowing + +From: Sakari Ailus + +commit 14f28f5cea9e3998442de87846d1907a531b6748 upstream. + +buf->size is an unsigned long; casting that to int will lead to an +overflow if buf->size exceeds INT_MAX. + +Fix this by changing the type to unsigned long instead. This is possible +as the buf->size is always aligned to PAGE_SIZE, and therefore the size +will never have values lesser than 0. + +Note on backporting to stable: the file used to be under +drivers/media/v4l2-core, it was moved to the current location after 4.14. + +Signed-off-by: Sakari Ailus +Cc: stable@vger.kernel.org +Reviewed-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/common/videobuf2/videobuf2-dma-sg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c ++++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c +@@ -59,7 +59,7 @@ static int vb2_dma_sg_alloc_compacted(st + gfp_t gfp_flags) + { + unsigned int last_page = 0; +- int size = buf->size; ++ unsigned long size = buf->size; + + while (size > 0) { + struct page *pages; diff --git a/queue-4.19/nfsv4-handle-the-special-linux-file-open-access-mode.patch b/queue-4.19/nfsv4-handle-the-special-linux-file-open-access-mode.patch new file mode 100644 index 00000000000..5529c396323 --- /dev/null +++ b/queue-4.19/nfsv4-handle-the-special-linux-file-open-access-mode.patch @@ -0,0 +1,49 @@ +From 44942b4e457beda00981f616402a1a791e8c616e Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Thu, 27 Jun 2019 06:41:45 -0400 +Subject: NFSv4: Handle the special Linux file open access mode + +From: Trond Myklebust + +commit 44942b4e457beda00981f616402a1a791e8c616e upstream. + +According to the open() manpage, Linux reserves the access mode 3 +to mean "check for read and write permission on the file and return +a file descriptor that can't be used for reading or writing." + +Currently, the NFSv4 code will ask the server to open the file, +and will use an incorrect share access mode of 0. Since it has +an incorrect share access mode, the client later forgets to send +a corresponding close, meaning it can leak stateids on the server. + +Fixes: ce4ef7c0a8a05 ("NFS: Split out NFS v4 file operations") +Cc: stable@vger.kernel.org # 3.6+ +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/inode.c | 1 + + fs/nfs/nfs4file.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/nfs/inode.c ++++ b/fs/nfs/inode.c +@@ -1100,6 +1100,7 @@ int nfs_open(struct inode *inode, struct + nfs_fscache_open_file(inode, filp); + return 0; + } ++EXPORT_SYMBOL_GPL(nfs_open); + + /* + * This function is called whenever some part of NFS notices that +--- a/fs/nfs/nfs4file.c ++++ b/fs/nfs/nfs4file.c +@@ -49,7 +49,7 @@ nfs4_file_open(struct inode *inode, stru + return err; + + if ((openflags & O_ACCMODE) == 3) +- openflags--; ++ return nfs_open(inode, filp); + + /* We can't create new files here */ + openflags &= ~(O_CREAT|O_EXCL); diff --git a/queue-4.19/pnfs-fix-a-problem-where-we-gratuitously-start-doing-i-o-through-the-mds.patch b/queue-4.19/pnfs-fix-a-problem-where-we-gratuitously-start-doing-i-o-through-the-mds.patch new file mode 100644 index 00000000000..c7e896d360e --- /dev/null +++ b/queue-4.19/pnfs-fix-a-problem-where-we-gratuitously-start-doing-i-o-through-the-mds.patch @@ -0,0 +1,33 @@ +From 58bbeab425c6c5e318f5b6ae31d351331ddfb34b Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Thu, 18 Jul 2019 15:33:42 -0400 +Subject: pnfs: Fix a problem where we gratuitously start doing I/O through the MDS + +From: Trond Myklebust + +commit 58bbeab425c6c5e318f5b6ae31d351331ddfb34b upstream. + +If the client has to stop in pnfs_update_layout() to wait for another +layoutget to complete, it currently exits and defaults to I/O through +the MDS if the layoutget was successful. + +Fixes: d03360aaf5cc ("pNFS: Ensure we return the error if someone kills...") +Signed-off-by: Trond Myklebust +Cc: stable@vger.kernel.org # v4.20+ +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/pnfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/pnfs.c ++++ b/fs/nfs/pnfs.c +@@ -1867,7 +1867,7 @@ lookup_again: + spin_unlock(&ino->i_lock); + lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding, + !atomic_read(&lo->plh_outstanding))); +- if (IS_ERR(lseg) || !list_empty(&lo->plh_segs)) ++ if (IS_ERR(lseg)) + goto out_put_layout_hdr; + pnfs_put_layout_hdr(lo); + goto lookup_again; diff --git a/queue-4.19/pnfs-fix-a-typo-in-pnfs_update_layout.patch b/queue-4.19/pnfs-fix-a-typo-in-pnfs_update_layout.patch new file mode 100644 index 00000000000..8835b315f72 --- /dev/null +++ b/queue-4.19/pnfs-fix-a-typo-in-pnfs_update_layout.patch @@ -0,0 +1,32 @@ +From 400417b05f3ec0531544ca5f94e64d838d8b8849 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Tue, 12 Mar 2019 16:04:51 -0400 +Subject: pNFS: Fix a typo in pnfs_update_layout + +From: Trond Myklebust + +commit 400417b05f3ec0531544ca5f94e64d838d8b8849 upstream. + +We're supposed to wait for the outstanding layout count to go to zero, +but that got lost somehow. + +Fixes: d03360aaf5cca ("pNFS: Ensure we return the error if someone...") +Reported-by: Anna Schumaker +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/pnfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/pnfs.c ++++ b/fs/nfs/pnfs.c +@@ -1866,7 +1866,7 @@ lookup_again: + atomic_read(&lo->plh_outstanding) != 0) { + spin_unlock(&ino->i_lock); + lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding, +- atomic_read(&lo->plh_outstanding))); ++ !atomic_read(&lo->plh_outstanding))); + if (IS_ERR(lseg) || !list_empty(&lo->plh_segs)) + goto out_put_layout_hdr; + pnfs_put_layout_hdr(lo); diff --git a/queue-4.19/pnfs-flexfiles-fix-ptr_err-dereferences-in-ff_layout_track_ds_error.patch b/queue-4.19/pnfs-flexfiles-fix-ptr_err-dereferences-in-ff_layout_track_ds_error.patch new file mode 100644 index 00000000000..21e954acdad --- /dev/null +++ b/queue-4.19/pnfs-flexfiles-fix-ptr_err-dereferences-in-ff_layout_track_ds_error.patch @@ -0,0 +1,32 @@ +From 8e04fdfadda75a849c649f7e50fe7d97772e1fcb Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Wed, 17 Jul 2019 13:57:44 -0400 +Subject: pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error + +From: Trond Myklebust + +commit 8e04fdfadda75a849c649f7e50fe7d97772e1fcb upstream. + +mirror->mirror_ds can be NULL if uninitialised, but can contain +a PTR_ERR() if call to GETDEVICEINFO failed. + +Fixes: 65990d1afbd2 ("pNFS/flexfiles: Fix a deadlock on LAYOUTGET") +Signed-off-by: Trond Myklebust +Cc: stable@vger.kernel.org # 4.10+ +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c ++++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +@@ -307,7 +307,7 @@ int ff_layout_track_ds_error(struct nfs4 + if (status == 0) + return 0; + +- if (mirror->mirror_ds == NULL) ++ if (IS_ERR_OR_NULL(mirror->mirror_ds)) + return -EINVAL; + + dserr = kmalloc(sizeof(*dserr), gfp_flags); diff --git a/queue-4.19/raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch b/queue-4.19/raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch new file mode 100644 index 00000000000..9ed1f0587d2 --- /dev/null +++ b/queue-4.19/raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch @@ -0,0 +1,56 @@ +From d9771f5ec46c282d518b453c793635dbdc3a2a94 Mon Sep 17 00:00:00 2001 +From: Xiao Ni +Date: Fri, 14 Jun 2019 15:41:05 -0700 +Subject: raid5-cache: Need to do start() part job after adding journal device + +From: Xiao Ni + +commit d9771f5ec46c282d518b453c793635dbdc3a2a94 upstream. + +commit d5d885fd514f ("md: introduce new personality funciton start()") +splits the init job to two parts. The first part run() does the jobs that +do not require the md threads. The second part start() does the jobs that +require the md threads. + +Now it just does run() in adding new journal device. It needs to do the +second part start() too. + +Fixes: d5d885fd514f ("md: introduce new personality funciton start()") +Cc: stable@vger.kernel.org #v4.9+ +Reported-by: Michal Soltys +Signed-off-by: Xiao Ni +Signed-off-by: Song Liu +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid5.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -7670,7 +7670,7 @@ abort: + static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev) + { + struct r5conf *conf = mddev->private; +- int err = -EEXIST; ++ int ret, err = -EEXIST; + int disk; + struct disk_info *p; + int first = 0; +@@ -7685,7 +7685,14 @@ static int raid5_add_disk(struct mddev * + * The array is in readonly mode if journal is missing, so no + * write requests running. We should be safe + */ +- log_init(conf, rdev, false); ++ ret = log_init(conf, rdev, false); ++ if (ret) ++ return ret; ++ ++ ret = r5l_start(conf->log); ++ if (ret) ++ return ret; ++ + return 0; + } + if (mddev->recovery_disabled == conf->recovery_disabled) diff --git a/queue-4.19/series b/queue-4.19/series index e0e3feb0c85..065012b48cc 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -197,3 +197,17 @@ iwlwifi-pcie-don-t-service-an-interrupt-that-was-masked.patch iwlwifi-pcie-fix-alive-interrupt-handling-for-gen2-devices-w-o-msi-x.patch iwlwifi-don-t-warn-when-calling-iwl_get_shared_mem_conf-with-rf-kill.patch iwlwifi-fix-rf-kill-interrupt-while-fw-load-for-gen2-devices.patch +nfsv4-handle-the-special-linux-file-open-access-mode.patch +pnfs-flexfiles-fix-ptr_err-dereferences-in-ff_layout_track_ds_error.patch +pnfs-fix-a-typo-in-pnfs_update_layout.patch +pnfs-fix-a-problem-where-we-gratuitously-start-doing-i-o-through-the-mds.patch +lib-scatterlist-fix-mapping-iterator-when-sg-offset-is-greater-than-page_size.patch +asoc-dapm-adapt-for-debugfs-api-change.patch +raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch +alsa-seq-break-too-long-mutex-context-in-the-write-loop.patch +alsa-hda-realtek-fixed-headphone-mic-can-t-record-on-dell-platform.patch +alsa-hda-realtek-apply-alc891-headset-fixup-to-one-dell-machine.patch +media-v4l2-test-type-instead-of-cfg-type-in-v4l2_ctrl_new_custom.patch +media-coda-remove-unbalanced-and-unneeded-mutex-unlock.patch +media-videobuf2-core-prevent-size-alignment-wrapping-buffer-size-to-0.patch +media-videobuf2-dma-sg-prevent-size-from-overflowing.patch -- 2.47.3