27 Nov, 2011

1 commit

  • When using l2tp over ipsec, the tunnel will hang when rekeying
    occurs. Reason is that the transformer bundle attached to the dst entry
    is now in STATE_DEAD and thus xfrm_output_one() drops all packets
    (XfrmOutStateExpired increases).

    Fix this by calling __sk_dst_check (which drops the stale dst
    if xfrm dst->check callback finds that the bundle is no longer valid).

    Cc: James Chapman
    Signed-off-by: Florian Westphal
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Florian Westphal
     

09 Nov, 2011

1 commit


04 Nov, 2011

1 commit

  • Misha Labjuk reported panics occurring in l2tp_recv_dequeue()

    If we release reorder_q.lock, we must not keep a dangling pointer (tmp),
    since another thread could manipulate reorder_q.

    Instead we must restart the scan at beginning of list.

    Reported-by: Misha Labjuk
    Tested-by: Misha Labjuk
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

25 Oct, 2011

1 commit


19 Oct, 2011

2 commits


28 Jul, 2011

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (32 commits)
    tg3: Remove 5719 jumbo frames and TSO blocks
    tg3: Break larger frags into 4k chunks for 5719
    tg3: Add tx BD budgeting code
    tg3: Consolidate code that calls tg3_tx_set_bd()
    tg3: Add partial fragment unmapping code
    tg3: Generalize tg3_skb_error_unmap()
    tg3: Remove short DMA check for 1st fragment
    tg3: Simplify tx bd assignments
    tg3: Reintroduce tg3_tx_ring_info
    ASIX: Use only 11 bits of header for data size
    ASIX: Simplify condition in rx_fixup()
    Fix cdc-phonet build
    bonding: reduce noise during init
    bonding: fix string comparison errors
    net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
    net: add IFF_SKB_TX_SHARED flag to priv_flags
    net: sock_sendmsg_nosec() is static
    forcedeth: fix vlans
    gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e
    gro: Only reset frag0 when skb can be pulled
    ...

    Linus Torvalds
     
  • After the last patch, We are left in a state in which only drivers calling
    ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
    hardware call ether_setup for their net_devices and don't hold any state in
    their skbs. There are a handful of drivers that violate this assumption of
    course, and need to be fixed up. This patch identifies those drivers, and marks
    them as not being able to support the safe transmission of skbs by clearning the
    IFF_TX_SKB_SHARING flag in priv_flags

    Signed-off-by: Neil Horman
    CC: Karsten Keil
    CC: "David S. Miller"
    CC: Jay Vosburgh
    CC: Andy Gospodarek
    CC: Patrick McHardy
    CC: Krzysztof Halasa
    CC: "John W. Linville"
    CC: Greg Kroah-Hartman
    CC: Marcel Holtmann
    CC: Johannes Berg
    Signed-off-by: David S. Miller

    Neil Horman
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

21 Jun, 2011

1 commit


14 Jun, 2011

1 commit

  • l2tp_ip_sendmsg() in non connected mode incorrectly calls
    sk_setup_caps(). Subsequent send() calls send data to wrong destination.

    We can also avoid changing dst refcount in connected mode, using
    appropriate rcu locking. Once output route lookups can also be done
    under rcu, sendto() calls wont change dst refcounts too.

    Signed-off-by: Eric Dumazet
    CC: James Chapman
    Signed-off-by: David S. Miller

    Eric Dumazet
     

06 Jun, 2011

1 commit

  • More fallout from struct net lifetime rules review: PTR_ERR() is *already*
    negative and failing ->open() should return negatives on failure.

    Signed-off-by: Al Viro
    Signed-off-by: James Chapman
    Signed-off-by: David S. Miller

    Al Viro
     

21 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits)
    macvlan: fix panic if lowerdev in a bond
    tg3: Add braces around 5906 workaround.
    tg3: Fix NETIF_F_LOOPBACK error
    macvlan: remove one synchronize_rcu() call
    networking: NET_CLS_ROUTE4 depends on INET
    irda: Fix error propagation in ircomm_lmp_connect_response()
    irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
    irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
    be2net: Kill set but unused variable 'req' in lancer_fw_download()
    irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
    atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
    rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
    pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
    isdn: capi: Use pr_debug() instead of ifdefs.
    tg3: Update version to 3.119
    tg3: Apply rx_discards fix to 5719/5720
    ...

    Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
    as per Davem.

    Linus Torvalds
     

13 May, 2011

1 commit

  • While trying to remove useless synchronize_rcu() calls, I found l2tp is
    indeed incorrectly using two of such calls, but also bumps tunnel
    refcount after list insertion.

    tunnel refcount must be incremented before being made publically visible
    by rcu readers.

    This fix can be applied to 2.6.35+ and might need a backport for older
    kernels, since things were shuffled in commit fd558d186df2c
    (l2tp: Split pppol2tp patch into separate l2tp and ppp parts)

    Signed-off-by: Eric Dumazet
    CC: Paul E. McKenney
    CC: James Chapman
    Reviewed-by: Paul E. McKenney
    Signed-off-by: David S. Miller

    Eric Dumazet
     

09 May, 2011

4 commits

  • This allows us to acquire the exact route keying information from the
    protocol, however that might be managed.

    It handles all of the possibilities, from the simplest case of storing
    the key in inet->cork.fl to the more complex setup SCTP has where
    individual transports determine the flow.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Now that the socket is consistently locked in these two routines,
    this transformation is legal.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • l2tp_xmit_skb() must take the socket lock. It makes use of ip_queue_xmit()
    which expects to execute in a socket atomic context.

    Since we execute this function in software interrupts, we cannot use the
    usual lock_sock()/release_sock() sequence, instead we have to use
    bh_lock_sock() and see if a user has the socket locked, and if so drop
    the packet.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Both l2tp_ip_connect() and l2tp_ip_sendmsg() must take the socket
    lock. They both modify socket state non-atomically, and in particular
    l2tp_ip_sendmsg() increments socket private counters without using
    atomic operations.
    Signed-off-by: David S. Miller

    David S. Miller
     

04 May, 2011

1 commit


29 Apr, 2011

4 commits

  • Now that output route lookups update the flow with
    destination address selection, we can fetch it from
    fl4->daddr instead of rt->rt_dst

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Now that output route lookups update the flow with
    source address selection, we can fetch it from
    fl4->saddr instead of rt->rt_src

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We don't actually hold the socket lock at this point, so the
    rcu_dereference_protected() isn't' correct. Thanks to Eric
    Dumazet for pointing this out.

    Thankfully, we're only interested in fetching the faddr value
    if srr is enabled, so we can simply make this an RCU sequence
    and use plain rcu_dereference().

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

    David S. Miller
     
  • We lack proper synchronization to manipulate inet->opt ip_options

    Problem is ip_make_skb() calls ip_setup_cork() and
    ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
    without any protection against another thread manipulating inet->opt.

    Another thread can change inet->opt pointer and free old one under us.

    Use RCU to protect inet->opt (changed to inet->inet_opt).

    Instead of handling atomic refcounts, just copy ip_options when
    necessary, to avoid cache line dirtying.

    We cant insert an rcu_head in struct ip_options since its included in
    skb->cb[], so this patch is large because I had to introduce a new
    ip_options_rcu structure.

    Signed-off-by: Eric Dumazet
    Cc: Herbert Xu
    Signed-off-by: David S. Miller

    Eric Dumazet
     

28 Apr, 2011

1 commit

  • These functions are used together as a unit for route resolution
    during connect(). They address the chicken-and-egg problem that
    exists when ports need to be allocated during connect() processing,
    yet such port allocations require addressing information from the
    routing code.

    It's currently more heavy handed than it needs to be, and in
    particular we allocate and initialize a flow object twice.

    Let the callers provide the on-stack flow object. That way we only
    need to initialize it once in the ip_route_connect() call.

    Later, if ip_route_newports() needs to do anything, it re-uses that
    flow object as-is except for the ports which it updates before the
    route re-lookup.

    Also, describe why this set of facilities are needed and how it works
    in a big comment.

    Signed-off-by: David S. Miller
    Reviewed-by: Eric Dumazet

    David S. Miller
     

27 Apr, 2011

1 commit


18 Apr, 2011

1 commit


22 Mar, 2011

1 commit

  • A struct used in the l2tp_eth driver for registering network namespace
    ops was incorrectly marked as __net_initdata, leading to oops when
    module unloaded.

    BUG: unable to handle kernel paging request at ffffffffa00ec098
    IP: [] ops_exit_list+0x7/0x4b
    PGD 142d067 PUD 1431063 PMD 195da8067 PTE 0
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/module/l2tp_eth/refcnt
    Call Trace:
    [] ? unregister_pernet_operations+0x32/0x93
    [] ? unregister_pernet_device+0x2b/0x38
    [] ? sys_delete_module+0x1b8/0x222
    [] ? do_munmap+0x254/0x318
    [] ? page_fault+0x25/0x30
    [] ? system_call_fastpath+0x16/0x1b

    Signed-off-by: James Chapman
    Signed-off-by: David S. Miller

    James Chapman
     

13 Mar, 2011

1 commit


03 Mar, 2011

1 commit


02 Mar, 2011

3 commits


09 Dec, 2010

2 commits


18 Nov, 2010

1 commit


01 Nov, 2010

1 commit

  • 'sparse' spotted that the parameters to kzalloc in l2tp_dfs_seq_open
    were swapped.

    Tested on current git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    at 1792f17b7210280a3d7ff29da9614ba779cfcedb build, boots and I can see that directory,
    but there again I could see /sys/kernel/debug/l2tp with it swapped; I don't have
    any l2tp in use.

    Signed-off-by: Dr. David Alan Gilbert
    Signed-off-by: David S. Miller

    Dr. David Alan Gilbert
     

25 Oct, 2010

2 commits

  • Causes these build failures on PowerPC:

    net/l2tp/l2tp_core.c:1228: error: __ksymtab_l2tp_tunnel_closeall causes a section type conflict
    net/l2tp/l2tp_core.c:1228: error: __ksymtab_l2tp_tunnel_closeall causes a section type conflict
    net/l2tp/l2tp_core.c:1006: error: __ksymtab_l2tp_xmit_core causes a section type conflict
    net/l2tp/l2tp_core.c:1006: error: __ksymtab_l2tp_xmit_core causes a section type conflict
    net/l2tp/l2tp_core.c:847: error: __ksymtab_l2tp_udp_recv_core causes a section type conflict
    net/l2tp/l2tp_core.c:847: error: __ksymtab_l2tp_udp_recv_core causes a section type conflict

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

    Stephen Rothwell
     
  • Also moved the refcound inlines from l2tp_core.h to l2tp_core.c
    since only used in that one file.

    Signed-off-by: Stephen Hemminger
    Acked-by: James Chapman
    Signed-off-by: David S. Miller

    stephen hemminger
     

21 Oct, 2010

1 commit


22 Sep, 2010

1 commit