1. 27 Jul, 2020 14 commits
    • Al Viro's avatar
      arm: switch to ->regset_get() · 3598e9f0
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3598e9f0
    • Al Viro's avatar
      sh: convert to ->regset_get() · 3399d90c
      Al Viro authored
      NB: there's a direct call of fpregs_get() left in dump_fpu().
      To be taken out once we convert ELF_FDPIC to use of regset.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3399d90c
    • Al Viro's avatar
      arm64: switch to ->regset_get() · 759de58f
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      759de58f
    • Al Viro's avatar
      mips: switch to ->regset_get() · a0faf966
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a0faf966
    • Al Viro's avatar
      sparc: switch to ->regset_get() · 4d617aaa
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      4d617aaa
    • Al Viro's avatar
      s390: switch to ->regset_get() · b69c6320
      Al Viro authored
      NB: compat NT_S390_LAST_BREAK might be better as compat_long_t
      rather than long.  User-visible ABI, again...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      b69c6320
    • Al Viro's avatar
      powerpc: switch to ->regset_get() · 47e12855
      Al Viro authored
      Note: compat variant of REGSET_TM_CGPR is almost certainly wrong;
      it claims to be 48*64bit, but just as compat REGSET_GPR it stores
      44*32bit of (truncated) registers + 4 32bit zeros... followed by
      48 more 32bit zeroes.  Might be too late to change - it's a userland
      ABI, after all ;-/
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      47e12855
    • Al Viro's avatar
      x86: switch to ->regset_get() · 0557d64d
      Al Viro authored
      	All instances of ->get() in arch/x86 switched; that might or might
      not be worth splitting up.  Notes:
      
      	* for xstateregs_get() the amount we want to store is determined at
      the boot time; see init_xstate_size() and update_regset_xstate_info() for
      details.  task->thread.fpu.state.xsave ends with a flexible array member and
      the amount of data in it depends upon the FPU features supported/enabled.
      
      	* fpregs_get() writes slightly less than full ->thread.fpu.state.fsave
      (the last word is not copied); we pass the full size of state.fsave and let
      membuf_write() trim to the amount declared by regset - __regset_get() will
      make sure that the space in buffer is no more than that.
      
      	* copy_xstate_to_user() and its helpers are gone now.
      
      	* fpregs_soft_get() was getting user_regset_copyout() arguments
      wrong.  Since "x86: x86 user_regset math_emu" back in 2008...  I really
      doubt that it's worth splitting out for -stable, though - you need
      a 486SX box for that to trigger...
      
      [Kevin's braino fix for copy_xstate_to_kernel() essentially duplicated here]
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      0557d64d
    • Al Viro's avatar
      regset: new method and helpers for it · 7717cb9b
      Al Viro authored
      ->regset_get() takes task+regset+buffer, returns the amount of free space
      left in the buffer on success and -E... on error.
      
      buffer is represented as struct membuf - a pair of (kernel) pointer
      and amount of space left
      
      Primitives for writing to such:
      	* membuf_write(buf, data, size)
      	* membuf_zero(buf, size)
      	* membuf_store(buf, value)
      
      These are implemented as inlines (in case of membuf_store - a macro).
      All writes are sequential; they become no-ops when there's no space
      left.  Return value of all primitives is the amount of space left
      after the operation, so they can be used as return values of ->regset_get().
      
      Example of use:
      
      // stores pt_regs of task + 64 bytes worth of zeroes + 32bit PID of task
      int foo_get(struct task_struct *task, const struct regset *regset,
      	    struct membuf to)
      {
      	membuf_write(&to, task_pt_regs(task), sizeof(struct pt_regs));
      	membuf_zero(&to, 64);
      	return membuf_store(&to, (u32)task_tgid_vnr(task));
      }
      
      regset_get()/regset_get_alloc() taught to use that thing if present.
      By the end of the series all users of ->get() will be converted;
      then ->get() and ->get_size() can go.
      
      Note that unlike ->get() this thing always starts at offset 0 and,
      since it only writes to kernel buffer, can't fail on copyout.
      It can, of course, fail for other reasons, but those tend to
      be less numerous.
      
      The caller guarantees that the buffer size won't be bigger than
      regset->n * regset->size.  That simplifies life for quite a few
      instances.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      7717cb9b
    • Al Viro's avatar
      copy_regset_to_user(): do all copyout at once. · dc12d796
      Al Viro authored
      Turn copy_regset_to_user() into regset_get_alloc() + copy_to_user().
      Now all ->get() calls have a kernel buffer as destination.
      
      Note that we'd already eliminated the callers of copy_regset_to_user()
      with non-zero offset; now that argument is simply unused.
      
      Uninlined, while we are at it.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      dc12d796
    • Al Viro's avatar
    • Al Viro's avatar
      introduction of regset ->get() wrappers, switching ELF coredumps to those · b4e9c954
      Al Viro authored
      Two new helpers: given a process and regset, dump into a buffer.
      regset_get() takes a buffer and size, regset_get_alloc() takes size
      and allocates a buffer.
      
      Return value in both cases is the amount of data actually dumped in
      case of success or -E...  on error.
      
      In both cases the size is capped by regset->n * regset->size, so
      ->get() is called with offset 0 and size no more than what regset
      expects.
      
      binfmt_elf.c callers of ->get() are switched to using those; the other
      caller (copy_regset_to_user()) will need some preparations to switch.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      b4e9c954
    • Al Viro's avatar
      b7e46c52
    • Al Viro's avatar
      sparc32: get rid of odd callers of copy_regset_from_user() · 98a7fbf3
      Al Viro authored
      [a couple of unused variables left behind by the previous version
      spotted by kernel test robot <lkp@intel.com>]
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      98a7fbf3
  2. 26 Jun, 2020 13 commits
  3. 14 Jun, 2020 4 commits
    • Linus Torvalds's avatar
      Linux 5.8-rc1 · b3a9e3b9
      Linus Torvalds authored
      b3a9e3b9
    • Linus Torvalds's avatar
      Merge tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux · 4a87b197
      Linus Torvalds authored
      Pull SafeSetID update from Micah Morton:
       "Add additional LSM hooks for SafeSetID
      
        SafeSetID is capable of making allow/deny decisions for set*uid calls
        on a system, and we want to add similar functionality for set*gid
        calls.
      
        The work to do that is not yet complete, so probably won't make it in
        for v5.8, but we are looking to get this simple patch in for v5.8
        since we have it ready.
      
        We are planning on the rest of the work for extending the SafeSetID
        LSM being merged during the v5.9 merge window"
      
      * tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux:
        security: Add LSM hooks to set*gid syscalls
      4a87b197
    • Thomas Cedeno's avatar
      security: Add LSM hooks to set*gid syscalls · 39030e13
      Thomas Cedeno authored
      The SafeSetID LSM uses the security_task_fix_setuid hook to filter
      set*uid() syscalls according to its configured security policy. In
      preparation for adding analagous support in the LSM for set*gid()
      syscalls, we add the requisite hook here. Tested by putting print
      statements in the security_task_fix_setgid hook and seeing them get hit
      during kernel boot.
      Signed-off-by: default avatarThomas Cedeno <thomascedeno@google.com>
      Signed-off-by: default avatarMicah Morton <mortonm@chromium.org>
      39030e13
    • Linus Torvalds's avatar
      Merge tag 'for-5.8-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 9d645db8
      Linus Torvalds authored
      Pull btrfs updates from David Sterba:
       "This reverts the direct io port to iomap infrastructure of btrfs
        merged in the first pull request. We found problems in invalidate page
        that don't seem to be fixable as regressions or without changing iomap
        code that would not affect other filesystems.
      
        There are four reverts in total, but three of them are followup
        cleanups needed to revert a43a67a2 cleanly. The result is the
        buffer head based implementation of direct io.
      
        Reverts are not great, but under current circumstances I don't see
        better options"
      
      * tag 'for-5.8-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Revert "btrfs: switch to iomap_dio_rw() for dio"
        Revert "fs: remove dio_end_io()"
        Revert "btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK"
        Revert "btrfs: split btrfs_direct_IO to read and write part"
      9d645db8
  4. 13 Jun, 2020 9 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 96144c58
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix cfg80211 deadlock, from Johannes Berg.
      
       2) RXRPC fails to send norigications, from David Howells.
      
       3) MPTCP RM_ADDR parsing has an off by one pointer error, fix from
          Geliang Tang.
      
       4) Fix crash when using MSG_PEEK with sockmap, from Anny Hu.
      
       5) The ucc_geth driver needs __netdev_watchdog_up exported, from
          Valentin Longchamp.
      
       6) Fix hashtable memory leak in dccp, from Wang Hai.
      
       7) Fix how nexthops are marked as FDB nexthops, from David Ahern.
      
       8) Fix mptcp races between shutdown and recvmsg, from Paolo Abeni.
      
       9) Fix crashes in tipc_disc_rcv(), from Tuong Lien.
      
      10) Fix link speed reporting in iavf driver, from Brett Creeley.
      
      11) When a channel is used for XSK and then reused again later for XSK,
          we forget to clear out the relevant data structures in mlx5 which
          causes all kinds of problems. Fix from Maxim Mikityanskiy.
      
      12) Fix memory leak in genetlink, from Cong Wang.
      
      13) Disallow sockmap attachments to UDP sockets, it simply won't work.
          From Lorenz Bauer.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (83 commits)
        net: ethernet: ti: ale: fix allmulti for nu type ale
        net: ethernet: ti: am65-cpsw-nuss: fix ale parameters init
        net: atm: Remove the error message according to the atomic context
        bpf: Undo internal BPF_PROBE_MEM in BPF insns dump
        libbpf: Support pre-initializing .bss global variables
        tools/bpftool: Fix skeleton codegen
        bpf: Fix memlock accounting for sock_hash
        bpf: sockmap: Don't attach programs to UDP sockets
        bpf: tcp: Recv() should return 0 when the peer socket is closed
        ibmvnic: Flush existing work items before device removal
        genetlink: clean up family attributes allocations
        net: ipa: header pad field only valid for AP->modem endpoint
        net: ipa: program upper nibbles of sequencer type
        net: ipa: fix modem LAN RX endpoint id
        net: ipa: program metadata mask differently
        ionic: add pcie_print_link_status
        rxrpc: Fix race between incoming ACK parser and retransmitter
        net/mlx5: E-Switch, Fix some error pointer dereferences
        net/mlx5: Don't fail driver on failure to create debugfs
        net/mlx5e: CT: Fix ipv6 nat header rewrite actions
        ...
      96144c58
    • David Sterba's avatar
      Revert "btrfs: switch to iomap_dio_rw() for dio" · 55e20bd1
      David Sterba authored
      This reverts commit a43a67a2.
      
      This patch reverts the main part of switching direct io implementation
      to iomap infrastructure. There's a problem in invalidate page that
      couldn't be solved as regression in this development cycle.
      
      The problem occurs when buffered and direct io are mixed, and the ranges
      overlap. Although this is not recommended, filesystems implement
      measures or fallbacks to make it somehow work. In this case, fallback to
      buffered IO would be an option for btrfs (this already happens when
      direct io is done on compressed data), but the change would be needed in
      the iomap code, bringing new semantics to other filesystems.
      
      Another problem arises when again the buffered and direct ios are mixed,
      invalidation fails, then -EIO is set on the mapping and fsync will fail,
      though there's no real error.
      
      There have been discussions how to fix that, but revert seems to be the
      least intrusive option.
      
      Link: https://lore.kernel.org/linux-btrfs/20200528192103.xm45qoxqmkw7i5yl@fiona/Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      55e20bd1
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: fix allmulti for nu type ale · bc139119
      Grygorii Strashko authored
      On AM65xx MCU CPSW2G NUSS and 66AK2E/L NUSS allmulti setting does not allow
      unregistered mcast packets to pass.
      
      This happens, because ALE VLAN entries on these SoCs do not contain port
      masks for reg/unreg mcast packets, but instead store indexes of
      ALE_VLAN_MASK_MUXx_REG registers which intended for store port masks for
      reg/unreg mcast packets.
      This path was missed by commit 9d1f6447 ("net: ethernet: ti: ale: fix
      seeing unreg mcast packets with promisc and allmulti disabled").
      
      Hence, fix it by taking into account ALE type in cpsw_ale_set_allmulti().
      
      Fixes: 9d1f6447 ("net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc139119
    • Grygorii Strashko's avatar
      net: ethernet: ti: am65-cpsw-nuss: fix ale parameters init · 2074f9ea
      Grygorii Strashko authored
      The ALE parameters structure is created on stack, so it has to be reset
      before passing to cpsw_ale_create() to avoid garbage values.
      
      Fixes: 93a76530 ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2074f9ea
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · fa7566a0
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2020-06-12
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 26 non-merge commits during the last 10 day(s) which contain
      a total of 27 files changed, 348 insertions(+), 93 deletions(-).
      
      The main changes are:
      
      1) sock_hash accounting fix, from Andrey.
      
      2) libbpf fix and probe_mem sanitizing, from Andrii.
      
      3) sock_hash fixes, from Jakub.
      
      4) devmap_val fix, from Jesper.
      
      5) load_bytes_relative fix, from YiFei.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa7566a0
    • Liao Pingfang's avatar
      net: atm: Remove the error message according to the atomic context · bf97bac9
      Liao Pingfang authored
      Looking into the context (atomic!) and the error message should be dropped.
      Signed-off-by: default avatarLiao Pingfang <liao.pingfang@zte.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf97bac9
    • Linus Torvalds's avatar
      Merge tag '5.8-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · f82e7b57
      Linus Torvalds authored
      Pull more cifs updates from Steve French:
       "12 cifs/smb3 fixes, 2 for stable.
      
         - add support for idsfromsid on create and chgrp/chown allowing
           ability to save owner information more naturally for some workloads
      
         - improve query info (getattr) when SMB3.1.1 posix extensions are
           negotiated by using new query info level"
      
      * tag '5.8-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: Add debug message for new file creation with idsfromsid mount option
        cifs: fix chown and chgrp when idsfromsid mount option enabled
        smb3: allow uid and gid owners to be set on create with idsfromsid mount option
        smb311: Add tracepoints for new compound posix query info
        smb311: add support for using info level for posix extensions query
        smb311: Add support for lookup with posix extensions query info
        smb311: Add support for SMB311 query info (non-compounded)
        SMB311: Add support for query info using posix extensions (level 100)
        smb3: add indatalen that can be a non-zero value to calculation of credit charge in smb2 ioctl
        smb3: fix typo in mount options displayed in /proc/mounts
        cifs: Add get_security_type_str function to return sec type.
        smb3: extend fscache mount volume coherency check
      f82e7b57
    • Linus Torvalds's avatar
      binderfs: add gitignore for generated sample program · 4f9b3a37
      Linus Torvalds authored
      Let's keep "git status" happy and quiet.
      
      Fixes: 9762dc14 ("samples: add binderfs sample program
      Fixes: fca5e949 ("samples: binderfs: really compile this sample and fix build issues")
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4f9b3a37
    • Linus Torvalds's avatar
      doc: don't use deprecated "---help---" markers in target docs · 3e1ad405
      Linus Torvalds authored
      I'm not convinced the script makes useful automaed help lines anyway,
      but since we're trying to deprecate the use of "---help---" in Kconfig
      files, let's fix the doc example code too.
      
      See commit a7f7f624 ("treewide: replace '---help---' in Kconfig
      files with 'help'")
      
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3e1ad405