netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
@ 2021-02-02  9:45 Rong Chen
  2021-02-02 10:11 ` Vadim Fedorenko
  2021-02-02 21:53 ` Jakub Kicinski
  0 siblings, 2 replies; 7+ messages in thread
From: Rong Chen @ 2021-02-02  9:45 UTC (permalink / raw)
  To: Jakub Kicinski, Boris Pismenny, Aviad Yehezkel
  Cc: Vadim Fedorenko, netdev, Rong Chen, kernel test robot

The kernel test robot reported the following errors:

tls.c: In function ‘tls_setup’:
tls.c:136:27: error: storage size of ‘tls12’ isn’t known
  union tls_crypto_context tls12;
                           ^~~~~
tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared (first use in this function)
   tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tls.c:150:21: note: each undeclared identifier is reported only once for each function it appears in
tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared (first use in this function)
   tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);

Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
Signed-off-by: Rong Chen <rong.a.chen@intel.com>
---
 include/net/tls.h                 | 9 ---------
 include/uapi/linux/tls.h          | 9 +++++++++
 tools/testing/selftests/net/tls.c | 4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/net/tls.h b/include/net/tls.h
index 3eccb525e8f7..54f7863ad915 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -212,15 +212,6 @@ struct cipher_context {
 	char *rec_seq;
 };
 
-union tls_crypto_context {
-	struct tls_crypto_info info;
-	union {
-		struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
-		struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
-		struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
-	};
-};
-
 struct tls_prot_info {
 	u16 version;
 	u16 cipher_type;
diff --git a/include/uapi/linux/tls.h b/include/uapi/linux/tls.h
index 0d54baea1d8d..9933dd425571 100644
--- a/include/uapi/linux/tls.h
+++ b/include/uapi/linux/tls.h
@@ -124,6 +124,15 @@ struct tls12_crypto_info_chacha20_poly1305 {
 	unsigned char rec_seq[TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE];
 };
 
+union tls_crypto_context {
+	struct tls_crypto_info info;
+	union {
+		struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
+		struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
+		struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
+	};
+};
+
 enum {
 	TLS_INFO_UNSPEC,
 	TLS_INFO_VERSION,
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index e0088c2d38a5..6951c8524a27 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -147,10 +147,10 @@ FIXTURE_SETUP(tls)
 	tls12.info.cipher_type = variant->cipher_type;
 	switch (variant->cipher_type) {
 	case TLS_CIPHER_CHACHA20_POLY1305:
-		tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
+		tls12_sz = sizeof(struct tls12_crypto_info_chacha20_poly1305);
 		break;
 	case TLS_CIPHER_AES_GCM_128:
-		tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
+		tls12_sz = sizeof(struct tls12_crypto_info_aes_gcm_128);
 		break;
 	default:
 		tls12_sz = 0;
-- 
2.20.1


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

* Re: [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
  2021-02-02  9:45 [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305 Rong Chen
@ 2021-02-02 10:11 ` Vadim Fedorenko
  2021-02-03  0:58   ` Rong Chen
  2021-02-02 21:53 ` Jakub Kicinski
  1 sibling, 1 reply; 7+ messages in thread
From: Vadim Fedorenko @ 2021-02-02 10:11 UTC (permalink / raw)
  To: Rong Chen, Jakub Kicinski, Boris Pismenny, Aviad Yehezkel
  Cc: netdev, kernel test robot

On 02.02.2021 09:45, Rong Chen wrote:
> The kernel test robot reported the following errors:
> 
> tls.c: In function ‘tls_setup’:
> tls.c:136:27: error: storage size of ‘tls12’ isn’t known
>    union tls_crypto_context tls12;
>                             ^~~~~
> tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared (first use in this function)
>     tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> tls.c:150:21: note: each undeclared identifier is reported only once for each function it appears in
> tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared (first use in this function)
>     tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
> 
> Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Link: https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
> ---
>   include/net/tls.h                 | 9 ---------
>   include/uapi/linux/tls.h          | 9 +++++++++
>   tools/testing/selftests/net/tls.c | 4 ++--
>   3 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/include/net/tls.h b/include/net/tls.h
> index 3eccb525e8f7..54f7863ad915 100644
> --- a/include/net/tls.h
> +++ b/include/net/tls.h
> @@ -212,15 +212,6 @@ struct cipher_context {
>   	char *rec_seq;
>   };
>   
> -union tls_crypto_context {
> -	struct tls_crypto_info info;
> -	union {
> -		struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
> -		struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
> -		struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
> -	};
> -};
> -
>   struct tls_prot_info {
>   	u16 version;
>   	u16 cipher_type;
> diff --git a/include/uapi/linux/tls.h b/include/uapi/linux/tls.h
> index 0d54baea1d8d..9933dd425571 100644
> --- a/include/uapi/linux/tls.h
> +++ b/include/uapi/linux/tls.h
> @@ -124,6 +124,15 @@ struct tls12_crypto_info_chacha20_poly1305 {
>   	unsigned char rec_seq[TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE];
>   };
>   
> +union tls_crypto_context {
> +	struct tls_crypto_info info;
> +	union {
> +		struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
> +		struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
> +		struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
> +	};
> +};
> +
>   enum {
>   	TLS_INFO_UNSPEC,
>   	TLS_INFO_VERSION,
> diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
> index e0088c2d38a5..6951c8524a27 100644
> --- a/tools/testing/selftests/net/tls.c
> +++ b/tools/testing/selftests/net/tls.c
> @@ -147,10 +147,10 @@ FIXTURE_SETUP(tls)
>   	tls12.info.cipher_type = variant->cipher_type;
>   	switch (variant->cipher_type) {
>   	case TLS_CIPHER_CHACHA20_POLY1305:
> -		tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
> +		tls12_sz = sizeof(struct tls12_crypto_info_chacha20_poly1305);
>   		break;
>   	case TLS_CIPHER_AES_GCM_128:
> -		tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
> +		tls12_sz = sizeof(struct tls12_crypto_info_aes_gcm_128);
>   		break;
>   	default:
>   		tls12_sz = 0;
> 

I'm not sure that it's a good idea to move tls_crypto_context to uapi as it's
an internal union. Previous patches assumes that user-space uses different
structures for different cipher configurations.

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

* Re: [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
  2021-02-02  9:45 [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305 Rong Chen
  2021-02-02 10:11 ` Vadim Fedorenko
@ 2021-02-02 21:53 ` Jakub Kicinski
  2021-02-03  1:03   ` Rong Chen
  2021-02-03  1:11   ` Vadim Fedorenko
  1 sibling, 2 replies; 7+ messages in thread
From: Jakub Kicinski @ 2021-02-02 21:53 UTC (permalink / raw)
  To: Rong Chen
  Cc: Boris Pismenny, Aviad Yehezkel, Vadim Fedorenko, netdev,
	kernel test robot

On Tue,  2 Feb 2021 17:45:00 +0800 Rong Chen wrote:
> The kernel test robot reported the following errors:
> 
> tls.c: In function ‘tls_setup’:
> tls.c:136:27: error: storage size of ‘tls12’ isn’t known
>   union tls_crypto_context tls12;
>                            ^~~~~
> tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared (first use in this function)
>    tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> tls.c:150:21: note: each undeclared identifier is reported only once for each function it appears in
> tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared (first use in this function)
>    tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
> 
> Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Link: https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
> Signed-off-by: Rong Chen <rong.a.chen@intel.com>

Are you sure you have latest headers installed on your system?

Try make headers_install or some such, I forgot what the way to appease
selftest was exactly but selftests often don't build on a fresh kernel
clone if system headers are not very recent :S

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

* Re: [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
  2021-02-02 10:11 ` Vadim Fedorenko
@ 2021-02-03  0:58   ` Rong Chen
  2021-02-03  1:09     ` Vadim Fedorenko
  0 siblings, 1 reply; 7+ messages in thread
From: Rong Chen @ 2021-02-03  0:58 UTC (permalink / raw)
  To: Vadim Fedorenko, Jakub Kicinski, Boris Pismenny, Aviad Yehezkel
  Cc: netdev, kernel test robot



On 2/2/21 6:11 PM, Vadim Fedorenko wrote:
> On 02.02.2021 09:45, Rong Chen wrote:
>> The kernel test robot reported the following errors:
>>
>> tls.c: In function ‘tls_setup’:
>> tls.c:136:27: error: storage size of ‘tls12’ isn’t known
>>    union tls_crypto_context tls12;
>>                             ^~~~~
>> tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared 
>> (first use in this function)
>>     tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> tls.c:150:21: note: each undeclared identifier is reported only once 
>> for each function it appears in
>> tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared 
>> (first use in this function)
>>     tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
>>
>> Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls 
>> selftests")
>> Reported-by: kernel test robot <oliver.sang@intel.com>
>> Link: 
>> https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
>> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
>> ---
>>   include/net/tls.h                 | 9 ---------
>>   include/uapi/linux/tls.h          | 9 +++++++++
>>   tools/testing/selftests/net/tls.c | 4 ++--
>>   3 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/include/net/tls.h b/include/net/tls.h
>> index 3eccb525e8f7..54f7863ad915 100644
>> --- a/include/net/tls.h
>> +++ b/include/net/tls.h
>> @@ -212,15 +212,6 @@ struct cipher_context {
>>       char *rec_seq;
>>   };
>>   -union tls_crypto_context {
>> -    struct tls_crypto_info info;
>> -    union {
>> -        struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
>> -        struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
>> -        struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
>> -    };
>> -};
>> -
>>   struct tls_prot_info {
>>       u16 version;
>>       u16 cipher_type;
>> diff --git a/include/uapi/linux/tls.h b/include/uapi/linux/tls.h
>> index 0d54baea1d8d..9933dd425571 100644
>> --- a/include/uapi/linux/tls.h
>> +++ b/include/uapi/linux/tls.h
>> @@ -124,6 +124,15 @@ struct tls12_crypto_info_chacha20_poly1305 {
>>       unsigned char rec_seq[TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE];
>>   };
>>   +union tls_crypto_context {
>> +    struct tls_crypto_info info;
>> +    union {
>> +        struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
>> +        struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
>> +        struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
>> +    };
>> +};
>> +
>>   enum {
>>       TLS_INFO_UNSPEC,
>>       TLS_INFO_VERSION,
>> diff --git a/tools/testing/selftests/net/tls.c 
>> b/tools/testing/selftests/net/tls.c
>> index e0088c2d38a5..6951c8524a27 100644
>> --- a/tools/testing/selftests/net/tls.c
>> +++ b/tools/testing/selftests/net/tls.c
>> @@ -147,10 +147,10 @@ FIXTURE_SETUP(tls)
>>       tls12.info.cipher_type = variant->cipher_type;
>>       switch (variant->cipher_type) {
>>       case TLS_CIPHER_CHACHA20_POLY1305:
>> -        tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>> +        tls12_sz = sizeof(struct tls12_crypto_info_chacha20_poly1305);
>>           break;
>>       case TLS_CIPHER_AES_GCM_128:
>> -        tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
>> +        tls12_sz = sizeof(struct tls12_crypto_info_aes_gcm_128);
>>           break;
>>       default:
>>           tls12_sz = 0;
>>
>
> I'm not sure that it's a good idea to move tls_crypto_context to uapi 
> as it's
> an internal union. Previous patches assumes that user-space uses 
> different
> structures for different cipher configurations.

Hi Vadim,

Sorry i don't have the background, could you help to fix these build errors?

Best Regards,
Rong Chen


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

* Re: [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
  2021-02-02 21:53 ` Jakub Kicinski
@ 2021-02-03  1:03   ` Rong Chen
  2021-02-03  1:11   ` Vadim Fedorenko
  1 sibling, 0 replies; 7+ messages in thread
From: Rong Chen @ 2021-02-03  1:03 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Boris Pismenny, Aviad Yehezkel, Vadim Fedorenko, netdev,
	kernel test robot



On 2/3/21 5:53 AM, Jakub Kicinski wrote:
> On Tue,  2 Feb 2021 17:45:00 +0800 Rong Chen wrote:
>> The kernel test robot reported the following errors:
>>
>> tls.c: In function ‘tls_setup’:
>> tls.c:136:27: error: storage size of ‘tls12’ isn’t known
>>    union tls_crypto_context tls12;
>>                             ^~~~~
>> tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared (first use in this function)
>>     tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> tls.c:150:21: note: each undeclared identifier is reported only once for each function it appears in
>> tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared (first use in this function)
>>     tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
>>
>> Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
>> Reported-by: kernel test robot <oliver.sang@intel.com>
>> Link: https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
>> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
> Are you sure you have latest headers installed on your system?
>
> Try make headers_install or some such, I forgot what the way to appease
> selftest was exactly but selftests often don't build on a fresh kernel
> clone if system headers are not very recent :S

Hi Jakub,

These errors still exist when testing the latest linux-next/master 
branch on our test system,
and kernelci noticed the errors too:

https://storage.staging.kernelci.org/kernelci/staging-mainline/staging-mainline-20210130.0/x86_64/x86_64_defconfig+kselftest/gcc-8/build.log

Best Regards,
Rong Chen


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

* Re: [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
  2021-02-03  0:58   ` Rong Chen
@ 2021-02-03  1:09     ` Vadim Fedorenko
  0 siblings, 0 replies; 7+ messages in thread
From: Vadim Fedorenko @ 2021-02-03  1:09 UTC (permalink / raw)
  To: Rong Chen, Jakub Kicinski, Boris Pismenny, Aviad Yehezkel
  Cc: netdev, kernel test robot

On 03.02.2021 00:58, Rong Chen wrote:
> 
> 
> On 2/2/21 6:11 PM, Vadim Fedorenko wrote:
>> On 02.02.2021 09:45, Rong Chen wrote:
>>> The kernel test robot reported the following errors:
>>>
>>> tls.c: In function ‘tls_setup’:
>>> tls.c:136:27: error: storage size of ‘tls12’ isn’t known
>>>    union tls_crypto_context tls12;
>>>                             ^~~~~
>>> tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared (first 
>>> use in this function)
>>>     tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>>>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> tls.c:150:21: note: each undeclared identifier is reported only once for each 
>>> function it appears in
>>> tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared (first use in 
>>> this function)
>>>     tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
>>>
>>> Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
>>> Reported-by: kernel test robot <oliver.sang@intel.com>
>>> Link: https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
>>> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
>>> ---
>>>   include/net/tls.h                 | 9 ---------
>>>   include/uapi/linux/tls.h          | 9 +++++++++
>>>   tools/testing/selftests/net/tls.c | 4 ++--
>>>   3 files changed, 11 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/include/net/tls.h b/include/net/tls.h
>>> index 3eccb525e8f7..54f7863ad915 100644
>>> --- a/include/net/tls.h
>>> +++ b/include/net/tls.h
>>> @@ -212,15 +212,6 @@ struct cipher_context {
>>>       char *rec_seq;
>>>   };
>>>   -union tls_crypto_context {
>>> -    struct tls_crypto_info info;
>>> -    union {
>>> -        struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
>>> -        struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
>>> -        struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
>>> -    };
>>> -};
>>> -
>>>   struct tls_prot_info {
>>>       u16 version;
>>>       u16 cipher_type;
>>> diff --git a/include/uapi/linux/tls.h b/include/uapi/linux/tls.h
>>> index 0d54baea1d8d..9933dd425571 100644
>>> --- a/include/uapi/linux/tls.h
>>> +++ b/include/uapi/linux/tls.h
>>> @@ -124,6 +124,15 @@ struct tls12_crypto_info_chacha20_poly1305 {
>>>       unsigned char rec_seq[TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE];
>>>   };
>>>   +union tls_crypto_context {
>>> +    struct tls_crypto_info info;
>>> +    union {
>>> +        struct tls12_crypto_info_aes_gcm_128 aes_gcm_128;
>>> +        struct tls12_crypto_info_aes_gcm_256 aes_gcm_256;
>>> +        struct tls12_crypto_info_chacha20_poly1305 chacha20_poly1305;
>>> +    };
>>> +};
>>> +
>>>   enum {
>>>       TLS_INFO_UNSPEC,
>>>       TLS_INFO_VERSION,
>>> diff --git a/tools/testing/selftests/net/tls.c 
>>> b/tools/testing/selftests/net/tls.c
>>> index e0088c2d38a5..6951c8524a27 100644
>>> --- a/tools/testing/selftests/net/tls.c
>>> +++ b/tools/testing/selftests/net/tls.c
>>> @@ -147,10 +147,10 @@ FIXTURE_SETUP(tls)
>>>       tls12.info.cipher_type = variant->cipher_type;
>>>       switch (variant->cipher_type) {
>>>       case TLS_CIPHER_CHACHA20_POLY1305:
>>> -        tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>>> +        tls12_sz = sizeof(struct tls12_crypto_info_chacha20_poly1305);
>>>           break;
>>>       case TLS_CIPHER_AES_GCM_128:
>>> -        tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
>>> +        tls12_sz = sizeof(struct tls12_crypto_info_aes_gcm_128);
>>>           break;
>>>       default:
>>>           tls12_sz = 0;
>>>
>>
>> I'm not sure that it's a good idea to move tls_crypto_context to uapi as it's
>> an internal union. Previous patches assumes that user-space uses different
>> structures for different cipher configurations.
> 
> Hi Vadim,
> 
> Sorry i don't have the background, could you help to fix these build errors?
> 
> Best Regards,
> Rong Chen
> 

Yes, sure, no problem. I will prepare new patch tomorrow.


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

* Re: [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305
  2021-02-02 21:53 ` Jakub Kicinski
  2021-02-03  1:03   ` Rong Chen
@ 2021-02-03  1:11   ` Vadim Fedorenko
  1 sibling, 0 replies; 7+ messages in thread
From: Vadim Fedorenko @ 2021-02-03  1:11 UTC (permalink / raw)
  To: Jakub Kicinski, Rong Chen
  Cc: Boris Pismenny, Aviad Yehezkel, netdev, kernel test robot

On 02.02.2021 21:53, Jakub Kicinski wrote:
> On Tue,  2 Feb 2021 17:45:00 +0800 Rong Chen wrote:
>> The kernel test robot reported the following errors:
>>
>> tls.c: In function ‘tls_setup’:
>> tls.c:136:27: error: storage size of ‘tls12’ isn’t known
>>    union tls_crypto_context tls12;
>>                             ^~~~~
>> tls.c:150:21: error: ‘tls12_crypto_info_chacha20_poly1305’ undeclared (first use in this function)
>>     tls12_sz = sizeof(tls12_crypto_info_chacha20_poly1305);
>>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> tls.c:150:21: note: each undeclared identifier is reported only once for each function it appears in
>> tls.c:153:21: error: ‘tls12_crypto_info_aes_gcm_128’ undeclared (first use in this function)
>>     tls12_sz = sizeof(tls12_crypto_info_aes_gcm_128);
>>
>> Fixes: 4f336e88a870 ("selftests/tls: add CHACHA20-POLY1305 to tls selftests")
>> Reported-by: kernel test robot <oliver.sang@intel.com>
>> Link: https://lore.kernel.org/lkml/20210108064141.GB3437@xsang-OptiPlex-9020/
>> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
> 
> Are you sure you have latest headers installed on your system?
> 
> Try make headers_install or some such, I forgot what the way to appease
> selftest was exactly but selftests often don't build on a fresh kernel
> clone if system headers are not very recent :S

There is definitely error in test - I could reproduce it in a clean environment.
I will take care of it.


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

end of thread, other threads:[~2021-02-03  1:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02  9:45 [PATCH] selftests/tls: fix compile errors after adding CHACHA20-POLY1305 Rong Chen
2021-02-02 10:11 ` Vadim Fedorenko
2021-02-03  0:58   ` Rong Chen
2021-02-03  1:09     ` Vadim Fedorenko
2021-02-02 21:53 ` Jakub Kicinski
2021-02-03  1:03   ` Rong Chen
2021-02-03  1:11   ` Vadim Fedorenko

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).