Skip to contentSkip to conversation

Fix a segmentation fault when trying to run "kexec -p"

PATCH Applied Petr Tesarik 3 participants 3 messages Apr 5, 2018 – Apr 10, 2018

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

PATCH 1/1 Fix a segmentation fault when trying to run "kexec -p"

Do not fall through to "--mem-min" when "-p" option is parsed. The break statement was apparently removed by mistake...

Fixes cb434cbe6f401037e448276bb12056d1fdc3dbfc
---
 kexec/kexec.c | 1 +
 1 file changed, 1 insertion(+)
kexec/kexec.c +1 -0
index 612c1c2..313d9fe 100644
@@ -1349,6 +1349,7 @@ int main(int argc, char *argv[])
 			do_sync = 0;
 			kexec_file_flags |= KEXEC_FILE_ON_CRASH;
 			kexec_flags = KEXEC_ON_CRASH;
+			break;
 		case OPT_MEM_MIN:
 			mem_min = strtoul(optarg, &endptr, 0);
 			if (*endptr) {
Signature · 6 lines
2.13.6

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Tested-by on v1 1/1
#1 lore raw
Quoted 15 lines · Petr Tesarik

Do not fall through to "--mem-min" when "-p" option is parsed. The break statement was apparently removed by mistake...

Fixes cb434cbe6f401037e448276bb12056d1fdc3dbfc
---
  kexec/kexec.c | 1 +
  1 file changed, 1 insertion(+)
kexec/kexec.c +0 -0
index 612c1c2..313d9fe 100644

kexec/kexec.c int main(int argc, char *argv[]) · line 1355

Quoted 7 lines
kexec/kexec.c +1 -0
@@ -1349,6 +1349,7 @@ int main(int argc, char *argv[])
  			do_sync = 0;
  			kexec_file_flags |= KEXEC_FILE_ON_CRASH;
  			kexec_flags = KEXEC_ON_CRASH;
+			break;
  		case OPT_MEM_MIN:
  			mem_min = strtoul(optarg, &endptr, 0);
  			if (*endptr) {

'kexec -p' is currently broken (segfaults) upstream. I tested this fix on my arm64 board, so:

Regards,
Bhupesh

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Applied
#2 lore raw
Quoted 27 lines · Bhupesh Sharma
Quoted 15 lines · Petr Tesarik

Do not fall through to "--mem-min" when "-p" option is parsed. The break statement was apparently removed by mistake...

Fixes cb434cbe6f401037e448276bb12056d1fdc3dbfc
---
  kexec/kexec.c | 1 +
  1 file changed, 1 insertion(+)
kexec/kexec.c +0 -0
index 612c1c2..313d9fe 100644

kexec/kexec.c int main(int argc, char *argv[]) · line 1355

Quoted 7 lines
kexec/kexec.c +1 -0
@@ -1349,6 +1349,7 @@ int main(int argc, char *argv[])
  			do_sync = 0;
  			kexec_file_flags |= KEXEC_FILE_ON_CRASH;
  			kexec_flags = KEXEC_ON_CRASH;
+			break;
  		case OPT_MEM_MIN:
  			mem_min = strtoul(optarg, &endptr, 0);
  			if (*endptr) {

'kexec -p' is currently broken (segfaults) upstream. I tested this fix on my arm64 board, so:

Quoted 1 line

Thanks, applied with the fixes tag updated to:

Fixes cb434cbe6f40 ("kexec: Do not special-case the -s option")

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec