22 Jun, 2019

1 commit


19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Jun, 2019

1 commit

  • ifa_list is protected by rcu, yet code doesn't reflect this.

    Add the __rcu annotations and fix up all places that are now reported by
    sparse.

    I've done this in the same commit to not add intermediate patches that
    result in new warnings.

    Reported-by: Eric Dumazet
    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

17 Sep, 2018

1 commit


29 May, 2018

1 commit

  • Similar to previous patch, this time, merge redirect+nat.
    The redirect module is just 2k in size, get rid of it and make
    redirect part available from the nat core.

    before:
    text data bss dec hex filename
    19461 1484 4138 25083 61fb net/netfilter/nf_nat.ko
    1236 792 0 2028 7ec net/netfilter/nf_nat_redirect.ko
    after:
    20340 1508 4138 25986 6582 net/netfilter/nf_nat.ko

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

    Florian Westphal
     

24 Apr, 2018

1 commit

  • This is a patch proposal to support shifted ranges in portmaps. (i.e. tcp/udp
    incoming port 5000-5100 on WAN redirected to LAN 192.168.1.5:2000-2100)

    Currently DNAT only works for single port or identical port ranges. (i.e.
    ports 5000-5100 on WAN interface redirected to a LAN host while original
    destination port is not altered) When different port ranges are configured,
    either 'random' mode should be used, or else all incoming connections are
    mapped onto the first port in the redirect range. (in described example
    WAN:5000-5100 will all be mapped to 192.168.1.5:2000)

    This patch introduces a new mode indicated by flag NF_NAT_RANGE_PROTO_OFFSET
    which uses a base port value to calculate an offset with the destination port
    present in the incoming stream. That offset is then applied as index within the
    redirect port range (index modulo rangewidth to handle range overflow).

    In described example the base port would be 5000. An incoming stream with
    destination port 5004 would result in an offset value 4 which means that the
    NAT'ed stream will be using destination port 2004.

    Other possibilities include deterministic mapping of larger or multiple ranges
    to a smaller range : WAN:5000-5999 -> LAN:5000-5099 (maps WAN port 5*xx to port
    51xx)

    This patch does not change any current behavior. It just adds new NAT proto
    range functionality which must be selected via the specific flag when intended
    to use.

    A patch for iptables (libipt_DNAT.c + libip6t_DNAT.c) will also be proposed
    which makes this functionality immediately available.

    Signed-off-by: Thierry Du Tre
    Signed-off-by: Pablo Neira Ayuso

    Thierry Du Tre
     

04 Sep, 2017

1 commit


09 Apr, 2017

1 commit


27 Oct, 2015

1 commit

  • Commit 8b13eddfdf04cbfa561725cfc42d6868fe896f56 ("netfilter: refactor NAT
    redirect IPv4 to use it from nf_tables") has introduced a trivial logic
    change which can result in the following crash.

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
    IP: [] nf_nat_redirect_ipv4+0x2d/0xa0 [nf_nat_redirect]
    PGD 3ba662067 PUD 3ba661067 PMD 0
    Oops: 0000 [#1] SMP
    Modules linked in: ipv6(E) xt_REDIRECT(E) nf_nat_redirect(E) xt_tcpudp(E) iptable_nat(E) nf_conntrack_ipv4(E) nf_defrag_ipv4(E) nf_nat_ipv4(E) nf_nat(E) nf_conntrack(E) ip_tables(E) x_tables(E) binfmt_misc(E) xfs(E) libcrc32c(E) evbug(E) evdev(E) psmouse(E) i2c_piix4(E) i2c_core(E) acpi_cpufreq(E) button(E) ext4(E) crc16(E) jbd2(E) mbcache(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E)
    CPU: 0 PID: 2536 Comm: ip Tainted: G E 4.1.7-15.23.amzn1.x86_64 #1
    Hardware name: Xen HVM domU, BIOS 4.2.amazon 05/06/2015
    task: ffff8800eb438000 ti: ffff8803ba664000 task.ti: ffff8803ba664000
    [...]
    Call Trace:

    [] redirect_tg4+0x15/0x20 [xt_REDIRECT]
    [] ipt_do_table+0x2b9/0x5e1 [ip_tables]
    [] iptable_nat_do_chain+0x25/0x30 [iptable_nat]
    [] nf_nat_ipv4_fn+0x13d/0x1f0 [nf_nat_ipv4]
    [] ? iptable_nat_ipv4_fn+0x20/0x20 [iptable_nat]
    [] nf_nat_ipv4_in+0x2e/0x90 [nf_nat_ipv4]
    [] iptable_nat_ipv4_in+0x15/0x20 [iptable_nat]
    [] nf_iterate+0x57/0x80
    [] nf_hook_slow+0x97/0x100
    [] ip_rcv+0x314/0x400

    unsigned int
    nf_nat_redirect_ipv4(struct sk_buff *skb,
    ...
    {
    ...
    rcu_read_lock();
    indev = __in_dev_get_rcu(skb->dev);
    if (indev != NULL) {
    ifa = indev->ifa_list;
    newdst = ifa->ifa_local;
    Signed-off-by: Pablo Neira Ayuso

    Munehisa Kamata
     

27 Nov, 2014

1 commit