Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 863212 - sys-fs/zfs-kmod-2.1.5-r4 fails to build for kernel 5.18.15
Summary: sys-fs/zfs-kmod-2.1.5-r4 fails to build for kernel 5.18.15
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-08-02 20:35 UTC by Phil Stracchino (Unix Ronin)
Modified: 2022-08-03 18:55 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Stracchino (Unix Ronin) 2022-08-02 20:35:08 UTC
This APPEARS to me to be the problem:

In file included from ./include/linux/string.h:253,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:22,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from /var/tmp/portage/sys-fs/zfs-kmod-2.1.5/work/zfs-2.1.5/include/os/linux/spl/sys/sysmacros.h:27,
                 from /var/tmp/portage/sys-fs/zfs-kmod-2.1.5/work/zfs-2.1.5/module/zfs/zfs_log.c:29:
In function ‘fortify_memset_chk’,
    inlined from ‘zfs_log_xvattr’ at /var/tmp/portage/sys-fs/zfs-kmod-2.1.5/work/zfs-2.1.5/module/zfs/zfs_log.c:131:2:
./include/linux/fortify-string.h:242:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  242 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘fortify_memset_chk’,
    inlined from ‘zfs_log_xvattr’ at /var/tmp/portage/sys-fs/zfs-kmod-2.1.5/work/zfs-2.1.5/module/zfs/zfs_log.c:133:2:
./include/linux/fortify-string.h:242:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  242 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘fortify_memcpy_chk’,
    inlined from ‘zfs_log_xvattr’ at /var/tmp/portage/sys-fs/zfs-kmod-2.1.5/work/zfs-2.1.5/module/zfs/zfs_log.c:172:3:
./include/linux/fortify-string.h:328:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  328 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘fortify_memcpy_chk’,
    inlined from ‘zfs_log_xvattr’ at /var/tmp/portage/sys-fs/zfs-kmod-2.1.5/work/zfs-2.1.5/module/zfs/zfs_log.c:178:3:
./include/linux/fortify-string.h:328:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  328 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


However, fixing this is beyond the depth of my knowledge and it's not something I want to take chances on.

This WORKS FINE with kernel 5.17.9, so there is a clear kernel dependency.  I am advised there was a 5.18 compatibility patch at some point before 5.18.15, but it appears subsequent changes in the kernel broke it again.



I am advised that 

Reproducible: Always
Comment 1 wippie 2022-08-03 00:03:15 UTC
Seems to be the same for all 5.18.* kernels
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-03 00:09:53 UTC
Please test https://github.com/openzfs/zfs/pull/13684.patch.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-03 00:20:55 UTC
(In reply to Sam James from comment #2)
> Please test https://github.com/openzfs/zfs/pull/13684.patch.

FWIW, I did have my eye on this before, but it hadn't been backported yet, and it was a bit large. But this is the backport variant so we can proceed now.

I did backport a small part already for bug 855182.
Comment 4 wippie 2022-08-03 00:23:51 UTC
Replacing the current 2.1.5-build-issues.patch in portage zfs-kmod/files with the 13684.patch above made it build for gentoo-sources-5.18.15. Haven't tested with other kernels yet, Will do tomorrow as it's late here.
Comment 5 Larry the Git Cow gentoo-dev 2022-08-03 04:35:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9059463a8b642a8d4a8d5a2a25fb38a49be8c2e6

commit 9059463a8b642a8d4a8d5a2a25fb38a49be8c2e6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-08-03 04:18:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-03 04:35:46 +0000

    sys-fs/zfs: backport various fixes
    
    Mostly build fixes (https://github.com/openzfs/zfs/pull/13684)
    but also https://github.com/openzfs/zfs/pull/13714.
    
    All from upstream zfs-2.1.6-staging branch.
    
    Temporarily unkeyworded.
    
    Bug: https://bugs.gentoo.org/863212
    Bug: https://bugs.gentoo.org/855182
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/zfs/Manifest                               |   1 +
 sys-fs/zfs/zfs-2.1.5-r5.ebuild                    | 334 ++++++++++++++++++++++
 sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild | 138 +++++++++
 3 files changed, 473 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b658334aaa40c30c08d1e003c11135507b83174

commit 2b658334aaa40c30c08d1e003c11135507b83174
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-08-03 04:18:24 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-03 04:35:22 +0000

    sys-fs/zfs-kmod: backport various fixes
    
    Mostly build fixes (https://github.com/openzfs/zfs/pull/13684)
    but also https://github.com/openzfs/zfs/pull/13714.
    
    All from upstream zfs-2.1.6-staging branch.
    
    Temporarily unkeyworded.
    
    Bug: https://bugs.gentoo.org/855182
    Bug: https://bugs.gentoo.org/863212
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/zfs-kmod/Manifest                 |   1 +
 sys-fs/zfs-kmod/zfs-kmod-2.1.5-r1.ebuild | 221 +++++++++++++++++++++++++++++++
 2 files changed, 222 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2022-08-03 18:55:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=153564d2412de6e1a4c73ef9589de972b694210d

commit 153564d2412de6e1a4c73ef9589de972b694210d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-08-03 18:55:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-03 18:55:00 +0000

    sys-fs/zfs-kmod: keyword 2.1.5-r1
    
    Bug: https://bugs.gentoo.org/863212
    Bug: https://bugs.gentoo.org/855182
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/zfs-kmod/zfs-kmod-2.1.5-r1.ebuild | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d88628119552af50c68386c1e0174f99bd54eab5

commit d88628119552af50c68386c1e0174f99bd54eab5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-08-03 18:54:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-03 18:54:39 +0000

    sys-fs/zfs: keyword 2.1.5-r5
    
    Bug: https://bugs.gentoo.org/863212
    Bug: https://bugs.gentoo.org/855182
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/zfs/zfs-2.1.5-r5.ebuild | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)