linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Kbuild: Elevate sha1sum to sha256sum for atomic headers check
@ 2023-03-15 13:05 Bhaskar Chowdhury
  2023-03-17  8:58 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Bhaskar Chowdhury @ 2023-03-15 13:05 UTC (permalink / raw)
  To: masahiroy, nicolas; +Cc: linux-kernel, linux-kbuild, Bhaskar Chowdhury

Thought it would be a good idea to use a elevated mechanism i.e sha256sum

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
---
 Kbuild | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Kbuild b/Kbuild
index 464b34a08f51..b74040346d76 100644
--- a/Kbuild
+++ b/Kbuild
@@ -45,14 +45,14 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file)

 # Check the manual modification of atomic headers

-quiet_cmd_check_sha1 = CHKSHA1 $<
-      cmd_check_sha1 = \
-	if ! command -v sha1sum >/dev/null; then \
-		echo "warning: cannot check the header due to sha1sum missing"; \
+quiet_cmd_check_sha256 = CHKSHA256 $<
+      cmd_check_sha256 = \
+	if ! command -v sha256sum >/dev/null; then \
+		echo "warning: cannot check the header due to sha256sum missing"; \
 		exit 0; \
 	fi; \
 	if [ "$$(sed -n '$$s:// ::p' $<)" != \
-	     "$$(sed '$$d' $< | sha1sum | sed 's/ .*//')" ]; then \
+	     "$$(sed '$$d' $< | sha256sum | sed 's/ .*//')" ]; then \
 		echo "error: $< has been modified." >&2; \
 		exit 1; \
 	fi; \
--
2.39.2


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

* RE: [PATCH] Kbuild: Elevate sha1sum to sha256sum for atomic headers check
  2023-03-15 13:05 [PATCH] Kbuild: Elevate sha1sum to sha256sum for atomic headers check Bhaskar Chowdhury
@ 2023-03-17  8:58 ` David Laight
  2023-03-18  3:26   ` Bhaskar Chowdhury
  0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2023-03-17  8:58 UTC (permalink / raw)
  To: 'Bhaskar Chowdhury', masahiroy, nicolas
  Cc: linux-kernel, linux-kbuild

From: Bhaskar Chowdhury
> Sent: 15 March 2023 13:05
> 
> Thought it would be a good idea to use a elevated mechanism i.e sha256sum

How can this change possibly work.
It is just a list of definitions read by another makefile.
You've changed the name of a definition without changing where it is used.
Also if the code is looking for a change, you'd need to change
what it is compared against.
In any case no one is worried about malicious attempts to change
things without being noticed, even sha1 is OTT.

	David

> 
> Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
> ---
>  Kbuild | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/Kbuild b/Kbuild
> index 464b34a08f51..b74040346d76 100644
> --- a/Kbuild
> +++ b/Kbuild
> @@ -45,14 +45,14 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file)
> 
>  # Check the manual modification of atomic headers
> 
> -quiet_cmd_check_sha1 = CHKSHA1 $<
> -      cmd_check_sha1 = \
> -	if ! command -v sha1sum >/dev/null; then \
> -		echo "warning: cannot check the header due to sha1sum missing"; \
> +quiet_cmd_check_sha256 = CHKSHA256 $<
> +      cmd_check_sha256 = \
> +	if ! command -v sha256sum >/dev/null; then \
> +		echo "warning: cannot check the header due to sha256sum missing"; \
>  		exit 0; \
>  	fi; \
>  	if [ "$$(sed -n '$$s:// ::p' $<)" != \
> -	     "$$(sed '$$d' $< | sha1sum | sed 's/ .*//')" ]; then \
> +	     "$$(sed '$$d' $< | sha256sum | sed 's/ .*//')" ]; then \
>  		echo "error: $< has been modified." >&2; \
>  		exit 1; \
>  	fi; \
> --
> 2.39.2

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* Re: [PATCH] Kbuild: Elevate sha1sum to sha256sum for atomic headers check
  2023-03-17  8:58 ` David Laight
@ 2023-03-18  3:26   ` Bhaskar Chowdhury
  0 siblings, 0 replies; 3+ messages in thread
From: Bhaskar Chowdhury @ 2023-03-18  3:26 UTC (permalink / raw)
  To: David Laight; +Cc: masahiroy, nicolas, linux-kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]

On 08:58 Fri 17 Mar 2023, David Laight wrote:
>From: Bhaskar Chowdhury
>> Sent: 15 March 2023 13:05
>>
>> Thought it would be a good idea to use a elevated mechanism i.e sha256sum
>
>How can this change possibly work.
>It is just a list of definitions read by another makefile.
>You've changed the name of a definition without changing where it is used.
>Also if the code is looking for a change, you'd need to change
>what it is compared against.

Gotcha. Thanks for the heads-up , David. I missed it.

>In any case no one is worried about malicious attempts to change
>things without being noticed, even sha1 is OTT.
>
>        David
>
>>
>> Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
>> ---
>>  Kbuild | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/Kbuild b/Kbuild
>> index 464b34a08f51..b74040346d76 100644
>> --- a/Kbuild
>> +++ b/Kbuild
>> @@ -45,14 +45,14 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file)
>>
>>  # Check the manual modification of atomic headers
>>
>> -quiet_cmd_check_sha1 = CHKSHA1 $<
>> -      cmd_check_sha1 = \
>> -     if ! command -v sha1sum >/dev/null; then \
>> -             echo "warning: cannot check the header due to sha1sum missing"; \
>> +quiet_cmd_check_sha256 = CHKSHA256 $<
>> +      cmd_check_sha256 = \
>> +     if ! command -v sha256sum >/dev/null; then \
>> +             echo "warning: cannot check the header due to sha256sum missing"; \
>>               exit 0; \
>>       fi; \
>>       if [ "$$(sed -n '$$s:// ::p' $<)" != \
>> -          "$$(sed '$$d' $< | sha1sum | sed 's/ .*//')" ]; then \
>> +          "$$(sed '$$d' $< | sha256sum | sed 's/ .*//')" ]; then \
>>               echo "error: $< has been modified." >&2; \
>>               exit 1; \
>>       fi; \
>> --
>> 2.39.2
>
>-
>Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
>Registration No: 1397386 (Wales)
--
Thanks,
Bhaskar

"Here's looking at you kid"-- Casablanca
https://about.me/unixbhaskar

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2023-03-18  3:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 13:05 [PATCH] Kbuild: Elevate sha1sum to sha256sum for atomic headers check Bhaskar Chowdhury
2023-03-17  8:58 ` David Laight
2023-03-18  3:26   ` Bhaskar Chowdhury

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