06 Dec, 2016

1 commit

  • The check of the return value of sock_register() is ineffective.
    "if(!err)" seems to be a typo. It is better to propagate the error code
    to the callers of caif_sktinit_module(). This patch removes the check
    statment and directly returns the result of sock_register().

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751
    Signed-off-by: Pan Bian
    Signed-off-by: David S. Miller

    Pan Bian
     

28 Jun, 2016

1 commit

  • Drop redundant include of moduleparam.h

    The Coccinelle semantic patch used to make this change is as follows:
    @ includesmodule @
    @@

    #include

    @ depends on includesmodule @
    @@

    - #include

    Signed-off-by: Amitoj Kaur Chawla
    Signed-off-by: David S. Miller

    Amitoj Kaur Chawla
     

15 Mar, 2016

1 commit

  • gcc points out code that is not indented the way it is
    interpreted:

    net/caif/cfpkt_skbuff.c: In function 'cfpkt_setlen':
    net/caif/cfpkt_skbuff.c:289:4: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
    return cfpkt_getlen(pkt);
    ^~~~~~
    net/caif/cfpkt_skbuff.c:286:3: note: ...this 'else' clause, but it is not
    else
    ^~~~

    It is clear from the context that not returning here would be
    a bug, as we'd end up passing a negative length into a function
    that takes a u16 length, so it is not missing curly braces
    here, and I'm assuming that the indentation is the only part
    that's wrong about it.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

19 Feb, 2016

1 commit


02 Dec, 2015

1 commit

  • This patch is a cleanup to make following patch easier to
    review.

    Goal is to move SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA
    from (struct socket)->flags to a (struct socket_wq)->flags
    to benefit from RCU protection in sock_wake_async()

    To ease backports, we rename both constants.

    Two new helpers, sk_set_bit(int nr, struct sock *sk)
    and sk_clear_bit(int net, struct sock *sk) are added so that
    following patch can change their implementation.

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

    Eric Dumazet
     

19 Aug, 2015

1 commit


21 Jul, 2015

1 commit


02 Jun, 2015

1 commit

  • Conflicts:
    drivers/net/phy/amd-xgbe-phy.c
    drivers/net/wireless/iwlwifi/Kconfig
    include/net/mac80211.h

    iwlwifi/Kconfig and mac80211.h were both trivial overlapping
    changes.

    The drivers/net/phy/amd-xgbe-phy.c file got removed in 'net-next' and
    the bug fix that happened on the 'net' side is already integrated
    into the rest of the amd-xgbe driver.

    Signed-off-by: David S. Miller

    David S. Miller
     

27 May, 2015

1 commit


11 May, 2015

1 commit


21 Mar, 2015

1 commit

  • Conflicts:
    drivers/net/ethernet/emulex/benet/be_main.c
    net/core/sysctl_net_core.c
    net/ipv4/inet_diag.c

    The be_main.c conflict resolution was really tricky. The conflict
    hunks generated by GIT were very unhelpful, to say the least. It
    split functions in half and moved them around, when the real actual
    conflict only existed solely inside of one function, that being
    be_map_pci_bars().

    So instead, to resolve this, I checked out be_main.c from the top
    of net-next, then I applied the be_main.c changes from 'net' since
    the last time I merged. And this worked beautifully.

    The inet_diag.c and sysctl_net_core.c conflicts were simple
    overlapping changes, and were easily to resolve.

    Signed-off-by: David S. Miller

    David S. Miller
     

16 Mar, 2015

1 commit

  • It should be checking flags, not msg->msg_flags. It's ->sendmsg()
    instances that need to look for that in ->msg_flags, ->recvmsg() ones
    (including the other ->recvmsg() instance in that file, as well as
    unix_dgram_recvmsg() this one claims to be imitating) check in flags.
    Braino had been introduced in commit dcda13 ("caif: Bugfix - use MSG_TRUNC
    in receive") back in 2010, so it goes quite a while back.

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

    Al Viro
     

04 Mar, 2015

1 commit


03 Mar, 2015

1 commit

  • After TIPC doesn't depend on iocb argument in its internal
    implementations of sendmsg() and recvmsg() hooks defined in proto
    structure, no any user is using iocb argument in them at all now.
    Then we can drop the redundant iocb argument completely from kinds of
    implementations of both sendmsg() and recvmsg() in the entire
    networking stack.

    Cc: Christoph Hellwig
    Suggested-by: Al Viro
    Signed-off-by: Ying Xue
    Signed-off-by: David S. Miller

    Ying Xue
     

21 Feb, 2015

1 commit

  • The cfpkt_iterate() function can return -EPROTO on error, but the
    function is a u16 so the negative value gets truncated to a positive
    unsigned short. This causes a static checker warning.

    The only caller which might care is cffrml_receive(), when it's checking
    the frame checksum. I modified cffrml_receive() so that it never says
    -EPROTO is a valid checksum.

    Also this isn't ever going to be inlined so I removed the "inline".

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     

30 Jan, 2015

1 commit

  • src_net points to the netns where the netlink message has been received. This
    netns may be different from the netns where the interface is created (because
    the user may add IFLA_NET_NS_[PID|FD]). In this case, src_net is the link netns.

    It seems wrong to override the netns in the newlink() handler because if it
    was not already src_net, it means that the user explicitly asks to create the
    netdevice in another netns.

    CC: Sjur Brændeland
    CC: Dmitry Tarnyagin
    Fixes: 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")
    Fixes: c41254006377 ("caif-hsi: Add rtnl support")
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

10 Dec, 2014

1 commit

  • Note that the code _using_ ->msg_iter at that point will be very
    unhappy with anything other than unshifted iovec-backed iov_iter.
    We still need to convert users to proper primitives.

    Signed-off-by: Al Viro

    Al Viro
     

24 Nov, 2014

2 commits


06 Nov, 2014

1 commit

  • This encapsulates all of the skb_copy_datagram_iovec() callers
    with call argument signature "skb, offset, msghdr->msg_iov, length".

    When we move to iov_iters in the networking, the iov_iter object will
    sit in the msghdr.

    Having a helper like this means there will be less places to touch
    during that transformation.

    Based upon descriptions and patch from Al Viro.

    Signed-off-by: David S. Miller

    David S. Miller
     

15 Oct, 2014

3 commits


16 Jul, 2014

1 commit


03 Jul, 2014

1 commit


12 Apr, 2014

1 commit

  • Several spots in the kernel perform a sequence like:

    skb_queue_tail(&sk->s_receive_queue, skb);
    sk->sk_data_ready(sk, skb->len);

    But at the moment we place the SKB onto the socket receive queue it
    can be consumed and freed up. So this skb->len access is potentially
    to freed up memory.

    Furthermore, the skb->len can be modified by the consumer so it is
    possible that the value isn't accurate.

    And finally, no actual implementation of this callback actually uses
    the length argument. And since nobody actually cared about it's
    value, lots of call sites pass arbitrary values in such as '0' and
    even '1'.

    So just remove the length argument from the callback, that way there
    is no confusion whatsoever and all of these use-after-free cases get
    fixed as a side effect.

    Based upon a patch by Eric Dumazet and his suggestion to audit this
    issue tree-wide.

    Signed-off-by: David S. Miller

    David S. Miller
     

10 Feb, 2014

2 commits

  • Include appropriate header file net/caif/caif_dev.h in caif/cfsrvl.c
    because it has prototype declaration of functions defined in
    caif/cfsrvl.c.

    This eliminates the following warning in caif/cfsrvl.c:
    net/caif/cfsrvl.c:198:6: warning: no previous prototype for ‘caif_free_client’ [-Wmissing-prototypes]
    net/caif/cfsrvl.c:208:6: warning: no previous prototype for ‘caif_client_register_refcnt’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: David S. Miller

    Rashika Kheria
     
  • Include appropriate header file net/caif/caif_dev.h in caif/caif_dev.c
    because it has prototype declarations of function defined in
    caif/caif_dev.c.

    This eliminates the following file in caif/caif_dev.c:
    net/caif/caif_dev.c:303:6: warning: no previous prototype for ‘caif_enroll_dev’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: David S. Miller

    Rashika Kheria
     

22 Jan, 2014

2 commits


15 Jan, 2014

1 commit

  • The following call chains indicate that chnl_net_open() is under
    rtnl_lock protection as __dev_open() is protected by rtnl_lock.
    So if __dev_get_by_index() instead of dev_get_by_index() is used
    to find interface handler in it, this would help us avoid to change
    interface reference counter.

    __dev_open()
    chnl_net_open()

    Cc: Dmitry Tarnyagin
    Signed-off-by: Ying Xue
    Signed-off-by: David S. Miller

    Ying Xue
     

21 Nov, 2013

1 commit


08 Nov, 2013

1 commit


06 Sep, 2013

1 commit


29 May, 2013

1 commit

  • So far, only net_device * could be passed along with netdevice notifier
    event. This patch provides a possibility to pass custom structure
    able to provide info that event listener needs to know.

    Signed-off-by: Jiri Pirko

    v2->v3: fix typo on simeth
    shortened dev_getter
    shortened notifier_info struct name
    v1->v2: fix notifier_call parameter in call_netdevice_notifier()
    Signed-off-by: David S. Miller

    Jiri Pirko
     

24 Apr, 2013

2 commits


08 Apr, 2013

2 commits

  • Conflicts:
    drivers/nfc/microread/mei.c
    net/netfilter/nfnetlink_queue_core.c

    Pull in 'net' to get Eric Biederman's AF_UNIX fix, upon which
    some cleanups are going to go on-top.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The current code does not fill the msg_name member in case it is set.
    It also does not set the msg_namelen member to 0 and therefore makes
    net/socket.c leak the local, uninitialized sockaddr_storage variable
    to userland -- 128 bytes of kernel stack memory.

    Fix that by simply setting msg_namelen to 0 as obviously nobody cared
    about caif_seqpkt_recvmsg() not filling the msg_name in case it was
    set.

    Cc: Sjur Braendeland
    Signed-off-by: Mathias Krause
    Signed-off-by: David S. Miller

    Mathias Krause
     

08 Mar, 2013

1 commit