Skip to contentSkip to conversation

xen/tools: Fix symbols segfaults

PATCH In review Pawel Wieczorkiewicz 3 participants 4 messages Apr 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/tools: Fix symbols segfaults

The symbols tool is outdated and has a bug in it leading to crashes. The tool is derived from linux kernel where this bug has been already fixed.

Original linux kernel commit:
e0a04b11e4059cab033469617 scripts/kallsyms.c: fix potential segfault

---
 xen/tools/symbols.c | 2 ++
 1 file changed, 2 insertions(+)
xen/tools/symbols.c +2 -0
index 8c5842d43f..05139d1600 100644
@@ -525,6 +525,8 @@ static void optimize_result(void)
 
 			/* find the token with the breates profit value */
 			best = find_best_token();
+			if (token_profit[best] == 0)
+			        break;
 
 			/* place it in the "best" table */
 			best_table_len[i] = 2;
Signature · 18 lines
2.16.5




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
Ust-ID: DE 289 237 879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B



_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 03.04.19 at 09:56, <[email protected]> wrote:

The symbols tool is outdated and has a bug in it leading to crashes. The tool is derived from linux kernel where this bug has been already fixed.

Thanks for noticing this omission of ours.

Quoted 6 lines

Original linux kernel commit:
e0a04b11e4059cab033469617 scripts/kallsyms.c: fix potential segfault

When we pull in changes (almost) verbatim from Linux, we typically retain original authorship as well as the (possibly massaged) title and description. See xen/arch/x86/cpu/mwait-idle.c's history for some examples. I'll do this transformation before committing the change, but in the future I'd appreciate if ported patches were submitted that way.

I'm btw also confused by the Cc list you've used: You should have Cc-ed THE REST, not just the tool stack maintainers.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author Reviewed-by Bjoern Doebel Reviewed-by Norbert Manthey Acked-by Jan Beulich
#2 lore raw

On 3. Apr 2019, at 10:10, Jan Beulich <[email protected]<mailto:[email protected]>> wrote:

On 03.04.19 at 09:56, <[email protected]<mailto:[email protected]>> wrote:
The symbols tool is outdated and has a bug in it leading to crashes. The tool is derived from linux kernel where this bug has been already fixed.

Thanks for noticing this omission of ours.

Anytime.

Original linux kernel commit:
e0a04b11e4059cab033469617 scripts/kallsyms.c: fix potential segfault

When we pull in changes (almost) verbatim from Linux, we typically retain original authorship as well as the (possibly massaged) title and description. See xen/arch/x86/cpu/mwait-idle.c's history for some examples. I'll do this transformation before committing the change, but in the future I'd appreciate if ported patches were submitted that way.

Sure, I will be submitting patches that way.
It might make sense to add this explanation into the CONTRIBUTING file to avoid this problem in the future (unless it documented already somewhere and I simply missed it).

I'm btw also confused by the Cc list you've used: You should have Cc-ed THE REST, not just the tool stack maintainers.

You’re right. My bad. Sorry.

Jan

Best Regards,
Pawel Wieczorkiewicz

Amazon Development Center Germany GmbH Krausenstr. 38
10117 Berlin
Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
Ust-ID: DE 289 237 879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel