Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] binfmt_elf_fdpic: fix execfd build regression
@ 2020-05-27 13:49 Arnd Bergmann
  2020-05-27 22:08 ` Eric W. Biederman
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2020-05-27 13:49 UTC (permalink / raw)
  To: Alexander Viro, Kees Cook, Eric W. Biederman
  Cc: Arnd Bergmann, Valdis Klētnieks, Greg Ungerer,
	linux-fsdevel, linux-kernel

The change to bprm->have_execfd was incomplete, leading
to a build failure:

fs/binfmt_elf_fdpic.c: In function 'create_elf_fdpic_tables':
fs/binfmt_elf_fdpic.c:591:27: error: 'BINPRM_FLAGS_EXECFD' undeclared

Change the last user of BINPRM_FLAGS_EXECFD in a corresponding
way.

Reported-by: Valdis Klētnieks <valdis.kletnieks@vt.edu>
Fixes: b8a61c9e7b4a ("exec: Generic execfd support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I have no idea whether this is right, I only looked briefly at
the commit that introduced the problem.
---
 fs/binfmt_elf_fdpic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index bba3ad555b94..aaf332d32326 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -588,7 +588,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
 	nitems = 1 + DLINFO_ITEMS + (k_platform ? 1 : 0) +
 		(k_base_platform ? 1 : 0) + AT_VECTOR_SIZE_ARCH;
 
-	if (bprm->interp_flags & BINPRM_FLAGS_EXECFD)
+	if (bprm->have_execfd)
 		nitems++;
 
 	csp = sp;
-- 
2.26.2


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

* Re: [PATCH] binfmt_elf_fdpic: fix execfd build regression
  2020-05-27 13:49 [PATCH] binfmt_elf_fdpic: fix execfd build regression Arnd Bergmann
@ 2020-05-27 22:08 ` Eric W. Biederman
  2020-05-27 22:29   ` Arnd Bergmann
  2020-05-27 22:35   ` Valdis Klētnieks
  0 siblings, 2 replies; 4+ messages in thread
From: Eric W. Biederman @ 2020-05-27 22:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Viro, Kees Cook, Valdis Klētnieks, Greg Ungerer,
	linux-fsdevel, linux-kernel

Arnd Bergmann <arnd@arndb.de> writes:

> The change to bprm->have_execfd was incomplete, leading
> to a build failure:
>
> fs/binfmt_elf_fdpic.c: In function 'create_elf_fdpic_tables':
> fs/binfmt_elf_fdpic.c:591:27: error: 'BINPRM_FLAGS_EXECFD' undeclared
>
> Change the last user of BINPRM_FLAGS_EXECFD in a corresponding
> way.
>
> Reported-by: Valdis Klētnieks <valdis.kletnieks@vt.edu>
> Fixes: b8a61c9e7b4a ("exec: Generic execfd support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I have no idea whether this is right, I only looked briefly at
> the commit that introduced the problem.

It is correct and my fault.

Is there an easy to build-test configuration that includes
binfmt_elf_fdpic?

I have this sense that it might be smart to unify binfmt_elf
and binftm_elf_fdpic to the extent possible, and that will take build
tests.

Eric



> ---
>  fs/binfmt_elf_fdpic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
> index bba3ad555b94..aaf332d32326 100644
> --- a/fs/binfmt_elf_fdpic.c
> +++ b/fs/binfmt_elf_fdpic.c
> @@ -588,7 +588,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
>  	nitems = 1 + DLINFO_ITEMS + (k_platform ? 1 : 0) +
>  		(k_base_platform ? 1 : 0) + AT_VECTOR_SIZE_ARCH;
>  
> -	if (bprm->interp_flags & BINPRM_FLAGS_EXECFD)
> +	if (bprm->have_execfd)
>  		nitems++;
>  
>  	csp = sp;

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

* Re: [PATCH] binfmt_elf_fdpic: fix execfd build regression
  2020-05-27 22:08 ` Eric W. Biederman
@ 2020-05-27 22:29   ` Arnd Bergmann
  2020-05-27 22:35   ` Valdis Klētnieks
  1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2020-05-27 22:29 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Alexander Viro, Kees Cook, Valdis Klētnieks, Greg Ungerer,
	Linux FS-devel Mailing List, linux-kernel

On Thu, May 28, 2020 at 12:12 AM Eric W. Biederman
<ebiederm@xmission.com> wrote:
>
> Arnd Bergmann <arnd@arndb.de> writes:
>
> > The change to bprm->have_execfd was incomplete, leading
> > to a build failure:
> >
> > fs/binfmt_elf_fdpic.c: In function 'create_elf_fdpic_tables':
> > fs/binfmt_elf_fdpic.c:591:27: error: 'BINPRM_FLAGS_EXECFD' undeclared
> >
> > Change the last user of BINPRM_FLAGS_EXECFD in a corresponding
> > way.
> >
> > Reported-by: Valdis Klētnieks <valdis.kletnieks@vt.edu>
> > Fixes: b8a61c9e7b4a ("exec: Generic execfd support")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > I have no idea whether this is right, I only looked briefly at
> > the commit that introduced the problem.
>
> It is correct and my fault.
>
> Is there an easy to build-test configuration that includes
> binfmt_elf_fdpic?
>
> I have this sense that it might be smart to unify binfmt_elf
> and binftm_elf_fdpic to the extent possible, and that will take build
> tests.

It should be included in an ARM allmodconfig. Nicolas Pitr did the
work to support ELF_FDPIC on ARM with MMU a while ago, but
I'm not sure what it would take to make this architecture independent
or support build-testing on x86.

       Arnd

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

* Re: [PATCH] binfmt_elf_fdpic: fix execfd build regression
  2020-05-27 22:08 ` Eric W. Biederman
  2020-05-27 22:29   ` Arnd Bergmann
@ 2020-05-27 22:35   ` Valdis Klētnieks
  1 sibling, 0 replies; 4+ messages in thread
From: Valdis Klētnieks @ 2020-05-27 22:35 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Arnd Bergmann, Alexander Viro, Kees Cook, Greg Ungerer,
	linux-fsdevel, linux-kernel

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

On Wed, 27 May 2020 17:08:57 -0500, Eric W. Biederman said:

> Is there an easy to build-test configuration that includes
> binfmt_elf_fdpic?

I tripped over it with a 'make ARM=arch allmodconfig', but any
config that includes CONFIG_BINFMT_ELF_FDPIC should suffice.
I haven't checked the 'depends' for that variable though...

> I have this sense that it might be smart to unify binfmt_elf
> and binftm_elf_fdpic to the extent possible, and that will take build
> tests.

Bring it on! :)


[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

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

end of thread, other threads:[~2020-05-27 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 13:49 [PATCH] binfmt_elf_fdpic: fix execfd build regression Arnd Bergmann
2020-05-27 22:08 ` Eric W. Biederman
2020-05-27 22:29   ` Arnd Bergmann
2020-05-27 22:35   ` Valdis Klētnieks

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