From: Greg Kroah-Hartman Date: Mon, 8 Jul 2024 12:42:44 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.6.38~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=190f29107edce8384337ccd117cda81cea824550;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: can-kvaser_usb-explicitly-initialize-family-in-leafimx-driver_info-struct.patch fsnotify-do-not-generate-events-for-o_path-file-descriptors.patch --- diff --git a/queue-5.4/can-kvaser_usb-explicitly-initialize-family-in-leafimx-driver_info-struct.patch b/queue-5.4/can-kvaser_usb-explicitly-initialize-family-in-leafimx-driver_info-struct.patch new file mode 100644 index 00000000000..1cc3a7fb62b --- /dev/null +++ b/queue-5.4/can-kvaser_usb-explicitly-initialize-family-in-leafimx-driver_info-struct.patch @@ -0,0 +1,33 @@ +From 19d5b2698c35b2132a355c67b4d429053804f8cc Mon Sep 17 00:00:00 2001 +From: Jimmy Assarsson +Date: Fri, 28 Jun 2024 21:45:29 +0200 +Subject: can: kvaser_usb: Explicitly initialize family in leafimx driver_info struct + +From: Jimmy Assarsson + +commit 19d5b2698c35b2132a355c67b4d429053804f8cc upstream. + +Explicitly set the 'family' driver_info struct member for leafimx. +Previously, the correct operation relied on KVASER_LEAF being the first +defined value in enum kvaser_usb_leaf_family. + +Fixes: e6c80e601053 ("can: kvaser_usb: kvaser_usb_leaf: fix CAN clock frequency regression") +Signed-off-by: Jimmy Assarsson +Link: https://lore.kernel.org/all/20240628194529.312968-1-extja@kvaser.com +Cc: stable@vger.kernel.org +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c ++++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +@@ -114,6 +114,7 @@ static const struct kvaser_usb_driver_in + + static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leafimx = { + .quirks = 0, ++ .family = KVASER_LEAF, + .ops = &kvaser_usb_leaf_dev_ops, + }; + diff --git a/queue-5.4/fsnotify-do-not-generate-events-for-o_path-file-descriptors.patch b/queue-5.4/fsnotify-do-not-generate-events-for-o_path-file-descriptors.patch new file mode 100644 index 00000000000..b4e2d1cb284 --- /dev/null +++ b/queue-5.4/fsnotify-do-not-generate-events-for-o_path-file-descriptors.patch @@ -0,0 +1,44 @@ +From 702eb71fd6501b3566283f8c96d7ccc6ddd662e9 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 17 Jun 2024 18:23:00 +0200 +Subject: fsnotify: Do not generate events for O_PATH file descriptors + +From: Jan Kara + +commit 702eb71fd6501b3566283f8c96d7ccc6ddd662e9 upstream. + +Currently we will not generate FS_OPEN events for O_PATH file +descriptors but we will generate FS_CLOSE events for them. This is +asymmetry is confusing. Arguably no fsnotify events should be generated +for O_PATH file descriptors as they cannot be used to access or modify +file content, they are just convenient handles to file objects like +paths. So fix the asymmetry by stopping to generate FS_CLOSE for O_PATH +file descriptors. + +Cc: +Signed-off-by: Jan Kara +Link: https://lore.kernel.org/r/20240617162303.1596-1-jack@suse.cz +Reviewed-by: Amir Goldstein +Signed-off-by: Christian Brauner +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/fsnotify.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/include/linux/fsnotify.h ++++ b/include/linux/fsnotify.h +@@ -62,7 +62,13 @@ static inline int fsnotify_perm(struct f + struct inode *inode = file_inode(file); + __u32 fsnotify_mask = 0; + +- if (file->f_mode & FMODE_NONOTIFY) ++ /* ++ * FMODE_NONOTIFY are fds generated by fanotify itself which should not ++ * generate new events. We also don't want to generate events for ++ * FMODE_PATH fds (involves open & close events) as they are just ++ * handle creation / destruction events and not "real" file events. ++ */ ++ if (file->f_mode & (FMODE_NONOTIFY | FMODE_PATH)) + return 0; + if (!(mask & (MAY_READ | MAY_OPEN))) + return 0; diff --git a/queue-5.4/series b/queue-5.4/series index 82267a5ef7c..c176da9369b 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -34,3 +34,5 @@ inet_diag-initialize-pad-field-in-struct-inet_diag_r.patch nilfs2-fix-inode-number-range-checks.patch nilfs2-add-missing-check-for-inode-numbers-on-directory-entries.patch mm-optimize-the-redundant-loop-of-mm_update_owner_next.patch +can-kvaser_usb-explicitly-initialize-family-in-leafimx-driver_info-struct.patch +fsnotify-do-not-generate-events-for-o_path-file-descriptors.patch