]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jul 2024 12:42:44 +0000 (14:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jul 2024 12:42:44 +0000 (14:42 +0200)
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

queue-5.4/can-kvaser_usb-explicitly-initialize-family-in-leafimx-driver_info-struct.patch [new file with mode: 0644]
queue-5.4/fsnotify-do-not-generate-events-for-o_path-file-descriptors.patch [new file with mode: 0644]
queue-5.4/series

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 (file)
index 0000000..1cc3a7f
--- /dev/null
@@ -0,0 +1,33 @@
+From 19d5b2698c35b2132a355c67b4d429053804f8cc Mon Sep 17 00:00:00 2001
+From: Jimmy Assarsson <extja@kvaser.com>
+Date: Fri, 28 Jun 2024 21:45:29 +0200
+Subject: can: kvaser_usb: Explicitly initialize family in leafimx driver_info struct
+
+From: Jimmy Assarsson <extja@kvaser.com>
+
+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 <extja@kvaser.com>
+Link: https://lore.kernel.org/all/20240628194529.312968-1-extja@kvaser.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..b4e2d1c
--- /dev/null
@@ -0,0 +1,44 @@
+From 702eb71fd6501b3566283f8c96d7ccc6ddd662e9 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 17 Jun 2024 18:23:00 +0200
+Subject: fsnotify: Do not generate events for O_PATH file descriptors
+
+From: Jan Kara <jack@suse.cz>
+
+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: <stable@vger.kernel.org>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Link: https://lore.kernel.org/r/20240617162303.1596-1-jack@suse.cz
+Reviewed-by: Amir Goldstein <amir73il@gmail.com>
+Signed-off-by: Christian Brauner <brauner@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
index 82267a5ef7c1070977abfa3f5a0833e97bc4e5ce..c176da9369b4154c5daa08e2b8a1d19c73254913 100644 (file)
@@ -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