From: Greg Kroah-Hartman Date: Tue, 21 Jun 2022 11:13:36 +0000 (+0200) Subject: drop netfs-gcc-12-temporarily-disable-wattribute-warning-.patch from 5.15 and older X-Git-Tag: v5.4.200~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=071d0ed67fa0e8905f8f4726dd31b6acadcc2529;p=thirdparty%2Fkernel%2Fstable-queue.git drop netfs-gcc-12-temporarily-disable-wattribute-warning-.patch from 5.15 and older --- diff --git a/queue-4.19/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch b/queue-4.19/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch deleted file mode 100644 index 87716ba558d..00000000000 --- a/queue-4.19/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch +++ /dev/null @@ -1,110 +0,0 @@ -From b28a7ad2c6e381340a4e3a51b45fe4279684f836 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Jun 2022 11:29:36 -0700 -Subject: netfs: gcc-12: temporarily disable '-Wattribute-warning' for now -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Linus Torvalds - -[ Upstream commit 507160f46c55913955d272ebf559d63809a8e560 ] - -This is a pure band-aid so that I can continue merging stuff from people -while some of the gcc-12 fallout gets sorted out. - -In particular, gcc-12 is very unhappy about the kinds of pointer -arithmetic tricks that netfs does, and that makes the fortify checks -trigger in afs and ceph: - - In function ‘fortify_memset_chk’, - inlined from ‘netfs_i_context_init’ at include/linux/netfs.h:327:2, - inlined from ‘afs_set_netfs_context’ at fs/afs/inode.c:61:2, - inlined from ‘afs_root_iget’ at fs/afs/inode.c:543:2: - include/linux/fortify-string.h:258:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] - 258 | __write_overflow_field(p_size_field, size); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -and the reason is that netfs_i_context_init() is passed a 'struct inode' -pointer, and then it does - - struct netfs_i_context *ctx = netfs_i_context(inode); - - memset(ctx, 0, sizeof(*ctx)); - -where that netfs_i_context() function just does pointer arithmetic on -the inode pointer, knowing that the netfs_i_context is laid out -immediately after it in memory. - -This is all truly disgusting, since the whole "netfs_i_context is laid -out immediately after it in memory" is not actually remotely true in -general, but is just made to be that way for afs and ceph. - -See for example fs/cifs/cifsglob.h: - - struct cifsInodeInfo { - struct { - /* These must be contiguous */ - struct inode vfs_inode; /* the VFS's inode record */ - struct netfs_i_context netfs_ctx; /* Netfslib context */ - }; - [...] - -and realize that this is all entirely wrong, and the pointer arithmetic -that netfs_i_context() is doing is also very very wrong and wouldn't -give the right answer if netfs_ctx had different alignment rules from a -'struct inode', for example). - -Anyway, that's just a long-winded way to say "the gcc-12 warning is -actually quite reasonable, and our code happens to work but is pretty -disgusting". - -This is getting fixed properly, but for now I made the mistake of -thinking "the week right after the merge window tends to be calm for me -as people take a breather" and I did a sustem upgrade. And I got gcc-12 -as a result, so to continue merging fixes from people and not have the -end result drown in warnings, I am fixing all these gcc-12 issues I hit. - -Including with these kinds of temporary fixes. - -Cc: Kees Cook -Cc: David Howells -Link: https://lore.kernel.org/all/AEEBCF5D-8402-441D-940B-105AA718C71F@chromium.org/ -Signed-off-by: Linus Torvalds -Signed-off-by: Sasha Levin ---- - fs/afs/inode.c | 3 +++ - fs/ceph/inode.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/fs/afs/inode.c b/fs/afs/inode.c -index a12ae3ef8fb4..4ed71605941d 100644 ---- a/fs/afs/inode.c -+++ b/fs/afs/inode.c -@@ -24,6 +24,9 @@ - #include - #include "internal.h" - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - static const struct inode_operations afs_symlink_inode_operations = { - .get_link = page_get_link, - .listxattr = afs_listxattr, -diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c -index 5f041fede7aa..93ae3a912d8f 100644 ---- a/fs/ceph/inode.c -+++ b/fs/ceph/inode.c -@@ -19,6 +19,9 @@ - #include "cache.h" - #include - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - /* - * Ceph inode operations - * --- -2.35.1 - diff --git a/queue-4.19/series b/queue-4.19/series index 5871f045265..75f0aecb69f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -195,7 +195,6 @@ virtio-mmio-fix-missing-put_device-when-vm_cmdline_p.patch nfc-nfcmrvl-fix-memory-leak-in-nfcmrvl_play_deferred.patch ipv6-fix-signed-integer-overflow-in-l2tp_ip6_sendmsg.patch net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch -netfs-gcc-12-temporarily-disable-wattribute-warning-.patch random-credit-cpu-and-bootloader-seeds-by-default.patch pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch i40e-fix-adding-adq-filter-to-tc0.patch diff --git a/queue-5.10/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch b/queue-5.10/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch deleted file mode 100644 index 4925b65d4d5..00000000000 --- a/queue-5.10/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch +++ /dev/null @@ -1,110 +0,0 @@ -From ed12458e3981320a74f9d536da9fbe32fa634159 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Jun 2022 11:29:36 -0700 -Subject: netfs: gcc-12: temporarily disable '-Wattribute-warning' for now -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Linus Torvalds - -[ Upstream commit 507160f46c55913955d272ebf559d63809a8e560 ] - -This is a pure band-aid so that I can continue merging stuff from people -while some of the gcc-12 fallout gets sorted out. - -In particular, gcc-12 is very unhappy about the kinds of pointer -arithmetic tricks that netfs does, and that makes the fortify checks -trigger in afs and ceph: - - In function ‘fortify_memset_chk’, - inlined from ‘netfs_i_context_init’ at include/linux/netfs.h:327:2, - inlined from ‘afs_set_netfs_context’ at fs/afs/inode.c:61:2, - inlined from ‘afs_root_iget’ at fs/afs/inode.c:543:2: - include/linux/fortify-string.h:258:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] - 258 | __write_overflow_field(p_size_field, size); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -and the reason is that netfs_i_context_init() is passed a 'struct inode' -pointer, and then it does - - struct netfs_i_context *ctx = netfs_i_context(inode); - - memset(ctx, 0, sizeof(*ctx)); - -where that netfs_i_context() function just does pointer arithmetic on -the inode pointer, knowing that the netfs_i_context is laid out -immediately after it in memory. - -This is all truly disgusting, since the whole "netfs_i_context is laid -out immediately after it in memory" is not actually remotely true in -general, but is just made to be that way for afs and ceph. - -See for example fs/cifs/cifsglob.h: - - struct cifsInodeInfo { - struct { - /* These must be contiguous */ - struct inode vfs_inode; /* the VFS's inode record */ - struct netfs_i_context netfs_ctx; /* Netfslib context */ - }; - [...] - -and realize that this is all entirely wrong, and the pointer arithmetic -that netfs_i_context() is doing is also very very wrong and wouldn't -give the right answer if netfs_ctx had different alignment rules from a -'struct inode', for example). - -Anyway, that's just a long-winded way to say "the gcc-12 warning is -actually quite reasonable, and our code happens to work but is pretty -disgusting". - -This is getting fixed properly, but for now I made the mistake of -thinking "the week right after the merge window tends to be calm for me -as people take a breather" and I did a sustem upgrade. And I got gcc-12 -as a result, so to continue merging fixes from people and not have the -end result drown in warnings, I am fixing all these gcc-12 issues I hit. - -Including with these kinds of temporary fixes. - -Cc: Kees Cook -Cc: David Howells -Link: https://lore.kernel.org/all/AEEBCF5D-8402-441D-940B-105AA718C71F@chromium.org/ -Signed-off-by: Linus Torvalds -Signed-off-by: Sasha Levin ---- - fs/afs/inode.c | 3 +++ - fs/ceph/inode.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/fs/afs/inode.c b/fs/afs/inode.c -index 7e7a9454bcb9..942badb9b24b 100644 ---- a/fs/afs/inode.c -+++ b/fs/afs/inode.c -@@ -25,6 +25,9 @@ - #include "internal.h" - #include "afs_fs.h" - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - static const struct inode_operations afs_symlink_inode_operations = { - .get_link = page_get_link, - }; -diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c -index 76be50f6f041..394501d347f4 100644 ---- a/fs/ceph/inode.c -+++ b/fs/ceph/inode.c -@@ -20,6 +20,9 @@ - #include "cache.h" - #include - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - /* - * Ceph inode operations - * --- -2.35.1 - diff --git a/queue-5.10/series b/queue-5.10/series index 1e3558cc56d..72fdabc3049 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -28,7 +28,6 @@ nfc-nfcmrvl-fix-memory-leak-in-nfcmrvl_play_deferred.patch ipv6-fix-signed-integer-overflow-in-l2tp_ip6_sendmsg.patch net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch mellanox-mlx5-avoid-uninitialized-variable-warning-w.patch -netfs-gcc-12-temporarily-disable-wattribute-warning-.patch mips-loongson-3-fix-compile-mips-cpu_hwmon-as-module.patch gpio-dwapb-don-t-print-error-on-eprobe_defer.patch random-credit-cpu-and-bootloader-seeds-by-default.patch diff --git a/queue-5.15/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch b/queue-5.15/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch deleted file mode 100644 index a0b0bf0f72b..00000000000 --- a/queue-5.15/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 1fe2d432f71b31f159707aa4542efd1ada85431e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Jun 2022 11:29:36 -0700 -Subject: netfs: gcc-12: temporarily disable '-Wattribute-warning' for now -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Linus Torvalds - -[ Upstream commit 507160f46c55913955d272ebf559d63809a8e560 ] - -This is a pure band-aid so that I can continue merging stuff from people -while some of the gcc-12 fallout gets sorted out. - -In particular, gcc-12 is very unhappy about the kinds of pointer -arithmetic tricks that netfs does, and that makes the fortify checks -trigger in afs and ceph: - - In function ‘fortify_memset_chk’, - inlined from ‘netfs_i_context_init’ at include/linux/netfs.h:327:2, - inlined from ‘afs_set_netfs_context’ at fs/afs/inode.c:61:2, - inlined from ‘afs_root_iget’ at fs/afs/inode.c:543:2: - include/linux/fortify-string.h:258:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] - 258 | __write_overflow_field(p_size_field, size); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -and the reason is that netfs_i_context_init() is passed a 'struct inode' -pointer, and then it does - - struct netfs_i_context *ctx = netfs_i_context(inode); - - memset(ctx, 0, sizeof(*ctx)); - -where that netfs_i_context() function just does pointer arithmetic on -the inode pointer, knowing that the netfs_i_context is laid out -immediately after it in memory. - -This is all truly disgusting, since the whole "netfs_i_context is laid -out immediately after it in memory" is not actually remotely true in -general, but is just made to be that way for afs and ceph. - -See for example fs/cifs/cifsglob.h: - - struct cifsInodeInfo { - struct { - /* These must be contiguous */ - struct inode vfs_inode; /* the VFS's inode record */ - struct netfs_i_context netfs_ctx; /* Netfslib context */ - }; - [...] - -and realize that this is all entirely wrong, and the pointer arithmetic -that netfs_i_context() is doing is also very very wrong and wouldn't -give the right answer if netfs_ctx had different alignment rules from a -'struct inode', for example). - -Anyway, that's just a long-winded way to say "the gcc-12 warning is -actually quite reasonable, and our code happens to work but is pretty -disgusting". - -This is getting fixed properly, but for now I made the mistake of -thinking "the week right after the merge window tends to be calm for me -as people take a breather" and I did a sustem upgrade. And I got gcc-12 -as a result, so to continue merging fixes from people and not have the -end result drown in warnings, I am fixing all these gcc-12 issues I hit. - -Including with these kinds of temporary fixes. - -Cc: Kees Cook -Cc: David Howells -Link: https://lore.kernel.org/all/AEEBCF5D-8402-441D-940B-105AA718C71F@chromium.org/ -Signed-off-by: Linus Torvalds -Signed-off-by: Sasha Levin ---- - fs/afs/inode.c | 3 +++ - fs/ceph/inode.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/fs/afs/inode.c b/fs/afs/inode.c -index a47666ba48f5..5c5b3cb05a5f 100644 ---- a/fs/afs/inode.c -+++ b/fs/afs/inode.c -@@ -25,6 +25,9 @@ - #include "internal.h" - #include "afs_fs.h" - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - static const struct inode_operations afs_symlink_inode_operations = { - .get_link = page_get_link, - }; -diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c -index 42e449d3f18b..2fc5ea85f08d 100644 ---- a/fs/ceph/inode.c -+++ b/fs/ceph/inode.c -@@ -20,6 +20,9 @@ - #include "cache.h" - #include - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - /* - * Ceph inode operations - * --- -2.35.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 06a0a834bc0..cfb934db7a3 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -34,7 +34,6 @@ ipv6-fix-signed-integer-overflow-in-l2tp_ip6_sendmsg.patch net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch gcc-12-disable-wdangling-pointer-warning-for-now.patch mellanox-mlx5-avoid-uninitialized-variable-warning-w.patch -netfs-gcc-12-temporarily-disable-wattribute-warning-.patch mips-loongson-3-fix-compile-mips-cpu_hwmon-as-module.patch random-credit-cpu-and-bootloader-seeds-by-default.patch gpio-dwapb-don-t-print-error-on-eprobe_defer.patch diff --git a/queue-5.4/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch b/queue-5.4/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch deleted file mode 100644 index e078cf547bf..00000000000 --- a/queue-5.4/netfs-gcc-12-temporarily-disable-wattribute-warning-.patch +++ /dev/null @@ -1,110 +0,0 @@ -From cbb3c5b4b3c63115b75577e6bee6ea3e88aa1053 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Jun 2022 11:29:36 -0700 -Subject: netfs: gcc-12: temporarily disable '-Wattribute-warning' for now -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Linus Torvalds - -[ Upstream commit 507160f46c55913955d272ebf559d63809a8e560 ] - -This is a pure band-aid so that I can continue merging stuff from people -while some of the gcc-12 fallout gets sorted out. - -In particular, gcc-12 is very unhappy about the kinds of pointer -arithmetic tricks that netfs does, and that makes the fortify checks -trigger in afs and ceph: - - In function ‘fortify_memset_chk’, - inlined from ‘netfs_i_context_init’ at include/linux/netfs.h:327:2, - inlined from ‘afs_set_netfs_context’ at fs/afs/inode.c:61:2, - inlined from ‘afs_root_iget’ at fs/afs/inode.c:543:2: - include/linux/fortify-string.h:258:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] - 258 | __write_overflow_field(p_size_field, size); - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -and the reason is that netfs_i_context_init() is passed a 'struct inode' -pointer, and then it does - - struct netfs_i_context *ctx = netfs_i_context(inode); - - memset(ctx, 0, sizeof(*ctx)); - -where that netfs_i_context() function just does pointer arithmetic on -the inode pointer, knowing that the netfs_i_context is laid out -immediately after it in memory. - -This is all truly disgusting, since the whole "netfs_i_context is laid -out immediately after it in memory" is not actually remotely true in -general, but is just made to be that way for afs and ceph. - -See for example fs/cifs/cifsglob.h: - - struct cifsInodeInfo { - struct { - /* These must be contiguous */ - struct inode vfs_inode; /* the VFS's inode record */ - struct netfs_i_context netfs_ctx; /* Netfslib context */ - }; - [...] - -and realize that this is all entirely wrong, and the pointer arithmetic -that netfs_i_context() is doing is also very very wrong and wouldn't -give the right answer if netfs_ctx had different alignment rules from a -'struct inode', for example). - -Anyway, that's just a long-winded way to say "the gcc-12 warning is -actually quite reasonable, and our code happens to work but is pretty -disgusting". - -This is getting fixed properly, but for now I made the mistake of -thinking "the week right after the merge window tends to be calm for me -as people take a breather" and I did a sustem upgrade. And I got gcc-12 -as a result, so to continue merging fixes from people and not have the -end result drown in warnings, I am fixing all these gcc-12 issues I hit. - -Including with these kinds of temporary fixes. - -Cc: Kees Cook -Cc: David Howells -Link: https://lore.kernel.org/all/AEEBCF5D-8402-441D-940B-105AA718C71F@chromium.org/ -Signed-off-by: Linus Torvalds -Signed-off-by: Sasha Levin ---- - fs/afs/inode.c | 3 +++ - fs/ceph/inode.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/fs/afs/inode.c b/fs/afs/inode.c -index 90eac3ec01cb..243ba4e0ab1f 100644 ---- a/fs/afs/inode.c -+++ b/fs/afs/inode.c -@@ -25,6 +25,9 @@ - #include "internal.h" - #include "afs_fs.h" - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - static const struct inode_operations afs_symlink_inode_operations = { - .get_link = page_get_link, - }; -diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c -index af85a7237604..d7e0f7cd3768 100644 ---- a/fs/ceph/inode.c -+++ b/fs/ceph/inode.c -@@ -20,6 +20,9 @@ - #include "cache.h" - #include - -+// Temporary: netfs does disgusting things with inode pointers -+#pragma GCC diagnostic ignored "-Wattribute-warning" -+ - /* - * Ceph inode operations - * --- -2.35.1 - diff --git a/queue-5.4/series b/queue-5.4/series index cee6f59b085..2b1a5036da8 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -200,7 +200,6 @@ virtio-mmio-fix-missing-put_device-when-vm_cmdline_p.patch nfc-nfcmrvl-fix-memory-leak-in-nfcmrvl_play_deferred.patch ipv6-fix-signed-integer-overflow-in-l2tp_ip6_sendmsg.patch net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch -netfs-gcc-12-temporarily-disable-wattribute-warning-.patch random-credit-cpu-and-bootloader-seeds-by-default.patch pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch clocksource-hyper-v-unexport-__init-annotated-hv_ini.patch