10 Feb, 2008

4 commits


09 Feb, 2008

1 commit

  • Setting up a meta match causes a kernel OOPS because of uninitialized
    elements in tree.

    [ 37.322381] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
    [ 37.322381] IP: [] :em_meta:em_meta_destroy+0x17/0x80

    [ 37.322381] Call Trace:
    [ 37.322381] [] tcf_em_tree_destroy+0x2d/0xa0
    [ 37.322381] [] tcf_em_tree_validate+0x2dc/0x4a0
    [ 37.322381] [] nla_parse+0x92/0xe0
    [ 37.322381] [] :cls_basic:basic_change+0x202/0x3c0
    [ 37.322381] [] kmem_cache_alloc+0x67/0xa0
    [ 37.322381] [] tc_ctl_tfilter+0x3b1/0x580
    [ 37.322381] [] rtnetlink_rcv_msg+0x0/0x260
    [ 37.322381] [] netlink_rcv_skb+0x74/0xa0
    [ 37.322381] [] rtnetlink_rcv+0x18/0x20
    [ 37.322381] [] netlink_unicast+0x263/0x290
    [ 37.322381] [] __alloc_skb+0x96/0x160
    [ 37.322381] [] netlink_sendmsg+0x274/0x340
    [ 37.322381] [] sock_sendmsg+0x12b/0x140
    [ 37.322381] [] autoremove_wake_function+0x0/0x30
    [ 37.322381] [] autoremove_wake_function+0x0/0x30
    [ 37.322381] [] sock_sendmsg+0x12b/0x140
    [ 37.322381] [] zone_statistics+0xb1/0xc0
    [ 37.322381] [] sys_sendmsg+0x20e/0x360
    [ 37.322381] [] sockfd_lookup_light+0x41/0x80
    [ 37.322381] [] handle_mm_fault+0x3eb/0x7f0
    [ 37.322381] [] system_call_after_swapgs+0x7b/0x80

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

08 Feb, 2008

1 commit

  • If userspace passes a unknown match index into em_meta, then
    em_meta_change will return an error and the data for the match will
    not be set. This then causes an null pointer dereference when the
    cleanup is done in the error path via tcf_em_tree_destroy. Since the
    tree structure comes kzalloc, it is initialized to NULL.

    Discovered when testing a new version of tc command against an
    accidental older kernel.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

06 Feb, 2008

3 commits


05 Feb, 2008

2 commits

  • Provide a way to use tc filters on vlan tag even if tag is buried in
    skb due to hardware acceleration.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • The 2.6 latest git build was broken when using the following
    configuration options:
    CONFIG_NET_EMATCH=n
    CONFIG_NET_CLS_FLOW=y

    with the following error:
    net/sched/cls_flow.c: In function 'flow_dump':
    net/sched/cls_flow.c:598: error: 'struct tcf_ematch_tree' has no
    member named 'hdr'
    make[2]: *** [net/sched/cls_flow.o] Error 1
    make[1]: *** [net/sched] Error 2
    make: *** [net] Error 2

    see the recent post by Li Zefan:
    http://www.spinics.net/lists/netdev/msg54434.html

    The reason for this crash is that struct tcf_ematch_tree
    (net/pkt_cls.h) is empty when CONFIG_NET_EMATCH is not defined.

    When CONFIG_NET_EMATCH is defined, the tcf_ematch_tree structure
    indeed holds a struct tcf_ematch_tree_hdr (hdr) as flow_dump()
    expects.

    This patch adds #ifdef CONFIG_NET_EMATCH in flow_dump to avoid this.

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     

01 Feb, 2008

6 commits

  • Add new "flow" classifier, which is meant to extend the SFQ hashing
    capabilities without hard-coding new hash functions and also allows
    deterministic mappings of keys to classes, replacing some out of tree
    iptables patches like IPCLASSIFY (maps IPs to classes), IPMARK (maps
    IPs to marks, with fw filters to classes), ...

    Some examples:

    - Classic SFQ hash:

    tc filter add ... flow hash \
    keys src,dst,proto,proto-src,proto-dst divisor 1024

    - Classic SFQ hash, but using information from conntrack to work properly in
    combination with NAT:

    tc filter add ... flow hash \
    keys nfct-src,nfct-dst,proto,nfct-proto-src,nfct-proto-dst divisor 1024

    - Map destination IPs of 192.168.0.0/24 to classids 1-257:

    tc filter add ... flow map \
    key dst addend -192.168.0.0 divisor 256

    - alternatively:

    tc filter add ... flow map \
    key dst and 0xff

    - similar, but reverse ordered:

    tc filter add ... flow map \
    key dst and 0xff xor 0xff

    Perturbation is currently not supported because we can't reliable kill the
    timer on destruction.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Add support for dumping statistics and make internal queues visible as
    classes.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Add support for external classifiers to allow using different flow
    hash functions similar to ESFQ. When no classifier is attached the
    built-in hash is used as before.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Signed-off-by: Roel Kluin
    Signed-off-by: David S. Miller

    Roel Kluin
     
  • Since the old policer code is gone, TC actions are needed for policing.
    The ingress qdisc can get packets directly from netif_receive_skb()
    in case TC actions are enabled or through netfilter otherwise, but
    since without TC actions there is no policer the only thing it actually
    does is count packets.

    Remove the netfilter support and always require TC actions.

    Signed-off-by: Patrick McHardy
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Patrick McHardy
     

29 Jan, 2008

23 commits