All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH crypto] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE
@ 2022-05-26  9:35 Jason A. Donenfeld
  2022-05-27  7:34 ` kernel test robot
  0 siblings, 1 reply; 5+ messages in thread
From: Jason A. Donenfeld @ 2022-05-26  9:35 UTC (permalink / raw)
  To: linux-crypto, herbert; +Cc: Jason A. Donenfeld, Linus Torvalds

When CRYPTO_LIB_POLY1305 is unset, CRYPTO_LIB_POLY1305_RSIZE is still
set in the Kconfig, cluttering things. Fix this by making
CRYPTO_LIB_POLY1305_RSIZE depend on CRYPTO_LIB_POLY1305.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 lib/crypto/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 379a66d7f504..a80b8c4dc2cf 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -85,6 +85,7 @@ config CRYPTO_LIB_POLY1305_RSIZE
 	default 11 if X86_64
 	default 9 if ARM || ARM64
 	default 1
+	depends on CRYPTO_LIB_POLY1305
 
 config CRYPTO_ARCH_HAVE_LIB_POLY1305
 	tristate
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH crypto] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE
  2022-05-26  9:35 [PATCH crypto] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE Jason A. Donenfeld
@ 2022-05-27  7:34 ` kernel test robot
  2022-05-27 20:19   ` [PATCH crypto v2] " Jason A. Donenfeld
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2022-05-27  7:34 UTC (permalink / raw)
  To: Jason A. Donenfeld, linux-crypto, herbert; +Cc: kbuild-all, Jason A. Donenfeld

Hi "Jason,

I love your patch! Yet something to improve:

[auto build test ERROR on herbert-cryptodev-2.6/master]
[also build test ERROR on herbert-crypto-2.6/master crng-random/master v5.18 next-20220526]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-A-Donenfeld/crypto-poly1305-cleanup-stray-CRYPTO_LIB_POLY1305_RSIZE/20220526-173718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: i386-debian-10.3-kselftests (https://download.01.org/0day-ci/archive/20220527/202205271557.oReeyAVT-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/fde026a9e6312b3278b170ca6a41cd84a6fb935e
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jason-A-Donenfeld/crypto-poly1305-cleanup-stray-CRYPTO_LIB_POLY1305_RSIZE/20220526-173718
        git checkout fde026a9e6312b3278b170ca6a41cd84a6fb935e
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash lib/crypto/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/crypto/internal/poly1305.h:11,
                    from lib/crypto/poly1305-donna32.c:11:
>> include/crypto/poly1305.h:56:46: error: 'CONFIG_CRYPTO_LIB_POLY1305_RSIZE' undeclared here (not in a function); did you mean 'CONFIG_CRYPTO_POLY1305_MODULE'?
      56 |                 struct poly1305_key opaque_r[CONFIG_CRYPTO_LIB_POLY1305_RSIZE];
         |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                              CONFIG_CRYPTO_POLY1305_MODULE


vim +56 include/crypto/poly1305.h

878afc35cd28bc Eric Biggers       2018-11-16  40  
2546f811ef45fc Martin Willi       2015-07-16  41  struct poly1305_desc_ctx {
2546f811ef45fc Martin Willi       2015-07-16  42  	/* partial buffer */
2546f811ef45fc Martin Willi       2015-07-16  43  	u8 buf[POLY1305_BLOCK_SIZE];
2546f811ef45fc Martin Willi       2015-07-16  44  	/* bytes used in partial buffer */
2546f811ef45fc Martin Willi       2015-07-16  45  	unsigned int buflen;
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  46  	/* how many keys have been set in r[] */
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  47  	unsigned short rset;
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  48  	/* whether s[] has been set */
2546f811ef45fc Martin Willi       2015-07-16  49  	bool sset;
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  50  	/* finalize key */
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  51  	u32 s[4];
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  52  	/* accumulator */
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  53  	struct poly1305_state h;
ad8f5b88383ea6 Ard Biesheuvel     2019-11-08  54  	/* key */
1c08a104360f3e Jason A. Donenfeld 2020-01-05  55  	union {
1c08a104360f3e Jason A. Donenfeld 2020-01-05 @56  		struct poly1305_key opaque_r[CONFIG_CRYPTO_LIB_POLY1305_RSIZE];
1c08a104360f3e Jason A. Donenfeld 2020-01-05  57  		struct poly1305_core_key core_r;
1c08a104360f3e Jason A. Donenfeld 2020-01-05  58  	};
2546f811ef45fc Martin Willi       2015-07-16  59  };
2546f811ef45fc Martin Willi       2015-07-16  60  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH crypto v2] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE
  2022-05-27  7:34 ` kernel test robot
@ 2022-05-27 20:19   ` Jason A. Donenfeld
       [not found]     ` <CAHk-=whyH8xx=2LVmOdQDTy9RRqBs_JJz_oMV2+6a2myk8+wow@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Jason A. Donenfeld @ 2022-05-27 20:19 UTC (permalink / raw)
  To: linux-crypto, herbert; +Cc: Jason A. Donenfeld, Linus Torvalds

When CRYPTO_LIB_POLY1305 is unset, CRYPTO_LIB_POLY1305_RSIZE is still
set in the Kconfig, cluttering things. Fix this by making
CRYPTO_LIB_POLY1305_RSIZE depend on CRYPTO_LIB_POLY1305 and other
various related config options.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
Changes v1->v2:
- Also depend on CRYPTO_ARCH_HAVE_LIB_POLY1305 and
  CRYPTO_LIB_POLY1305_GENERIC, after kbuild bot warning. Hopefully this
  handles all the weird edge cases in this unfortunate maze.

 lib/crypto/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 379a66d7f504..7ee13c08c970 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -85,6 +85,7 @@ config CRYPTO_LIB_POLY1305_RSIZE
 	default 11 if X86_64
 	default 9 if ARM || ARM64
 	default 1
+	depends on CRYPTO_LIB_POLY1305 || CRYPTO_ARCH_HAVE_LIB_POLY1305 || CRYPTO_LIB_POLY1305_GENERIC
 
 config CRYPTO_ARCH_HAVE_LIB_POLY1305
 	tristate
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH crypto v2] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE
       [not found]     ` <CAHk-=whyH8xx=2LVmOdQDTy9RRqBs_JJz_oMV2+6a2myk8+wow@mail.gmail.com>
@ 2022-05-27 21:15       ` Jason A. Donenfeld
  2022-05-27 22:19         ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Jason A. Donenfeld @ 2022-05-27 21:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Crypto Mailing List, Herbert Xu

Hi Linus,

On Fri, May 27, 2022 at 11:10 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Oh well. I already applied your v1 patch earlier today..
>
>        Linus

Whoops. I sent this to linux-crypto/Herbert assuming that it'd work
with the "2 weeks pass and nobody complains --> queued up" flow of
that list.

I can send you a patch on top of your tree to fix the v1 you applied.
But let's let the kernel test robot chew on my v2 for a day or two.
The crypto/ Kconfig system is incredibly convoluted, and the config
fuzzing the robot does tends to be (unfortunately) helpful.

Jason

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH crypto v2] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE
  2022-05-27 21:15       ` Jason A. Donenfeld
@ 2022-05-27 22:19         ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2022-05-27 22:19 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: Linux Crypto Mailing List, Herbert Xu

On Fri, May 27, 2022 at 2:16 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> Whoops. I sent this to linux-crypto/Herbert assuming that it'd work
> with the "2 weeks pass and nobody complains --> queued up" flow of
> that list.

Well, it's more like "4 months since I complained about this thing",
so I thought it was overdue and applied it..

That said, I don't think CRYPTO_LIB_POLY1305_GENERIC can be set unless
CRYPTO_LIB_POLY1305 is set. And CRYPTO_ARCH_HAVE_LIB_POLY1305 looks
like a bogus thing to test for too - those two just decide if the
arch-specific one or the generic one should be used.

So I think v1 was actually the right one. Possibly

        depends on CRYPTO_LIB_POLY1305 != n

due to the tristate?


                    Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-27 22:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26  9:35 [PATCH crypto] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE Jason A. Donenfeld
2022-05-27  7:34 ` kernel test robot
2022-05-27 20:19   ` [PATCH crypto v2] " Jason A. Donenfeld
     [not found]     ` <CAHk-=whyH8xx=2LVmOdQDTy9RRqBs_JJz_oMV2+6a2myk8+wow@mail.gmail.com>
2022-05-27 21:15       ` Jason A. Donenfeld
2022-05-27 22:19         ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.