]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Tue, 24 Aug 2021 02:59:52 +0000 (22:59 -0400)
committerSasha Levin <sashal@kernel.org>
Tue, 24 Aug 2021 02:59:52 +0000 (22:59 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/alsa-hda-fix-the-capture-switch-value-change-notific.patch [new file with mode: 0644]
queue-4.14/asoc-intel-atom-fix-breakage-for-pcm-buffer-address-.patch [new file with mode: 0644]
queue-4.14/btrfs-prevent-rename2-from-exchanging-a-subvol-with-.patch [new file with mode: 0644]
queue-4.14/fs-warn-about-impending-deprecation-of-mandatory-loc.patch [new file with mode: 0644]
queue-4.14/ipack-tpci200-fix-many-double-free-issues-in-tpci200.patch [new file with mode: 0644]
queue-4.14/locks-print-a-warning-when-mount-fails-due-to-lack-o.patch [new file with mode: 0644]
queue-4.14/mmc-dw_mmc-fix-hang-on-data-crc-error.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/alsa-hda-fix-the-capture-switch-value-change-notific.patch b/queue-4.14/alsa-hda-fix-the-capture-switch-value-change-notific.patch
new file mode 100644 (file)
index 0000000..4e78b1d
--- /dev/null
@@ -0,0 +1,57 @@
+From eb19676eea20010f1b6cbede8c9e011d72c4723d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 11 Aug 2021 18:14:41 +0200
+Subject: ALSA: hda - fix the 'Capture Switch' value change notifications
+
+From: Jaroslav Kysela <perex@perex.cz>
+
+[ Upstream commit a2befe9380dd04ee76c871568deca00eedf89134 ]
+
+The original code in the cap_put_caller() function does not
+handle correctly the positive values returned from the passed
+function for multiple iterations. It means that the change
+notifications may be lost.
+
+Fixes: 352f7f914ebb ("ALSA: hda - Merge Realtek parser code to generic parser")
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213851
+Cc: <stable@kernel.org>
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+Link: https://lore.kernel.org/r/20210811161441.1325250-1-perex@perex.cz
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/hda/hda_generic.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
+index 1833deefe1af..cf406f22f406 100644
+--- a/sound/pci/hda/hda_generic.c
++++ b/sound/pci/hda/hda_generic.c
+@@ -3468,7 +3468,7 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,
+       struct hda_gen_spec *spec = codec->spec;
+       const struct hda_input_mux *imux;
+       struct nid_path *path;
+-      int i, adc_idx, err = 0;
++      int i, adc_idx, ret, err = 0;
+       imux = &spec->input_mux;
+       adc_idx = kcontrol->id.index;
+@@ -3478,9 +3478,13 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,
+               if (!path || !path->ctls[type])
+                       continue;
+               kcontrol->private_value = path->ctls[type];
+-              err = func(kcontrol, ucontrol);
+-              if (err < 0)
++              ret = func(kcontrol, ucontrol);
++              if (ret < 0) {
++                      err = ret;
+                       break;
++              }
++              if (ret > 0)
++                      err = 1;
+       }
+       mutex_unlock(&codec->control_mutex);
+       if (err >= 0 && spec->cap_sync_hook)
+-- 
+2.30.2
+
diff --git a/queue-4.14/asoc-intel-atom-fix-breakage-for-pcm-buffer-address-.patch b/queue-4.14/asoc-intel-atom-fix-breakage-for-pcm-buffer-address-.patch
new file mode 100644 (file)
index 0000000..c4ff275
--- /dev/null
@@ -0,0 +1,48 @@
+From 0bf7413ad73c833efccec1bbf6baf0a000f82f02 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 19 Aug 2021 17:29:45 +0200
+Subject: ASoC: intel: atom: Fix breakage for PCM buffer address setup
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 65ca89c2b12cca0d473f3dd54267568ad3af55cc ]
+
+The commit 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM
+buffer address") changed the reference of PCM buffer address to
+substream->runtime->dma_addr as the buffer address may change
+dynamically.  However, I forgot that the dma_addr field is still not
+set up for the CONTINUOUS buffer type (that this driver uses) yet in
+5.14 and earlier kernels, and it resulted in garbage I/O.  The problem
+will be fixed in 5.15, but we need to address it quickly for now.
+
+The fix is to deduce the address again from the DMA pointer with
+virt_to_phys(), but from the right one, substream->runtime->dma_area.
+
+Fixes: 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM buffer address")
+Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
+Cc: <stable@vger.kernel.org>
+Acked-by: Mark Brown <broonie@kernel.org>
+Link: https://lore.kernel.org/r/2048c6aa-2187-46bd-6772-36a4fb3c5aeb@redhat.com
+Link: https://lore.kernel.org/r/20210819152945.8510-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+index c877326cb0a6..96f7facd0fa0 100644
+--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
++++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+@@ -135,7 +135,7 @@ static void sst_fill_alloc_params(struct snd_pcm_substream *substream,
+       snd_pcm_uframes_t period_size;
+       ssize_t periodbytes;
+       ssize_t buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
+-      u32 buffer_addr = substream->runtime->dma_addr;
++      u32 buffer_addr = virt_to_phys(substream->runtime->dma_area);
+       channels = substream->runtime->channels;
+       period_size = substream->runtime->period_size;
+-- 
+2.30.2
+
diff --git a/queue-4.14/btrfs-prevent-rename2-from-exchanging-a-subvol-with-.patch b/queue-4.14/btrfs-prevent-rename2-from-exchanging-a-subvol-with-.patch
new file mode 100644 (file)
index 0000000..94b044f
--- /dev/null
@@ -0,0 +1,124 @@
+From a64a4598ac105f0696960f86381547bf73f3182b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 6 Aug 2021 14:26:24 +1000
+Subject: btrfs: prevent rename2 from exchanging a subvol with a directory from
+ different parents
+
+From: NeilBrown <neilb@suse.de>
+
+[ Upstream commit 3f79f6f6247c83f448c8026c3ee16d4636ef8d4f ]
+
+Cross-rename lacks a check when that would prevent exchanging a
+directory and subvolume from different parent subvolume. This causes
+data inconsistencies and is caught before commit by tree-checker,
+turning the filesystem to read-only.
+
+Calling the renameat2 with RENAME_EXCHANGE flags like
+
+  renameat2(AT_FDCWD, namesrc, AT_FDCWD, namedest, (1 << 1))
+
+on two paths:
+
+  namesrc = dir1/subvol1/dir2
+ namedest = subvol2/subvol3
+
+will cause key order problem with following write time tree-checker
+report:
+
+  [1194842.307890] BTRFS critical (device loop1): corrupt leaf: root=5 block=27574272 slot=10 ino=258, invalid previous key objectid, have 257 expect 258
+  [1194842.322221] BTRFS info (device loop1): leaf 27574272 gen 8 total ptrs 11 free space 15444 owner 5
+  [1194842.331562] BTRFS info (device loop1): refs 2 lock_owner 0 current 26561
+  [1194842.338772]        item 0 key (256 1 0) itemoff 16123 itemsize 160
+  [1194842.338793]                inode generation 3 size 16 mode 40755
+  [1194842.338801]        item 1 key (256 12 256) itemoff 16111 itemsize 12
+  [1194842.338809]        item 2 key (256 84 2248503653) itemoff 16077 itemsize 34
+  [1194842.338817]                dir oid 258 type 2
+  [1194842.338823]        item 3 key (256 84 2363071922) itemoff 16043 itemsize 34
+  [1194842.338830]                dir oid 257 type 2
+  [1194842.338836]        item 4 key (256 96 2) itemoff 16009 itemsize 34
+  [1194842.338843]        item 5 key (256 96 3) itemoff 15975 itemsize 34
+  [1194842.338852]        item 6 key (257 1 0) itemoff 15815 itemsize 160
+  [1194842.338863]                inode generation 6 size 8 mode 40755
+  [1194842.338869]        item 7 key (257 12 256) itemoff 15801 itemsize 14
+  [1194842.338876]        item 8 key (257 84 2505409169) itemoff 15767 itemsize 34
+  [1194842.338883]                dir oid 256 type 2
+  [1194842.338888]        item 9 key (257 96 2) itemoff 15733 itemsize 34
+  [1194842.338895]        item 10 key (258 12 256) itemoff 15719 itemsize 14
+  [1194842.339163] BTRFS error (device loop1): block=27574272 write time tree block corruption detected
+  [1194842.339245] ------------[ cut here ]------------
+  [1194842.443422] WARNING: CPU: 6 PID: 26561 at fs/btrfs/disk-io.c:449 csum_one_extent_buffer+0xed/0x100 [btrfs]
+  [1194842.511863] CPU: 6 PID: 26561 Comm: kworker/u17:2 Not tainted 5.14.0-rc3-git+ #793
+  [1194842.511870] Hardware name: empty empty/S3993, BIOS PAQEX0-3 02/24/2008
+  [1194842.511876] Workqueue: btrfs-worker-high btrfs_work_helper [btrfs]
+  [1194842.511976] RIP: 0010:csum_one_extent_buffer+0xed/0x100 [btrfs]
+  [1194842.512068] RSP: 0018:ffffa2c284d77da0 EFLAGS: 00010282
+  [1194842.512074] RAX: 0000000000000000 RBX: 0000000000001000 RCX: ffff928867bd9978
+  [1194842.512078] RDX: 0000000000000000 RSI: 0000000000000027 RDI: ffff928867bd9970
+  [1194842.512081] RBP: ffff92876b958000 R08: 0000000000000001 R09: 00000000000c0003
+  [1194842.512085] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
+  [1194842.512088] R13: ffff92875f989f98 R14: 0000000000000000 R15: 0000000000000000
+  [1194842.512092] FS:  0000000000000000(0000) GS:ffff928867a00000(0000) knlGS:0000000000000000
+  [1194842.512095] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  [1194842.512099] CR2: 000055f5384da1f0 CR3: 0000000102fe4000 CR4: 00000000000006e0
+  [1194842.512103] Call Trace:
+  [1194842.512128]  ? run_one_async_free+0x10/0x10 [btrfs]
+  [1194842.631729]  btree_csum_one_bio+0x1ac/0x1d0 [btrfs]
+  [1194842.631837]  run_one_async_start+0x18/0x30 [btrfs]
+  [1194842.631938]  btrfs_work_helper+0xd5/0x1d0 [btrfs]
+  [1194842.647482]  process_one_work+0x262/0x5e0
+  [1194842.647520]  worker_thread+0x4c/0x320
+  [1194842.655935]  ? process_one_work+0x5e0/0x5e0
+  [1194842.655946]  kthread+0x135/0x160
+  [1194842.655953]  ? set_kthread_struct+0x40/0x40
+  [1194842.655965]  ret_from_fork+0x1f/0x30
+  [1194842.672465] irq event stamp: 1729
+  [1194842.672469] hardirqs last  enabled at (1735): [<ffffffffbd1104f5>] console_trylock_spinning+0x185/0x1a0
+  [1194842.672477] hardirqs last disabled at (1740): [<ffffffffbd1104cc>] console_trylock_spinning+0x15c/0x1a0
+  [1194842.672482] softirqs last  enabled at (1666): [<ffffffffbdc002e1>] __do_softirq+0x2e1/0x50a
+  [1194842.672491] softirqs last disabled at (1651): [<ffffffffbd08aab7>] __irq_exit_rcu+0xa7/0xd0
+
+The corrupted data will not be written, and filesystem can be unmounted
+and mounted again (all changes since the last commit will be lost).
+
+Add the missing check for new_ino so that all non-subvolumes must reside
+under the same parent subvolume. There's an exception allowing to
+exchange two subvolumes from any parents as the directory representing a
+subvolume is only a logical link and does not have any other structures
+related to the parent subvolume, unlike files, directories etc, that
+are always in the inode namespace of the parent subvolume.
+
+Fixes: cdd1fedf8261 ("btrfs: add support for RENAME_EXCHANGE and RENAME_WHITEOUT")
+CC: stable@vger.kernel.org # 4.7+
+Reviewed-by: Nikolay Borisov <nborisov@suse.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/inode.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
+index 7ca0fafcd5a6..275a89b8e4b8 100644
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
+@@ -9833,8 +9833,14 @@ static int btrfs_rename_exchange(struct inode *old_dir,
+       bool root_log_pinned = false;
+       bool dest_log_pinned = false;
+-      /* we only allow rename subvolume link between subvolumes */
+-      if (old_ino != BTRFS_FIRST_FREE_OBJECTID && root != dest)
++      /*
++       * For non-subvolumes allow exchange only within one subvolume, in the
++       * same inode namespace. Two subvolumes (represented as directory) can
++       * be exchanged as they're a logical link and have a fixed inode number.
++       */
++      if (root != dest &&
++          (old_ino != BTRFS_FIRST_FREE_OBJECTID ||
++           new_ino != BTRFS_FIRST_FREE_OBJECTID))
+               return -EXDEV;
+       /* close the race window with snapshot create/destroy ioctl */
+-- 
+2.30.2
+
diff --git a/queue-4.14/fs-warn-about-impending-deprecation-of-mandatory-loc.patch b/queue-4.14/fs-warn-about-impending-deprecation-of-mandatory-loc.patch
new file mode 100644 (file)
index 0000000..0bfdf54
--- /dev/null
@@ -0,0 +1,41 @@
+From 4bf2bc427eab0cf80db7f1c943bac7b6af021857 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 20 Aug 2021 09:29:50 -0400
+Subject: fs: warn about impending deprecation of mandatory locks
+
+From: Jeff Layton <jlayton@kernel.org>
+
+[ Upstream commit fdd92b64d15bc4aec973caa25899afd782402e68 ]
+
+We've had CONFIG_MANDATORY_FILE_LOCKING since 2015 and a lot of distros
+have disabled it. Warn the stragglers that still use "-o mand" that
+we'll be dropping support for that mount option.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Jeff Layton <jlayton@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/namespace.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/fs/namespace.c b/fs/namespace.c
+index 11def59b0d50..683668a20bed 100644
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -1696,8 +1696,12 @@ static inline bool may_mount(void)
+ }
+ #ifdef        CONFIG_MANDATORY_FILE_LOCKING
+-static inline bool may_mandlock(void)
++static bool may_mandlock(void)
+ {
++      pr_warn_once("======================================================\n"
++                   "WARNING: the mand mount option is being deprecated and\n"
++                   "         will be removed in v5.15!\n"
++                   "======================================================\n");
+       return capable(CAP_SYS_ADMIN);
+ }
+ #else
+-- 
+2.30.2
+
diff --git a/queue-4.14/ipack-tpci200-fix-many-double-free-issues-in-tpci200.patch b/queue-4.14/ipack-tpci200-fix-many-double-free-issues-in-tpci200.patch
new file mode 100644 (file)
index 0000000..34b0e94
--- /dev/null
@@ -0,0 +1,140 @@
+From a147cb4c8f25605ff01b186e03389fe09244cad9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Aug 2021 18:03:18 +0800
+Subject: ipack: tpci200: fix many double free issues in tpci200_pci_probe
+
+From: Dongliang Mu <mudongliangabcd@gmail.com>
+
+[ Upstream commit 57a1681095f912239c7fb4d66683ab0425973838 ]
+
+The function tpci200_register called by tpci200_install and
+tpci200_unregister called by tpci200_uninstall are in pair. However,
+tpci200_unregister has some cleanup operations not in the
+tpci200_register. So the error handling code of tpci200_pci_probe has
+many different double free issues.
+
+Fix this problem by moving those cleanup operations out of
+tpci200_unregister, into tpci200_pci_remove and reverting
+the previous commit 9272e5d0028d ("ipack/carriers/tpci200:
+Fix a double free in tpci200_pci_probe").
+
+Fixes: 9272e5d0028d ("ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe")
+Cc: stable@vger.kernel.org
+Reported-by: Dongliang Mu <mudongliangabcd@gmail.com>
+Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
+Link: https://lore.kernel.org/r/20210810100323.3938492-1-mudongliangabcd@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/ipack/carriers/tpci200.c | 36 ++++++++++++++++----------------
+ 1 file changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c
+index 7ba1a94497f5..4294523bede5 100644
+--- a/drivers/ipack/carriers/tpci200.c
++++ b/drivers/ipack/carriers/tpci200.c
+@@ -94,16 +94,13 @@ static void tpci200_unregister(struct tpci200_board *tpci200)
+       free_irq(tpci200->info->pdev->irq, (void *) tpci200);
+       pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
+-      pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);
+       pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
+       pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
+       pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
+       pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
+-      pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR);
+       pci_disable_device(tpci200->info->pdev);
+-      pci_dev_put(tpci200->info->pdev);
+ }
+ static void tpci200_enable_irq(struct tpci200_board *tpci200,
+@@ -524,7 +521,7 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
+       tpci200->info = kzalloc(sizeof(struct tpci200_infos), GFP_KERNEL);
+       if (!tpci200->info) {
+               ret = -ENOMEM;
+-              goto out_err_info;
++              goto err_tpci200;
+       }
+       pci_dev_get(pdev);
+@@ -535,7 +532,7 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
+       if (ret) {
+               dev_err(&pdev->dev, "Failed to allocate PCI Configuration Memory");
+               ret = -EBUSY;
+-              goto out_err_pci_request;
++              goto err_tpci200_info;
+       }
+       tpci200->info->cfg_regs = ioremap_nocache(
+                       pci_resource_start(pdev, TPCI200_CFG_MEM_BAR),
+@@ -543,7 +540,7 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
+       if (!tpci200->info->cfg_regs) {
+               dev_err(&pdev->dev, "Failed to map PCI Configuration Memory");
+               ret = -EFAULT;
+-              goto out_err_ioremap;
++              goto err_request_region;
+       }
+       /* Disable byte swapping for 16 bit IP module access. This will ensure
+@@ -566,7 +563,7 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
+       if (ret) {
+               dev_err(&pdev->dev, "error during tpci200 install\n");
+               ret = -ENODEV;
+-              goto out_err_install;
++              goto err_cfg_regs;
+       }
+       /* Register the carrier in the industry pack bus driver */
+@@ -578,7 +575,7 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
+               dev_err(&pdev->dev,
+                       "error registering the carrier on ipack driver\n");
+               ret = -EFAULT;
+-              goto out_err_bus_register;
++              goto err_tpci200_install;
+       }
+       /* save the bus number given by ipack to logging purpose */
+@@ -589,19 +586,16 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
+               tpci200_create_device(tpci200, i);
+       return 0;
+-out_err_bus_register:
++err_tpci200_install:
+       tpci200_uninstall(tpci200);
+-      /* tpci200->info->cfg_regs is unmapped in tpci200_uninstall */
+-      tpci200->info->cfg_regs = NULL;
+-out_err_install:
+-      if (tpci200->info->cfg_regs)
+-              iounmap(tpci200->info->cfg_regs);
+-out_err_ioremap:
++err_cfg_regs:
++      pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);
++err_request_region:
+       pci_release_region(pdev, TPCI200_CFG_MEM_BAR);
+-out_err_pci_request:
+-      pci_dev_put(pdev);
++err_tpci200_info:
+       kfree(tpci200->info);
+-out_err_info:
++      pci_dev_put(pdev);
++err_tpci200:
+       kfree(tpci200);
+       return ret;
+ }
+@@ -611,6 +605,12 @@ static void __tpci200_pci_remove(struct tpci200_board *tpci200)
+       ipack_bus_unregister(tpci200->info->ipack_bus);
+       tpci200_uninstall(tpci200);
++      pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);
++
++      pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR);
++
++      pci_dev_put(tpci200->info->pdev);
++
+       kfree(tpci200->info);
+       kfree(tpci200);
+ }
+-- 
+2.30.2
+
diff --git a/queue-4.14/locks-print-a-warning-when-mount-fails-due-to-lack-o.patch b/queue-4.14/locks-print-a-warning-when-mount-fails-due-to-lack-o.patch
new file mode 100644 (file)
index 0000000..a7eabc1
--- /dev/null
@@ -0,0 +1,78 @@
+From ee1019ea64cf5a878bc3a2718ef821dfb3fb47b5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 15 Aug 2019 15:21:17 -0400
+Subject: locks: print a warning when mount fails due to lack of "mand" support
+
+From: Jeff Layton <jlayton@kernel.org>
+
+[ Upstream commit df2474a22c42ce419b67067c52d71da06c385501 ]
+
+Since 9e8925b67a ("locks: Allow disabling mandatory locking at compile
+time"), attempts to mount filesystems with "-o mand" will fail.
+Unfortunately, there is no other indiciation of the reason for the
+failure.
+
+Change how the function is defined for better readability. When
+CONFIG_MANDATORY_FILE_LOCKING is disabled, printk a warning when
+someone attempts to mount with -o mand.
+
+Also, add a blurb to the mandatory-locking.txt file to explain about
+the "mand" option, and the behavior one should expect when it is
+disabled.
+
+Reported-by: Jan Kara <jack@suse.cz>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Jeff Layton <jlayton@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ Documentation/filesystems/mandatory-locking.txt | 10 ++++++++++
+ fs/namespace.c                                  | 11 ++++++++---
+ 2 files changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/filesystems/mandatory-locking.txt b/Documentation/filesystems/mandatory-locking.txt
+index 0979d1d2ca8b..a251ca33164a 100644
+--- a/Documentation/filesystems/mandatory-locking.txt
++++ b/Documentation/filesystems/mandatory-locking.txt
+@@ -169,3 +169,13 @@ havoc if they lock crucial files. The way around it is to change the file
+ permissions (remove the setgid bit) before trying to read or write to it.
+ Of course, that might be a bit tricky if the system is hung :-(
++7. The "mand" mount option
++--------------------------
++Mandatory locking is disabled on all filesystems by default, and must be
++administratively enabled by mounting with "-o mand". That mount option
++is only allowed if the mounting task has the CAP_SYS_ADMIN capability.
++
++Since kernel v4.5, it is possible to disable mandatory locking
++altogether by setting CONFIG_MANDATORY_FILE_LOCKING to "n". A kernel
++with this disabled will reject attempts to mount filesystems with the
++"mand" mount option with the error status EPERM.
+diff --git a/fs/namespace.c b/fs/namespace.c
+index 473446ae9e9b..11def59b0d50 100644
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -1695,13 +1695,18 @@ static inline bool may_mount(void)
+       return ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN);
+ }
++#ifdef        CONFIG_MANDATORY_FILE_LOCKING
+ static inline bool may_mandlock(void)
+ {
+-#ifndef       CONFIG_MANDATORY_FILE_LOCKING
+-      return false;
+-#endif
+       return capable(CAP_SYS_ADMIN);
+ }
++#else
++static inline bool may_mandlock(void)
++{
++      pr_warn("VFS: \"mand\" mount option not supported");
++      return false;
++}
++#endif
+ /*
+  * Now umount can handle mount points as well as block devices.
+-- 
+2.30.2
+
diff --git a/queue-4.14/mmc-dw_mmc-fix-hang-on-data-crc-error.patch b/queue-4.14/mmc-dw_mmc-fix-hang-on-data-crc-error.patch
new file mode 100644 (file)
index 0000000..62795e2
--- /dev/null
@@ -0,0 +1,73 @@
+From d273d3016579da21fd952aee568ac5b3e46d7fcb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 30 Jun 2021 12:22:32 +0200
+Subject: mmc: dw_mmc: Fix hang on data CRC error
+
+From: Vincent Whitchurch <vincent.whitchurch@axis.com>
+
+[ Upstream commit 25f8203b4be1937c4939bb98623e67dcfd7da4d1 ]
+
+When a Data CRC interrupt is received, the driver disables the DMA, then
+sends the stop/abort command and then waits for Data Transfer Over.
+
+However, sometimes, when a data CRC error is received in the middle of a
+multi-block write transfer, the Data Transfer Over interrupt is never
+received, and the driver hangs and never completes the request.
+
+The driver sets the BMOD.SWR bit (SDMMC_IDMAC_SWRESET) when stopping the
+DMA, but according to the manual CMD.STOP_ABORT_CMD should be programmed
+"before assertion of SWR".  Do these operations in the recommended
+order.  With this change the Data Transfer Over is always received
+correctly in my tests.
+
+Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
+Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20210630102232.16011-1-vincent.whitchurch@axis.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/mmc/host/dw_mmc.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
+index 32001d43e453..bd994a8fce14 100644
+--- a/drivers/mmc/host/dw_mmc.c
++++ b/drivers/mmc/host/dw_mmc.c
+@@ -2051,8 +2051,8 @@ static void dw_mci_tasklet_func(unsigned long priv)
+                                       continue;
+                               }
+-                              dw_mci_stop_dma(host);
+                               send_stop_abort(host, data);
++                              dw_mci_stop_dma(host);
+                               state = STATE_SENDING_STOP;
+                               break;
+                       }
+@@ -2076,10 +2076,10 @@ static void dw_mci_tasklet_func(unsigned long priv)
+                        */
+                       if (test_and_clear_bit(EVENT_DATA_ERROR,
+                                              &host->pending_events)) {
+-                              dw_mci_stop_dma(host);
+                               if (!(host->data_status & (SDMMC_INT_DRTO |
+                                                          SDMMC_INT_EBE)))
+                                       send_stop_abort(host, data);
++                              dw_mci_stop_dma(host);
+                               state = STATE_DATA_ERROR;
+                               break;
+                       }
+@@ -2112,10 +2112,10 @@ static void dw_mci_tasklet_func(unsigned long priv)
+                        */
+                       if (test_and_clear_bit(EVENT_DATA_ERROR,
+                                              &host->pending_events)) {
+-                              dw_mci_stop_dma(host);
+                               if (!(host->data_status & (SDMMC_INT_DRTO |
+                                                          SDMMC_INT_EBE)))
+                                       send_stop_abort(host, data);
++                              dw_mci_stop_dma(host);
+                               state = STATE_DATA_ERROR;
+                               break;
+                       }
+-- 
+2.30.2
+
index 62eac3bdfbff1b2cc647361ed03402f728c19dd6..5a95d496cb18ae9f01f7ab5492b6f49a7428fbf9 100644 (file)
@@ -53,3 +53,10 @@ ptp_pch-restore-dependency-on-pci.patch
 net-qlcnic-add-missed-unlock-in-qlcnic_83xx_flash_re.patch
 net-mdio-mux-don-t-ignore-memory-allocation-errors.patch
 net-mdio-mux-handle-eprobe_defer-correctly.patch
+mmc-dw_mmc-fix-hang-on-data-crc-error.patch
+alsa-hda-fix-the-capture-switch-value-change-notific.patch
+ipack-tpci200-fix-many-double-free-issues-in-tpci200.patch
+btrfs-prevent-rename2-from-exchanging-a-subvol-with-.patch
+asoc-intel-atom-fix-breakage-for-pcm-buffer-address-.patch
+locks-print-a-warning-when-mount-fails-due-to-lack-o.patch
+fs-warn-about-impending-deprecation-of-mandatory-loc.patch