linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts: make some scripts executable
@ 2021-07-27 15:39 Masahiro Yamada
  2021-07-27 15:56 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2021-07-27 15:39 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Masahiro Yamada, Wan Jiabing, Kees Cook, linux-kernel,
	linux-hardening, Andrew Morton

Set the x bit to some scripts to make them directly executable.

Especially, scripts/checkdeclares.pl is not hooked by anyone.
It should be executable since it is tedious to type
'perl scripts/checkdeclares.pl'.

The original patch [1] set the x bit properly, but it was lost when
it was merged as commit 21917bded72c ("scripts: a new script for
checking duplicate struct declaration").

[1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/checkdeclares.pl               | 0
 scripts/gcc-plugins/gen-random-seed.sh | 0
 scripts/syscallnr.sh                   | 0
 scripts/xen-hypercalls.sh              | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/checkdeclares.pl
 mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
 mode change 100644 => 100755 scripts/syscallnr.sh
 mode change 100644 => 100755 scripts/xen-hypercalls.sh

diff --git a/scripts/checkdeclares.pl b/scripts/checkdeclares.pl
old mode 100644
new mode 100755
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/syscallnr.sh b/scripts/syscallnr.sh
old mode 100644
new mode 100755
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
old mode 100644
new mode 100755
-- 
2.27.0


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

* Re: [PATCH] scripts: make some scripts executable
  2021-07-27 15:39 [PATCH] scripts: make some scripts executable Masahiro Yamada
@ 2021-07-27 15:56 ` Greg KH
  2021-07-28  1:03   ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-07-27 15:56 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Wan Jiabing, Kees Cook, linux-kernel,
	linux-hardening, Andrew Morton

On Wed, Jul 28, 2021 at 12:39:24AM +0900, Masahiro Yamada wrote:
> Set the x bit to some scripts to make them directly executable.
> 
> Especially, scripts/checkdeclares.pl is not hooked by anyone.
> It should be executable since it is tedious to type
> 'perl scripts/checkdeclares.pl'.
> 
> The original patch [1] set the x bit properly, but it was lost when
> it was merged as commit 21917bded72c ("scripts: a new script for
> checking duplicate struct declaration").
> 
> [1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/checkdeclares.pl               | 0
>  scripts/gcc-plugins/gen-random-seed.sh | 0
>  scripts/syscallnr.sh                   | 0
>  scripts/xen-hypercalls.sh              | 0
>  4 files changed, 0 insertions(+), 0 deletions(-)
>  mode change 100644 => 100755 scripts/checkdeclares.pl
>  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
>  mode change 100644 => 100755 scripts/syscallnr.sh
>  mode change 100644 => 100755 scripts/xen-hypercalls.sh

Please no, as other tools (i.e. patch), can not set mode bits, and some
people still rely on patch in places.

If these need to be called by other parts of the build, we should
execute them properly, not rely on the mode settings.

thanks,

greg k-h

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

* Re: [PATCH] scripts: make some scripts executable
  2021-07-27 15:56 ` Greg KH
@ 2021-07-28  1:03   ` Masahiro Yamada
  2021-07-28  1:22     ` Randy Dunlap
  2021-07-28  6:27     ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-07-28  1:03 UTC (permalink / raw)
  To: Greg KH
  Cc: Linux Kbuild mailing list, Wan Jiabing, Kees Cook,
	Linux Kernel Mailing List, linux-hardening, Andrew Morton

On Wed, Jul 28, 2021 at 12:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Jul 28, 2021 at 12:39:24AM +0900, Masahiro Yamada wrote:
> > Set the x bit to some scripts to make them directly executable.
> >
> > Especially, scripts/checkdeclares.pl is not hooked by anyone.
> > It should be executable since it is tedious to type
> > 'perl scripts/checkdeclares.pl'.
> >
> > The original patch [1] set the x bit properly, but it was lost when
> > it was merged as commit 21917bded72c ("scripts: a new script for
> > checking duplicate struct declaration").
> >
> > [1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  scripts/checkdeclares.pl               | 0
> >  scripts/gcc-plugins/gen-random-seed.sh | 0
> >  scripts/syscallnr.sh                   | 0
> >  scripts/xen-hypercalls.sh              | 0
> >  4 files changed, 0 insertions(+), 0 deletions(-)
> >  mode change 100644 => 100755 scripts/checkdeclares.pl
> >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> >  mode change 100644 => 100755 scripts/syscallnr.sh
> >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
>
> Please no, as other tools (i.e. patch), can not set mode bits, and some
> people still rely on patch in places.
>
> If these need to be called by other parts of the build, we should
> execute them properly, not rely on the mode settings.
>
> thanks,
>
> greg k-h


I believe tools should be executable.

If the x bit were missing in scripts/checkpatch.pl
for example, we would need to run 'perl scripts/checkpatch.pl'
instead of 'scripts/checkpatch.pl'. That is annoying.


Most of the scripts under the scripts/ directory
are already executable, and we rely on that fact.
Some of them are run directly, and I do not hear
from anyone who complains about that.




BTW, my 'patch' command on Ubuntu can handle the
x bit.  Doesn't it work on your 'patch' ?


masahiro@grover:~/x-bit-test$ ls -l test.sh
-rw-rw-r-- 1 masahiro masahiro 7 Jul 28 09:50 test.sh
masahiro@grover:~/x-bit-test$ cat set-x.patch
diff --git a/test.sh b/test.sh
old mode 100644
new mode 100755
masahiro@grover:~/x-bit-test$ patch -p1 < set-x.patch
patching file test.sh
masahiro@grover:~/x-bit-test$ ls -l test.sh
-rwxr-xr-x 1 masahiro masahiro 7 Jul 28 09:51 test.sh



Even if it did not work on somebody's tools,
the diff files are provided for bug-fix
releases (for example, 5.13.x), not the entire source.

Developers (except Andrew Morton) use git
to merge patches like this, so I see no issue
on changing the mode.

-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] scripts: make some scripts executable
  2021-07-28  1:03   ` Masahiro Yamada
@ 2021-07-28  1:22     ` Randy Dunlap
  2021-07-28  6:27     ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2021-07-28  1:22 UTC (permalink / raw)
  To: Masahiro Yamada, Greg KH
  Cc: Linux Kbuild mailing list, Wan Jiabing, Kees Cook,
	Linux Kernel Mailing List, linux-hardening, Andrew Morton

On 7/27/21 6:03 PM, Masahiro Yamada wrote:
> On Wed, Jul 28, 2021 at 12:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>>
>> On Wed, Jul 28, 2021 at 12:39:24AM +0900, Masahiro Yamada wrote:
>>> Set the x bit to some scripts to make them directly executable.
>>>
>>> Especially, scripts/checkdeclares.pl is not hooked by anyone.
>>> It should be executable since it is tedious to type
>>> 'perl scripts/checkdeclares.pl'.>>>
>>> The original patch [1] set the x bit properly, but it was lost when
>>> it was merged as commit 21917bded72c ("scripts: a new script for
>>> checking duplicate struct declaration").
>>>
>>> [1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/
>>>
>>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>>> ---
>>>
>>>  scripts/checkdeclares.pl               | 0
>>>  scripts/gcc-plugins/gen-random-seed.sh | 0
>>>  scripts/syscallnr.sh                   | 0
>>>  scripts/xen-hypercalls.sh              | 0
>>>  4 files changed, 0 insertions(+), 0 deletions(-)
>>>  mode change 100644 => 100755 scripts/checkdeclares.pl
>>>  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
>>>  mode change 100644 => 100755 scripts/syscallnr.sh
>>>  mode change 100644 => 100755 scripts/xen-hypercalls.sh
>>
>> Please no, as other tools (i.e. patch), can not set mode bits, and some
>> people still rely on patch in places.
>>
>> If these need to be called by other parts of the build, we should
>> execute them properly, not rely on the mode settings.
>>
>> thanks,
>>
>> greg k-h
> 
> 
> I believe tools should be executable.
> 
> If the x bit were missing in scripts/checkpatch.pl
> for example, we would need to run 'perl scripts/checkpatch.pl'
> instead of 'scripts/checkpatch.pl'. That is annoying.
> 
> 
> Most of the scripts under the scripts/ directory
> are already executable, and we rely on that fact.
> Some of them are run directly, and I do not hear
> from anyone who complains about that.
> 
> 
...
> 
> 
> Even if it did not work on somebody's tools,
> the diff files are provided for bug-fix
> releases (for example, 5.13.x), not the entire source.
> 
> Developers (except Andrew Morton) use git
> to merge patches like this, so I see no issue
> on changing the mode.

Sure, once the changes are in a git tree, it's not an
issue, so I don't see a problem with it.
Someone may have to go a few weeks without such a change,
but that's not a big deal.


-- 
~Randy


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

* Re: [PATCH] scripts: make some scripts executable
  2021-07-28  1:03   ` Masahiro Yamada
  2021-07-28  1:22     ` Randy Dunlap
@ 2021-07-28  6:27     ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-07-28  6:27 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Wan Jiabing, Kees Cook,
	Linux Kernel Mailing List, linux-hardening, Andrew Morton

On Wed, Jul 28, 2021 at 10:03:56AM +0900, Masahiro Yamada wrote:
> On Wed, Jul 28, 2021 at 12:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Jul 28, 2021 at 12:39:24AM +0900, Masahiro Yamada wrote:
> > > Set the x bit to some scripts to make them directly executable.
> > >
> > > Especially, scripts/checkdeclares.pl is not hooked by anyone.
> > > It should be executable since it is tedious to type
> > > 'perl scripts/checkdeclares.pl'.
> > >
> > > The original patch [1] set the x bit properly, but it was lost when
> > > it was merged as commit 21917bded72c ("scripts: a new script for
> > > checking duplicate struct declaration").
> > >
> > > [1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/
> > >
> > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > ---
> > >
> > >  scripts/checkdeclares.pl               | 0
> > >  scripts/gcc-plugins/gen-random-seed.sh | 0
> > >  scripts/syscallnr.sh                   | 0
> > >  scripts/xen-hypercalls.sh              | 0
> > >  4 files changed, 0 insertions(+), 0 deletions(-)
> > >  mode change 100644 => 100755 scripts/checkdeclares.pl
> > >  mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> > >  mode change 100644 => 100755 scripts/syscallnr.sh
> > >  mode change 100644 => 100755 scripts/xen-hypercalls.sh
> >
> > Please no, as other tools (i.e. patch), can not set mode bits, and some
> > people still rely on patch in places.
> >
> > If these need to be called by other parts of the build, we should
> > execute them properly, not rely on the mode settings.
> >
> > thanks,
> >
> > greg k-h
> 
> 
> I believe tools should be executable.
> 
> If the x bit were missing in scripts/checkpatch.pl
> for example, we would need to run 'perl scripts/checkpatch.pl'
> instead of 'scripts/checkpatch.pl'. That is annoying.
> 
> 
> Most of the scripts under the scripts/ directory
> are already executable, and we rely on that fact.
> Some of them are run directly, and I do not hear
> from anyone who complains about that.

Ok, fair enough, I just run into problems when dealing with this with
backports to stable trees, and I know Andrew has also had problems when
dealing with patches like this.

> BTW, my 'patch' command on Ubuntu can handle the
> x bit.  Doesn't it work on your 'patch' ?

Somehow quilt can not handle it, I do not know if that is a problem with
patch not knowing how to read the git-generated-patch or not, but we
have had issues in the past here.

thanks,

greg k-h

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

end of thread, other threads:[~2021-07-28  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 15:39 [PATCH] scripts: make some scripts executable Masahiro Yamada
2021-07-27 15:56 ` Greg KH
2021-07-28  1:03   ` Masahiro Yamada
2021-07-28  1:22     ` Randy Dunlap
2021-07-28  6:27     ` Greg KH

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