Skip to contentSkip to conversation

binfmt: a.out: Fix bogus semicolon

PATCH In review Geert Uytterhoeven 2 participants 2 messages Sep 5, 2021

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

PATCH 1/1 binfmt: a.out: Fix bogus semicolon

fs/binfmt_aout.c: In function ‘load_aout_library’:
fs/binfmt_aout.c:311:27: error: expected ‘)’ before ‘;’ token
311 | MAP_FIXED | MAP_PRIVATE;
| ^
fs/binfmt_aout.c:309:10: error: too few arguments to function ‘vm_mmap’
309 | error = vm_mmap(file, start_addr, ex.a_text + ex.a_data,
| ^~~~~~~
In file included from fs/binfmt_aout.c:12:
include/linux/mm.h:2626:35: note: declared here
2626 | extern unsigned long __must_check vm_mmap(struct file *, unsigned long,
| ^~~~~~~

Fix this by reverting the accidental replacement of a comma by a semicolon.

Fixes 42be8b42535183f8 ("binfmt: don't use MAP_DENYWRITE when loading shared libraries via uselib()")
Reported-by [email protected]
---
 fs/binfmt_aout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_aout.c +1 -1
index a47496d0f123355c..0dcfc691e7e218bc 100644
@@ -308,7 +308,7 @@ static int load_aout_library(struct file *file)
 	/* Now use mmap to map the library into memory. */
 	error = vm_mmap(file, start_addr, ex.a_text + ex.a_data,
 			PROT_READ | PROT_WRITE | PROT_EXEC,
-			MAP_FIXED | MAP_PRIVATE;
+			MAP_FIXED | MAP_PRIVATE,
 			N_TXTOFF(ex));
 	retval = error;
 	if (error != start_addr)
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Geert Uytterhoeven

fs/binfmt_aout.c: In function ‘load_aout_library’:
fs/binfmt_aout.c:311:27: error: expected ‘)’ before ‘;’ token
311 | MAP_FIXED | MAP_PRIVATE;
| ^
fs/binfmt_aout.c:309:10: error: too few arguments to function ‘vm_mmap’
309 | error = vm_mmap(file, start_addr, ex.a_text + ex.a_data,
| ^~~~~~~
In file included from fs/binfmt_aout.c:12:
include/linux/mm.h:2626:35: note: declared here
2626 | extern unsigned long __must_check vm_mmap(struct file *, unsigned long,
| ^~~~~~~

Fix this by reverting the accidental replacement of a comma by a semicolon.

Fixes 42be8b42535183f8 ("binfmt: don't use MAP_DENYWRITE when loading shared libraries via uselib()")
Reported-by [email protected]
---
  fs/binfmt_aout.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_aout.c +0 -0
index a47496d0f123355c..0dcfc691e7e218bc 100644

fs/binfmt_aout.c static int load_aout_library(struct file *file) · line 314

Quoted 8 lines
fs/binfmt_aout.c +1 -1
@@ -308,7 +308,7 @@ static int load_aout_library(struct file *file)
  	/* Now use mmap to map the library into memory. */
  	error = vm_mmap(file, start_addr, ex.a_text + ex.a_data,
  			PROT_READ | PROT_WRITE | PROT_EXEC,
-			MAP_FIXED | MAP_PRIVATE;
+			MAP_FIXED | MAP_PRIVATE,
  			N_TXTOFF(ex));
  	retval = error;
  	if (error != start_addr)

Thanks for reporting and fixing that quickly!

Signature · 3 lines
Thanks,

David / dhildenb