diff options
-rw-r--r-- | queue-6.1/fbdev-hyperv_fb-convert-comma-to-semicolon.patch | 30 | ||||
-rw-r--r-- | queue-6.1/fs-omfs-use-flexible-array-member-in-struct-omfs_extent.patch | 115 | ||||
-rw-r--r-- | queue-6.1/series | 2 |
3 files changed, 147 insertions, 0 deletions
diff --git a/queue-6.1/fbdev-hyperv_fb-convert-comma-to-semicolon.patch b/queue-6.1/fbdev-hyperv_fb-convert-comma-to-semicolon.patch new file mode 100644 index 0000000000..1a6064cc8a --- /dev/null +++ b/queue-6.1/fbdev-hyperv_fb-convert-comma-to-semicolon.patch @@ -0,0 +1,30 @@ +From 27f22f897095b09df32bf689b63624d23b0c8ebc Mon Sep 17 00:00:00 2001 +From: Chen Ni <nichen@iscas.ac.cn> +Date: Mon, 2 Sep 2024 15:44:02 +0800 +Subject: fbdev: hyperv_fb: Convert comma to semicolon + +From: Chen Ni <nichen@iscas.ac.cn> + +commit 27f22f897095b09df32bf689b63624d23b0c8ebc upstream. + +Replace a comma between expression statements by a semicolon. + +Fixes: d786e00d19f9 ("drivers: hv, hyperv_fb: Untangle and refactor Hyper-V panic notifiers") +Signed-off-by: Chen Ni <nichen@iscas.ac.cn> +Signed-off-by: Helge Deller <deller@gmx.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/video/fbdev/hyperv_fb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/video/fbdev/hyperv_fb.c ++++ b/drivers/video/fbdev/hyperv_fb.c +@@ -1217,7 +1217,7 @@ static int hvfb_probe(struct hv_device * + * which is almost at the end of list, with priority = INT_MIN + 1. + */ + par->hvfb_panic_nb.notifier_call = hvfb_on_panic; +- par->hvfb_panic_nb.priority = INT_MIN + 10, ++ par->hvfb_panic_nb.priority = INT_MIN + 10; + atomic_notifier_chain_register(&panic_notifier_list, + &par->hvfb_panic_nb); + diff --git a/queue-6.1/fs-omfs-use-flexible-array-member-in-struct-omfs_extent.patch b/queue-6.1/fs-omfs-use-flexible-array-member-in-struct-omfs_extent.patch new file mode 100644 index 0000000000..334377c9a1 --- /dev/null +++ b/queue-6.1/fs-omfs-use-flexible-array-member-in-struct-omfs_extent.patch @@ -0,0 +1,115 @@ +From 4d8cbf6dbcdaebe949461b0a933ae4c71cb53edc Mon Sep 17 00:00:00 2001 +From: "Gustavo A. R. Silva" <gustavoars@kernel.org> +Date: Fri, 14 Jul 2023 13:56:37 -0600 +Subject: fs: omfs: Use flexible-array member in struct omfs_extent + +From: Gustavo A. R. Silva <gustavoars@kernel.org> + +commit 4d8cbf6dbcdaebe949461b0a933ae4c71cb53edc upstream. + +Memory for 'struct omfs_extent' and a 'e_extent_count' number of extent +entries is indirectly allocated through 'bh->b_data', which is a pointer +to data within the page. This implies that the member 'e_entry' +(which is the start of extent entries) functions more like an array than +a single object of type 'struct omfs_extent_entry'. + +So we better turn this object into a proper array, in this case a +flexible-array member, and with that, fix the following +-Wstringop-overflow warning seen after building s390 architecture with +allyesconfig (GCC 13): + +fs/omfs/file.c: In function 'omfs_grow_extent': +include/linux/fortify-string.h:57:33: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=] + 57 | #define __underlying_memcpy __builtin_memcpy + | ^ +include/linux/fortify-string.h:648:9: note: in expansion of macro '__underlying_memcpy' + 648 | __underlying_##op(p, q, __fortify_size); \ + | ^~~~~~~~~~~~~ +include/linux/fortify-string.h:693:26: note: in expansion of macro '__fortify_memcpy_chk' + 693 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ + | ^~~~~~~~~~~~~~~~~~~~ +fs/omfs/file.c:170:9: note: in expansion of macro 'memcpy' + 170 | memcpy(terminator, entry, sizeof(struct omfs_extent_entry)); + | ^~~~~~ +In file included from fs/omfs/omfs.h:8, + from fs/omfs/file.c:11: +fs/omfs/omfs_fs.h:80:34: note: at offset 16 into destination object 'e_entry' of size 16 + 80 | struct omfs_extent_entry e_entry; /* start of extent entries */ + | ^~~~~~~ + +There are some binary differences before and after changes, but this are +expected due to the change in the size of 'struct omfs_extent' and the +necessary adjusments. + +This helps with the ongoing efforts to globally enable +-Wstringop-overflow. + +Link: https://github.com/KSPP/linux/issues/330 +Reviewed-by: Kees Cook <keescook@chromium.org> +Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + fs/omfs/file.c | 12 ++++++------ + fs/omfs/omfs_fs.h | 2 +- + 2 files changed, 7 insertions(+), 7 deletions(-) + +--- a/fs/omfs/file.c ++++ b/fs/omfs/file.c +@@ -14,7 +14,7 @@ static u32 omfs_max_extents(struct omfs_ + { + return (sbi->s_sys_blocksize - offset - + sizeof(struct omfs_extent)) / +- sizeof(struct omfs_extent_entry) + 1; ++ sizeof(struct omfs_extent_entry); + } + + void omfs_make_empty_table(struct buffer_head *bh, int offset) +@@ -24,8 +24,8 @@ void omfs_make_empty_table(struct buffer + oe->e_next = ~cpu_to_be64(0ULL); + oe->e_extent_count = cpu_to_be32(1), + oe->e_fill = cpu_to_be32(0x22), +- oe->e_entry.e_cluster = ~cpu_to_be64(0ULL); +- oe->e_entry.e_blocks = ~cpu_to_be64(0ULL); ++ oe->e_entry[0].e_cluster = ~cpu_to_be64(0ULL); ++ oe->e_entry[0].e_blocks = ~cpu_to_be64(0ULL); + } + + int omfs_shrink_inode(struct inode *inode) +@@ -68,7 +68,7 @@ int omfs_shrink_inode(struct inode *inod + + last = next; + next = be64_to_cpu(oe->e_next); +- entry = &oe->e_entry; ++ entry = oe->e_entry; + + /* ignore last entry as it is the terminator */ + for (; extent_count > 1; extent_count--) { +@@ -117,7 +117,7 @@ static int omfs_grow_extent(struct inode + u64 *ret_block) + { + struct omfs_extent_entry *terminator; +- struct omfs_extent_entry *entry = &oe->e_entry; ++ struct omfs_extent_entry *entry = oe->e_entry; + struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb); + u32 extent_count = be32_to_cpu(oe->e_extent_count); + u64 new_block = 0; +@@ -245,7 +245,7 @@ static int omfs_get_block(struct inode * + + extent_count = be32_to_cpu(oe->e_extent_count); + next = be64_to_cpu(oe->e_next); +- entry = &oe->e_entry; ++ entry = oe->e_entry; + + if (extent_count > max_extents) + goto out_brelse; +--- a/fs/omfs/omfs_fs.h ++++ b/fs/omfs/omfs_fs.h +@@ -77,7 +77,7 @@ struct omfs_extent { + __be64 e_next; /* next extent table location */ + __be32 e_extent_count; /* total # extents in this table */ + __be32 e_fill; +- struct omfs_extent_entry e_entry; /* start of extent entries */ ++ struct omfs_extent_entry e_entry[]; /* start of extent entries */ + }; + + #endif diff --git a/queue-6.1/series b/queue-6.1/series index b1ffc6ffb6..67676077b1 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -116,3 +116,5 @@ drm-i915-gem-allow-exec_capture-on-recoverable-contexts-on-dg1.patch drm-amdgpu-add-kicker-device-detection.patch ksmbd-use-unsafe_memcpy-for-ntlm_negotiate.patch ksmbd-remove-unsafe_memcpy-use-in-session-setup.patch +fs-omfs-use-flexible-array-member-in-struct-omfs_extent.patch +fbdev-hyperv_fb-convert-comma-to-semicolon.patch |