From 08a07457f862a3ec1383cf395c7a8450b35a7f47 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 16 Jul 2023 16:48:39 +0200 Subject: [PATCH] 6.4-stable patches 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 | 45 ++++++++++++++++++ ...nput-ads7846-fix-usage-of-match-data.patch | 47 +++++++++++++++++++ ...ized-structure-in-raid1_submit_write.patch | 41 ++++++++++++++++ queue-6.4/series | 3 ++ 4 files changed, 136 insertions(+) create mode 100644 queue-6.4/fs-no-need-to-check-source.patch create mode 100644 queue-6.4/input-ads7846-fix-usage-of-match-data.patch create mode 100644 queue-6.4/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch 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 index 00000000000..15573476e8a --- /dev/null +++ b/queue-6.4/fs-no-need-to-check-source.patch @@ -0,0 +1,45 @@ +From 66d8fc0539b0d49941f313c9509a8384e4245ac1 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 3 Jul 2023 16:49:11 +0200 +Subject: fs: no need to check source + +From: Jan Kara + +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 +Reported-by: Dan Carpenter +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..7fe7e5d07b1 --- /dev/null +++ b/queue-6.4/input-ads7846-fix-usage-of-match-data.patch @@ -0,0 +1,47 @@ +From 8f7913c04f6a7b90bcf998ece17395d7090f6d44 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 6 Jun 2023 21:13:04 +0200 +Subject: Input: ads7846 - Fix usage of match data + +From: Linus Walleij + +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 +Signed-off-by: Linus Walleij +Acked-by: Dmitry Torokhov +Link: https://lore.kernel.org/r/20230606191304.3804174-1-linus.walleij@linaro.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..8f94c7423a5 --- /dev/null +++ b/queue-6.4/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch @@ -0,0 +1,41 @@ +From b5a99602b74bbfa655be509c615181dd95b0719e Mon Sep 17 00:00:00 2001 +From: Yu Kuai +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 + +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 +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 +Signed-off-by: Song Liu +Link: https://lore.kernel.org/r/20230616012136.3047071-1-yukuai1@huaweicloud.com +Signed-off-by: Greg Kroah-Hartman +--- + 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); diff --git a/queue-6.4/series b/queue-6.4/series index 936e70ade35..57894a720f5 100644 --- a/queue-6.4/series +++ b/queue-6.4/series @@ -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 -- 2.47.3