lkml.org 
[lkml]   [2006]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] per-task delay accounting taskstats interface: control exit data through cpumasks]
Shailabh Nagar <nagar@watson.ibm.com> wrote:
>
> Andrew Morton wrote:
> > Thomas Graf <tgraf@suug.ch> wrote:
> >
> >>* Shailabh Nagar <nagar@watson.ibm.com> 2006-07-06 07:37
> >>
> >>>@@ -37,9 +45,26 @@ static struct nla_policy taskstats_cmd_g
> >>> __read_mostly = {
> >>> [TASKSTATS_CMD_ATTR_PID] = { .type = NLA_U32 },
> >>> [TASKSTATS_CMD_ATTR_TGID] = { .type = NLA_U32 },
> >>>+ [TASKSTATS_CMD_ATTR_REGISTER_CPUMASK] = { .type = NLA_STRING },
> >>>+ [TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK] = { .type = NLA_STRING },};
> >>
> >>>+ na = info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK];
> >>>+ if (nla_len(na) > TASKSTATS_CPUMASK_MAXLEN)
> >>>+ return -E2BIG;
> >>>+ rc = cpulist_parse((char *)nla_data(na), mask);
> >>
> >>This isn't safe, the data in the attribute is not guaranteed to be
> >>NUL terminated. Still it's probably me to blame for not making
> >>this more obvious in the API.
> >>
> >
> >
> > Thanks, that was an unpleasant bug.
> >
> >
> >>I've attached a patch below extending the API to make it easier
> >>for interfaces using NUL termianted strings,
> >
> >
> > In the interests of keeping this work decoupled from netlink enhancements
> > I'd propose the below.
>
> The patch looks good. I was also thinking of simply modifying the input
> to have the null termination and modify later when netlink provides
> generic support.
>
>

Yup. Thomas, what's the testing status of the netlink patch you sent? Should I
queue it up and start plagueing people with it?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-07 00:57    [W:0.264 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site