Skip to contentSkip to conversation

binfmt_elf_fdpic: fix execfd build regression

PATCH In review Arnd Bergmann 3 participants 4 messages May 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 binfmt_elf_fdpic: fix execfd build regression

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.

Fixes b8a61c9e7b4a ("exec: Generic execfd support")

---
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(-)
fs/binfmt_elf_fdpic.c +1 -1
index bba3ad555b94..aaf332d32326 100644
@@ -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;
Signature · 1 line
2.26.2
#1 lore raw
Quoted 9 lines · Arnd Bergmann

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.

Quoted 6 lines
Fixes b8a61c9e7b4a ("exec: Generic execfd support")

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

Quoted 17 lines
---
 fs/binfmt_elf_fdpic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_elf_fdpic.c +1 -1
index bba3ad555b94..aaf332d32326 100644
@@ -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 lore raw
Quoted 19 lines · Eric W. Biederman
Quoted 9 lines · Arnd Bergmann

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.

Quoted 6 lines
Fixes b8a61c9e7b4a ("exec: Generic execfd support")

---
I have no idea whether this is right, I only looked briefly at the commit that introduced the problem.

Quoted 8 lines

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

#3 lore raw
In reply to Eric W. Biederman
Quoted 2 lines · Eric W. Biederman

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

Quoted 3 lines

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! :)