ia64, ppc: Remove uses of sprintf().
A message that is not in the archive (sent off-list or not yet received): [email protected]
xen/arch/ia64/linux-xen/setup.c show_cpuinfo (struct seq_file *m, void * · line 554
Quoted 10 lines · Xen staging patchbot-unstable
diff -r
300c47bec138-rbd69e83b65eaxen/arch/ia64/linux-xen/setup.cxen/arch/ia64/linux-xen/setup.c +1
-1@@ -550,7 +550,7 @@ show_cpuinfo (struct seq_file *m, void *switch (c->family) {case 0x07 :memcpy (family,"Itanium" ,8 );break ;case 0x1f :memcpy (family,"Itanium 2" ,10 );break ; -default :sprintf (family,"%u" , c->family);break ; +default :snprintf (family,sizeof (family),"%u" , c->family);break ; }
What's the purpose of all this "cleanup"? This is just munging files
that we're leveraging from Linux, making updating them later on more difficult. And these really should have been submitted via the xen-ia64-devel list.
Alex
Signature · 1 line
Alex Williamson HP Open Source & Linux Org.
Quoted 4 lines · Alex Williamson
What's the purpose of all this "cleanup"? This is just munging files
that we're leveraging from Linux, making updating them later on more difficult. And these really should have been submitted via the xen-ia64-devel list.
The aim is to get rid of the 'dangerous' sprintf/strcat/strcpy functions. Obviously not all uses are unsafe but if we don't define them then dangerous uses can't creep in. There were already a few uses throughout Xen where overflow might have silently become a possibility in future (although none would be obviously exploitable). On the x86 side at least it turned out that only a few Linux-derived lines of code had to be modified which seems an acceptable price to pay.
If you still need those functions (do you still grab and munge a whole Linux tree to make Xen on ia64?) then you can define them just for ia64/linux-xen to provide a Linux-y environment, in which case it would make sense to revert any removal patches applied in that subtree.
-- Keir