lkml.org 
[lkml]   [2011]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] x86, mce: Add persistent MCE event
From
Date
On Tue, 2011-05-03 at 17:22 +0200, Borislav Petkov wrote:
> On Tue, May 03, 2011 at 11:14:16AM -0400, Joe Perches wrote:
> > On Tue, 2011-05-03 at 09:18 +0200, Borislav Petkov wrote:
> > > On Tue, May 03, 2011 at 02:44:01AM -0400, Ingo Molnar wrote:
> > > > * Borislav Petkov <bp@amd64.org> wrote:
> > []
> > > > > +static struct dentry *mce_add_event_debugfs(struct perf_event *event, int cpu)
> > > > > +{
> > > > > + char buf[14];

There should be no harm in upping that number to 32. (I've seen much
worse on stacks).

> > > > > +
> > > > > + sprintf(buf, "mce_record%d", cpu);

At least change this to:

snprintf(buf, 14, ....)

> >
> > trivia:
> >
> > buf[14] doesn't fit 10k+ cpus.
>
> I'll fix that when someone comes up with a x86 system that supports 10k+
> CPUs with a single system image :).
>

Best to fix it now, to save the trouble of finding this bug for those
that are maintaining this code long after we have retired or are dead ;)

-- Steve





\
 
 \ /
  Last update: 2011-05-03 17:37    [W:0.054 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site