Bug 210021 - IB/rxe: build error due to unmet dependency for CRYPTO_CRC32 by RDMA_RXE
Summary: IB/rxe: build error due to unmet dependency for CRYPTO_CRC32 by RDMA_RXE
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Infiniband/RDMA (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_infiniband-rdma
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-03 11:32 UTC by Necip Fazil Yildiran
Modified: 2020-11-03 15:30 UTC (History)
4 users (show)

See Also:
Kernel Version: 5.4.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
reproduce.tar.gz (103.48 KB, application/gzip)
2020-11-03 11:32 UTC, Necip Fazil Yildiran
Details

Description Necip Fazil Yildiran 2020-11-03 11:32:05 UTC
Created attachment 293417 [details]
reproduce.tar.gz

Attachment (reproduce.tar.gz) content:
 - sample.config: Config file to reproduce the bug.
 - build_out.txt: Output of Kbuild including the error messages.

When RDMA_RXE is enabled and CRYPTO is disabled, it results in the
following Kbuild warning:

WARNING: unmet direct dependencies detected for CRYPTO_CRC32
  Depends on [n]: CRYPTO [=n]
  Selected by [y]:
  - RDMA_RXE [=y] && (INFINIBAND_USER_ACCESS [=y] || !INFINIBAND_USER_ACCESS [=y]) && INET [=y] && PCI [=y] && INFINIBAND [=y] && (!64BIT [=y] || ARCH_DMA_ADDR_T_64BIT [=y])

Building the kernel fails due to this unmet direct dependency issue as follows:

[...]
  LD      .tmp_vmlinux1
crypto/crc32_generic.o: In function `crc32_mod_fini':
crc32_generic.c:(.exit.text+0x8): undefined reference to `crypto_unregister_shash'
crypto/crc32_generic.o: In function `crc32_mod_init':
crc32_generic.c:(.init.text+0x8): undefined reference to `crypto_register_shash'
drivers/infiniband/sw/rxe/rxe.o: In function `rxe_dealloc':
rxe.c:(.text+0x102): undefined reference to `crypto_destroy_tfm'
drivers/infiniband/sw/rxe/rxe_req.o: In function `rxe_crc32.isra.17':
rxe_req.c:(.text+0x219): undefined reference to `crypto_shash_update'
drivers/infiniband/sw/rxe/rxe_recv.o: In function `rxe_crc32.isra.7':
rxe_recv.c:(.text+0xeb): undefined reference to `crypto_shash_update'
drivers/infiniband/sw/rxe/rxe_verbs.o: In function `rxe_register_device':
rxe_verbs.c:(.text+0x117d): undefined reference to `crypto_alloc_shash'
drivers/infiniband/sw/rxe/rxe_mr.o: In function `rxe_crc32.isra.3':
rxe_mr.c:(.text+0x13b): undefined reference to `crypto_shash_update'
drivers/infiniband/sw/rxe/rxe_icrc.o: In function `rxe_crc32.isra.0':
rxe_icrc.c:(.text+0x26): undefined reference to `crypto_shash_update'
Makefile:1077: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Steps to reproduce the bug for v5.4.4:
  1. wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
  2. chmod +x ~/bin/make.cross
  3. tar -xvf reproduce.tar.gz # sample.config and build_out.txt
  4. cp sample.config path/to/linux-source-v5.4.4/.config
  5. cd path/to/linux-source-v5.4.4/
  6. ~/bin/make.cross ARCH=x86_64 clean
  7. ~/bin/make.cross ARCH=x86_64 olddefconfig # unmet direct dependency warning
  8. ~/bin/make.cross ARCH=x86_64 # should have a build error

The output for the steps [6-8] can be found in build_out.txt.

The build error happens as follows: RDMA_RXE selects CRYPTO_CRC32.
CRYPTO_CRC32 selects CRYPTO_HASH, and CRYPTO_HASH selects CRYPTO_HASH2.
When RDMA_RXE selects CRYPTO_CRC32 without accounting for its direct
dependency (CRYPTO), CRYPTO_CRC32 gets enabled but it does not select
CRYPTO_HASH thus CRYPTO_HASH2. Consequently, the required functions
such crypto_unregister_shash are left undefined, causing the build error.

Thanks,
Necip
Comment 1 zyjzyj2000 2020-11-03 14:31:04 UTC
On Tue, Nov 3, 2020 at 7:33 PM <bugzilla-daemon@bugzilla.kernel.org> wrote:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=210021
>
>             Bug ID: 210021
>            Summary: IB/rxe: build error due to unmet dependency for
>                     CRYPTO_CRC32 by RDMA_RXE
>            Product: Drivers
>            Version: 2.5
>     Kernel Version: 5.4.4
>           Hardware: All
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Infiniband/RDMA
>           Assignee: drivers_infiniband-rdma@kernel-bugs.osdl.org
>           Reporter: fazilyildiran@gmail.com
>                 CC: dledford@redhat.com, fazilyildiran@gmail.com,
>                     leon@leon.nu, paul@pgazz.com
>         Regression: No
>
> Created attachment 293417 [details]
>   --> https://bugzilla.kernel.org/attachment.cgi?id=293417&action=edit
> reproduce.tar.gz
>
> Attachment (reproduce.tar.gz) content:
>  - sample.config: Config file to reproduce the bug.
>  - build_out.txt: Output of Kbuild including the error messages.
>
> When RDMA_RXE is enabled and CRYPTO is disabled, it results in the
> following Kbuild warning:
>
> WARNING: unmet direct dependencies detected for CRYPTO_CRC32

https://lkml.org/lkml/2020/9/15/360

Please check this mail thread.

The discussion is in the above link.

Zhu Yanjun

>   Depends on [n]: CRYPTO [=n]
>   Selected by [y]:
>   - RDMA_RXE [=y] && (INFINIBAND_USER_ACCESS [=y] || !INFINIBAND_USER_ACCESS
> [=y]) && INET [=y] && PCI [=y] && INFINIBAND [=y] && (!64BIT [=y] ||
> ARCH_DMA_ADDR_T_64BIT [=y])
>
> Building the kernel fails due to this unmet direct dependency issue as
> follows:
>
> [...]
>   LD      .tmp_vmlinux1
> crypto/crc32_generic.o: In function `crc32_mod_fini':
> crc32_generic.c:(.exit.text+0x8): undefined reference to
> `crypto_unregister_shash'
> crypto/crc32_generic.o: In function `crc32_mod_init':
> crc32_generic.c:(.init.text+0x8): undefined reference to
> `crypto_register_shash'
> drivers/infiniband/sw/rxe/rxe.o: In function `rxe_dealloc':
> rxe.c:(.text+0x102): undefined reference to `crypto_destroy_tfm'
> drivers/infiniband/sw/rxe/rxe_req.o: In function `rxe_crc32.isra.17':
> rxe_req.c:(.text+0x219): undefined reference to `crypto_shash_update'
> drivers/infiniband/sw/rxe/rxe_recv.o: In function `rxe_crc32.isra.7':
> rxe_recv.c:(.text+0xeb): undefined reference to `crypto_shash_update'
> drivers/infiniband/sw/rxe/rxe_verbs.o: In function `rxe_register_device':
> rxe_verbs.c:(.text+0x117d): undefined reference to `crypto_alloc_shash'
> drivers/infiniband/sw/rxe/rxe_mr.o: In function `rxe_crc32.isra.3':
> rxe_mr.c:(.text+0x13b): undefined reference to `crypto_shash_update'
> drivers/infiniband/sw/rxe/rxe_icrc.o: In function `rxe_crc32.isra.0':
> rxe_icrc.c:(.text+0x26): undefined reference to `crypto_shash_update'
> Makefile:1077: recipe for target 'vmlinux' failed
> make: *** [vmlinux] Error 1
>
> Steps to reproduce the bug for v5.4.4:
>   1. wget
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
> ~/bin/make.cross
>   2. chmod +x ~/bin/make.cross
>   3. tar -xvf reproduce.tar.gz # sample.config and build_out.txt
>   4. cp sample.config path/to/linux-source-v5.4.4/.config
>   5. cd path/to/linux-source-v5.4.4/
>   6. ~/bin/make.cross ARCH=x86_64 clean
>   7. ~/bin/make.cross ARCH=x86_64 olddefconfig # unmet direct dependency
> warning
>   8. ~/bin/make.cross ARCH=x86_64 # should have a build error
>
> The output for the steps [6-8] can be found in build_out.txt.
>
> The build error happens as follows: RDMA_RXE selects CRYPTO_CRC32.
> CRYPTO_CRC32 selects CRYPTO_HASH, and CRYPTO_HASH selects CRYPTO_HASH2.
> When RDMA_RXE selects CRYPTO_CRC32 without accounting for its direct
> dependency (CRYPTO), CRYPTO_CRC32 gets enabled but it does not select
> CRYPTO_HASH thus CRYPTO_HASH2. Consequently, the required functions
> such crypto_unregister_shash are left undefined, causing the build error.
>
> Thanks,
> Necip
>
> --
> You are receiving this mail because:
> You are watching the assignee of the bug.
Comment 2 jgg 2020-11-03 15:30:57 UTC
On Tue, Nov 03, 2020 at 10:30:50PM +0800, Zhu Yanjun wrote:
> On Tue, Nov 3, 2020 at 7:33 PM <bugzilla-daemon@bugzilla.kernel.org> wrote:
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=210021
> >
> >             Bug ID: 210021
> >            Summary: IB/rxe: build error due to unmet dependency for
> >                     CRYPTO_CRC32 by RDMA_RXE
> >            Product: Drivers
> >            Version: 2.5
> >     Kernel Version: 5.4.4
> >           Hardware: All
> >                 OS: Linux
> >               Tree: Mainline
> >             Status: NEW
> >           Severity: normal
> >           Priority: P1
> >          Component: Infiniband/RDMA
> >           Assignee: drivers_infiniband-rdma@kernel-bugs.osdl.org
> >           Reporter: fazilyildiran@gmail.com
> >                 CC: dledford@redhat.com, fazilyildiran@gmail.com,
> >                     leon@leon.nu, paul@pgazz.com
> >         Regression: No
> >
> > Created attachment 293417 [details]
> > reproduce.tar.gz
> >
> > Attachment (reproduce.tar.gz) content:
> >  - sample.config: Config file to reproduce the bug.
> >  - build_out.txt: Output of Kbuild including the error messages.
> >
> > When RDMA_RXE is enabled and CRYPTO is disabled, it results in the
> > following Kbuild warning:
> >
> > WARNING: unmet direct dependencies detected for CRYPTO_CRC32
> 
> https://lkml.org/lkml/2020/9/15/360
> 
> Please check this mail thread.
> 
> The discussion is in the above link.

I'd like crypto people to weight on what is proper here

Jason

Note You need to log in before you can comment on or make changes to this bug.