11 Jul, 2012

1 commit


02 Jul, 2012

1 commit

  • Put can_rx_alldev_list into the af_can header to fix the following
    sparse warning: net/can/af_can.c:80:22: warning: symbol
    'can_rx_alldev_list' was not declared. Should it be static?

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     

20 Jun, 2012

3 commits

  • - introduce a new sockopt CAN_RAW_FD_FRAMES to allow CAN FD frames
    - handle CAN frames and CAN FD frames simultaneously when enabled

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     
  • - handle ETH_P_CAN and ETH_P_CANFD skbuffs
    - update sanity checks for CAN and CAN FD
    - make sure the CAN frame can pass the selected CAN netdevice on send
    - bump core version and abi version to indicate the new CAN FD support

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     
  • - add new struct canfd_frame
    - check identical element offsets in struct can_frame and struct canfd_frame
    - new ETH_P_CANFD definition to tag CAN FD skbs correctly
    - add CAN_MTU and CANFD_MTU definitions for easy frame and mode detection
    - add CAN[FD]_MAX_[DLC|DLEN] helper constants to remove hard coded values
    - update existing struct can_frame with helper constants and comments

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     

16 Jun, 2012

2 commits

  • Conflicts:
    net/ipv6/route.c

    This deals with a merge conflict between the net-next addition of the
    inetpeer network namespace ops, and Thomas Graf's bug fix in
    2a0c451ade8e1783c5d453948289e4a978d417c9 which makes sure we don't
    register /proc/net/ipv6_route before it is actually safe to do so.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Orphaning skb in dev_hard_start_xmit() makes bonding behavior
    unfriendly for applications sending big UDP bursts : Once packets
    pass the bonding device and come to real device, they might hit a full
    qdisc and be dropped. Without orphaning, the sender is automatically
    throttled because sk->sk_wmemalloc reaches sk->sk_sndbuf (assuming
    sk_sndbuf is not too big)

    We could try to defer the orphaning adding another test in
    dev_hard_start_xmit(), but all this seems of little gain,
    now that BQL tends to make packets more likely to be parked
    in Qdisc queues instead of NIC TX ring, in cases where performance
    matters.

    Reverts commits :
    fc6055a5ba31 net: Introduce skb_orphan_try()
    87fd308cfc6b net: skb_tx_hash() fix relative to skb_orphan_try()
    and removes SKBTX_DRV_NEEDS_SK_REF flag

    Reported-and-bisected-by: Jean-Michel Hautbois
    Signed-off-by: Eric Dumazet
    Tested-by: Oliver Hartkopp
    Acked-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Eric Dumazet
     

24 May, 2012

1 commit

  • As Heinz-Juergen Oertel pointed out 'CAN error frames' are a already defined
    term for the CAN protocol violation indication on the wire.

    To avoid confusion with the error messages created by CAN drivers available
    via CAN RAW sockets update the documentation and change the naming from
    'error frames' to 'error messages' or 'error message frames'.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Oliver Hartkopp
     

17 Apr, 2012

1 commit

  • Make cgw_list static to remove the following sparse warning:
    net/can/gw.c:69:1: warning: symbol 'cgw_list' was not declared.
    Should it be static?

    Signed-off-by: Daniel Baluta
    Acked-by: Oliver Hartkopp
    Signed-off-by: Marc Kleine-Budde

    Daniel Baluta
     

18 Oct, 2011

1 commit


08 Oct, 2011

1 commit


30 Sep, 2011

1 commit

  • The commit aabdcb0b553b9c9547b1a506b34d55a764745870 ("can bcm: fix tx_setup
    off-by-one errors") fixed only a part of the original problem reported by
    Andre Naujoks. It turned out that the original code needed to be re-ordered
    to reduce complexity and to finally fix the reported frame counting issues.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

29 Sep, 2011

1 commit

  • This patch fixes two off-by-one errors that canceled each other out.
    Checking for the same condition two times in bcm_tx_timeout_tsklet() reduced
    the count of frames to be sent by one. This did not show up the first time
    tx_setup is invoked as an additional frame is sent due to TX_ANNONCE.
    Invoking a second tx_setup on the same item led to a reduced (by 1) number of
    sent frames.

    Reported-by: Andre Naujoks
    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

22 Sep, 2011

1 commit

  • Conflicts:
    MAINTAINERS
    drivers/net/Kconfig
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
    drivers/net/ethernet/broadcom/tg3.c
    drivers/net/wireless/iwlwifi/iwl-pci.c
    drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
    drivers/net/wireless/rt2x00/rt2800usb.c
    drivers/net/wireless/wl12xx/main.c

    David S. Miller
     

17 Sep, 2011

1 commit

  • This patch adds a CAN Gateway/Router to route (and modify) CAN frames.

    It is based on the PF_CAN core infrastructure for msg filtering and msg
    sending and can optionally modify routed CAN frames on the fly.
    CAN frames can *only* be routed between CAN network interfaces (one hop).
    They can be modified with AND/OR/XOR/SET operations as configured by the
    netlink configuration interface known e.g. from iptables. From the netlink
    view this can-gw implements RTM_{NEW|DEL|GET}ROUTE for PF_CAN.

    The CAN specific userspace tool to manage CAN routing entries can be found in
    the CAN utils http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/cangw.c
    at the SocketCAN SVN on BerliOS.

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

16 Sep, 2011

1 commit


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
     

17 Jun, 2011

1 commit


07 Jun, 2011

1 commit


27 May, 2011

1 commit


24 May, 2011

1 commit

  • The %pK format specifier is designed to hide exposed kernel pointers,
    specifically via /proc interfaces. Exposing these pointers provides an
    easy target for kernel write vulnerabilities, since they reveal the
    locations of writable structures containing easily triggerable function
    pointers. The behavior of %pK depends on the kptr_restrict sysctl.

    If kptr_restrict is set to 0, no deviation from the standard %p behavior
    occurs. If kptr_restrict is set to 1, the default, if the current user
    (intended to be a reader via seq_printf(), etc.) does not have CAP_SYSLOG
    (currently in the LSM tree), kernel pointers using %pK are printed as 0's.
    If kptr_restrict is set to 2, kernel pointers using %pK are printed as
    0's regardless of privileges. Replacing with 0's was chosen over the
    default "(null)", which cannot be parsed by userland %p, which expects
    "(nil)".

    The supporting code for kptr_restrict and %pK are currently in the -mm
    tree. This patch converts users of %p in net/ to %pK. Cases of printing
    pointers to the syslog are not covered, since this would eliminate useful
    information for postmortem debugging and the reading of the syslog is
    already optionally protected by the dmesg_restrict sysctl.

    Signed-off-by: Dan Rosenberg
    Cc: James Morris
    Cc: Eric Dumazet
    Cc: Thomas Graf
    Cc: Eugene Teo
    Cc: Kees Cook
    Cc: Ingo Molnar
    Cc: David S. Miller
    Cc: Peter Zijlstra
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Dan Rosenberg
     

05 May, 2011

2 commits

  • can: rename can_try_module_get to can_get_proto

    can_try_module_get does return a struct can_proto.
    The name explains what is done in so much detail that a caller
    may not notice that a struct can_proto is locked/unlocked.

    Signed-off-by: Kurt Van Dijck
    Acked-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Kurt Van Dijck
     
  • commit 53914b67993c724cec585863755c9ebc8446e83b had the
    same message. That commit did put everything in place but
    did not make can_proto const itself.

    Signed-off-by: Kurt Van Dijck
    Acked-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Kurt Van Dijck
     

27 Apr, 2011

1 commit


21 Apr, 2011

1 commit


20 Apr, 2011

1 commit


12 Apr, 2011

1 commit


07 Apr, 2011

1 commit

  • This patch removes spin_locks at CAN socket creation time by using RCU.

    Inspired by the discussion with Kurt van Dijck and Eric Dumazet the RCU code
    was partly derived from af_phonet.c

    Signed-off-by: Oliver Hartkopp
    Reviewed-by: Eric Dumazet
    Acked-by: Kurt Van Dijck
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

31 Mar, 2011

1 commit


28 Mar, 2011

1 commit

  • can_ioctl is the only reason for struct proto to be non-const.
    script/check-patch.pl suggests struct proto be const.

    Setting the reference to the common can_ioctl() in all CAN protocols directly
    removes the need to make the struct proto writable in af_can.c

    Signed-off-by: Kurt Van Dijck
    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

16 Jan, 2011

1 commit


05 Jan, 2011

1 commit


01 Jan, 2011

1 commit

  • Since the socket address is just being used as a unique identifier, its
    inode number is an alternative that does not leak potentially sensitive
    information.

    CC-ing stable because MITRE has assigned CVE-2010-4565 to the issue.

    Signed-off-by: Dan Rosenberg
    Acked-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Dan Rosenberg
     

23 Nov, 2010

1 commit


13 Nov, 2010

1 commit

  • On 64-bit platforms the ASCII representation of a pointer may be up to 17
    bytes long. This patch increases the length of the buffer accordingly.

    http://marc.info/?l=linux-netdev&m=128872251418192&w=2

    Reported-by: Dan Rosenberg
    Signed-off-by: Oliver Hartkopp
    CC: Linus Torvalds
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

21 Oct, 2010

1 commit

  • CAN has no addressing scheme. It is currently impossible for userspace
    to tell is a received CAN frame comes from another process on the local
    host, or from a remote CAN device.

    This patch add support for userspace applications to distinguish between
    'own', 'local' and 'remote' CAN traffic. The distinction is made by returning
    flags in msg->msg_flags in the call to recvmsg().

    The added documentation explains the introduced flags.

    Signed-off-by: Kurt Van Dijck
    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

19 Aug, 2010

1 commit

  • This patch removes the abstraction introduced by the union skb_shared_tx in
    the shared skb data.

    The access of the different union elements at several places led to some
    confusion about accessing the shared tx_flags e.g. in skb_orphan_try().

    http://marc.info/?l=linux-netdev&m=128084897415886&w=2

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

12 Aug, 2010

1 commit

  • This patch adds a limit for nframes as the number of frames in TX_SETUP and
    RX_SETUP are derived from a single byte multiplex value by default.
    Use-cases that would require to send/filter more than 256 CAN frames should
    be implemented in userspace for complexity reasons anyway.

    Additionally the assignments of unsigned values from userspace to signed
    values in kernelspace and vice versa are fixed by using unsigned values in
    kernelspace consistently.

    Signed-off-by: Oliver Hartkopp
    Reported-by: Ben Hawkes
    Acked-by: Urs Thuermann
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

03 Aug, 2010

1 commit

  • Commit fc6055a5ba31e2c14e36e8939f9bf2b6d586a7f5 (net: Introduce
    skb_orphan_try()) allows an early orphan of the skb and takes care on
    tx timestamping, which needs the sk-reference in the skb on driver level.
    So does the can-raw socket, which has not been taken into account here.

    The patch below adds a 'prevent_sk_orphan' bit in the skb tx shared info,
    which fixes the problem discovered by Matthias Fuchs here:

    http://marc.info/?t=128030411900003&r=1&w=2

    Even if it's not a primary tx timestamp topic it fits well into some skb
    shared tx context. Or should be find a different place for the information to
    protect the sk reference until it reaches the driver level?

    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     

31 May, 2010

1 commit

  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall