* Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors
2024-10-10 8:57 ` Thorsten Leemhuis
@ 2024-10-10 9:09 ` Sedat Dilek
2024-10-10 9:36 ` Sedat Dilek
2024-10-10 15:52 ` Sami Tolvanen
2 siblings, 0 replies; 11+ messages in thread
From: Sedat Dilek @ 2024-10-10 9:09 UTC (permalink / raw)
To: Thorsten Leemhuis
Cc: Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
linux-modules, Masahiro Yamada, linux-kbuild, linux-kernel
On Thu, Oct 10, 2024 at 10:57 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>
> On 10.10.24 10:42, Sedat Dilek wrote:
> > On Thu, Oct 10, 2024 at 10:29 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >> On Thu, Oct 10, 2024 at 10:19 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
> >>> On 10.10.24 09:00, Thorsten Leemhuis wrote:
> >>
> >> That was wrong in the original code which you moved:
> >>
> >> +config MODULE_SIG_SHA384
> >> + bool "SHA-384"
> >> + select CRYPTO_SHA512 <--- SHA*384*
> >
> > Thorsten, please fix it!
>
> That looks intentional to me -- and CRYPTO_SHA384 from a quick look does
> not even exist.
>
> But that's not at all my area of expertise, so I would not want to touch
> it anyway.
>
> Ciao, Thorsten
>
> P.S.: Vegard Nossum mentioned in the fediverse that I could also solve
> the problem the patch is about by adding "default MODULE_SIG_SHA512" to
> the "choice" section; haven't tried that, but that sounds like a better
> solution. Will likely give it a try, unless someone brings up unwanted
> side effects this might cause.
>
Not an expert in this area, too.
Looks like I misread it.
SHA224 selects XXX_SHA*256* so the code might be intentional.
-sed@-
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors
2024-10-10 8:57 ` Thorsten Leemhuis
2024-10-10 9:09 ` Sedat Dilek
@ 2024-10-10 9:36 ` Sedat Dilek
2024-10-10 15:52 ` Sami Tolvanen
2 siblings, 0 replies; 11+ messages in thread
From: Sedat Dilek @ 2024-10-10 9:36 UTC (permalink / raw)
To: Thorsten Leemhuis
Cc: Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
linux-modules, Masahiro Yamada, linux-kbuild, linux-kernel
On Thu, Oct 10, 2024 at 10:57 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>
> On 10.10.24 10:42, Sedat Dilek wrote:
> > On Thu, Oct 10, 2024 at 10:29 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >> On Thu, Oct 10, 2024 at 10:19 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
> >>> On 10.10.24 09:00, Thorsten Leemhuis wrote:
> >>
> >> That was wrong in the original code which you moved:
> >>
> >> +config MODULE_SIG_SHA384
> >> + bool "SHA-384"
> >> + select CRYPTO_SHA512 <--- SHA*384*
> >
> > Thorsten, please fix it!
>
> That looks intentional to me -- and CRYPTO_SHA384 from a quick look does
> not even exist.
>
> But that's not at all my area of expertise, so I would not want to touch
> it anyway.
>
> Ciao, Thorsten
>
> P.S.: Vegard Nossum mentioned in the fediverse that I could also solve
> the problem the patch is about by adding "default MODULE_SIG_SHA512" to
> the "choice" section; haven't tried that, but that sounds like a better
> solution. Will likely give it a try, unless someone brings up unwanted
> side effects this might cause.
>
>
SHA1 | SHA256 | SHA512 <--- IMHO enough.
-sed@-
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors
2024-10-10 8:57 ` Thorsten Leemhuis
2024-10-10 9:09 ` Sedat Dilek
2024-10-10 9:36 ` Sedat Dilek
@ 2024-10-10 15:52 ` Sami Tolvanen
2024-10-11 10:27 ` Thorsten Leemhuis
2 siblings, 1 reply; 11+ messages in thread
From: Sami Tolvanen @ 2024-10-10 15:52 UTC (permalink / raw)
To: Thorsten Leemhuis
Cc: sedat.dilek, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
linux-modules, Masahiro Yamada, linux-kbuild, linux-kernel
Hi,
On Thu, Oct 10, 2024 at 1:57 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>
> On 10.10.24 10:42, Sedat Dilek wrote:
> > On Thu, Oct 10, 2024 at 10:29 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >> On Thu, Oct 10, 2024 at 10:19 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
> >>> On 10.10.24 09:00, Thorsten Leemhuis wrote:
> >>
> >> That was wrong in the original code which you moved:
> >>
> >> +config MODULE_SIG_SHA384
> >> + bool "SHA-384"
> >> + select CRYPTO_SHA512 <--- SHA*384*
> >
> > Thorsten, please fix it!
>
> That looks intentional to me -- and CRYPTO_SHA384 from a quick look does
> not even exist.
It is intentional. SHA-384 is just truncated SHA-512 with different
initial hash values. The same with SHA-224/256.
> But that's not at all my area of expertise, so I would not want to touch
> it anyway.
>
> Ciao, Thorsten
>
> P.S.: Vegard Nossum mentioned in the fediverse that I could also solve
> the problem the patch is about by adding "default MODULE_SIG_SHA512" to
> the "choice" section; haven't tried that, but that sounds like a better
> solution. Will likely give it a try, unless someone brings up unwanted
> side effects this might cause.
Yes, that would be a much better way to change the default. Overall,
moving away from SHA-1 seems like a good idea and SHA-512 feels like a
reasonable choice. Luis, do you see any issues with changing the
default here?
Sami
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors
2024-10-10 15:52 ` Sami Tolvanen
@ 2024-10-11 10:27 ` Thorsten Leemhuis
2024-10-11 12:00 ` Thorsten Leemhuis
0 siblings, 1 reply; 11+ messages in thread
From: Thorsten Leemhuis @ 2024-10-11 10:27 UTC (permalink / raw)
To: Sami Tolvanen
Cc: sedat.dilek, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
linux-modules, Masahiro Yamada, linux-kbuild, linux-kernel
On 10.10.24 17:52, Sami Tolvanen wrote:
Thx for your feedback!
> On Thu, Oct 10, 2024 at 1:57 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>> On 10.10.24 10:42, Sedat Dilek wrote:
>>> On Thu, Oct 10, 2024 at 10:29 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>> On Thu, Oct 10, 2024 at 10:19 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>>>>> On 10.10.24 09:00, Thorsten Leemhuis wrote:
>
>> P.S.: Vegard Nossum mentioned in the fediverse that I could also solve
>> the problem the patch is about by adding "default MODULE_SIG_SHA512" to
>> the "choice" section; haven't tried that, but that sounds like a better
>> solution. Will likely give it a try, unless someone brings up unwanted
>> side effects this might cause.
>
> Yes, that would be a much better way to change the default. Overall,
> moving away from SHA-1 seems like a good idea and SHA-512 feels like a
> reasonable choice. Luis, do you see any issues with changing the
> default here?
So, how do I make such a default choice work without breaking the
current magic, which looks like this:
"""
config MODULE_SIG_HASH
string
depends on MODULE_SIG || IMA_APPRAISE_MODSIG
default "sha1" if MODULE_SIG_SHA1
default "sha256" if MODULE_SIG_SHA256
default "sha384" if MODULE_SIG_SHA384
default "sha512" if MODULE_SIG_SHA512
default "sha3-256" if MODULE_SIG_SHA3_256
default "sha3-384" if MODULE_SIG_SHA3_384
default "sha3-512" if MODULE_SIG_SHA3_512
"""
Reordering those did not do the trick. And I suspect adding a
default "sha512"
would break the magic. Would dropping sha1, sha256 and sha384 from the
list be a middle ground that could work for everyone?
Ciao, Thorsten
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors
2024-10-11 10:27 ` Thorsten Leemhuis
@ 2024-10-11 12:00 ` Thorsten Leemhuis
2024-10-11 23:14 ` Luis Chamberlain
0 siblings, 1 reply; 11+ messages in thread
From: Thorsten Leemhuis @ 2024-10-11 12:00 UTC (permalink / raw)
To: Sami Tolvanen
Cc: sedat.dilek, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
linux-modules, Masahiro Yamada, linux-kbuild, linux-kernel
On 11.10.24 12:27, Thorsten Leemhuis wrote:
> On 10.10.24 17:52, Sami Tolvanen wrote:
> Thx for your feedback!
>> On Thu, Oct 10, 2024 at 1:57 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>>> On 10.10.24 10:42, Sedat Dilek wrote:
>>>> On Thu, Oct 10, 2024 at 10:29 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>>> On Thu, Oct 10, 2024 at 10:19 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
>>>>>> On 10.10.24 09:00, Thorsten Leemhuis wrote:
>>
>>> P.S.: Vegard Nossum mentioned in the fediverse that I could also solve
>>> the problem the patch is about by adding "default MODULE_SIG_SHA512" to
>>> the "choice" section; haven't tried that, but that sounds like a better
>>> solution. Will likely give it a try, unless someone brings up unwanted
>>> side effects this might cause.
>>
>> Yes, that would be a much better way to change the default. Overall,
>> moving away from SHA-1 seems like a good idea and SHA-512 feels like a
>> reasonable choice. Luis, do you see any issues with changing the
>> default here?
>
> So, how do I make such a default choice work without breaking the
> current magic, which looks like this:
> [...]
Ignore that, I was missing something obvious and got mislead by my
brain, sorry for the noise. Will send a updated patch in a few days to
give Luis and others a chance to raise objections reg. switching to SHA512.
Ciao, Thorsten
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors
2024-10-11 12:00 ` Thorsten Leemhuis
@ 2024-10-11 23:14 ` Luis Chamberlain
0 siblings, 0 replies; 11+ messages in thread
From: Luis Chamberlain @ 2024-10-11 23:14 UTC (permalink / raw)
To: Thorsten Leemhuis
Cc: Sami Tolvanen, sedat.dilek, Petr Pavlu, Daniel Gomez,
linux-modules, Masahiro Yamada, linux-kbuild, linux-kernel
On Fri, Oct 11, 2024 at 02:00:47PM +0200, Thorsten Leemhuis wrote:
> On 11.10.24 12:27, Thorsten Leemhuis wrote:
> > On 10.10.24 17:52, Sami Tolvanen wrote:
> > Thx for your feedback!
> >> On Thu, Oct 10, 2024 at 1:57 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
> >>> On 10.10.24 10:42, Sedat Dilek wrote:
> >>>> On Thu, Oct 10, 2024 at 10:29 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >>>>> On Thu, Oct 10, 2024 at 10:19 AM Thorsten Leemhuis <linux@leemhuis.info> wrote:
> >>>>>> On 10.10.24 09:00, Thorsten Leemhuis wrote:
> >>
> >>> P.S.: Vegard Nossum mentioned in the fediverse that I could also solve
> >>> the problem the patch is about by adding "default MODULE_SIG_SHA512" to
> >>> the "choice" section; haven't tried that, but that sounds like a better
> >>> solution. Will likely give it a try, unless someone brings up unwanted
> >>> side effects this might cause.
> >>
> >> Yes, that would be a much better way to change the default. Overall,
> >> moving away from SHA-1 seems like a good idea and SHA-512 feels like a
> >> reasonable choice. Luis, do you see any issues with changing the
> >> default here?
> >
> > So, how do I make such a default choice work without breaking the
> > current magic, which looks like this:
> > [...]
>
> Ignore that, I was missing something obvious and got mislead by my
> brain, sorry for the noise. Will send a updated patch in a few days to
> give Luis and others a chance to raise objections reg. switching to SHA512.
The commmit log goes something like this:
Fix build by switching to sha512 by default.
The commit log should be imperative about the crap show issue without
the build considerations. Beat down the current default, call it names,
give URLs to back it up. You "noticed" this issue because the build
fails.
Luis
^ permalink raw reply [flat|nested] 11+ messages in thread