linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
@ 2020-08-27  6:05 Mrinal Pandey
  2020-08-27  6:13 ` Mrinal Pandey
  0 siblings, 1 reply; 14+ messages in thread
From: Mrinal Pandey @ 2020-08-27  6:05 UTC (permalink / raw)
  To: lukas.bulwahn, skhan, Linux-kernel-mentees, mrinalmni


[-- Attachment #1.1: Type: text/plain, Size: 1903 bytes --]

commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
spdxcheck-test.sh to repository without the executable flag and license
information.

commit eb8305aecb95 ("scripts: Coccinelle script for namespace
dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
and commit 9b4ade226f74 ("xen: build infrastructure for generating
hypercall depending symbols") added the file xen-hypercalls.sh without the
executable bit.

Set to usual modes for these files and provide the SPDX license for
spdxcheck-test.sh. No functional changes.

Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
---
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/nsdeps                         | 0
 scripts/spdxcheck-test.sh              | 2 +-
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/nsdeps
 mode change 100644 => 100755 scripts/spdxcheck-test.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
old mode 100644
new mode 100755
diff --git a/scripts/nsdeps b/scripts/nsdeps
old mode 100644
new mode 100755
diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
old mode 100644
new mode 100755
index cfea6a0d1cc0..758fa645ed99
--- a/scripts/spdxcheck-test.sh
+++ b/scripts/spdxcheck-test.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# SPDX-License-Identifier: GPL-2.0
 for PYTHON in python2 python3; do
 	# run check on a text and a binary file
 	for FILE in Makefile Documentation/logo.gif; do
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
old mode 100644
new mode 100755
-- 
2.25.1


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

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  6:05 [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license Mrinal Pandey
@ 2020-08-27  6:13 ` Mrinal Pandey
  2020-08-27  6:16   ` Lukas Bulwahn
  0 siblings, 1 reply; 14+ messages in thread
From: Mrinal Pandey @ 2020-08-27  6:13 UTC (permalink / raw)
  To: lukas.bulwahn, skhan, Linux-kernel-mentees, mrinalmni


[-- Attachment #1.1: Type: text/plain, Size: 2314 bytes --]

On 20/08/27 11:35AM, Mrinal Pandey wrote:
> commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> spdxcheck-test.sh to repository without the executable flag and license
> information.
> 
> commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> and commit 9b4ade226f74 ("xen: build infrastructure for generating
> hypercall depending symbols") added the file xen-hypercalls.sh without the
> executable bit.
> 
> Set to usual modes for these files and provide the SPDX license for
> spdxcheck-test.sh. No functional changes.
> 
> Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> ---
>  scripts/gcc-plugins/gen-random-seed.sh | 0
>  scripts/nsdeps                         | 0
>  scripts/spdxcheck-test.sh              | 2 +-
>  scripts/xen-hypercalls.sh              | 0
>  4 files changed, 1 insertion(+), 1 deletion(-)
>  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
>  mode change 100644 => 100755 scripts/nsdeps
>  mode change 100644 => 100755 scripts/spdxcheck-test.sh
>  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> 
> diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
> old mode 100644
> new mode 100755
> diff --git a/scripts/nsdeps b/scripts/nsdeps
> old mode 100644
> new mode 100755
> diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
> old mode 100644
> new mode 100755
> index cfea6a0d1cc0..758fa645ed99
> --- a/scripts/spdxcheck-test.sh
> +++ b/scripts/spdxcheck-test.sh
> @@ -1,5 +1,5 @@
>  #!/bin/sh
> -
> +# SPDX-License-Identifier: GPL-2.0
>  for PYTHON in python2 python3; do
>  	# run check on a text and a binary file
>  	for FILE in Makefile Documentation/logo.gif; do
> diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
> old mode 100644
> new mode 100755
> -- 
> 2.25.1
> 

Sir,

I realized this was not supposed to be a single patch. I apologize for
the mistake. Kindly ignore this patch. I will send new separate patches
to the concerned developers.
Kindly let me know if those patches need to go through you first.

Thank you.

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

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  6:13 ` Mrinal Pandey
@ 2020-08-27  6:16   ` Lukas Bulwahn
  2020-08-27  6:26     ` Mrinal Pandey
  0 siblings, 1 reply; 14+ messages in thread
From: Lukas Bulwahn @ 2020-08-27  6:16 UTC (permalink / raw)
  To: Mrinal Pandey; +Cc: Linux-kernel-mentees

On Thu, Aug 27, 2020 at 8:13 AM Mrinal Pandey <mrinalmni@gmail.com> wrote:
>
> On 20/08/27 11:35AM, Mrinal Pandey wrote:
> > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > spdxcheck-test.sh to repository without the executable flag and license

s/to/to the/

> > information.
> >
> > commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> > dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> > Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> > and commit 9b4ade226f74 ("xen: build infrastructure for generating
> > hypercall depending symbols") added the file xen-hypercalls.sh without the
> > executable bit.
> >
> > Set to usual modes for these files and provide the SPDX license for
> > spdxcheck-test.sh. No functional changes.
> >
> > Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> > ---
> >  scripts/gcc-plugins/gen-random-seed.sh | 0
> >  scripts/nsdeps                         | 0
> >  scripts/spdxcheck-test.sh              | 2 +-
> >  scripts/xen-hypercalls.sh              | 0
> >  4 files changed, 1 insertion(+), 1 deletion(-)
> >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> >  mode change 100644 => 100755 scripts/nsdeps
> >  mode change 100644 => 100755 scripts/spdxcheck-test.sh
> >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> >
> > diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
> > old mode 100644
> > new mode 100755
> > diff --git a/scripts/nsdeps b/scripts/nsdeps
> > old mode 100644
> > new mode 100755
> > diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
> > old mode 100644
> > new mode 100755
> > index cfea6a0d1cc0..758fa645ed99
> > --- a/scripts/spdxcheck-test.sh
> > +++ b/scripts/spdxcheck-test.sh
> > @@ -1,5 +1,5 @@
> >  #!/bin/sh
> > -

Why do you delete the newline?

> > +# SPDX-License-Identifier: GPL-2.0
> >  for PYTHON in python2 python3; do
> >       # run check on a text and a binary file
> >       for FILE in Makefile Documentation/logo.gif; do
> > diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
> > old mode 100644
> > new mode 100755
> > --
> > 2.25.1
> >
>

I think it is fine to have this as a single patch. It is local enough
to say that we are touching all those files in a single go.

Other than that, it looks good to me.

Please state to whom you intend to send this patch.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  6:16   ` Lukas Bulwahn
@ 2020-08-27  6:26     ` Mrinal Pandey
  2020-08-27  7:24       ` Lukas Bulwahn
  0 siblings, 1 reply; 14+ messages in thread
From: Mrinal Pandey @ 2020-08-27  6:26 UTC (permalink / raw)
  To: Lukas Bulwahn, skhan, Linux-kernel-mentees, mrinalmni


[-- Attachment #1.1: Type: text/plain, Size: 3410 bytes --]

On 20/08/27 08:16AM, Lukas Bulwahn wrote:
> On Thu, Aug 27, 2020 at 8:13 AM Mrinal Pandey <mrinalmni@gmail.com> wrote:
> >
> > On 20/08/27 11:35AM, Mrinal Pandey wrote:
> > > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > > spdxcheck-test.sh to repository without the executable flag and license
> 
> s/to/to the/
> 
> > > information.
> > >
> > > commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> > > dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> > > Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> > > and commit 9b4ade226f74 ("xen: build infrastructure for generating
> > > hypercall depending symbols") added the file xen-hypercalls.sh without the
> > > executable bit.
> > >
> > > Set to usual modes for these files and provide the SPDX license for
> > > spdxcheck-test.sh. No functional changes.
> > >
> > > Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> > > ---
> > >  scripts/gcc-plugins/gen-random-seed.sh | 0
> > >  scripts/nsdeps                         | 0
> > >  scripts/spdxcheck-test.sh              | 2 +-
> > >  scripts/xen-hypercalls.sh              | 0
> > >  4 files changed, 1 insertion(+), 1 deletion(-)
> > >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> > >  mode change 100644 => 100755 scripts/nsdeps
> > >  mode change 100644 => 100755 scripts/spdxcheck-test.sh
> > >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> > >
> > > diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
> > > old mode 100644
> > > new mode 100755
> > > diff --git a/scripts/nsdeps b/scripts/nsdeps
> > > old mode 100644
> > > new mode 100755
> > > diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
> > > old mode 100644
> > > new mode 100755
> > > index cfea6a0d1cc0..758fa645ed99
> > > --- a/scripts/spdxcheck-test.sh
> > > +++ b/scripts/spdxcheck-test.sh
> > > @@ -1,5 +1,5 @@
> > >  #!/bin/sh
> > > -
> 
> Why do you delete the newline?

Sir,

I will rectify this and include the above suggested change in the final
patch.
> 
> > > +# SPDX-License-Identifier: GPL-2.0
> > >  for PYTHON in python2 python3; do
> > >       # run check on a text and a binary file
> > >       for FILE in Makefile Documentation/logo.gif; do
> > > diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
> > > old mode 100644
> > > new mode 100755
> > > --
> > > 2.25.1
> > >
> >
> 
> I think it is fine to have this as a single patch. It is local enough
> to say that we are touching all those files in a single go.
> 
> Other than that, it looks good to me.
> 
> Please state to whom you intend to send this patch.

Running get_maintainer.pl on patch suggests to send it to the following adresses:

Kees Cook <keescook@chromium.org> (maintainer:GCC PLUGINS)
Emese Revfy <re.emese@gmail.com> (reviewer:GCC PLUGINS)
Matthias Maennich <maennich@google.com> (maintainer:NSDEPS)
Thomas Gleixner <tglx@linutronix.de> (maintainer:LICENSES and SPDX stuff)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (maintainer:LICENSES and SPDX stuff)
kernel-hardening@lists.openwall.com (open list:GCC PLUGINS)
linux-kernel@vger.kernel.org (open list)
linux-spdx@vger.kernel.org (open list:LICENSES and SPDX stuff)

Thank you.
> 
> Lukas

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

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  6:26     ` Mrinal Pandey
@ 2020-08-27  7:24       ` Lukas Bulwahn
  0 siblings, 0 replies; 14+ messages in thread
From: Lukas Bulwahn @ 2020-08-27  7:24 UTC (permalink / raw)
  To: Mrinal Pandey; +Cc: Linux-kernel-mentees

On Thu, Aug 27, 2020 at 8:26 AM Mrinal Pandey <mrinalmni@gmail.com> wrote:
>
> On 20/08/27 08:16AM, Lukas Bulwahn wrote:
> > On Thu, Aug 27, 2020 at 8:13 AM Mrinal Pandey <mrinalmni@gmail.com> wrote:
> > >
> > > On 20/08/27 11:35AM, Mrinal Pandey wrote:
> > > > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > > > spdxcheck-test.sh to repository without the executable flag and license
> >
> > s/to/to the/
> >
> > > > information.
> > > >
> > > > commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> > > > dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> > > > Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> > > > and commit 9b4ade226f74 ("xen: build infrastructure for generating
> > > > hypercall depending symbols") added the file xen-hypercalls.sh without the
> > > > executable bit.
> > > >
> > > > Set to usual modes for these files and provide the SPDX license for
> > > > spdxcheck-test.sh. No functional changes.
> > > >
> > > > Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> > > > ---
> > > >  scripts/gcc-plugins/gen-random-seed.sh | 0
> > > >  scripts/nsdeps                         | 0
> > > >  scripts/spdxcheck-test.sh              | 2 +-
> > > >  scripts/xen-hypercalls.sh              | 0
> > > >  4 files changed, 1 insertion(+), 1 deletion(-)
> > > >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> > > >  mode change 100644 => 100755 scripts/nsdeps
> > > >  mode change 100644 => 100755 scripts/spdxcheck-test.sh
> > > >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> > > >
> > > > diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
> > > > old mode 100644
> > > > new mode 100755
> > > > diff --git a/scripts/nsdeps b/scripts/nsdeps
> > > > old mode 100644
> > > > new mode 100755
> > > > diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
> > > > old mode 100644
> > > > new mode 100755
> > > > index cfea6a0d1cc0..758fa645ed99
> > > > --- a/scripts/spdxcheck-test.sh
> > > > +++ b/scripts/spdxcheck-test.sh
> > > > @@ -1,5 +1,5 @@
> > > >  #!/bin/sh
> > > > -
> >
> > Why do you delete the newline?
>
> Sir,
>
> I will rectify this and include the above suggested change in the final
> patch.
> >
> > > > +# SPDX-License-Identifier: GPL-2.0
> > > >  for PYTHON in python2 python3; do
> > > >       # run check on a text and a binary file
> > > >       for FILE in Makefile Documentation/logo.gif; do
> > > > diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
> > > > old mode 100644
> > > > new mode 100755
> > > > --
> > > > 2.25.1
> > > >
> > >
> >
> > I think it is fine to have this as a single patch. It is local enough
> > to say that we are touching all those files in a single go.
> >
> > Other than that, it looks good to me.
> >
> > Please state to whom you intend to send this patch.
>
> Running get_maintainer.pl on patch suggests to send it to the following adresses:
>
> Kees Cook <keescook@chromium.org> (maintainer:GCC PLUGINS)
> Emese Revfy <re.emese@gmail.com> (reviewer:GCC PLUGINS)
> Matthias Maennich <maennich@google.com> (maintainer:NSDEPS)
> Thomas Gleixner <tglx@linutronix.de> (maintainer:LICENSES and SPDX stuff)
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> (maintainer:LICENSES and SPDX stuff)
> kernel-hardening@lists.openwall.com (open list:GCC PLUGINS)
> linux-kernel@vger.kernel.org (open list)
> linux-spdx@vger.kernel.org (open list:LICENSES and SPDX stuff)
>

I think you should ask for a quick ack from (Kees or Emese) and
Matthias and Thomas, and add

Andrew Morton <akpm@linux-foundation.org>

and ask Andrew to pick up this patch once the ACKs from the people
above are there. The patch travels best through Andrew's tree.

Also, CC linux-kernel-mentees, Shuah and me.

So, go fix the minor points I mentioned above and then send it out to
the proposed list with my mentioned additions here.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-31  5:45   ` Lukas Bulwahn
@ 2020-08-31 19:20     ` Kees Cook
  0 siblings, 0 replies; 14+ messages in thread
From: Kees Cook @ 2020-08-31 19:20 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: kernel-hardening, maennich, linux-kernel, re.emese, linux-spdx,
	Andrew Morton, Linux-kernel-mentees, tglx

On Mon, Aug 31, 2020 at 07:45:25AM +0200, Lukas Bulwahn wrote:
> 
> 
> On Sun, 30 Aug 2020, Andrew Morton wrote:
> 
> > On Thu, 27 Aug 2020 14:54:05 +0530 Mrinal Pandey <mrinalmni@gmail.com> wrote:
> > 
> > > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > > spdxcheck-test.sh to the repository without the executable flag and license
> > > information.
> > 
> > The x bit shouldn't matter.
> > 
> > If someone downloads and applies patch-5.9.xz (which is a supported way
> > of obtaining a kernel) then patch(1) will erase the x bit anyway.
> >
> 
> Andrew, Kees,
> 
> thanks for the feedback.
> 
> As his mentor, I see two valuable tasks for Mrinal to work on:
> 
> 1. Document this knowledge how scripts should be called, not relying on 
> the executable bit, probably best somewhere here:
> ./Documentation/kbuild/makefiles.rst, a new section on using dedicated 
> scripts in chapter 3 ("The  kbuild files").
> 
> https://www.kernel.org/doc/html/latest/kbuild/makefiles.html#the-kbuild-files

Yes, that would be excellent.

> 2. Determine if there are places in the build Makefiles that do rely on 
> the executable bit and fix those script invocations. (Kees' idea of remove 
> all executable bits and see...)

I think this has value, yes. I don't think patches to remove the x bits
are needed, but any cases where they are depended on need to be fixed.

And I think "3" could be "wire up or remove spdx shell script"

-- 
Kees Cook
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-31  0:44 ` Andrew Morton
@ 2020-08-31  5:45   ` Lukas Bulwahn
  2020-08-31 19:20     ` Kees Cook
  0 siblings, 1 reply; 14+ messages in thread
From: Lukas Bulwahn @ 2020-08-31  5:45 UTC (permalink / raw)
  To: Andrew Morton, keescook
  Cc: linux-spdx, kernel-hardening, maennich, linux-kernel, re.emese,
	tglx, Linux-kernel-mentees



On Sun, 30 Aug 2020, Andrew Morton wrote:

> On Thu, 27 Aug 2020 14:54:05 +0530 Mrinal Pandey <mrinalmni@gmail.com> wrote:
> 
> > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > spdxcheck-test.sh to the repository without the executable flag and license
> > information.
> 
> The x bit shouldn't matter.
> 
> If someone downloads and applies patch-5.9.xz (which is a supported way
> of obtaining a kernel) then patch(1) will erase the x bit anyway.
>

Andrew, Kees,

thanks for the feedback.

As his mentor, I see two valuable tasks for Mrinal to work on:

1. Document this knowledge how scripts should be called, not relying on 
the executable bit, probably best somewhere here:
./Documentation/kbuild/makefiles.rst, a new section on using dedicated 
scripts in chapter 3 ("The  kbuild files").

https://www.kernel.org/doc/html/latest/kbuild/makefiles.html#the-kbuild-files

2. Determine if there are places in the build Makefiles that do rely on 
the executable bit and fix those script invocations. (Kees' idea of remove 
all executable bits and see...)


Lukas
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  9:24 Mrinal Pandey
                   ` (2 preceding siblings ...)
  2020-08-27 18:14 ` Kees Cook
@ 2020-08-31  0:44 ` Andrew Morton
  2020-08-31  5:45   ` Lukas Bulwahn
  3 siblings, 1 reply; 14+ messages in thread
From: Andrew Morton @ 2020-08-31  0:44 UTC (permalink / raw)
  To: Mrinal Pandey
  Cc: keescook, kernel-hardening, linux-spdx, maennich, linux-kernel,
	re.emese, tglx, Linux-kernel-mentees

On Thu, 27 Aug 2020 14:54:05 +0530 Mrinal Pandey <mrinalmni@gmail.com> wrote:

> commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> spdxcheck-test.sh to the repository without the executable flag and license
> information.

The x bit shouldn't matter.

If someone downloads and applies patch-5.9.xz (which is a supported way
of obtaining a kernel) then patch(1) will erase the x bit anyway.

Is some other script invoking spdxcheck-test.sh directly, instead of
using `/bin/sh spdxcheck-test.sh'?  If so, please let's fix that.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  9:24 Mrinal Pandey
  2020-08-27  9:34 ` Lukas Bulwahn
  2020-08-27  9:43 ` Greg KH
@ 2020-08-27 18:14 ` Kees Cook
  2020-08-31  0:44 ` Andrew Morton
  3 siblings, 0 replies; 14+ messages in thread
From: Kees Cook @ 2020-08-27 18:14 UTC (permalink / raw)
  To: Mrinal Pandey
  Cc: linux-spdx, maennich, linux-kernel, re.emese, tglx,
	Thierry Reding, Linux-kernel-mentees, akpm

On Thu, Aug 27, 2020 at 02:54:05PM +0530, Mrinal Pandey wrote:
> commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> and commit 9b4ade226f74 ("xen: build infrastructure for generating
> hypercall depending symbols") added the file xen-hypercalls.sh without the
> executable bit.
> [...]
>  scripts/gcc-plugins/gen-random-seed.sh | 0
>  scripts/nsdeps                         | 0
>  scripts/spdxcheck-test.sh              | 1 +
>  scripts/xen-hypercalls.sh              | 0
>  4 files changed, 1 insertion(+)
>  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
>  mode change 100644 => 100755 scripts/nsdeps
>  mode change 100644 => 100755 scripts/spdxcheck-test.sh
>  mode change 100644 => 100755 scripts/xen-hypercalls.sh

I can't find "official" guidance on this right now, but I'm pretty sure
this (having execute bits set correctly) wasn't something we could depend
on (i.e. regular "diff" output doesn't support it (just git's diff),
and copies of the tree (or tarballs, etc) may have missed the bits). All
the portions of the kernel that uses these kinds of files explicitly
specify the interpreter (or universally set the execute bit)[1]. As such,
is this change useful?

It might be better to _remove_ execute bits to catch the places where
the build is accidentally depending on them. ;)

-Kees


[1] These all use CONFIG_SHELL:

scripts/gcc-plugins/Makefile:
  $(CONFIG_SHELL) $(srctree)/$(src)/gen-random-seed.sh $@ $(objtree)/include/generated/randomize_layout_hash.h

Makefile:
       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/nsdeps

arch/x86/entry/syscalls/Makefile:
quiet_cmd_hypercalls = HYPERCALLS $@
      cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^)
...
$(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh
        $(call if_changed,hypercalls)

And I can't even find anything in the kernel that calls
scripts/spdxcheck-test.sh :) I think that should likely be moved into
the selftests directory and wired up.


-- 
Kees Cook
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  9:49   ` Lukas Bulwahn
@ 2020-08-27 10:00     ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2020-08-27 10:00 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: keescook, kernel-hardening, maennich, linux-kernel, re.emese,
	linux-spdx, tglx, Linux-kernel-mentees, akpm

On Thu, Aug 27, 2020 at 11:49:31AM +0200, Lukas Bulwahn wrote:
> 
> 
> On Thu, 27 Aug 2020, Greg KH wrote:
> 
> > On Thu, Aug 27, 2020 at 02:54:05PM +0530, Mrinal Pandey wrote:
> > > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > > spdxcheck-test.sh to the repository without the executable flag and license
> > > information.
> > > 
> > > commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> > > dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> > > Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> > > and commit 9b4ade226f74 ("xen: build infrastructure for generating
> > > hypercall depending symbols") added the file xen-hypercalls.sh without the
> > > executable bit.
> > > 
> > > Set to usual modes for these files and provide the SPDX license for
> > > spdxcheck-test.sh. No functional changes.
> > > 
> > > Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> > > ---
> > > applies cleanly on next-20200827
> > > 
> > > Kees, Matthias, Thomas, please ack this patch.
> > > 
> > > Andrew, please pick this minor non-urgent cleanup patch once the
> > > mainainers ack.
> > > 
> > >  scripts/gcc-plugins/gen-random-seed.sh | 0
> > >  scripts/nsdeps                         | 0
> > >  scripts/spdxcheck-test.sh              | 1 +
> > >  scripts/xen-hypercalls.sh              | 0
> > >  4 files changed, 1 insertion(+)
> > >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> > >  mode change 100644 => 100755 scripts/nsdeps
> > >  mode change 100644 => 100755 scripts/spdxcheck-test.sh
> > >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> > 
> > This does 2 different things in one patch, shouldn't this be 2 different
> > patches?  One to change the permissions and one to add the SPDX line?
> >
> 
> For me, this was one thing: minor cleanup; and taking one 
> minor patch is easier than taking two, but you make the call. Then, the 
> two or even three patches would also just travel through different trees, 
> the spdx tree and Andrew's.

License "additions" are good to separate from other changes, in case
people have questions/comments/objections about them, they can be easier
to discuss and possibly reverted.

More patches is not a problem :)

thanks,

greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  9:43 ` Greg KH
@ 2020-08-27  9:49   ` Lukas Bulwahn
  2020-08-27 10:00     ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Lukas Bulwahn @ 2020-08-27  9:49 UTC (permalink / raw)
  To: Greg KH
  Cc: keescook, kernel-hardening, linux-spdx, maennich, linux-kernel,
	re.emese, tglx, Linux-kernel-mentees, akpm



On Thu, 27 Aug 2020, Greg KH wrote:

> On Thu, Aug 27, 2020 at 02:54:05PM +0530, Mrinal Pandey wrote:
> > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> > spdxcheck-test.sh to the repository without the executable flag and license
> > information.
> > 
> > commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> > dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> > Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> > and commit 9b4ade226f74 ("xen: build infrastructure for generating
> > hypercall depending symbols") added the file xen-hypercalls.sh without the
> > executable bit.
> > 
> > Set to usual modes for these files and provide the SPDX license for
> > spdxcheck-test.sh. No functional changes.
> > 
> > Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> > ---
> > applies cleanly on next-20200827
> > 
> > Kees, Matthias, Thomas, please ack this patch.
> > 
> > Andrew, please pick this minor non-urgent cleanup patch once the
> > mainainers ack.
> > 
> >  scripts/gcc-plugins/gen-random-seed.sh | 0
> >  scripts/nsdeps                         | 0
> >  scripts/spdxcheck-test.sh              | 1 +
> >  scripts/xen-hypercalls.sh              | 0
> >  4 files changed, 1 insertion(+)
> >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> >  mode change 100644 => 100755 scripts/nsdeps
> >  mode change 100644 => 100755 scripts/spdxcheck-test.sh
> >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> 
> This does 2 different things in one patch, shouldn't this be 2 different
> patches?  One to change the permissions and one to add the SPDX line?
>

For me, this was one thing: minor cleanup; and taking one 
minor patch is easier than taking two, but you make the call. Then, the 
two or even three patches would also just travel through different trees, 
the spdx tree and Andrew's.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  9:24 Mrinal Pandey
  2020-08-27  9:34 ` Lukas Bulwahn
@ 2020-08-27  9:43 ` Greg KH
  2020-08-27  9:49   ` Lukas Bulwahn
  2020-08-27 18:14 ` Kees Cook
  2020-08-31  0:44 ` Andrew Morton
  3 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2020-08-27  9:43 UTC (permalink / raw)
  To: Mrinal Pandey
  Cc: keescook, kernel-hardening, linux-spdx, maennich, linux-kernel,
	re.emese, tglx, Linux-kernel-mentees, akpm

On Thu, Aug 27, 2020 at 02:54:05PM +0530, Mrinal Pandey wrote:
> commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> spdxcheck-test.sh to the repository without the executable flag and license
> information.
> 
> commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> and commit 9b4ade226f74 ("xen: build infrastructure for generating
> hypercall depending symbols") added the file xen-hypercalls.sh without the
> executable bit.
> 
> Set to usual modes for these files and provide the SPDX license for
> spdxcheck-test.sh. No functional changes.
> 
> Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
> ---
> applies cleanly on next-20200827
> 
> Kees, Matthias, Thomas, please ack this patch.
> 
> Andrew, please pick this minor non-urgent cleanup patch once the
> mainainers ack.
> 
>  scripts/gcc-plugins/gen-random-seed.sh | 0
>  scripts/nsdeps                         | 0
>  scripts/spdxcheck-test.sh              | 1 +
>  scripts/xen-hypercalls.sh              | 0
>  4 files changed, 1 insertion(+)
>  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
>  mode change 100644 => 100755 scripts/nsdeps
>  mode change 100644 => 100755 scripts/spdxcheck-test.sh
>  mode change 100644 => 100755 scripts/xen-hypercalls.sh

This does 2 different things in one patch, shouldn't this be 2 different
patches?  One to change the permissions and one to add the SPDX line?

thanks,

greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
  2020-08-27  9:24 Mrinal Pandey
@ 2020-08-27  9:34 ` Lukas Bulwahn
  2020-08-27  9:43 ` Greg KH
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Lukas Bulwahn @ 2020-08-27  9:34 UTC (permalink / raw)
  To: Mrinal Pandey
  Cc: keescook, kernel-hardening, linux-spdx, maennich, linux-kernel,
	re.emese, tglx, Linux-kernel-mentees, akpm



On Thu, 27 Aug 2020, Mrinal Pandey wrote:

> commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
> spdxcheck-test.sh to the repository without the executable flag and license
> information.
> 
> commit eb8305aecb95 ("scripts: Coccinelle script for namespace
> dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
> Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
> and commit 9b4ade226f74 ("xen: build infrastructure for generating
> hypercall depending symbols") added the file xen-hypercalls.sh without the
> executable bit.
> 
> Set to usual modes for these files and provide the SPDX license for
> spdxcheck-test.sh. No functional changes.
> 
> Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>

This is a contribution from a candidate of the Linux Kernel Onboarding 
Mentorship. If successful, the candidate will work on improving 
checkpatch.pl so that we get closer to a state where we can run it as a 
bot reporting on patch submissions to mailing lists.

This was clean-up work we came across looking at SPDX license warnings,
script shebangs, and executable modes of files.

Acked-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

> ---
> applies cleanly on next-20200827
> 
> Kees, Matthias, Thomas, please ack this patch.
> 
> Andrew, please pick this minor non-urgent cleanup patch once the
> mainainers ack.
> 
>  scripts/gcc-plugins/gen-random-seed.sh | 0
>  scripts/nsdeps                         | 0
>  scripts/spdxcheck-test.sh              | 1 +
>  scripts/xen-hypercalls.sh              | 0
>  4 files changed, 1 insertion(+)
>  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
>  mode change 100644 => 100755 scripts/nsdeps
>  mode change 100644 => 100755 scripts/spdxcheck-test.sh
>  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> 
> diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
> old mode 100644
> new mode 100755
> diff --git a/scripts/nsdeps b/scripts/nsdeps
> old mode 100644
> new mode 100755
> diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
> old mode 100644
> new mode 100755
> index cfea6a0d1cc0..e2902520a081
> --- a/scripts/spdxcheck-test.sh
> +++ b/scripts/spdxcheck-test.sh
> @@ -1,4 +1,5 @@
>  #!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
>  
>  for PYTHON in python2 python3; do
>  	# run check on a text and a binary file
> diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
> old mode 100644
> new mode 100755
> -- 
> 2.25.1
> 
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license
@ 2020-08-27  9:24 Mrinal Pandey
  2020-08-27  9:34 ` Lukas Bulwahn
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Mrinal Pandey @ 2020-08-27  9:24 UTC (permalink / raw)
  To: skhan, Linux-kernel-mentees, lukas.bulwahn, keescook, re.emese,
	maennich, tglx, gregkh, akpm, kernel-hardening, linux-kernel,
	linux-spdx, mrinalmni


[-- Attachment #1.1: Type: text/plain, Size: 2011 bytes --]

commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file
spdxcheck-test.sh to the repository without the executable flag and license
information.

commit eb8305aecb95 ("scripts: Coccinelle script for namespace
dependencies.") added the file nsdeps, commit 313dd1b62921 ("gcc-plugins:
Add the randstruct plugin") added the file gcc-plugins/gen-random-seed.sh
and commit 9b4ade226f74 ("xen: build infrastructure for generating
hypercall depending symbols") added the file xen-hypercalls.sh without the
executable bit.

Set to usual modes for these files and provide the SPDX license for
spdxcheck-test.sh. No functional changes.

Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
---
applies cleanly on next-20200827

Kees, Matthias, Thomas, please ack this patch.

Andrew, please pick this minor non-urgent cleanup patch once the
mainainers ack.

 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/nsdeps                         | 0
 scripts/spdxcheck-test.sh              | 1 +
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 1 insertion(+)
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/nsdeps
 mode change 100644 => 100755 scripts/spdxcheck-test.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
old mode 100644
new mode 100755
diff --git a/scripts/nsdeps b/scripts/nsdeps
old mode 100644
new mode 100755
diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh
old mode 100644
new mode 100755
index cfea6a0d1cc0..e2902520a081
--- a/scripts/spdxcheck-test.sh
+++ b/scripts/spdxcheck-test.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
 
 for PYTHON in python2 python3; do
 	# run check on a text and a binary file
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
old mode 100644
new mode 100755
-- 
2.25.1


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

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

end of thread, other threads:[~2020-08-31 19:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  6:05 [Linux-kernel-mentees] [PATCH] scripts: Add intended executable mode and SPDX license Mrinal Pandey
2020-08-27  6:13 ` Mrinal Pandey
2020-08-27  6:16   ` Lukas Bulwahn
2020-08-27  6:26     ` Mrinal Pandey
2020-08-27  7:24       ` Lukas Bulwahn
2020-08-27  9:24 Mrinal Pandey
2020-08-27  9:34 ` Lukas Bulwahn
2020-08-27  9:43 ` Greg KH
2020-08-27  9:49   ` Lukas Bulwahn
2020-08-27 10:00     ` Greg KH
2020-08-27 18:14 ` Kees Cook
2020-08-31  0:44 ` Andrew Morton
2020-08-31  5:45   ` Lukas Bulwahn
2020-08-31 19:20     ` Kees Cook

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