10 Mar, 2019

1 commit

  • [ Upstream commit ff7b11aa481f682e0e9711abfeb7d03f5cd612bf ]

    Commit 9060cb719e61 ("net: crypto set sk to NULL when af_alg_release.")
    fixed a use-after-free in sockfs_setattr() when an AF_ALG socket is
    closed concurrently with fchownat(). However, it ignored that many
    other proto_ops::release() methods don't set sock->sk to NULL and
    therefore allow the same use-after-free:

    - base_sock_release
    - bnep_sock_release
    - cmtp_sock_release
    - data_sock_release
    - dn_release
    - hci_sock_release
    - hidp_sock_release
    - iucv_sock_release
    - l2cap_sock_release
    - llcp_sock_release
    - llc_ui_release
    - rawsock_release
    - rfcomm_sock_release
    - sco_sock_release
    - svc_release
    - vcc_release
    - x25_release

    Rather than fixing all these and relying on every socket type to get
    this right forever, just make __sock_release() set sock->sk to NULL
    itself after calling proto_ops::release().

    Reproducer that produces the KASAN splat when any of these socket types
    are configured into the kernel:

    #include
    #include
    #include
    #include

    pthread_t t;
    volatile int fd;

    void *close_thread(void *arg)
    {
    for (;;) {
    usleep(rand() % 100);
    close(fd);
    }
    }

    int main()
    {
    pthread_create(&t, NULL, close_thread, NULL);
    for (;;) {
    fd = socket(rand() % 50, rand() % 11, 0);
    fchownat(fd, "", 1000, 1000, 0x1000);
    close(fd);
    }
    }

    Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.")
    Signed-off-by: Eric Biggers
    Acked-by: Cong Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     

27 Feb, 2019

4 commits

  • [ Upstream commit 98406133dd9cb9f195676eab540c270dceca879a ]

    Same story as before, these use struct ifreq and thus need
    to be read with the shorter version to not cause faults.

    Cc: stable@vger.kernel.org
    Fixes: f92d4fc95341 ("kill bond_ioctl()")
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • [ Upstream commit c6c9fee35dc27362b7bac34b2fc9f5b8ace2e22c ]

    As reported by Robert O'Callahan in
    https://bugzilla.kernel.org/show_bug.cgi?id=202273
    reverting the previous changes in this area broke
    the SIOCGIFNAME ioctl in compat again (I'd previously
    fixed it after his previous report of breakage in
    https://bugzilla.kernel.org/show_bug.cgi?id=199469).

    This is obviously because I fixed SIOCGIFNAME more or
    less by accident.

    Fix it explicitly now by making it pass through the
    restored compat translation code.

    Cc: stable@vger.kernel.org
    Fixes: 4cf808e7ac32 ("kill dev_ifname32()")
    Reported-by: Robert O'Callahan
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • [ Upstream commit 37ac39bdddc528c998a9f36db36937de923fdf2a ]

    This reverts commit bf4405737f9f ("kill dev_ifsioc()").

    This wasn't really unused as implied by the original commit,
    it still handles the copy to/from user differently, and the
    commit thus caused issues such as
    https://bugzilla.kernel.org/show_bug.cgi?id=199469
    and
    https://bugzilla.kernel.org/show_bug.cgi?id=202273

    However, deviating from a strict revert, rename dev_ifsioc()
    to compat_ifreq_ioctl() to be clearer as to its purpose and
    add a comment.

    Cc: stable@vger.kernel.org
    Fixes: bf4405737f9f ("kill dev_ifsioc()")
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • [ Upstream commit 63ff03ab786ab1bc6cca01d48eacd22c95b9b3eb ]

    This reverts commit 1cebf8f143c2 ("socket: fix struct ifreq
    size in compat ioctl"), it's a bugfix for another commit that
    I'll revert next.

    This is not a 'perfect' revert, I'm keeping some coding style
    intact rather than revert to the state with indentation errors.

    Cc: stable@vger.kernel.org
    Fixes: 1cebf8f143c2 ("socket: fix struct ifreq size in compat ioctl")
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

19 Oct, 2018

1 commit

  • In ethtool_ioctl(), the ioctl command 'ethcmd' is checked through a switch
    statement to see whether it is necessary to pre-process the ethtool
    structure, because, as mentioned in the comment, the structure
    ethtool_rxnfc is defined with padding. If yes, a user-space buffer 'rxnfc'
    is allocated through compat_alloc_user_space(). One thing to note here is
    that, if 'ethcmd' is ETHTOOL_GRXCLSRLALL, the size of the buffer 'rxnfc' is
    partially determined by 'rule_cnt', which is actually acquired from the
    user-space buffer 'compat_rxnfc', i.e., 'compat_rxnfc->rule_cnt', through
    get_user(). After 'rxnfc' is allocated, the data in the original user-space
    buffer 'compat_rxnfc' is then copied to 'rxnfc' through copy_in_user(),
    including the 'rule_cnt' field. However, after this copy, no check is
    re-enforced on 'rxnfc->rule_cnt'. So it is possible that a malicious user
    race to change the value in the 'compat_rxnfc->rule_cnt' between these two
    copies. Through this way, the attacker can bypass the previous check on
    'rule_cnt' and inject malicious data. This can cause undefined behavior of
    the kernel and introduce potential security risk.

    This patch avoids the above issue via copying the value acquired by
    get_user() to 'rxnfc->rule_cn', if 'ethcmd' is ETHTOOL_GRXCLSRLALL.

    Signed-off-by: Wenwen Wang
    Signed-off-by: David S. Miller

    Wenwen Wang
     

14 Sep, 2018

1 commit

  • As reported by Reobert O'Callahan, since Viro's commit to kill
    dev_ifsioc() we attempt to copy too much data in compat mode,
    which may lead to EFAULT when the 32-bit version of struct ifreq
    sits at/near the end of a page boundary, and the next page isn't
    mapped.

    Fix this by passing the approprate compat/non-compat size to copy
    and using that, as before the dev_ifsioc() removal. This works
    because only the embedded "struct ifmap" has different size, and
    this is only used in SIOCGIFMAP/SIOCSIFMAP which has a different
    handler. All other parts of the union are naturally compatible.

    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=199469.

    Fixes: bf4405737f9f ("kill dev_ifsioc()")
    Reported-by: Robert O'Callahan
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

16 Aug, 2018

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    - Gustavo A. R. Silva keeps working on the implicit switch fallthru
    changes.

    - Support 802.11ax High-Efficiency wireless in cfg80211 et al, From
    Luca Coelho.

    - Re-enable ASPM in r8169, from Kai-Heng Feng.

    - Add virtual XFRM interfaces, which avoids all of the limitations of
    existing IPSEC tunnels. From Steffen Klassert.

    - Convert GRO over to use a hash table, so that when we have many
    flows active we don't traverse a long list during accumluation.

    - Many new self tests for routing, TC, tunnels, etc. Too many
    contributors to mention them all, but I'm really happy to keep
    seeing this stuff.

    - Hardware timestamping support for dpaa_eth/fsl-fman from Yangbo Lu.

    - Lots of cleanups and fixes in L2TP code from Guillaume Nault.

    - Add IPSEC offload support to netdevsim, from Shannon Nelson.

    - Add support for slotting with non-uniform distribution to netem
    packet scheduler, from Yousuk Seung.

    - Add UDP GSO support to mlx5e, from Boris Pismenny.

    - Support offloading of Team LAG in NFP, from John Hurley.

    - Allow to configure TX queue selection based upon RX queue, from
    Amritha Nambiar.

    - Support ethtool ring size configuration in aquantia, from Anton
    Mikaev.

    - Support DSCP and flowlabel per-transport in SCTP, from Xin Long.

    - Support list based batching and stack traversal of SKBs, this is
    very exciting work. From Edward Cree.

    - Busyloop optimizations in vhost_net, from Toshiaki Makita.

    - Introduce the ETF qdisc, which allows time based transmissions. IGB
    can offload this in hardware. From Vinicius Costa Gomes.

    - Add parameter support to devlink, from Moshe Shemesh.

    - Several multiplication and division optimizations for BPF JIT in
    nfp driver, from Jiong Wang.

    - Lots of prepatory work to make more of the packet scheduler layer
    lockless, when possible, from Vlad Buslov.

    - Add ACK filter and NAT awareness to sch_cake packet scheduler, from
    Toke Høiland-Jørgensen.

    - Support regions and region snapshots in devlink, from Alex Vesker.

    - Allow to attach XDP programs to both HW and SW at the same time on
    a given device, with initial support in nfp. From Jakub Kicinski.

    - Add TLS RX offload and support in mlx5, from Ilya Lesokhin.

    - Use PHYLIB in r8169 driver, from Heiner Kallweit.

    - All sorts of changes to support Spectrum 2 in mlxsw driver, from
    Ido Schimmel.

    - PTP support in mv88e6xxx DSA driver, from Andrew Lunn.

    - Make TCP_USER_TIMEOUT socket option more accurate, from Jon
    Maxwell.

    - Support for templates in packet scheduler classifier, from Jiri
    Pirko.

    - IPV6 support in RDS, from Ka-Cheong Poon.

    - Native tproxy support in nf_tables, from Máté Eckl.

    - Maintain IP fragment queue in an rbtree, but optimize properly for
    in-order frags. From Peter Oskolkov.

    - Improvde handling of ACKs on hole repairs, from Yuchung Cheng"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1996 commits)
    bpf: test: fix spelling mistake "REUSEEPORT" -> "REUSEPORT"
    hv/netvsc: Fix NULL dereference at single queue mode fallback
    net: filter: mark expected switch fall-through
    xen-netfront: fix warn message as irq device name has '/'
    cxgb4: Add new T5 PCI device ids 0x50af and 0x50b0
    net: dsa: mv88e6xxx: missing unlock on error path
    rds: fix building with IPV6=m
    inet/connection_sock: prefer _THIS_IP_ to current_text_addr
    net: dsa: mv88e6xxx: bitwise vs logical bug
    net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
    ieee802154: hwsim: using right kind of iteration
    net: hns3: Add vlan filter setting by ethtool command -K
    net: hns3: Set tx ring' tc info when netdev is up
    net: hns3: Remove tx ring BD len register in hns3_enet
    net: hns3: Fix desc num set to default when setting channel
    net: hns3: Fix for phy link issue when using marvell phy driver
    net: hns3: Fix for information of phydev lost problem when down/up
    net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero
    net: hns3: Add support for serdes loopback selftest
    bnxt_en: take coredump_record structure off stack
    ...

    Linus Torvalds
     

15 Aug, 2018

1 commit

  • req->sdiag_family is a user-controlled value that's used as an array
    index. Sanitize it after the bounds check to avoid speculative
    out-of-bounds array access.

    This also protects the sock_is_registered() call, so this removes the
    sanitize call there.

    Fixes: e978de7a6d38 ("net: socket: Fix potential spectre v1 gadget in sock_is_registered")
    Cc: Josh Poimboeuf
    Cc: konrad.wilk@oracle.com
    Cc: jamie.iles@oracle.com
    Cc: liran.alon@oracle.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Jeremy Cline
    Signed-off-by: David S. Miller

    Jeremy Cline
     

14 Aug, 2018

1 commit

  • Pull vfs open-related updates from Al Viro:

    - "do we need fput() or put_filp()" rules are gone - it's always fput()
    now. We keep track of that state where it belongs - in ->f_mode.

    - int *opened mess killed - in finish_open(), in ->atomic_open()
    instances and in fs/namei.c code around do_last()/lookup_open()/atomic_open().

    - alloc_file() wrappers with saner calling conventions are introduced
    (alloc_file_clone() and alloc_file_pseudo()); callers converted, with
    much simplification.

    - while we are at it, saner calling conventions for path_init() and
    link_path_walk(), simplifying things inside fs/namei.c (both on
    open-related paths and elsewhere).

    * 'work.open3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (40 commits)
    few more cleanups of link_path_walk() callers
    allow link_path_walk() to take ERR_PTR()
    make path_init() unconditionally paired with terminate_walk()
    document alloc_file() changes
    make alloc_file() static
    do_shmat(): grab shp->shm_file earlier, switch to alloc_file_clone()
    new helper: alloc_file_clone()
    create_pipe_files(): switch the first allocation to alloc_file_pseudo()
    anon_inode_getfile(): switch to alloc_file_pseudo()
    hugetlb_file_setup(): switch to alloc_file_pseudo()
    ocxlflash_getfile(): switch to alloc_file_pseudo()
    cxl_getfile(): switch to alloc_file_pseudo()
    ... and switch shmem_file_setup() to alloc_file_pseudo()
    __shmem_file_setup(): reorder allocations
    new wrapper: alloc_file_pseudo()
    kill FILE_{CREATED,OPENED}
    switch atomic_open() and lookup_open() to returning 0 in all success cases
    document ->atomic_open() changes
    ->atomic_open(): return 0 in all success cases
    get rid of 'opened' in path_openat() and the helpers downstream
    ...

    Linus Torvalds
     

03 Aug, 2018

1 commit


01 Aug, 2018

1 commit

  • We never use RCU protection for it, just a lot of cargo-cult
    rcu_deference_protects calls.

    Note that we do keep the kfree_rcu call for it, as the references through
    struct sock are RCU protected and thus might require a grace period before
    freeing.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Eric Dumazet
    Acked-by: Paul E. McKenney
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

31 Jul, 2018

2 commits


29 Jul, 2018

2 commits


12 Jul, 2018

2 commits


29 Jun, 2018

2 commits

  • The big aio poll revert broke various network protocols that don't
    implement ->poll as a patch in the aio poll serie removed sock_no_poll
    and made the common code handle this case.

    Reported-by: syzbot+57727883dbad76db2ef0@syzkaller.appspotmail.com
    Reported-by: syzbot+cdb0d3176b53d35ad454@syzkaller.appspotmail.com
    Reported-by: syzbot+2c7e8f74f8b2571c87e8@syzkaller.appspotmail.com
    Reported-by: Tetsuo Handa
    Fixes: a11e1d432b51 ("Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL")
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • The poll() changes were not well thought out, and completely
    unexplained. They also caused a huge performance regression, because
    "->poll()" was no longer a trivial file operation that just called down
    to the underlying file operations, but instead did at least two indirect
    calls.

    Indirect calls are sadly slow now with the Spectre mitigation, but the
    performance problem could at least be largely mitigated by changing the
    "->get_poll_head()" operation to just have a per-file-descriptor pointer
    to the poll head instead. That gets rid of one of the new indirections.

    But that doesn't fix the new complexity that is completely unwarranted
    for the regular case. The (undocumented) reason for the poll() changes
    was some alleged AIO poll race fixing, but we don't make the common case
    slower and more complex for some uncommon special case, so this all
    really needs way more explanations and most likely a fundamental
    redesign.

    [ This revert is a revert of about 30 different commits, not reverted
    individually because that would just be unnecessarily messy - Linus ]

    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

11 Jun, 2018

1 commit

  • fchownat() doesn't even hold refcnt of fd until it figures out
    fd is really needed (otherwise is ignored) and releases it after
    it resolves the path. This means sock_close() could race with
    sockfs_setattr(), which leads to a NULL pointer dereference
    since typically we set sock->sk to NULL in ->release().

    As pointed out by Al, this is unique to sockfs. So we can fix this
    in socket layer by acquiring inode_lock in sock_close() and
    checking against NULL in sockfs_setattr().

    sock_release() is called in many places, only the sock_close()
    path matters here. And fortunately, this should not affect normal
    sock_close() as it is only called when the last fd refcnt is gone.
    It only affects sock_close() with a parallel sockfs_setattr() in
    progress, which is not common.

    Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.")
    Reported-by: shankarapailoor
    Cc: Tetsuo Handa
    Cc: Lorenzo Colitti
    Cc: Al Viro
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

07 Jun, 2018

1 commit

  • Pull security system updates from James Morris:

    - incorporate new socketpair() hook into LSM and wire up the SELinux
    and Smack modules. From David Herrmann:

    "The idea is to allow SO_PEERSEC to be called on AF_UNIX sockets
    created via socketpair(2), and return the same information as if
    you emulated socketpair(2) via a temporary listener socket.

    Right now SO_PEERSEC will return the unlabeled credentials for a
    socketpair, rather than the actual credentials of the creating
    process."

    - remove the unused security_settime LSM hook (Sargun Dhillon).

    - remove some stack allocated arrays from the keys code (Tycho
    Andersen)

    * 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    dh key: get rid of stack allocated array for zeroes
    dh key: get rid of stack allocated array
    big key: get rid of stack array allocation
    smack: provide socketpair callback
    selinux: provide socketpair callback
    net: hook socketpair() into LSM
    security: add hook for socketpair()
    security: remove security_settime

    Linus Torvalds
     

26 May, 2018

2 commits


05 May, 2018

1 commit

  • Use the newly created LSM-hook for socketpair(). The default hook
    return-value is 0, so behavior stays the same unless LSMs start using
    this hook.

    Acked-by: Serge Hallyn
    Signed-off-by: Tom Gundersen
    Signed-off-by: David Herrmann
    Acked-by: David S. Miller
    Signed-off-by: James Morris

    David Herrmann
     

06 Apr, 2018

1 commit

  • Pull trivial tree updates from Jiri Kosina.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
    kfifo: fix inaccurate comment
    tools/thermal: tmon: fix for segfault
    net: Spelling s/stucture/structure/
    edd: don't spam log if no EDD information is present
    Documentation: Fix early-microcode.txt references after file rename
    tracing: Block comments should align the * on each line
    treewide: Fix typos in printk
    GenWQE: Fix a typo in two comments
    treewide: Align function definition open/close braces

    Linus Torvalds
     

04 Apr, 2018

1 commit

  • Pull networking updates from David Miller:

    1) Support offloading wireless authentication to userspace via
    NL80211_CMD_EXTERNAL_AUTH, from Srinivas Dasari.

    2) A lot of work on network namespace setup/teardown from Kirill Tkhai.
    Setup and cleanup of namespaces now all run asynchronously and thus
    performance is significantly increased.

    3) Add rx/tx timestamping support to mv88e6xxx driver, from Brandon
    Streiff.

    4) Support zerocopy on RDS sockets, from Sowmini Varadhan.

    5) Use denser instruction encoding in x86 eBPF JIT, from Daniel
    Borkmann.

    6) Support hw offload of vlan filtering in mvpp2 dreiver, from Maxime
    Chevallier.

    7) Support grafting of child qdiscs in mlxsw driver, from Nogah
    Frankel.

    8) Add packet forwarding tests to selftests, from Ido Schimmel.

    9) Deal with sub-optimal GSO packets better in BBR congestion control,
    from Eric Dumazet.

    10) Support 5-tuple hashing in ipv6 multipath routing, from David Ahern.

    11) Add path MTU tests to selftests, from Stefano Brivio.

    12) Various bits of IPSEC offloading support for mlx5, from Aviad
    Yehezkel, Yossi Kuperman, and Saeed Mahameed.

    13) Support RSS spreading on ntuple filters in SFC driver, from Edward
    Cree.

    14) Lots of sockmap work from John Fastabend. Applications can use eBPF
    to filter sendmsg and sendpage operations.

    15) In-kernel receive TLS support, from Dave Watson.

    16) Add XDP support to ixgbevf, this is significant because it should
    allow optimized XDP usage in various cloud environments. From Tony
    Nguyen.

    17) Add new Intel E800 series "ice" ethernet driver, from Anirudh
    Venkataramanan et al.

    18) IP fragmentation match offload support in nfp driver, from Pieter
    Jansen van Vuuren.

    19) Support XDP redirect in i40e driver, from Björn Töpel.

    20) Add BPF_RAW_TRACEPOINT program type for accessing the arguments of
    tracepoints in their raw form, from Alexei Starovoitov.

    21) Lots of striding RQ improvements to mlx5 driver with many
    performance improvements, from Tariq Toukan.

    22) Use rhashtable for inet frag reassembly, from Eric Dumazet.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1678 commits)
    net: mvneta: improve suspend/resume
    net: mvneta: split rxq/txq init and txq deinit into SW and HW parts
    ipv6: frags: fix /proc/sys/net/ipv6/ip6frag_low_thresh
    net: bgmac: Fix endian access in bgmac_dma_tx_ring_free()
    net: bgmac: Correctly annotate register space
    route: check sysctl_fib_multipath_use_neigh earlier than hash
    fix typo in command value in drivers/net/phy/mdio-bitbang.
    sky2: Increase D3 delay to sky2 stops working after suspend
    net/mlx5e: Set EQE based as default TX interrupt moderation mode
    ibmvnic: Disable irqs before exiting reset from closed state
    net: sched: do not emit messages while holding spinlock
    vlan: also check phy_driver ts_info for vlan's real device
    Bluetooth: Mark expected switch fall-throughs
    Bluetooth: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for BTUSB_QCA_ROME
    Bluetooth: btrsi: remove unused including
    Bluetooth: hci_bcm: Remove DMI quirk for the MINIX Z83-4
    sh_eth: kill useless check in __sh_eth_get_regs()
    sh_eth: add sh_eth_cpu_data::no_xdfar flag
    ipv6: factorize sk_wmem_alloc updates done by __ip6_append_data()
    ipv4: factorize sk_wmem_alloc updates done by __ip_append_data()
    ...

    Linus Torvalds
     

03 Apr, 2018

13 commits

  • Pull removal of in-kernel calls to syscalls from Dominik Brodowski:
    "System calls are interaction points between userspace and the kernel.
    Therefore, system call functions such as sys_xyzzy() or
    compat_sys_xyzzy() should only be called from userspace via the
    syscall table, but not from elsewhere in the kernel.

    At least on 64-bit x86, it will likely be a hard requirement from
    v4.17 onwards to not call system call functions in the kernel: It is
    better to use use a different calling convention for system calls
    there, where struct pt_regs is decoded on-the-fly in a syscall wrapper
    which then hands processing over to the actual syscall function. This
    means that only those parameters which are actually needed for a
    specific syscall are passed on during syscall entry, instead of
    filling in six CPU registers with random user space content all the
    time (which may cause serious trouble down the call chain). Those
    x86-specific patches will be pushed through the x86 tree in the near
    future.

    Moreover, rules on how data may be accessed may differ between kernel
    data and user data. This is another reason why calling sys_xyzzy() is
    generally a bad idea, and -- at most -- acceptable in arch-specific
    code.

    This patchset removes all in-kernel calls to syscall functions in the
    kernel with the exception of arch/. On top of this, it cleans up the
    three places where many syscalls are referenced or prototyped, namely
    kernel/sys_ni.c, include/linux/syscalls.h and include/linux/compat.h"

    * 'syscalls-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: (109 commits)
    bpf: whitelist all syscalls for error injection
    kernel/sys_ni: remove {sys_,sys_compat} from cond_syscall definitions
    kernel/sys_ni: sort cond_syscall() entries
    syscalls/x86: auto-create compat_sys_*() prototypes
    syscalls: sort syscall prototypes in include/linux/compat.h
    net: remove compat_sys_*() prototypes from net/compat.h
    syscalls: sort syscall prototypes in include/linux/syscalls.h
    kexec: move sys_kexec_load() prototype to syscalls.h
    x86/sigreturn: use SYSCALL_DEFINE0
    x86: fix sys_sigreturn() return type to be long, not unsigned long
    x86/ioport: add ksys_ioperm() helper; remove in-kernel calls to sys_ioperm()
    mm: add ksys_readahead() helper; remove in-kernel calls to sys_readahead()
    mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff()
    mm: add ksys_fadvise64_64() helper; remove in-kernel call to sys_fadvise64_64()
    fs: add ksys_fallocate() wrapper; remove in-kernel calls to sys_fallocate()
    fs: add ksys_p{read,write}64() helpers; remove in-kernel calls to syscalls
    fs: add ksys_truncate() wrapper; remove in-kernel calls to sys_truncate()
    fs: add ksys_sync_file_range helper(); remove in-kernel calls to syscall
    kernel: add ksys_setsid() helper; remove in-kernel call to sys_setsid()
    kernel: add ksys_unshare() helper; remove in-kernel calls to sys_unshare()
    ...

    Linus Torvalds
     
  • sys_recv() merely expands the parameters to __sys_recvfrom() by NULL and
    NULL. Open-code this in the two places which used sys_recv() as a wrapper
    to __sys_recvfrom().

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • sys_send() merely expands the parameters to __sys_sendto() by NULL and 0.
    Open-code this in the two places which used sys_send() as a wrapper to
    __sys_sendto().

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • The non-compat codepaths for sys_...msg() verify that MSG_CMSG_COMPAT
    is not set. By moving this check to the __sys_...msg() functions
    (and making it dependent on a static flag passed to this function), we
    can call the __sys...msg() functions instead of the syscall functions
    in all cases. __sys_recvmmsg() does not need this trickery, as the
    check is handled within the do_sys_recvmmsg() function internal to
    net/socket.c.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper do_sys_recvmmsg() allows us to avoid the
    internal calls to the sys_getsockopt() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_getsockopt() allows us to avoid the
    internal calls to the sys_getsockopt() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_setsockopt() allows us to avoid the
    internal calls to the sys_setsockopt() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_shutdown() allows us to avoid the
    internal calls to the sys_shutdown() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_socketpair() allows us to avoid the
    internal calls to the sys_socketpair() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_getpeername() allows us to avoid the
    internal calls to the sys_getpeername() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_getsockname() allows us to avoid the
    internal calls to the sys_getsockname() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_listen() allows us to avoid the
    internal calls to the sys_listen() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     
  • Using the net-internal helper __sys_connect() allows us to avoid the
    internal calls to the sys_connect() syscall.

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski