Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[PKT_SCHED]: Fix error handling while dumping actions
[PKT_SCHED]: Return ENOENT if action module is unavailable
[PKT_SCHED]: Fix illegal memory dereferences when dumping actions

+10 -8
+10 -8
net/sched/act_api.c
··· 250 250 RTA_PUT(skb, a->order, 0, NULL); 251 251 err = tcf_action_dump_1(skb, a, bind, ref); 252 252 if (err < 0) 253 - goto rtattr_failure; 253 + goto errout; 254 254 r->rta_len = skb->tail - (u8*)r; 255 255 } 256 256 257 257 return 0; 258 258 259 259 rtattr_failure: 260 + err = -EINVAL; 261 + errout: 260 262 skb_trim(skb, b - skb->data); 261 - return -err; 263 + return err; 262 264 } 263 265 264 266 struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, ··· 307 305 goto err_mod; 308 306 } 309 307 #endif 308 + *err = -ENOENT; 310 309 goto err_out; 311 310 } 312 311 ··· 779 776 return ret; 780 777 } 781 778 782 - static char * 779 + static struct rtattr * 783 780 find_dump_kind(struct nlmsghdr *n) 784 781 { 785 782 struct rtattr *tb1, *tb2[TCA_ACT_MAX+1]; ··· 807 804 return NULL; 808 805 kind = tb2[TCA_ACT_KIND-1]; 809 806 810 - return (char *) RTA_DATA(kind); 807 + return kind; 811 808 } 812 809 813 810 static int ··· 820 817 struct tc_action a; 821 818 int ret = 0; 822 819 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); 823 - char *kind = find_dump_kind(cb->nlh); 820 + struct rtattr *kind = find_dump_kind(cb->nlh); 824 821 825 822 if (kind == NULL) { 826 823 printk("tc_dump_action: action bad kind\n"); 827 824 return 0; 828 825 } 829 826 830 - a_o = tc_lookup_action_n(kind); 827 + a_o = tc_lookup_action(kind); 831 828 if (a_o == NULL) { 832 - printk("failed to find %s\n", kind); 833 829 return 0; 834 830 } 835 831 ··· 836 834 a.ops = a_o; 837 835 838 836 if (a_o->walk == NULL) { 839 - printk("tc_dump_action: %s !capable of dumping table\n", kind); 837 + printk("tc_dump_action: %s !capable of dumping table\n", a_o->kind); 840 838 goto rtattr_failure; 841 839 } 842 840