05 Mar, 2020

2 commits

  • commit 369537c97024dca99303a8d4d6ab38b4f54d3909 upstream.

    Just SMCR requires a CLC Peer ID, but not SMCD. The field should be
    zero for SMCD.

    Fixes: c758dfddc1b5 ("net/smc: add SMC-D support in CLC messages")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ursula Braun
     
  • commit 67f562e3e147750a02b2a91d21a163fc44a1d13e upstream.

    SMC does not work together with FASTOPEN. If sendmsg() is called with
    flag MSG_FASTOPEN in SMC_INIT state, the SMC-socket switches to
    fallback mode. To handle the previous ioctl FIOASYNC call correctly
    in this case, it is necessary to transfer the socket wait queue
    fasync_list to the internal TCP socket.

    Reported-by: syzbot+4b1fe8105f8044a26162@syzkaller.appspotmail.com
    Fixes: ee9dfbef02d18 ("net/smc: handle sockopts forcing fallback")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ursula Braun
     

24 Feb, 2020

1 commit

  • [ Upstream commit 457fed775c97ac2c0cd1672aaf2ff2c8a6235e87 ]

    As nlmsg_put() does not clear the memory that is reserved,
    it this the caller responsability to make sure all of this
    memory will be written, in order to not reveal prior content.

    While we are at it, we can provide the socket cookie even
    if clsock is not set.

    syzbot reported :

    BUG: KMSAN: uninit-value in __arch_swab32 arch/x86/include/uapi/asm/swab.h:10 [inline]
    BUG: KMSAN: uninit-value in __fswab32 include/uapi/linux/swab.h:59 [inline]
    BUG: KMSAN: uninit-value in __swab32p include/uapi/linux/swab.h:179 [inline]
    BUG: KMSAN: uninit-value in __be32_to_cpup include/uapi/linux/byteorder/little_endian.h:82 [inline]
    BUG: KMSAN: uninit-value in get_unaligned_be32 include/linux/unaligned/access_ok.h:30 [inline]
    BUG: KMSAN: uninit-value in ____bpf_skb_load_helper_32 net/core/filter.c:240 [inline]
    BUG: KMSAN: uninit-value in ____bpf_skb_load_helper_32_no_cache net/core/filter.c:255 [inline]
    BUG: KMSAN: uninit-value in bpf_skb_load_helper_32_no_cache+0x14a/0x390 net/core/filter.c:252
    CPU: 1 PID: 5262 Comm: syz-executor.5 Not tainted 5.5.0-rc5-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x1c9/0x220 lib/dump_stack.c:118
    kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:118
    __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
    __arch_swab32 arch/x86/include/uapi/asm/swab.h:10 [inline]
    __fswab32 include/uapi/linux/swab.h:59 [inline]
    __swab32p include/uapi/linux/swab.h:179 [inline]
    __be32_to_cpup include/uapi/linux/byteorder/little_endian.h:82 [inline]
    get_unaligned_be32 include/linux/unaligned/access_ok.h:30 [inline]
    ____bpf_skb_load_helper_32 net/core/filter.c:240 [inline]
    ____bpf_skb_load_helper_32_no_cache net/core/filter.c:255 [inline]
    bpf_skb_load_helper_32_no_cache+0x14a/0x390 net/core/filter.c:252

    Uninit was created at:
    kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
    kmsan_internal_poison_shadow+0x66/0xd0 mm/kmsan/kmsan.c:127
    kmsan_kmalloc_large+0x73/0xc0 mm/kmsan/kmsan_hooks.c:128
    kmalloc_large_node_hook mm/slub.c:1406 [inline]
    kmalloc_large_node+0x282/0x2c0 mm/slub.c:3841
    __kmalloc_node_track_caller+0x44b/0x1200 mm/slub.c:4368
    __kmalloc_reserve net/core/skbuff.c:141 [inline]
    __alloc_skb+0x2fd/0xac0 net/core/skbuff.c:209
    alloc_skb include/linux/skbuff.h:1049 [inline]
    netlink_dump+0x44b/0x1ab0 net/netlink/af_netlink.c:2224
    __netlink_dump_start+0xbb2/0xcf0 net/netlink/af_netlink.c:2352
    netlink_dump_start include/linux/netlink.h:233 [inline]
    smc_diag_handler_dump+0x2ba/0x300 net/smc/smc_diag.c:242
    sock_diag_rcv_msg+0x211/0x610 net/core/sock_diag.c:256
    netlink_rcv_skb+0x451/0x650 net/netlink/af_netlink.c:2477
    sock_diag_rcv+0x63/0x80 net/core/sock_diag.c:275
    netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
    netlink_unicast+0xf9e/0x1100 net/netlink/af_netlink.c:1328
    netlink_sendmsg+0x1248/0x14d0 net/netlink/af_netlink.c:1917
    sock_sendmsg_nosec net/socket.c:639 [inline]
    sock_sendmsg net/socket.c:659 [inline]
    kernel_sendmsg+0x433/0x440 net/socket.c:679
    sock_no_sendpage+0x235/0x300 net/core/sock.c:2740
    kernel_sendpage net/socket.c:3776 [inline]
    sock_sendpage+0x1e1/0x2c0 net/socket.c:937
    pipe_to_sendpage+0x38c/0x4c0 fs/splice.c:458
    splice_from_pipe_feed fs/splice.c:512 [inline]
    __splice_from_pipe+0x539/0xed0 fs/splice.c:636
    splice_from_pipe fs/splice.c:671 [inline]
    generic_splice_sendpage+0x1d5/0x2d0 fs/splice.c:844
    do_splice_from fs/splice.c:863 [inline]
    do_splice fs/splice.c:1170 [inline]
    __do_sys_splice fs/splice.c:1447 [inline]
    __se_sys_splice+0x2380/0x3350 fs/splice.c:1427
    __x64_sys_splice+0x6e/0x90 fs/splice.c:1427
    do_syscall_64+0xb8/0x160 arch/x86/entry/common.c:296
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets")
    Signed-off-by: Eric Dumazet
    Cc: Ursula Braun
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     

05 Jan, 2020

1 commit

  • commit 86434744fedf0cfe07a9eee3f4632c0e25c1d136 upstream.

    FASTOPEN setsockopt() or sendmsg() may switch the SMC socket to fallback
    mode. Once fallback mode is active, the native TCP socket functions are
    called. Nevertheless there is a small race window, when FASTOPEN
    setsockopt/sendmsg runs in parallel to a connect(), and switch the
    socket into fallback mode before connect() takes the sock lock.
    Make sure the SMC-specific connect setup is omitted in this case.

    This way a syzbot-reported refcount problem is fixed, triggered by
    different threads running non-blocking connect() and FASTOPEN_KEY
    setsockopt.

    Reported-by: syzbot+96d3f9ff6a86d37e44c8@syzkaller.appspotmail.com
    Fixes: 6d6dd528d5af ("net/smc: fix refcount non-blocking connect() -part 2")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Ursula Braun
     

31 Dec, 2019

1 commit

  • [ Upstream commit b3cb53c05f20c5b4026a36a7bbd3010d1f3e0a55 ]

    SMCD link groups belong to certain ISM-devices and SMCR link group
    links belong to certain IB-devices. Increase the refcount for
    these devices, as long as corresponding link groups exist.

    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Sasha Levin

    Ursula Braun
     

17 Nov, 2019

1 commit

  • FASTOPEN does not work with SMC-sockets. Since SMC allows fallback to
    TCP native during connection start, the FASTOPEN setsockopts trigger
    this fallback, if the SMC-socket is still in state SMC_INIT.
    But if a FASTOPEN setsockopt is called after a non-blocking connect(),
    this is broken, and fallback does not make sense.
    This change complements
    commit cd2063604ea6 ("net/smc: avoid fallback in case of non-blocking connect")
    and fixes the syzbot reported problem "WARNING in smc_unhash_sk".

    Reported-by: syzbot+8488cc4cf1c9e09b8b86@syzkaller.appspotmail.com
    Fixes: e1bbdd570474 ("net/smc: reduce sock_put() for fallback sockets")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     

13 Nov, 2019

1 commit

  • If an SMC socket is immediately terminated after a non-blocking connect()
    has been called, a memory leak is possible.
    Due to the sock_hold move in
    commit 301428ea3708 ("net/smc: fix refcounting for non-blocking connect()")
    an extra sock_put() is needed in smc_connect_work(), if the internal
    TCP socket is aborted and cancels the sk_stream_wait_connect() of the
    connect worker.

    Reported-by: syzbot+4b73ad6fc767e576e275@syzkaller.appspotmail.com
    Fixes: 301428ea3708 ("net/smc: fix refcounting for non-blocking connect()")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     

07 Nov, 2019

1 commit

  • If a pnet table entry is to be added mentioning a valid ethernet
    interface, but an invalid infiniband or ISM device, the dev_put()
    operation for the ethernet interface is called twice, resulting
    in a negative refcount for the ethernet interface, which disables
    removal of such a network interface.

    This patch removes one of the dev_put() calls.

    Fixes: 890a2cb4a966 ("net/smc: rework pnet table")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     

30 Oct, 2019

1 commit

  • If a nonblocking socket is immediately closed after connect(),
    the connect worker may not have started. This results in a refcount
    problem, since sock_hold() is called from the connect worker.
    This patch moves the sock_hold in front of the connect worker
    scheduling.

    Reported-by: syzbot+4c063e6dea39e4b79f29@syzkaller.appspotmail.com
    Fixes: 50717a37db03 ("net/smc: nonblocking connect rework")
    Reviewed-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

26 Oct, 2019

2 commits

  • Creating of an SMC-R connection with vlan-id fails, because
    smc_listen_work() determines the vlan_id of the connection,
    saves it in struct smc_init_info ini, but clears the ini area
    again if SMC-D is not applicable.
    This patch just resets the ISM device before investigating
    SMC-R availability.

    Fixes: bc36d2fc93eb ("net/smc: consolidate function parameters")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • For SMC sockets forced to fallback to TCP, the file is propagated
    from the outer SMC to the internal TCP socket. When closing the SMC
    socket, the internal TCP socket file pointer must be restored to the
    original NULL value, otherwise memory leaks may show up (found with
    CONFIG_DEBUG_KMEMLEAK).

    The internal TCP socket is released in smc_clcsock_release(), which
    calls __sock_release() function in net/socket.c. This calls the
    needed iput(SOCK_INODE(sock)) only, if the file pointer has been reset
    to the original NULL-value.

    Fixes: 07603b230895 ("net/smc: propagate file from SMC to TCP socket")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     

25 Oct, 2019

1 commit

  • This patch removes variables and callback these are related to the nested
    device structure.
    devices that can be nested have their own nest_level variable that
    represents the depth of nested devices.
    In the previous patch, new {lower/upper}_level variables are added and
    they replace old private nest_level variable.
    So, this patch removes all 'nest_level' variables.

    In order to avoid lockdep warning, ->ndo_get_lock_subclass() was added
    to get lockdep subclass value, which is actually lower nested depth value.
    But now, they use the dynamic lockdep key to avoid lockdep warning instead
    of the subclass.
    So, this patch removes ->ndo_get_lock_subclass() callback.

    Signed-off-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Taehee Yoo
     

11 Oct, 2019

3 commits

  • smc_rx_recvmsg() first checks if data is available, and then if
    RCV_SHUTDOWN is set. There is a race when smc_cdc_msg_recv_action() runs
    in between these 2 checks, receives data and sets RCV_SHUTDOWN.
    In that case smc_rx_recvmsg() would return from receive without to
    process the available data.
    Fix that with a final check for data available if RCV_SHUTDOWN is set.
    Move the check for data into a function and call it twice.
    And use the existing helper smc_rx_data_available().

    Fixes: 952310ccf2d8 ("smc: receive data from RMBE")
    Reviewed-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: Jakub Kicinski

    Karsten Graul
     
  • smc_cdc_rxed_any_close_or_senddone() is used as an end condition for the
    receive loop. This conflicts with smc_cdc_msg_recv_action() which could
    run in parallel and set the bits checked by
    smc_cdc_rxed_any_close_or_senddone() before the receive is processed.
    In that case we could return from receive with no data, although data is
    available. The same applies to smc_rx_wait().
    Fix this by checking for RCV_SHUTDOWN only, which is set in
    smc_cdc_msg_recv_action() after the receive was actually processed.

    Fixes: 952310ccf2d8 ("smc: receive data from RMBE")
    Reviewed-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: Jakub Kicinski

    Karsten Graul
     
  • If creation of an SMCD link group with VLAN id fails, the initial
    smc_ism_get_vlan() step has to be reverted as well.

    Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: Jakub Kicinski

    Ursula Braun
     

21 Aug, 2019

1 commit

  • Currently, we are only explicitly setting SOCK_NOSPACE on a write timeout
    for non-blocking sockets. Epoll() edge-trigger mode relies on SOCK_NOSPACE
    being set when -EAGAIN is returned to ensure that EPOLLOUT is raised.
    Expand the setting of SOCK_NOSPACE to non-blocking sockets as well that can
    use SO_SNDTIMEO to adjust their write timeout. This mirrors the behavior
    that Eric Dumazet introduced for tcp sockets.

    Signed-off-by: Jason Baron
    Cc: Eric Dumazet
    Cc: Ursula Braun
    Cc: Karsten Graul
    Signed-off-by: David S. Miller

    Jason Baron
     

06 Aug, 2019

2 commits

  • FASTOPEN is not possible with SMC. sendmsg() with msg_flag MSG_FASTOPEN
    triggers a fallback to TCP if the socket is in state SMC_INIT.
    But if a nonblocking connect is already started, fallback to TCP
    is no longer possible, even though the socket may still be in state
    SMC_INIT.
    And if a nonblocking connect is already started, a listen() call
    does not make sense.

    Reported-by: syzbot+bd8cc73d665590a1fcad@syzkaller.appspotmail.com
    Fixes: 50717a37db032 ("net/smc: nonblocking connect rework")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • The setsockopts options TCP_NODELAY and TCP_CORK may schedule the
    tx worker. Make sure the socket is not yet moved into SMC_CLOSED
    state (for instance by a shutdown SHUT_RDWR call).

    Reported-by: syzbot+92209502e7aab127c75f@syzkaller.appspotmail.com
    Reported-by: syzbot+b972214bb803a343f4fe@syzkaller.appspotmail.com
    Fixes: 01d2f7e2cdd31 ("net/smc: sockopts TCP_NODELAY and TCP_CORK")
    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     

28 Jun, 2019

2 commits


27 Jun, 2019

2 commits

  • If register_pernet_subsys success in smc_init,
    we should cleanup it in case any other error.

    Fixes: 64e28b52c7a6 (net/smc: add pnet table namespace support")
    Signed-off-by: YueHaibing
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    YueHaibing
     
  • After smc_lgr_create(), the newly created link group is added
    to smc_lgr_list, thus is accessible from other context.
    Although link group creation is serialized by
    smc_create_lgr_pending, the new link group may still be accessed
    concurrently. For example, if ib_device is no longer active,
    smc_ib_port_event_work() will call smc_port_terminate(), which
    in turn will call __smc_lgr_terminate() on every link group of
    this device. So conns_lock is required here.

    Signed-off-by: Huaping Zhou
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Huaping Zhou
     

03 Jun, 2019

1 commit


21 May, 2019

2 commits


10 May, 2019

1 commit

  • Pull rdma updates from Jason Gunthorpe:
    "This has been a smaller cycle than normal. One new driver was
    accepted, which is unusual, and at least one more driver remains in
    review on the list.

    Summary:

    - Driver fixes for hns, hfi1, nes, rxe, i40iw, mlx5, cxgb4,
    vmw_pvrdma

    - Many patches from MatthewW converting radix tree and IDR users to
    use xarray

    - Introduction of tracepoints to the MAD layer

    - Build large SGLs at the start for DMA mapping and get the driver to
    split them

    - Generally clean SGL handling code throughout the subsystem

    - Support for restricting RDMA devices to net namespaces for
    containers

    - Progress to remove object allocation boilerplate code from drivers

    - Change in how the mlx5 driver shows representor ports linked to VFs

    - mlx5 uapi feature to access the on chip SW ICM memory

    - Add a new driver for 'EFA'. This is HW that supports user space
    packet processing through QPs in Amazon's cloud"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (186 commits)
    RDMA/ipoib: Allow user space differentiate between valid dev_port
    IB/core, ipoib: Do not overreact to SM LID change event
    RDMA/device: Don't fire uevent before device is fully initialized
    lib/scatterlist: Remove leftover from sg_page_iter comment
    RDMA/efa: Add driver to Kconfig/Makefile
    RDMA/efa: Add the efa module
    RDMA/efa: Add EFA verbs implementation
    RDMA/efa: Add common command handlers
    RDMA/efa: Implement functions that submit and complete admin commands
    RDMA/efa: Add the ABI definitions
    RDMA/efa: Add the com service API definitions
    RDMA/efa: Add the efa_com.h file
    RDMA/efa: Add the efa.h header file
    RDMA/efa: Add EFA device definitions
    RDMA: Add EFA related definitions
    RDMA/umem: Remove hugetlb flag
    RDMA/bnxt_re: Use core helpers to get aligned DMA address
    RDMA/i40iw: Use core helpers to get aligned DMA address within a supported page size
    RDMA/verbs: Add a DMA iterator to return aligned contiguous memory blocks
    RDMA/umem: Add API to find best driver supported page size in an MR
    ...

    Linus Torvalds
     

03 May, 2019

1 commit

  • Use core provided API to fill the source MAC address and use
    rdma_read_gid_attr_ndev_rcu() to get stable netdev.

    This is preparation patch to allow gid attribute to become NULL when
    associated net device is removed.

    Signed-off-by: Parav Pandit
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Parav Pandit
     

28 Apr, 2019

1 commit

  • Add options to strictly validate messages and dump messages,
    sometimes perhaps validating dump messages non-strictly may
    be required, so add an option for that as well.

    Since none of this can really be applied to existing commands,
    set the options everwhere using the following spatch:

    @@
    identifier ops;
    expression X;
    @@
    struct genl_ops ops[] = {
    ...,
    {
    .cmd = X,
    + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
    ...
    },
    ...
    };

    For new commands one should just not copy the .validate 'opt-out'
    flags and thus get strict validation.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

18 Apr, 2019

1 commit


13 Apr, 2019

8 commits

  • Rework smc_conn_create() to always return a valid DECLINE reason code.
    This removes the need to translate the return codes on 4 different
    places and allows to easily add more detailed return codes by changing
    smc_conn_create() only.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • Rework smc_listen_work() to provide improved reason codes when an
    SMC connection is declined. This allows better debugging on user side.
    This also adds 3 more detailed reason codes in smc_clc.h to indicate
    what type of device was not found (ism or rdma or both), or if ism
    cannot talk to the peer.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • In smc_listen_work() the variables rc and reason_code are defined which
    have the same meaning. Eliminate reason_code in favor of the shorter
    name rc. No functional changes.
    Rename the functions smc_check_ism() and smc_check_rdma() into
    smc_find_ism_device() and smc_find_rdma_device() to make there purpose
    more clear. No functional changes.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • The vlan_id of the underlying CLC socket was retrieved two times
    during processing of the listen handshaking. Change this to get the
    vlan id one time in connect and in listen processing, and reuse the id.
    And add a new CLC DECLINE return code for the case when the retrieval
    of the vlan id failed.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • During initialization of an SMC socket a lot of function parameters need
    to get passed down the function call path. Consolidate the parameters
    in a helper struct so there are less enough parameters to get all passed
    by register.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • The check for a matching ip prefix and subnet was only done for SMC-R
    in smc_listen_rdma_check() but not when an SMC-D connection was
    possible. Rename the function into smc_listen_prfx_check() and move its
    call to a place where it is called for both SMC variants.
    And add a new CLC DECLINE reason for the case when the IP prefix or
    subnet check fails so the reason for the failing SMC connection can be
    found out more easily.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • Correct the CLC decline reason codes for internal problems to not have
    the sign bit set, negative reason codes are interpreted as not eligible
    for TCP fallback.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • For nonblocking sockets move the kernel_connect() from the connect
    worker into the initial smc_connect part to return kernel_connect()
    errors other than -EINPROGRESS to user space.

    Reviewed-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

12 Apr, 2019

3 commits

  • Commit
    ("net/smc: move unhash as early as possible in smc_release()")
    fixes one occurrence in the smc code, but the same pattern exists
    in other places. This patch covers the remaining occurrences and
    makes sure, the unhash operation is done before the smc->clcsock is
    released. This avoids a potential use-after-free in smc_diag_dump().

    Reviewed-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • The FLUSH command is used to empty the pnet table. No return code is
    expected from the command. Commit a9d8b0b1e3d6 added namespace support
    for the pnet table and changed the FLUSH command processing to call
    smc_pnet_remove_by_pnetid() to remove the pnet entries. This function
    returns -ENOENT when no entry was deleted, which is now the return code
    of the FLUSH command. As a result the FLUSH command will return an error
    when the pnet table is already empty.
    Restore the expected behavior and let FLUSH always return 0.

    Fixes: a9d8b0b1e3d6 ("net/smc: add pnet table namespace support")
    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • fcntl(fd, F_SETOWN, getpid()) selects the recipient of SIGURG signals
    that are delivered when out-of-band data arrives on socket fd.
    If an SMC socket program makes use of such an fcntl() call, it fails
    in case of fallback to TCP-mode. In case of fallback the traffic is
    processed with the internal TCP socket. Propagating field "file" from the
    SMC socket to the internal TCP socket fixes the issue.

    Reviewed-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun