The patch titled per task delay accounting taskstats interface: fix clone skbs for each listener has been added to the -mm tree. Its filename is per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-cleanup-fix.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: per task delay accounting taskstats interface: fix clone skbs for each listener From: Shailabh Nagar <nagar@xxxxxxxxxxxxxx> Use a cloned sk_buff for each netlink message sent to multiple listeners. Earlier, the same skb, representing a netlink message, was being erroneously reused for doing genetlink_unicast()'s (effectively netlink_unicast()) to each listener on the per-cpu list of listeners. Since netlink_unicast() frees up the skb passed to it, regardless of status of the send, reuse is bad. Thanks to Chandra Seetharaman for discovering this bug. Signed-off-by: Shailabh Nagar <nagar@xxxxxxxxxxxxxx> Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/taskstats.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff -puN kernel/taskstats.c~per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-cleanup-fix kernel/taskstats.c --- a/kernel/taskstats.c~per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-cleanup-fix +++ a/kernel/taskstats.c @@ -125,6 +125,7 @@ static int send_cpu_listeners(struct sk_ struct genlmsghdr *genlhdr = nlmsg_data((struct nlmsghdr *)skb->data); struct listener_list *listeners; struct listener *s, *tmp; + struct sk_buff *skb_next, *skb_cur = skb; void *reply = genlmsg_data(genlhdr); int rc, ret; @@ -138,12 +139,22 @@ static int send_cpu_listeners(struct sk_ listeners = &per_cpu(listener_array, cpu); down_write(&listeners->sem); list_for_each_entry_safe(s, tmp, &listeners->list, list) { - ret = genlmsg_unicast(skb, s->pid); + skb_next = NULL; + if (!list_islast(&s->list, &listeners->list)) { + skb_next = skb_clone(skb_cur, GFP_KERNEL); + if (!skb_next) { + nlmsg_free(skb_cur); + rc = -ENOMEM; + break; + } + } + ret = genlmsg_unicast(skb_cur, s->pid); if (ret == -ECONNREFUSED) { list_del(&s->list); kfree(s); rc = ret; } + skb_cur = skb_next; } up_write(&listeners->sem); _ Patches currently in -mm which might be from nagar@xxxxxxxxxxxxxx are netlink-improve-string-attribute-validation.patch list_islast-utility.patch per-task-delay-accounting-setup.patch per-task-delay-accounting-sync-block-i-o-and-swapin-delay-collection.patch per-task-delay-accounting-cpu-delay-collection-via-schedstats.patch per-task-delay-accounting-utilities-for-genetlink-usage.patch per-task-delay-accounting-taskstats-interface.patch per-task-delay-accounting-delay-accounting-usage-of-taskstats-interface.patch per-task-delay-accounting-documentation.patch per-task-delay-accounting-proc-export-of-aggregated-block-i-o-delays.patch delay-accounting-taskstats-interface-send-tgid-once.patch per-task-delay-accounting-avoid-send-without-listeners.patch per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks.patch per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix.patch per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-2.patch per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-3.patch per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-cleanup.patch per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix-cleanup-fix.patch per-task-delay-accounting-taskstats-interface-documentation-fix.patch task-watchers-register-per-task-delay-accounting.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html