09 Nov, 2016

1 commit

  • Thomas reports its not possible to attach the H.245 helper:

    iptables -t raw -A PREROUTING -p udp -j CT --helper H.245
    iptables: No chain/target/match by that name.
    xt_CT: No such helper "H.245"

    This is because H.245 registers as NFPROTO_UNSPEC, but the CT target
    passes NFPROTO_IPV4/IPV6 to nf_conntrack_helper_try_module_get.

    We should treat UNSPEC as wildcard and ignore the l3num instead.

    Reported-by: Thomas Woerner
    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     

25 Sep, 2016

1 commit


13 Sep, 2016

1 commit


21 Jul, 2016

1 commit

  • Add nf_ct_helper_init(), nf_conntrack_helpers_register() and
    nf_conntrack_helpers_unregister() functions to avoid repetitive
    opencoded initialization in helpers.

    This patch keeps an id parameter for nf_ct_helper_init() not to break
    helper matching by name that has been inconsistently exposed to
    userspace through ports, eg. ftp-2121, and through an incremental id,
    eg. tftp-1.

    Signed-off-by: Gao Feng
    Signed-off-by: Pablo Neira Ayuso

    Gao Feng
     

11 Jul, 2016

1 commit


07 Jul, 2016

1 commit

  • Pablo Neira Ayuso says:

    ====================
    Netfilter updates for net-next

    The following patchset contains Netfilter updates for net-next,
    they are:

    1) Don't use userspace datatypes in bridge netfilter code, from
    Tobin Harding.

    2) Iterate only once over the expectation table when removing the
    helper module, instead of once per-netns, from Florian Westphal.

    3) Extra sanitization in xt_hook_ops_alloc() to return error in case
    we ever pass zero hooks, xt_hook_ops_alloc():

    4) Handle NFPROTO_INET from the logging core infrastructure, from
    Liping Zhang.

    5) Autoload loggers when TRACE target is used from rules, this doesn't
    change the behaviour in case the user already selected nfnetlink_log
    as preferred way to print tracing logs, also from Liping Zhang.

    6) Conntrack slabs with SLAB_HWCACHE_ALIGN to allow rearranging fields
    by cache lines, increases the size of entries in 11% per entry.
    From Florian Westphal.

    7) Skip zone comparison if CONFIG_NF_CONNTRACK_ZONES=n, from Florian.

    8) Remove useless defensive check in nf_logger_find_get() from Shivani
    Bhardwaj.

    9) Remove zone extension as place it in the conntrack object, this is
    always include in the hashing and we expect more intensive use of
    zones since containers are in place. Also from Florian Westphal.

    10) Owner match now works from any namespace, from Eric Bierdeman.

    11) Make sure we only reply with TCP reset to TCP traffic from
    nf_reject_ipv4, patch from Liping Zhang.

    12) Introduce --nflog-size to indicate amount of network packet bytes
    that are copied to userspace via log message, from Vishwanath Pai.
    This obsoletes --nflog-range that has never worked, it was designed
    to achieve this but it has never worked.

    13) Introduce generic macros for nf_tables object generation masks.

    14) Use generation mask in table, chain and set objects in nf_tables.
    This allows fixes interferences with ongoing preparation phase of
    the commit protocol and object listings going on at the same time.
    This update is introduced in three patches, one per object.

    15) Check if the object is active in the next generation for element
    deactivation in the rbtree implementation, given that deactivation
    happens from the commit phase path we have to observe the future
    status of the object.

    16) Support for deletion of just added elements in the hash set type.

    17) Allow to resize hashtable from /proc entry, not only from the
    obscure /sys entry that maps to the module parameter, from Florian
    Westphal.

    18) Get rid of NFT_BASECHAIN_DISABLED, this code is not exercised
    anymore since we tear down the ruleset whenever the netdevice
    goes away.

    19) Support for matching inverted set lookups, from Arturo Borrero.

    20) Simplify the iptables_mangle_hook() by removing a superfluous
    extra branch.

    21) Introduce ether_addr_equal_masked() and use it from the netfilter
    codebase, from Joe Perches.

    22) Remove references to "Use netfilter MARK value as routing key"
    from the Netfilter Kconfig description given that this toggle
    doesn't exists already for 10 years, from Moritz Sichert.

    23) Introduce generic NF_INVF() and use it from the xtables codebase,
    from Joe Perches.

    24) Setting logger to NONE via /proc was not working unless explicit
    nul-termination was included in the string. This fixes seems to
    leave the former behaviour there, so we don't break backward.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

07 Jun, 2016

1 commit


02 Jun, 2016

1 commit

  • Pablo Neira Ayuso says:

    ====================
    Netfilter fixes for net

    The following patchset contains Netfilter fixes for your net tree,
    they are:

    1) Fix incorrect timestamp in nfnetlink_queue introduced when addressing
    y2038 safe timestamp, from Florian Westphal.

    2) Get rid of leftover conntrack definition from the previous merge
    window, oneliner from Florian.

    3) Make nf_queue handler pernet to resolve race on dereferencing the
    hook state structure with netns removal, from Eric Biederman.

    4) Ensure clean exit on unregistered helper ports, from Taehee Yoo.

    5) Restore FLOWI_FLAG_KNOWN_NH in nf_dup_ipv6. This got lost while
    generalizing xt_TEE to add packet duplication support in nf_tables,
    from Paolo Abeni.

    6) Insufficient netlink NFTA_SET_TABLE attribute check in
    nf_tables_getset(), from Phil Turnbull.

    7) Reject helper registration on duplicated ports via modparams.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

31 May, 2016

1 commit

  • Don't allow registration of helpers using the same tuple:

    { l3proto, l4proto, src-port }

    We lookup for the helper from the packet path using this tuple through
    __nf_ct_helper_find(). Therefore, we have to avoid having two helpers
    with the same tuple to ensure predictible behaviour.

    Don't compare the helper string names anymore since it is valid to
    register two helpers with the same name, but using different tuples.
    This is also implicitly fixing up duplicated helper registration via
    ports= modparam since the name comparison was defeating the tuple
    duplication validation.

    Reported-by: Feng Gao
    Reported-by: Taehee Yoo
    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

06 May, 2016

1 commit


05 May, 2016

1 commit

  • We already include netns address in the hash and compare the netns pointers
    during lookup, so even if namespaces have overlapping addresses entries
    will be spread across the table.

    Assuming 64k bucket size, this change saves 0.5 mbyte per namespace on a
    64bit system.

    NAT bysrc and expectation hash is still per namespace, those will
    changed too soon.

    Future patch will also make conntrack object slab cache global again.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     

25 Apr, 2016

1 commit

  • Four years ago we introduced a new sysctl knob to disable automatic
    helper assignment in 72110dfaa907 ("netfilter: nf_ct_helper: disable
    automatic helper assignment"). This knob kept this behaviour enabled by
    default to remain conservative.

    This measure was introduced to provide a secure way to configure
    iptables and connection tracking helpers through explicit rules.

    Give the time we have waited for this, let's turn off this by default
    now, worse case users still have a chance to recover the former
    behaviour by explicitly enabling this back through sysctl.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

20 Jan, 2016

1 commit

  • When we need to lock all buckets in the connection hashtable we'd attempt to
    lock 1024 spinlocks, which is way more preemption levels than supported by
    the kernel. Furthermore, this behavior was hidden by checking if lockdep is
    enabled, and if it was - use only 8 buckets(!).

    Fix this by using a global lock and synchronize all buckets on it when we
    need to lock them all. This is pretty heavyweight, but is only done when we
    need to resize the hashtable, and that doesn't happen often enough (or at all).

    Signed-off-by: Sasha Levin
    Acked-by: Jesper Dangaard Brouer
    Reviewed-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Sasha Levin
     

31 Oct, 2014

1 commit


07 Mar, 2014

3 commits

  • nf_conntrack_lock is a monolithic lock and suffers from huge contention
    on current generation servers (8 or more core/threads).

    Perf locking congestion is clear on base kernel:

    - 72.56% ksoftirqd/6 [kernel.kallsyms] [k] _raw_spin_lock_bh
    - _raw_spin_lock_bh
    + 25.33% init_conntrack
    + 24.86% nf_ct_delete_from_lists
    + 24.62% __nf_conntrack_confirm
    + 24.38% destroy_conntrack
    + 0.70% tcp_packet
    + 2.21% ksoftirqd/6 [kernel.kallsyms] [k] fib_table_lookup
    + 1.15% ksoftirqd/6 [kernel.kallsyms] [k] __slab_free
    + 0.77% ksoftirqd/6 [kernel.kallsyms] [k] inet_getpeer
    + 0.70% ksoftirqd/6 [nf_conntrack] [k] nf_ct_delete
    + 0.55% ksoftirqd/6 [ip_tables] [k] ipt_do_table

    This patch change conntrack locking and provides a huge performance
    improvement. SYN-flood attack tested on a 24-core E5-2695v2(ES) with
    10Gbit/s ixgbe (with tool trafgen):

    Base kernel: 810.405 new conntrack/sec
    After patch: 2.233.876 new conntrack/sec

    Notice other floods attack (SYN+ACK or ACK) can easily be deflected using:
    # iptables -A INPUT -m state --state INVALID -j DROP
    # sysctl -w net/netfilter/nf_conntrack_tcp_loose=0

    Use an array of hashed spinlocks to protect insertions/deletions of
    conntracks into the hash table. 1024 spinlocks seem to give good
    results, at minimal cost (4KB memory). Due to lockdep max depth,
    1024 becomes 8 if CONFIG_LOCKDEP=y

    The hash resize is a bit tricky, because we need to take all locks in
    the array. A seqcount_t is used to synchronize the hash table users
    with the resizing process.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: David S. Miller
    Reviewed-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Jesper Dangaard Brouer
     
  • Netfilter expectations are protected with the same lock as conntrack
    entries (nf_conntrack_lock). This patch split out expectations locking
    to use it's own lock (nf_conntrack_expect_lock).

    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: David S. Miller
    Reviewed-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Jesper Dangaard Brouer
     
  • One spinlock per cpu to protect dying/unconfirmed/template special lists.
    (These lists are now per cpu, a bit like the untracked ct)
    Add a @cpu field to nf_conn, to make sure we hold the appropriate
    spinlock at removal time.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: David S. Miller
    Reviewed-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Jesper Dangaard Brouer
     

19 Apr, 2013

1 commit

  • Add copyright statements to all netfilter files which have had significant
    changes done by myself in the past.

    Some notes:

    - nf_conntrack_ecache.c was incorrectly attributed to Rusty and Netfilter
    Core Team when it got split out of nf_conntrack_core.c. The copyrights
    even state a date which lies six years before it was written. It was
    written in 2005 by Harald and myself.

    - net/ipv{4,6}/netfilter.c, net/netfitler/nf_queue.c were missing copyright
    statements. I've added the copyright statement from net/netfilter/core.c,
    where this code originated

    - for nf_conntrack_proto_tcp.c I've also added Jozsef, since I didn't want
    it to give the wrong impression

    Signed-off-by: Patrick McHardy
    Signed-off-by: Pablo Neira Ayuso

    Patrick McHardy
     

06 Apr, 2013

1 commit

  • This patch adds netns support to nf_log and it prepares netns
    support for existing loggers. It is composed of four major
    changes.

    1) nf_log_register has been split to two functions: nf_log_register
    and nf_log_set. The new nf_log_register is used to globally
    register the nf_logger and nf_log_set is used for enabling
    pernet support from nf_loggers.

    Per netns is not yet complete after this patch, it comes in
    separate follow up patches.

    2) Add net as a parameter of nf_log_bind_pf. Per netns is not
    yet complete after this patch, it only allows to bind the
    nf_logger to the protocol family from init_net and it skips
    other cases.

    3) Adapt all nf_log_packet callers to pass netns as parameter.
    After this patch, this function only works for init_net.

    4) Make the sysctl net/netfilter/nf_log pernet.

    Signed-off-by: Gao feng
    Signed-off-by: Pablo Neira Ayuso

    Gao feng
     

08 Mar, 2013

1 commit

  • Pablo Neira Ayuso says:

    ====================
    The following patchset contains Netfilter fixes for your net tree,
    they are:

    * Don't generate audit log message if audit is not enabled, from Gao Feng.

    * Fix logging formatting for packets dropped by helpers, by Joe Perches.

    * Fix a compilation warning in nfnetlink if CONFIG_PROVE_RCU is not set,
    from Paul Bolle.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

03 Mar, 2013

1 commit


28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

19 Feb, 2013

3 commits

  • Pablo Neira Ayuso says:

    ====================
    The following patchset contain updates for your net-next tree, they are:

    * Fix (for just added) connlabel dependencies, from Florian Westphal.

    * Add aliasing support for conntrack, thus users can either use -m state
    or -m conntrack from iptables while using the same kernel module, from
    Jozsef Kadlecsik.

    * Some code refactoring for the CT target to merge common code in
    revision 0 and 1, from myself.

    * Add aliasing support for CT, based on patch from Jozsef Kadlecsik.

    * Add one mutex per nfnetlink subsystem, from myself.

    * Improved logging for packets that are dropped by helpers, from myself.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull in 'net' to take in the bug fixes that didn't make it into
    3.8-final.

    Also, deal with the semantic conflict of the change made to
    net/ipv6/xfrm6_policy.c A missing rt6->n neighbour release
    was added to 'net', but in 'net-next' we no longer cache the
    neighbour entries in the ipv6 routes so that change is not
    appropriate there.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Connection tracking helpers have to drop packets under exceptional
    situations. Currently, the user gets the following logging message
    in case that happens:

    nf_ct_%s: dropping packet ...

    However, depending on the helper, there are different reasons why a
    packet can be dropped.

    This patch modifies the existing code to provide more specific
    error message in the scope of each helper to help users to debug
    the reason why the packet has been dropped, ie:

    nf_ct_%s: dropping packet: reason ...

    Thanks to Joe Perches for many formatting suggestions.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

13 Feb, 2013

1 commit

  • commit (32f5376 netfilter: nf_ct_helper: disable automatic helper
    re-assignment of different type) broke transparent proxy scenarios.

    For example, initial helper lookup might yield "ftp" (dport 21),
    while re-lookup after REDIRECT yields "ftp-2121".

    This causes the autoassign code to toss the ftp helper, even
    though these are just different instances of the same helper.

    Change the test to check for the helper function address instead
    of the helper address, as suggested by Pablo.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     

23 Jan, 2013

1 commit


19 Nov, 2012

1 commit

  • In preparation for supporting the creation of network namespaces
    by unprivileged users, modify all of the per net sysctl exports
    and refuse to allow them to unprivileged users.

    This makes it safe for unprivileged users in general to access
    per net sysctls, and allows sysctls to be exported to unprivileged
    users on an individual basis as they are deemed safe.

    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

19 Jun, 2012

1 commit

  • This patch modifies __nf_ct_try_assign_helper in a way that invalidates support
    for the following scenario:

    1) attach the helper A for first time when the conntrack is created
    2) attach new (different) helper B due to changes the reply tuple caused by NAT

    eg. port redirection from TCP/21 to TCP/5060 with both FTP and SIP helpers
    loaded, which seems to be a quite unorthodox scenario.

    I can provide a more elaborated patch to support this scenario but explicit
    helper attachment provides a better solution for this since now the use can
    attach the helpers consistently, without relying on the automatic helper
    lookup magic.

    This patch fixes a possible out of bound zeroing of the conntrack helper
    extension if the helper B uses more memory for its private data than
    helper A.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

16 Jun, 2012

2 commits

  • There are good reasons to supports helpers in user-space instead:

    * Rapid connection tracking helper development, as developing code
    in user-space is usually faster.

    * Reliability: A buggy helper does not crash the kernel. Moreover,
    we can monitor the helper process and restart it in case of problems.

    * Security: Avoid complex string matching and mangling in kernel-space
    running in privileged mode. Going further, we can even think about
    running user-space helpers as a non-root process.

    * Extensibility: It allows the development of very specific helpers (most
    likely non-standard proprietary protocols) that are very likely not to be
    accepted for mainline inclusion in the form of kernel-space connection
    tracking helpers.

    This patch adds the infrastructure to allow the implementation of
    user-space conntrack helpers by means of the new nfnetlink subsystem
    `nfnetlink_cthelper' and the existing queueing infrastructure
    (nfnetlink_queue).

    I had to add the new hook NF_IP6_PRI_CONNTRACK_HELPER to register
    ipv[4|6]_helper which results from splitting ipv[4|6]_confirm into
    two pieces. This change is required not to break NAT sequence
    adjustment and conntrack confirmation for traffic that is enqueued
    to our user-space conntrack helpers.

    Basic operation, in a few steps:

    1) Register user-space helper by means of `nfct':

    nfct helper add ftp inet tcp

    [ It must be a valid existing helper supported by conntrack-tools ]

    2) Add rules to enable the FTP user-space helper which is
    used to track traffic going to TCP port 21.

    For locally generated packets:

    iptables -I OUTPUT -t raw -p tcp --dport 21 -j CT --helper ftp

    For non-locally generated packets:

    iptables -I PREROUTING -t raw -p tcp --dport 21 -j CT --helper ftp

    3) Run the test conntrackd in helper mode (see example files under
    doc/helper/conntrackd.conf

    conntrackd

    4) Generate FTP traffic going, if everything is OK, then conntrackd
    should create expectations (you can check that with `conntrack':

    conntrack -E expect

    [NEW] 301 proto=6 src=192.168.1.136 dst=130.89.148.12 sport=0 dport=54037 mask-src=255.255.255.255 mask-dst=255.255.255.255 sport=0 dport=65535 master-src=192.168.1.136 master-dst=130.89.148.12 sport=57127 dport=21 class=0 helper=ftp
    [DESTROY] 301 proto=6 src=192.168.1.136 dst=130.89.148.12 sport=0 dport=54037 mask-src=255.255.255.255 mask-dst=255.255.255.255 sport=0 dport=65535 master-src=192.168.1.136 master-dst=130.89.148.12 sport=57127 dport=21 class=0 helper=ftp

    This confirms that our test helper is receiving packets including the
    conntrack information, and adding expectations in kernel-space.

    The user-space helper can also store its private tracking information
    in the conntrack structure in the kernel via the CTA_HELP_INFO. The
    kernel will consider this a binary blob whose layout is unknown. This
    information will be included in the information that is transfered
    to user-space via glue code that integrates nfnetlink_queue and
    ctnetlink.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • This patch uses the new variable length conntrack extensions.

    Instead of using union nf_conntrack_help that contain all the
    helper private data information, we allocate variable length
    area to store the private helper data.

    This patch includes the modification of all existing helpers.
    It also includes a couple of include header to avoid compilation
    warnings.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

09 May, 2012

2 commits

  • Explicit helper attachment via the CT target is broken with NAT
    if non-standard ports are used. This problem was hidden behind
    the automatic helper assignment routine. Thus, it becomes more
    noticeable now that we can disable the automatic helper assignment
    with Eric Leblond's:

    9e8ac5a netfilter: nf_ct_helper: allow to disable automatic helper assignment

    Basically, nf_conntrack_alter_reply asks for looking up the helper
    up if NAT is enabled. Unfortunately, we don't have the conntrack
    template at that point anymore.

    Since we don't want to rely on the automatic helper assignment,
    we can skip the second look-up and stick to the helper that was
    attached by iptables. With the CT target, the user is in full
    control of helper attachment, thus, the policy is to trust what
    the user explicitly configures via iptables (no automatic magic
    anymore).

    Interestingly, this bug was hidden by the automatic helper look-up
    code. But it can be easily trigger if you attach the helper in
    a non-standard port, eg.

    iptables -I PREROUTING -t raw -p tcp --dport 8888 \
    -j CT --helper ftp

    And you disabled the automatic helper assignment.

    I added the IPS_HELPER_BIT that allows us to differenciate between
    a helper that has been explicitly attached and those that have been
    automatically assigned. I didn't come up with a better solution
    (having backward compatibility in mind).

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     
  • This patch allows you to disable automatic conntrack helper
    lookup based on TCP/UDP ports, eg.

    echo 0 > /proc/sys/net/netfilter/nf_conntrack_helper

    [ Note: flows that already got a helper will keep using it even
    if automatic helper assignment has been disabled ]

    Once this behaviour has been disabled, you have to explicitly
    use the iptables CT target to attach helper to flows.

    There are good reasons to stop supporting automatic helper
    assignment, for further information, please read:

    http://www.netfilter.org/news.html#2012-04-03

    This patch also adds one message to inform that automatic helper
    assignment is deprecated and it will be removed soon (this is
    spotted only once, with the first flow that gets a helper attached
    to make it as less annoying as possible).

    Signed-off-by: Eric Leblond
    Signed-off-by: Pablo Neira Ayuso

    Eric Leblond
     

08 Mar, 2012

1 commit

  • This patch allows you to set expectfn which is specifically used
    by the NAT side of most of the existing conntrack helpers.

    I have added a symbol map that uses a string as key to look up for
    the function that is attached to the expectation object. This is
    the best solution I came out with to solve this issue.

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

16 Jan, 2012

1 commit

  • This patch partially reverts:
    3d058d7 netfilter: rework user-space expectation helper support
    that was applied during the 3.2 development cycle.

    After this patch, the tree remains just like before patch bc01bef,
    that initially added the preliminary infrastructure.

    I decided to partially revert this patch because the approach
    that I proposed to resolve this problem is broken in NAT setups.
    Moreover, a new infrastructure will be submitted for the 3.3.x
    development cycle that resolve the existing issues while
    providing a neat solution.

    Since nobody has been seriously using this infrastructure in
    user-space, the removal of this feature should affect any know
    FOSS project (to my knowledge).

    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

13 Jan, 2012

1 commit

  • commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to
    RCU_INIT_POINTER) did a lot of incorrect changes, since it did a
    complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x,
    y).

    We miss needed barriers, even on x86, when y is not NULL.

    Signed-off-by: Eric Dumazet
    CC: Stephen Hemminger
    CC: Paul E. McKenney
    Signed-off-by: David S. Miller

    Eric Dumazet
     

23 Dec, 2011

1 commit

  • This partially reworks bc01befdcf3e40979eb518085a075cbf0aacede0
    which added userspace expectation support.

    This patch removes the nf_ct_userspace_expect_list since now we
    force to use the new iptables CT target feature to add the helper
    extension for conntracks that have attached expectations from
    userspace.

    A new version of the proof-of-concept code to implement userspace
    helpers from userspace is available at:

    http://people.netfilter.org/pablo/userspace-conntrack-helpers/nf-ftp-helper-POC.tar.bz2

    This patch also modifies the CT target to allow to set the
    conntrack's userspace helper status flags. This flag is used
    to tell the conntrack system to explicitly allocate the helper
    extension.

    This helper extension is useful to link the userspace expectations
    with the master conntrack that is being tracked from one userspace
    helper.

    This feature fixes a problem in the current approach of the
    userspace helper support. Basically, if the master conntrack that
    has got a userspace expectation vanishes, the expectations point to
    one invalid memory address. Thus, triggering an oops in the
    expectation deletion event path.

    I decided not to add a new revision of the CT target because
    I only needed to add a new flag for it. I'll document in this
    issue in the iptables manpage. I have also changed the return
    value from EINVAL to EOPNOTSUPP if one flag not supported is
    specified. Thus, in the future adding new features that only
    require a new flag can be added without a new revision.

    There is no official code using this in userspace (apart from
    the proof-of-concept) that uses this infrastructure but there
    will be some by beginning 2012.

    Reported-by: Sam Roberts
    Signed-off-by: Pablo Neira Ayuso

    Pablo Neira Ayuso
     

02 Aug, 2011

1 commit

  • When assigning a NULL value to an RCU protected pointer, no barrier
    is needed. The rcu_assign_pointer, used to handle that but will soon
    change to not handle the special case.

    Convert all rcu_assign_pointer of NULL value.

    //smpl
    @@ expression P; @@

    - rcu_assign_pointer(P, NULL)
    + RCU_INIT_POINTER(P, NULL)

    //

    Signed-off-by: Stephen Hemminger
    Acked-by: Paul E. McKenney
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

14 Jan, 2011

1 commit


16 Nov, 2010

1 commit