Skip to contentSkip to conversation

libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified

PATCH In review Ian Campbell 4 participants 9 messages Feb 26, 2014 – Apr 4, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified

Otherwise we deference a NULL pointer.

I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default.

---
This is a pretty obvious fix and would be nice to have if we are taking any more fixes for other stuff , but otherwise I think we can leave to 4.4.1 quite happily.

---
 tools/libxl/libxl_arm.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/libxl/libxl_arm.c +4 -2
index 0a1c8c5..0cfd0cf 100644
@@ -164,8 +164,10 @@ static int make_chosen_node(libxl__gc *gc, void *fdt,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
 
-    res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
-    if (res) return res;
+    if (info->u.pv.cmdline) {
+        res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
+        if (res) return res;
+    }
 
     res = fdt_end_node(fdt);
     if (res) return res;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 7 lines · Ian Campbell

Otherwise we deference a NULL pointer.

I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default.

Typo (extra ">") so Goerge's CC got missed out...

Quoted 25 lines

---
This is a pretty obvious fix and would be nice to have if we are taking any more fixes for other stuff , but otherwise I think we can leave to 4.4.1 quite happily.

---
 tools/libxl/libxl_arm.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/libxl/libxl_arm.c +4 -2
index 0a1c8c5..0cfd0cf 100644
@@ -164,8 +164,10 @@ static int make_chosen_node(libxl__gc *gc, void *fdt,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
 
-    res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
-    if (res) return res;
+    if (info->u.pv.cmdline) {
+        res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
+        if (res) return res;
+    }
 
     res = fdt_end_node(fdt);
     if (res) return res;
#2 lore raw
Quoted 9 lines · Ian Campbell
Quoted 7 lines · Ian Campbell

Otherwise we deference a NULL pointer.

I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default.

Typo (extra ">") so Goerge's CC got missed out...

I'm not aware (yet) of anything that might make us delay the release.

-George

Acked-by
#3 lore raw
In reply to Ian Campbell
Quoted 8 lines · Ian Campbell
Quoted 7 lines · Ian Campbell

Otherwise we deference a NULL pointer.

I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default.

Quoted 30 lines

Typo (extra ">") so Goerge's CC got missed out...

Quoted 25 lines

---
This is a pretty obvious fix and would be nice to have if we are taking any more fixes for other stuff , but otherwise I think we can leave to 4.4.1 quite happily.

---
  tools/libxl/libxl_arm.c |    6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tools/libxl/libxl_arm.c +4 -2
index 0a1c8c5..0cfd0cf 100644
@@ -164,8 +164,10 @@ static int make_chosen_node(libxl__gc *gc, void *fdt,
      res = fdt_begin_node(fdt, "chosen");
      if (res) return res;
 
-    res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
-    if (res) return res;
+    if (info->u.pv.cmdline) {
+        res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
+        if (res) return res;
+    }
 
      res = fdt_end_node(fdt);
      if (res) return res;
Signature · 1 line
Julien Grall
#5 lore raw

Ian Campbell writes ("Re: [PATCH] libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified"):

Quoted 1 line

Ian -- please can you queue for 4.4.1.

Queued.

Ian.

#6 lore raw

Ian Jackson writes ("Re: [PATCH] libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified"):

Quoted 4 lines

Ian Campbell writes ("Re: [PATCH] libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified"):

Quoted 1 line

Ian -- please can you queue for 4.4.1.

Queued.

Now pushed to staging-4.4.

Thanks.
Ian.

#7 lore raw
In reply to Ian Campbell
Quoted 10 lines · Ian Campbell
Quoted 7 lines · Ian Campbell

Otherwise we deference a NULL pointer.

I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default.

Typo (extra ">") so Goerge's CC got missed out...

Dropping George since 4.4 is out the door so I'm sure he doesn't care any more.

Ping to the rest of you...

Quoted 33 lines
Quoted 16 lines

---
This is a pretty obvious fix and would be nice to have if we are taking any more fixes for other stuff , but otherwise I think we can leave to 4.4.1 quite happily.

---
 tools/libxl/libxl_arm.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/libxl/libxl_arm.c +0 -0
index 0a1c8c5..0cfd0cf 100644
@@ -164,8 +164,10 @@ static int make_chosen_node(libxl__gc *gc, void *fdt,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;

tools/libxl/libxl_arm.c static int make_chosen_node(libxl__gc *gc, void *fdt, · line 173

Quoted 10 lines
tools/libxl/libxl_arm.c +4 -2
 
-    res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
-    if (res) return res;
+    if (info->u.pv.cmdline) {
+        res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
+        if (res) return res;
+    }
 
     res = fdt_end_node(fdt);
     if (res) return res;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
Quoted 10 lines · Ian Campbell
Quoted 9 lines · Ian Campbell
Quoted 7 lines · Ian Campbell

Otherwise we deference a NULL pointer.

I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default.

Quoted 6 lines
Quoted 1 line

Typo (extra ">") so Goerge's CC got missed out...

Dropping George since 4.4 is out the door so I'm sure he doesn't care any more.

Ping to the rest of you...

Nevermind, I misfiled Julien's ack.

Ian.