]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2023 14:48:39 +0000 (16:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2023 14:48:39 +0000 (16:48 +0200)
added patches:
fs-no-need-to-check-source.patch
input-ads7846-fix-usage-of-match-data.patch
md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch

queue-6.4/fs-no-need-to-check-source.patch [new file with mode: 0644]
queue-6.4/input-ads7846-fix-usage-of-match-data.patch [new file with mode: 0644]
queue-6.4/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch [new file with mode: 0644]
queue-6.4/series

diff --git a/queue-6.4/fs-no-need-to-check-source.patch b/queue-6.4/fs-no-need-to-check-source.patch
new file mode 100644 (file)
index 0000000..1557347
--- /dev/null
@@ -0,0 +1,45 @@
+From 66d8fc0539b0d49941f313c9509a8384e4245ac1 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 3 Jul 2023 16:49:11 +0200
+Subject: fs: no need to check source
+
+From: Jan Kara <jack@suse.cz>
+
+commit 66d8fc0539b0d49941f313c9509a8384e4245ac1 upstream.
+
+The @source inode must be valid. It is even checked via IS_SWAPFILE()
+above making it pretty clear. So no need to check it when we unlock.
+
+What doesn't need to exist is the @target inode. The lock_two_inodes()
+helper currently swaps the @inode1 and @inode2 arguments if @inode1 is
+NULL to have consistent lock class usage. However, we know that at least
+for vfs_rename() that @inode1 is @source and thus is never NULL as per
+above. We also know that @source is a different inode than @target as
+that is checked right at the beginning of vfs_rename(). So we know that
+@source is valid and locked and that @target is locked. So drop the
+check whether @source is non-NULL.
+
+Fixes: 28eceeda130f ("fs: Lock moved directories")
+Reported-by: kernel test robot <lkp@intel.com>
+Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
+Closes: https://lore.kernel.org/r/202307030026.9sE2pk2x-lkp@intel.com
+Message-Id: <20230703-vfs-rename-source-v1-1-37eebb29b65b@kernel.org>
+[brauner: use commit message from patch I sent concurrently]
+Signed-off-by: Christian Brauner <brauner@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/namei.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -4872,8 +4872,7 @@ int vfs_rename(struct renamedata *rd)
+                       d_exchange(old_dentry, new_dentry);
+       }
+ out:
+-      if (source)
+-              inode_unlock(source);
++      inode_unlock(source);
+       if (target)
+               inode_unlock(target);
+       dput(new_dentry);
diff --git a/queue-6.4/input-ads7846-fix-usage-of-match-data.patch b/queue-6.4/input-ads7846-fix-usage-of-match-data.patch
new file mode 100644 (file)
index 0000000..7fe7e5d
--- /dev/null
@@ -0,0 +1,47 @@
+From 8f7913c04f6a7b90bcf998ece17395d7090f6d44 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Tue, 6 Jun 2023 21:13:04 +0200
+Subject: Input: ads7846 - Fix usage of match data
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit 8f7913c04f6a7b90bcf998ece17395d7090f6d44 upstream.
+
+device_get_match_data() returns the match data directly, fix
+this up and fix the probe crash.
+
+Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Link: https://lore.kernel.org/r/20230606191304.3804174-1-linus.walleij@linaro.org
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/touchscreen/ads7846.c |    9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -1117,20 +1117,13 @@ MODULE_DEVICE_TABLE(of, ads7846_dt_ids);
+ static const struct ads7846_platform_data *ads7846_get_props(struct device *dev)
+ {
+       struct ads7846_platform_data *pdata;
+-      const struct platform_device_id *pdev_id;
+       u32 value;
+-      pdev_id = device_get_match_data(dev);
+-      if (!pdev_id) {
+-              dev_err(dev, "Unknown device model\n");
+-              return ERR_PTR(-EINVAL);
+-      }
+-
+       pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+       if (!pdata)
+               return ERR_PTR(-ENOMEM);
+-      pdata->model = (unsigned long)pdev_id->driver_data;
++      pdata->model = (u32)device_get_match_data(dev);
+       device_property_read_u16(dev, "ti,vref-delay-usecs",
+                                &pdata->vref_delay_usecs);
diff --git a/queue-6.4/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch b/queue-6.4/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch
new file mode 100644 (file)
index 0000000..8f94c74
--- /dev/null
@@ -0,0 +1,41 @@
+From b5a99602b74bbfa655be509c615181dd95b0719e Mon Sep 17 00:00:00 2001
+From: Yu Kuai <yukuai3@huawei.com>
+Date: Fri, 16 Jun 2023 09:21:36 +0800
+Subject: md/raid1-10: fix casting from randomized structure in raid1_submit_write()
+
+From: Yu Kuai <yukuai3@huawei.com>
+
+commit b5a99602b74bbfa655be509c615181dd95b0719e upstream.
+
+Following build error triggered while build with clang version 17.0.0
+with W=1(this can't be reporduced with gcc 13.1.0):
+
+drivers/md/raid1-10.c:117:25: error: casting from randomized structure
+pointer type 'struct block_device *' to 'struct md_rdev *'
+     117 |         struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev;
+         |                                ^
+
+Fix this by casting 'bio->bi_bdev' to 'void *', as it used to be.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Closes: https://lore.kernel.org/oe-kbuild-all/202306142042.fmjfmTF8-lkp@intel.com/
+Fixes: 8295efbe68c0 ("md/raid1-10: factor out a helper to submit normal write")
+Signed-off-by: Yu Kuai <yukuai3@huawei.com>
+Signed-off-by: Song Liu <song@kernel.org>
+Link: https://lore.kernel.org/r/20230616012136.3047071-1-yukuai1@huaweicloud.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/md/raid1-10.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/md/raid1-10.c
++++ b/drivers/md/raid1-10.c
+@@ -113,7 +113,7 @@ static void md_bio_reset_resync_pages(st
+ static inline void raid1_submit_write(struct bio *bio)
+ {
+-      struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev;
++      struct md_rdev *rdev = (void *)bio->bi_bdev;
+       bio->bi_next = NULL;
+       bio_set_dev(bio, rdev->bdev);
index 936e70ade3517aa81460d70b35aee0c59d346da6..57894a720f5040a237c66e936ee3bdc1a80c85e0 100644 (file)
@@ -772,3 +772,6 @@ arm-dts-qcom-ipq4019-fix-broken-nand-controller-properties-override.patch
 arm-orion5x-fix-d2net-gpio-initialization.patch
 leds-trigger-netdev-recheck-netdev_led_mode_linkup-on-dev-rename.patch
 blktrace-use-inline-function-for-blk_trace_remove-while-blktrace-is-disabled.patch
+input-ads7846-fix-usage-of-match-data.patch
+md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch
+fs-no-need-to-check-source.patch