linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Dronov <vdronov@redhat.com>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, LKML <linux-kernel@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Harald Freudenberger <freude@linux.ibm.com>
Subject: Re: include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch'
Date: Mon, 4 Jul 2022 17:24:22 +0200	[thread overview]
Message-ID: <CAMusb+QJ3yvEF8rUQ7=4Xf4dGG3Bs_ZOb2muJPKQ9ftXO+mX5g@mail.gmail.com> (raw)
In-Reply-To: <CAMusb+QDk4CutzAGg-ZVmndnDh9N9q=HK1-Se=r6ebxPpdLp2g@mail.gmail.com>

Hi,

On Mon, Jul 4, 2022 at 4:58 PM Vlad Dronov <vdronov@redhat.com> wrote:
>
> Hi,
>
> On Mon, Jul 4, 2022 at 4:35 PM Vlad Dronov <vdronov@redhat.com> wrote:
> >
> > Hi,
> >
> > On Sun, Jul 3, 2022 at 12:51 AM kernel test robot <lkp@intel.com> wrote:
> > > ...
> > > config: s390-buildonly-randconfig-r005-20220703 (https://download.01.org/0day-ci/archive/20220703/202207030630.6SZVkrWf-lkp@intel.com/config)
> > > ...
> > >    s390-linux-ld: lib/crypto/chacha20poly1305.o: in function `chacha_crypt':
> > > >> include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch'
> > > >> s390-linux-ld: include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch'
> > > ...
> > > Kconfig warnings: (for reference only)
> > >    WARNING: unmet direct dependencies detected for CRYPTO_LIB_CHACHA20POLY1305
> > >    Depends on (CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA && (CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305 && CRYPTO
> >
> > Ok, this is either weird or I do not understand how the Kconfig system works.
> >
> > What I look at is CRYPTO_LIB_CHACHA20POLY1305 definition:
> >
> > [ lib/crypto/Kconfig ]
> > config CRYPTO_LIB_CHACHA20POLY1305
> >     tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)"
> >     depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
> >     depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
> >     depends on CRYPTO
> >
> > and this test's random config (s390-buildonly-randconfig-r005-20220703):
> >
> > $ grep -e CRYPTO_LIB_CHACHA20POLY1305 -e CRYPTO_ARCH_HAVE_LIB_CHACHA
> > -e CRYPTO_ARCH_HAVE_LIB_POLY1305 -e CRYPTO= config
> > CONFIG_CRYPTO=y
> > CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m
> > CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
> > // missing CRYPTO_ARCH_HAVE_LIB_POLY1305 implies =n (I guess?)
> >
> > I'm following the canonical "Kconfig Language" doc (
> > https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html )
> > which states:
> >
> > > - dependencies: “depends on” <expr>
> > > This defines a dependency for this menu entry. If multiple dependencies are defined, they are connected with ‘&&’.
> >
> > and
> >
> > >         '!' <expr>                           (6)
> > >         <expr> '&&' <expr>                   (7)
> > >         <expr> '||' <expr>                   (8)
> > >
> > > 6. Returns the result of (2-/expr/).
> > > 7. Returns the result of min(/expr/, /expr/).
> > > 8. Returns the result of max(/expr/, /expr/).
> > > An expression can have a value of ‘n’, ‘m’ or ‘y’ (or 0, 1, 2 respectively for calculations).
> >
> > So calculating:
> >
> > (CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA) &&
> > (CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305) &&
> > CRYPTO
> >
> > I find it equal to:
> >
> > (m || !m) && (n || !n) && y  =>  m && y && y  =>  m
> >
> > So CRYPTO_LIB_CHACHA20POLY1305 should be no higher than M, but it is
> > =Y in a config file => weird :\ (or me wrong somewhere).
> >
> > WDYT?
>
> Ok, I should have tested this beforehand. With the configs set as above:
>
> CONFIG_CRYPTO=y
> CONFIG_CRYPTO_CHACHA20_X86_64=m // implies the next line =m
> CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m
> CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305 is not set // =n
>
> "make menuconfig" allows only =n and =m for CRYPTO_LIB_CHACHA20POLY1305 indeed.
> So the test robot has fed an invalid config to a build process. Let me
> forward this thread to lkp@lists.01.org to report this issue.

Hi,

False alarm, I apologize.

CRYPTO_LIB_CHACHA20POLY1305=y was selected by CONFIG_WIREGUARD=y:

config WIREGUARD
    tristate "WireGuard secure network tunnel"
    depends on NET && INET
    depends on IPV6 || !IPV6
    select CRYPTO_LIB_CHACHA20POLY1305

$ grep -e CONFIG_WIREGUARD= -e CONFIG_NETDEVICES= -e CONFIG_NET_CORE=
-e CONFIG_NET= -e CONFIG_INET= -e CONFIG_IPV6= config
CONFIG_NET=y
CONFIG_INET=y
CONFIG_IPV6=y
CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
CONFIG_WIREGUARD=y

This breaks the "In general use select only for non-visible symbols
(no prompts anywhere)
and for symbols with no dependencies" rules from the "Kconfig
Language" doc, but I'm not
sure how to proceed from here.

Best regards,
Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer


  reply	other threads:[~2022-07-04 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 22:49 include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch' kernel test robot
2022-07-04 14:35 ` Vlad Dronov
2022-07-04 14:58   ` Vlad Dronov
2022-07-04 15:24     ` Vlad Dronov [this message]
2022-07-04 15:42       ` Vlad Dronov
2022-07-04 19:22         ` Vlad Dronov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMusb+QJ3yvEF8rUQ7=4Xf4dGG3Bs_ZOb2muJPKQ9ftXO+mX5g@mail.gmail.com' \
    --to=vdronov@redhat.com \
    --cc=freude@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).