Skip to content
  1. Mar 15, 2019
    • Aurelien Aptel's avatar
      CIFS: fix POSIX lock leak and invalid ptr deref · bc31d0cd
      Aurelien Aptel authored
      
      
      We have a customer reporting crashes in lock_get_status() with many
      "Leaked POSIX lock" messages preceeding the crash.
      
       Leaked POSIX lock on dev=0x0:0x56 ...
       Leaked POSIX lock on dev=0x0:0x56 ...
       Leaked POSIX lock on dev=0x0:0x56 ...
       Leaked POSIX lock on dev=0x0:0x53 ...
       Leaked POSIX lock on dev=0x0:0x53 ...
       Leaked POSIX lock on dev=0x0:0x53 ...
       Leaked POSIX lock on dev=0x0:0x53 ...
       POSIX: fl_owner=ffff8900e7b79380 fl_flags=0x1 fl_type=0x1 fl_pid=20709
       Leaked POSIX lock on dev=0x0:0x4b ino...
       Leaked locks on dev=0x0:0x4b ino=0xf911400000029:
       POSIX: fl_owner=ffff89f41c870e00 fl_flags=0x1 fl_type=0x1 fl_pid=19592
       stack segment: 0000 [#1] SMP
       Modules linked in: binfmt_misc msr tcp_diag udp_diag inet_diag unix_diag af_packet_diag netlink_diag rpcsec_gss_krb5 arc4 ecb auth_rpcgss nfsv4 md4 nfs nls_utf8 lockd grace cifs sunrpc ccm dns_resolver fscache af_packet iscsi_ibft iscsi_boot_sysfs vmw_vsock_vmci_transport vsock xfs libcrc32c sb_edac edac_core crct10dif_pclmul crc32_pclmul ghash_clmulni_intel drbg ansi_cprng vmw_balloon aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd joydev pcspkr vmxnet3 i2c_piix4 vmw_vmci shpchp fjes processor button ac btrfs xor raid6_pq sr_mod cdrom ata_generic sd_mod ata_piix vmwgfx crc32c_intel drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm serio_raw ahci libahci drm libata vmw_pvscsi sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua scsi_mod autofs4
      
       Supported: Yes
       CPU: 6 PID: 28250 Comm: lsof Not tainted 4.4.156-94.64-default #1
       Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
       task: ffff88a345f28740 ti: ffff88c74005c000 task.ti: ffff88c74005c000
       RIP: 0010:[<ffffffff8125dcab>]  [<ffffffff8125dcab>] lock_get_status+0x9b/0x3b0
       RSP: 0018:ffff88c74005fd90  EFLAGS: 00010202
       RAX: ffff89bde83e20ae RBX: ffff89e870003d18 RCX: 0000000049534f50
       RDX: ffffffff81a3541f RSI: ffffffff81a3544e RDI: ffff89bde83e20ae
       RBP: 0026252423222120 R08: 0000000020584953 R09: 000000000000ffff
       R10: 0000000000000000 R11: ffff88c74005fc70 R12: ffff89e5ca7b1340
       R13: 00000000000050e5 R14: ffff89e870003d30 R15: ffff89e5ca7b1340
       FS:  00007fafd64be800(0000) GS:ffff89f41fd00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000001c80018 CR3: 000000a522048000 CR4: 0000000000360670
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       Stack:
        0000000000000208 ffffffff81a3d6b6 ffff89e870003d30 ffff89e870003d18
        ffff89e5ca7b1340 ffff89f41738d7c0 ffff89e870003d30 ffff89e5ca7b1340
        ffffffff8125e08f 0000000000000000 ffff89bc22b67d00 ffff88c74005ff28
       Call Trace:
        [<ffffffff8125e08f>] locks_show+0x2f/0x70
        [<ffffffff81230ad1>] seq_read+0x251/0x3a0
        [<ffffffff81275bbc>] proc_reg_read+0x3c/0x70
        [<ffffffff8120e456>] __vfs_read+0x26/0x140
        [<ffffffff8120e9da>] vfs_read+0x7a/0x120
        [<ffffffff8120faf2>] SyS_read+0x42/0xa0
        [<ffffffff8161cbc3>] entry_SYSCALL_64_fastpath+0x1e/0xb7
      
      When Linux closes a FD (close(), close-on-exec, dup2(), ...) it calls
      filp_close() which also removes all posix locks.
      
      The lock struct is initialized like so in filp_close() and passed
      down to cifs
      
      	...
              lock.fl_type = F_UNLCK;
              lock.fl_flags = FL_POSIX | FL_CLOSE;
              lock.fl_start = 0;
              lock.fl_end = OFFSET_MAX;
      	...
      
      Note the FL_CLOSE flag, which hints the VFS code that this unlocking
      is done for closing the fd.
      
      filp_close()
        locks_remove_posix(filp, id);
          vfs_lock_file(filp, F_SETLK, &lock, NULL);
            return filp->f_op->lock(filp, cmd, fl) => cifs_lock()
              rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, xid);
                rc = server->ops->mand_unlock_range(cfile, flock, xid);
                if (flock->fl_flags & FL_POSIX && !rc)
                        rc = locks_lock_file_wait(file, flock)
      
      Notice how we don't call locks_lock_file_wait() which does the
      generic VFS lock/unlock/wait work on the inode if rc != 0.
      
      If we are closing the handle, the SMB server is supposed to remove any
      locks associated with it. Similarly, cifs.ko frees and wakes up any
      lock and lock waiter when closing the file:
      
      cifs_close()
        cifsFileInfo_put(file->private_data)
      	/*
      	 * Delete any outstanding lock records. We'll lose them when the file
      	 * is closed anyway.
      	 */
      	down_write(&cifsi->lock_sem);
      	list_for_each_entry_safe(li, tmp, &cifs_file->llist->locks, llist) {
      		list_del(&li->llist);
      		cifs_del_lock_waiters(li);
      		kfree(li);
      	}
      	list_del(&cifs_file->llist->llist);
      	kfree(cifs_file->llist);
      	up_write(&cifsi->lock_sem);
      
      So we can safely ignore unlocking failures in cifs_lock() if they
      happen with the FL_CLOSE flag hint set as both the server and the
      client take care of it during the actual closing.
      
      This is not a proper fix for the unlocking failure but it's safe and
      it seems to prevent the lock leakages and crashes the customer
      experiences.
      
      Signed-off-by: default avatarAurelien Aptel <aaptel@suse.com>
      Signed-off-by: default avatarNeilBrown <neil@brown.name>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Acked-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      bc31d0cd
    • Ronnie Sahlberg's avatar
      SMB3: Allow SMB3 FSCTL queries to be sent to server from tools · f5778c39
      Ronnie Sahlberg authored
      
      
      For debugging purposes we often have to be able to query
      additional information only available via SMB3 FSCTL
      from the server from user space tools (e.g. like
      cifs-utils's smbinfo).  See MS-FSCC and MS-SMB2 protocol
      specifications for more details.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      f5778c39
    • Ronnie Sahlberg's avatar
      cifs: fix incorrect handling of smb2_set_sparse() return in smb3_simple_falloc · f1699479
      Ronnie Sahlberg authored
      
      
      smb2_set_sparse does not return -errno, it returns a boolean where
      true means success.
      Change this to just ignore the return value just like the other callsites.
      
      Additionally add code to handle the case where we must set the file sparse
      and possibly also extending it.
      
      Fixes xfstests: generic/236 generic/350 generic/420
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      f1699479
    • Steve French's avatar
      smb2: fix typo in definition of a few error flags · dd0ac2d2
      Steve French authored
      
      
      As Sergey Senozhatsky pointed out __constant_cpu_to_le32()
      is misspelled in a few definitions in the list of status
      codes smb2status.h as __constanst_cpu_to_le32()
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      CC: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      dd0ac2d2
    • Aurelien Aptel's avatar
      CIFS: make mknod() an smb_version_op · c847dccf
      Aurelien Aptel authored
      
      
      This cleanup removes cifs specific code from SMB2/SMB3 code paths
      which is cleaner and easier to maintain as the code to handle
      special files is improved.  Below is an example creating special files
      using 'sfu' mount option over SMB3 to Windows (with this patch)
      (Note that to Samba server, support for saving dos attributes
      has to be enabled for the SFU mount option to work).
      
      In the future this will also make implementation of creating
      special files as reparse points easier (as Windows NFS server does
      for example).
      
         root@smf-Thinkpad-P51:~# stat -c "%F" /mnt2/char
         character special file
      
         root@smf-Thinkpad-P51:~# stat -c "%F" /mnt2/block
         block special file
      
      Signed-off-by: default avatarAurelien Aptel <aaptel@suse.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      c847dccf
    • Steve French's avatar
      cifs: minor documentation updates · 65525802
      Steve French authored
      
      
      Also updated a comment describing use of the GlobalMid_Lock
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      65525802
    • Steve French's avatar
      cifs: remove unused value pointed out by Coverity · d44d1372
      Steve French authored
      
      
      Detected by CoverityScan CID#1438719 ("Unused Value")
      
      buf is reset again before being used so these two lines of code
      are useless.
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      d44d1372
    • Steve French's avatar
      SMB3: passthru query info doesn't check for SMB3 FSCTL passthru · 31ba4331
      Steve French authored
      
      
      The passthrough queries from user space tools like smbinfo can be either
      SMB3 QUERY_INFO or SMB3 FSCTL, but we are not checking for the latter.
      Temporarily we return EOPNOTSUPP for SMB3 FSCTL passthrough requests
      but once compounding fsctls is fixed can enable.
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      31ba4331
    • Steve French's avatar
      smb3: add dynamic tracepoints for simple fallocate and zero range · 779ede04
      Steve French authored
      
      
      Can be helpful in debugging various xfstests that are currently
      skipped or failing due to missing features in our current
      implementation of fallocate.
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      779ede04
    • Ronnie Sahlberg's avatar
      cifs: fix smb3_zero_range so it can expand the file-size when required · 72c419d9
      Ronnie Sahlberg authored
      
      
      This allows fallocate -z to work against a Windows2016 share.
      
      This is due to the SMB3 ZERO_RANGE command does not modify the filesize.
      To address this we will now append a compounded SET-INFO to update the
      end-of-file information.
      
      This brings xfstests generic/469 closer to working against a windows share.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      72c419d9
    • Ronnie Sahlberg's avatar
      cifs: add SMB2_ioctl_init/free helpers to be used with compounding · ccdc77a3
      Ronnie Sahlberg authored
      
      
      Define an _init() and a _free() function for SMB2_init so that we will
      be able to use it with compounds.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      ccdc77a3
    • Steve French's avatar
      smb3: Add dynamic trace points for various compounded smb3 ops · 8191576a
      Steve French authored
      
      
      Adds trace points for enter and exit (done vs. error) for:
      
      	compounded query and setinfo, hardlink, rename,
      	mkdir, rmdir, set_eof, delete (unlink)
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      8191576a
    • Ronnie Sahlberg's avatar
      cifs: cache FILE_ALL_INFO for the shared root handle · b0f6df73
      Ronnie Sahlberg authored
      
      
      When we open the shared root handle also ask for FILE_ALL_INFORMATION since
      we can do this at zero cost as part of a compound.
      Cache this information as long as the lease is held and return and serve any
      future requests from cache.
      
      This allows us to serve "stat /<mountpoint>" directly from cache and avoid
      a network roundtrip.  Since clients often want to do this quite a lot
      this improve performance slightly.
      
      As an example: xfstest generic/533 performs 43 stat operations on the root
      of the share while it is run. Which are eliminated with this patch.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      b0f6df73
    • Steve French's avatar
      smb3: display volume serial number for shares in /proc/fs/cifs/DebugData · ab7b10cf
      Steve French authored
      
      
      It can be helpful for debugging.  According to MS-FSCC:
      
      "A 32-bit unsigned integer that contains the serial number of the
      volume. The serial number is an opaque value generated by the file
      system at format time"
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Acked-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      ab7b10cf
    • Ronnie Sahlberg's avatar
      cifs: simplify how we handle credits in compound_send_recv() · 257b7809
      Ronnie Sahlberg authored
      
      
      Since we can now wait for multiple requests atomically in
      wait_for_free_request() we can now greatly simplify the handling
      of the credits in this function.
      
      This fixes a potential deadlock where many concurrent compound requests
      could each have reserved 1 or 2 credits each but are all blocked
      waiting for the final credits they need to be able to issue the requests
      to the server.
      
      Set a default timeout of 60 seconds for compounded requests.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      257b7809
    • Steve French's avatar
      smb3: add dynamic tracepoint for timeout waiting for credits · 7937ca96
      Steve French authored
      
      
      To help debug credit starvation problems where we timeout
      waiting for server to grant the client credits.
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      7937ca96
    • Steve French's avatar
      smb3: display security information in /proc/fs/cifs/DebugData more accurately · ffd1ef1e
      Steve French authored
      
      
      When the server required encryption (but we didn't connect to it with the
      "seal" mount option) we weren't displaying in /proc/fs/cifs/DebugData that
      the tcon for that share was encrypted. Similarly we were not displaying
      that signing was required when ses->sign was enabled (we only
      checked ses->server->sign).  This makes it easier to debug when in
      fact the connection is signed (or sealed), whether for performance
      or security questions.
      
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      ffd1ef1e
    • Ronnie Sahlberg's avatar
      cifs: add a timeout argument to wait_for_free_credits · 2b53b929
      Ronnie Sahlberg authored
      
      
      A negative timeout is the same as the current behaviour, i.e. no timeout.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      2b53b929
    • Ronnie Sahlberg's avatar
      cifs: prevent starvation in wait_for_free_credits for multi-credit requests · 16b34aa4
      Ronnie Sahlberg authored
      
      
      Reserve the last MAX_COMPOUND credits for any request asking for >1 credit.
      This is to prevent future compound requests from becoming starved while waiting
      for potentially many requests is there is a large number of concurrent
      singe-credit requests.
      
      However, we need to protect from servers that are very slow to hand out
      new credits on new sessions so we only do this IFF there are 2*MAX_COMPOUND
      (arbitrary) credits already in flight.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      16b34aa4
    • Ronnie Sahlberg's avatar
      cifs: wait_for_free_credits() make it possible to wait for >=1 credits · b227d215
      Ronnie Sahlberg authored
      
      
      Change wait_for_free_credits() to allow waiting for >=1 credits instead of just
      a single credit.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      b227d215
    • Ronnie Sahlberg's avatar
    • Ronnie Sahlberg's avatar
      cifs: change wait_for_free_request() to take flags as argument · 480b1cb9
      Ronnie Sahlberg authored
      
      
      and compute timeout and optyp from it.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      480b1cb9
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · f261c4e5
      Linus Torvalds authored
      Merge misc patches from Andrew Morton:
      
      - a little bit more MM
      
      - a few fixups
      
      [ The "little bit more MM" is actually just one of the three patches
        Andrew sent for mm/filemap.c, I'm still mulling over two more of them
        from Josef Bacik     - Linus ]
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        include/linux/swap.h: use offsetof() instead of custom __swapoffset macro
        tools/testing/selftests/proc/proc-pid-vm.c: test with vsyscall in mind
        zram: default to lzo-rle instead of lzo
        filemap: pass vm_fault to the mmap ra helpers
      f261c4e5
    • Pi-Hsun Shih's avatar
      include/linux/swap.h: use offsetof() instead of custom __swapoffset macro · a4046c06
      Pi-Hsun Shih authored
      Use offsetof() to calculate offset of a field to take advantage of
      compiler built-in version when possible, and avoid UBSAN warning when
      compiling with Clang:
      
        UBSAN: Undefined behaviour in mm/swapfile.c:3010:38
        member access within null pointer of type 'union swap_header'
        CPU: 6 PID: 1833 Comm: swapon Tainted: G S                4.19.23 #43
        Call trace:
         dump_backtrace+0x0/0x194
         show_stack+0x20/0x2c
         __dump_stack+0x20/0x28
         dump_stack+0x70/0x94
         ubsan_epilogue+0x14/0x44
         ubsan_type_mismatch_common+0xf4/0xfc
         __ubsan_handle_type_mismatch_v1+0x34/0x54
         __se_sys_swapon+0x654/0x1084
         __arm64_sys_swapon+0x1c/0x24
         el0_svc_common+0xa8/0x150
         el0_svc_compat_handler+0x2c/0x38
         el0_svc_compat+0x8/0x18
      
      Link: http://lkml.kernel.org/r/20190312081902.223764-1-pihsun@chromium.org
      
      
      Signed-off-by: default avatarPi-Hsun Shih <pihsun@chromium.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a4046c06
    • Alexey Dobriyan's avatar
      tools/testing/selftests/proc/proc-pid-vm.c: test with vsyscall in mind · 17415606
      Alexey Dobriyan authored
      : selftests: proc: proc-pid-vm
      : ========================================
      : proc-pid-vm: proc-pid-vm.c:277: main: Assertion `rv == strlen(buf0)' failed.
      : Aborted
      
      Because the vsyscall mapping is enabled.  Read from vsyscall page to tell
      if vsyscall is being used.
      
      Link: http://lkml.kernel.org/r/20190307183204.GA11405@avx2
      Link: http://lkml.kernel.org/r/20190219094722.GB28258@shao2-debian
      
      
      Fixes: 34aab6bec23e7e9 ("proc: test /proc/*/maps, smaps, smaps_rollup, statm")
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Reported-by: default avatarkernel test robot <rong.a.chen@intel.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      17415606
    • Dave Rodgman's avatar
      zram: default to lzo-rle instead of lzo · ce82f19f
      Dave Rodgman authored
      lzo-rle gives higher performance and similar compression ratios to lzo.
      
      Link: http://lkml.kernel.org/r/20190205155944.16007-4-dave.rodgman@arm.com
      
      
      Signed-off-by: default avatarDave Rodgman <dave.rodgman@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ce82f19f
    • Josef Bacik's avatar
      filemap: pass vm_fault to the mmap ra helpers · 2a1180f1
      Josef Bacik authored
      All of the arguments to these functions come from the vmf.
      
      Cut down on the amount of arguments passed by simply passing in the vmf
      to these two helpers.
      
      Link: http://lkml.kernel.org/r/20181211173801.29535-3-josef@toxicpanda.com
      
      
      Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2a1180f1
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3b319ee2
      Linus Torvalds authored
      Pull more ACPI updates from Rafael Wysocki:
       "These fix a couple of issues and do some cleanups on top of the
        previous ACPI changes for 5.1-rc1.
      
        Specifics:
      
         - Fix a crash caused by unloading an SSDT overlay (Andy Shevchenko)
      
         - Prevent user space from getting confusing error values on failing
           ACPI sysfs accesses (Rafael Wysocki)
      
         - Simplify leaf node detection in the PPTT parsing code by using a
           new flag defined in ACPI 6.3 (Jeremy Linton)
      
         - Add missing "static" in some places in the ACPI configfs code (Andy
           Shevchenko)
      
         - Fix acpidbg tool path in the ACPI documentation (Flavio Suligoi)"
      
      * tag 'acpi-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: sysfs: Prevent get_status() from returning acpi_status
        ACPI / device_sysfs: Avoid OF modalias creation for removed device
        ACPI / configfs: Mark local data structures static
        ACPI / configfs: Mark local functions static
        ACPI: tables: Simplify PPTT leaf node detection
        ACPI: Documentation: Fix path for acpidbg tool
      3b319ee2
    • Linus Torvalds's avatar
      Merge tag 'pm-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 9352ca58
      Linus Torvalds authored
      Pull more power management updates from Rafael Wysocki:
       "These are mostly fixes and cleanups on top of the previously merged
        power management material for 5.1-rc1 with one cpupower utility update
        that wasn't pushed earlier due to unfortunate timing.
      
        Specifics:
      
         - Fix registration of new cpuidle governors partially broken during
           the 5.0 development cycle by mistake (Rafael Wysocki).
      
         - Avoid integer overflows in the menu cpuidle governor by making it
           discard the overflowing data points upfront (Rafael Wysocki).
      
         - Fix minor mistake in the recent update of the iowait boost
           computation in the intel_pstate driver (Rafael Wysocki).
      
         - Drop incorrect __init annotation from one function in the pxa2xx
           cpufreq driver (Arnd Bergmann).
      
         - Fix the operating performance points (OPP) framework initialization
           for devices in multiple power domains if only one of them is
           scalable (Rajendra Nayak).
      
         - Fix mistake in dev_pm_opp_set_rate() which causes it to skip
           updating the performance state if the new frequency is the same as
           the old one (Viresh Kumar).
      
         - Rework the cancellation of wakeup source timers to avoid potential
           issues with it and do some cleanups unlocked by that change (Viresh
           Kumar, Rafael Wysocki).
      
         - Clean up the code computing the active/suspended time of devices in
           the PM-runtime framework after recent changes (Ulf Hansson).
      
         - Make the power management infrastructure code use pr_fmt()
           consistently (Joe Perches).
      
         - Clean up the generic power domains (genpd) framework somewhat
           (Aisheng Dong).
      
         - Improve kerneldoc comments for two functions in the cpufreq core
           (Rafael Wysocki).
      
         - Fix typo in a PM QoS file description comment (Aisheng Dong).
      
         - Update the handling of CPU boost frequencies in the cpupower
           utility (Abhishek Goel)"
      
      * tag 'pm-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpuidle: governor: Add new governors to cpuidle_governors again
        cpufreq: intel_pstate: Fix up iowait_boost computation
        PM / OPP: Update performance state when freq == old_freq
        PM / wakeup: Drop wakeup_source_drop()
        PM / wakeup: Rework wakeup source timer cancellation
        PM / domains: Remove one unnecessary blank line
        PM / Domains: Return early for all errors in _genpd_power_off()
        PM / Domains: Improve warn for multiple states but no governor
        OPP: Fix handling of multiple power domains
        PM / QoS: Fix typo in file description
        cpufreq: pxa2xx: remove incorrect __init annotation
        PM-runtime: Call pm_runtime_active|suspended_time() from sysfs
        PM-runtime: Consolidate code to get active/suspended time
        PM: Add and use pr_fmt()
        cpufreq: Improve kerneldoc comments for cpufreq_cpu_get/put()
        cpuidle: menu: Avoid overflows when computing variance
        tools/power/cpupower: Display boost frequency separately
      9352ca58
    • Linus Torvalds's avatar
      Merge tag 'microblaze-v5.1-rc1' of git://git.monstr.eu/linux-2.6-microblaze · 9bc44610
      Linus Torvalds authored
      Pull Microblaze update from Michal Simek:
       "Simplify debugfs initialization"
      
      * tag 'microblaze-v5.1-rc1' of git://git.monstr.eu/linux-2.6-microblaze:
        microblaze: no need to check return value of debugfs_create functions
      9bc44610
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · f3ca4c55
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "More fixes in the queue:
      
        1) Netfilter nat can erroneously register the device notifier twice,
           fix from Florian Westphal.
      
        2) Use after free in nf_tables, from Pablo Neira Ayuso.
      
        3) Parallel update of steering rule fix in mlx5 river, from Eli
           Britstein.
      
        4) RX processing panic in lan743x, fix from Bryan Whitehead.
      
        5) Use before initialization of TCP_SKB_CB, fix from Christoph Paasch.
      
        6) Fix locking in SRIOV mode of mlx4 driver, from Jack Morgenstein.
      
        7) Fix TX stalls in lan743x due to mishandling of interrupt ACKing
           modes, from Bryan Whitehead.
      
        8) Fix infoleak in l2tp_ip6_recvmsg(), from Eric Dumazet"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (43 commits)
        pptp: dst_release sk_dst_cache in pptp_sock_destruct
        MAINTAINERS: GENET & SYSTEMPORT: Add internal Broadcom list
        l2tp: fix infoleak in l2tp_ip6_recvmsg()
        net/tls: Inform user space about send buffer availability
        net_sched: return correct value for *notify* functions
        lan743x: Fix TX Stall Issue
        net/mlx4_core: Fix qp mtt size calculation
        net/mlx4_core: Fix locking in SRIOV mode when switching between events and polling
        net/mlx4_core: Fix reset flow when in command polling mode
        mlxsw: minimal: Initialize base_mac
        mlxsw: core: Prevent duplication during QSFP module initialization
        net: dwmac-sun8i: fix a missing check of of_get_phy_mode
        net: sh_eth: fix a missing check of of_get_phy_mode
        net: 8390: fix potential NULL pointer dereferences
        net: fujitsu: fix a potential NULL pointer dereference
        net: qlogic: fix a potential NULL pointer dereference
        isdn: hfcpci: fix potential NULL pointer dereference
        Documentation: devicetree: add a new optional property for port mac address
        net: rocker: fix a potential NULL pointer dereference
        net: qlge: fix a potential NULL pointer dereference
        ...
      f3ca4c55
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-5.1-rc1' of git://git.infradead.org/users/vkoul/slave-dma · 31ef489a
      Linus Torvalds authored
      Pull dmaengine updates from Vinod Koul:
      
       - dmatest updates for modularizing common struct and code
      
       - remove SG support for VDMA xilinx IP and updates to driver
      
       - Update to dw driver to support Intel iDMA controllers multi-block
         support
      
       - tegra updates for proper reporting of residue
      
       - Add Snow Ridge ioatdma device id and support for IOATDMA v3.4
      
       - struct_size() usage and useless LIST_HEAD cleanups in subsystem.
      
       - qDMA controller driver for Layerscape SoCs
      
       - stm32-dma PM Runtime support
      
       - And usual updates to imx-sdma, sprd, Documentation, fsl-edma,
         bcm2835, qcom_hidma etc
      
      * tag 'dmaengine-5.1-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (81 commits)
        dmaengine: imx-sdma: fix consistent dma test failures
        dmaengine: imx-sdma: add a test for imx8mq multi sdma devices
        dmaengine: imx-sdma: add clock ratio 1:1 check
        dmaengine: dmatest: move test data alloc & free into functions
        dmaengine: dmatest: add short-hand `buf_size` var in dmatest_func()
        dmaengine: dmatest: wrap src & dst data into a struct
        dmaengine: ioatdma: support latency tolerance report (LTR) for v3.4
        dmaengine: ioatdma: add descriptor pre-fetch support for v3.4
        dmaengine: ioatdma: disable DCA enabling on IOATDMA v3.4
        dmaengine: ioatdma: Add Snow Ridge ioatdma device id
        dmaengine: sprd: Change channel id to slave id for DMA cell specifier
        dt-bindings: dmaengine: sprd: Change channel id to slave id for DMA cell specifier
        dmaengine: mv_xor: Use correct device for DMA API
        Documentation :dmaengine: clarify DMA desc. pointer after submission
        Documentation: dmaengine: fix dmatest.rst warning
        dmaengine: k3dma: Add support for dma-channel-mask
        dmaengine: k3dma: Delete axi_config
        dmaengine: k3dma: Upgrade k3dma driver to support hisi_asp_dma hardware
        Documentation: bindings: dma: Add binding for dma-channel-mask
        Documentation: bindings: k3dma: Extend the k3dma driver binding to support hisi-asp
        ...
      31ef489a
    • Linus Torvalds's avatar
      Merge tag 'rproc-v5.1' of git://github.com/andersson/remoteproc · 2f194646
      Linus Torvalds authored
      Pull remoteproc updates from Bjorn Andersson:
       "This contains the last patches in Loic's remoteproc resource table
        handling changes, a number of updates to documentation, support for
        invoking the crash handler (for testing purposes), a fix for the
        handling of virtio devices during recovery, performance state votes in
        Qualcomm modem driver, support for specifying board specific firmware
        path for Qualcomm modem driver and improved support for graceful
        shutdown of Qualcomm remoteprocs"
      
      * tag 'rproc-v5.1' of git://github.com/andersson/remoteproc: (33 commits)
        remoteproc: fix for "dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag"
        remoteproc: fix rproc_check_carveout_da() returned error and comments
        remoteproc: fix trace buffer va initialization
        remoteproc: fix rproc_alloc_carveout() for rproc with iommu domain
        remoteproc: add warning on resource table cast
        remoteproc: fix rproc_alloc_carveout() bad variable cast
        remotep...
      2f194646
  2. Mar 14, 2019
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · dc2535be
      Linus Torvalds authored
      Pull clk subsystem updates from Stephen Boyd:
       "We have a fairly balanced mix of clk driver updates and clk framework
        updates this time around. It's the usual pile of new drivers for new
        hardware out there and the normal small fixes and updates, but then we
        have some core framework changes too.
      
        In the core framework, we introduce support for a clk_get_optional()
        API to get clks that may not always be populated and a way to devm
        manage clkdev lookups registered by provider drivers. We also do some
        refactoring to simplify the interface between clkdev and the common
        clk framework so we can reuse the DT parsing and clk_get() path in
        provider drivers in the future. This work will continue in the next
        few cycles while we convert how providers specify clk parents.
      
        On the driver side, the biggest part of the dirstat is the Amlogic clk
        driver that got support for the G12A SoC. It dominates with almost
        h...
      dc2535be
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-tables', 'acpi-debug', 'acpi-doc' and 'acpi-misc' · b6e88119
      Rafael J. Wysocki authored
      * acpi-tables:
        ACPI: tables: Simplify PPTT leaf node detection
      
      * acpi-debug:
        ACPI: sysfs: Prevent get_status() from returning acpi_status
      
      * acpi-doc:
        ACPI: Documentation: Fix path for acpidbg tool
      
      * acpi-misc:
        ACPI / configfs: Mark local data structures static
        ACPI / configfs: Mark local functions static
      b6e88119
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-opp' and 'pm-tools' · b444e1aa
      Rafael J. Wysocki authored
      * pm-opp:
        PM / OPP: Update performance state when freq == old_freq
        OPP: Fix handling of multiple power domains
      
      * pm-tools:
        tools/power/cpupower: Display boost frequency separately
      b444e1aa
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-domains' · 75f3e239
      Rafael J. Wysocki authored
      * pm-domains:
        PM / domains: Remove one unnecessary blank line
        PM / Domains: Return early for all errors in _genpd_power_off()
        PM / Domains: Improve warn for multiple states but no governor
      75f3e239
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpuidle' and 'pm-cpufreq' · 4650b279
      Rafael J. Wysocki authored
      * pm-cpuidle:
        cpuidle: governor: Add new governors to cpuidle_governors again
        cpuidle: menu: Avoid overflows when computing variance
      
      * pm-cpufreq:
        cpufreq: intel_pstate: Fix up iowait_boost computation
        cpufreq: pxa2xx: remove incorrect __init annotation
        cpufreq: Improve kerneldoc comments for cpufreq_cpu_get/put()
      4650b279
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-core', 'pm-sleep' and 'pm-qos' · e6035258
      Rafael J. Wysocki authored
      * pm-core:
        PM-runtime: Call pm_runtime_active|suspended_time() from sysfs
        PM-runtime: Consolidate code to get active/suspended time
      
      * pm-sleep:
        PM / wakeup: Drop wakeup_source_drop()
        PM / wakeup: Rework wakeup source timer cancellation
      
      * pm-qos:
        PM / QoS: Fix typo in file description
      e6035258
    • Xin Long's avatar
      pptp: dst_release sk_dst_cache in pptp_sock_destruct · 9417d81f
      Xin Long authored
      sk_setup_caps() is called to set sk->sk_dst_cache in pptp_connect,
      so we have to dst_release(sk->sk_dst_cache) in pptp_sock_destruct,
      otherwise, the dst refcnt will leak.
      
      It can be reproduced by this syz log:
      
        r1 = socket$pptp(0x18, 0x1, 0x2)
        bind$pptp(r1, &(0x7f0000000100)={0x18, 0x2, {0x0, @local}}, 0x1e)
        connect$pptp(r1, &(0x7f0000000000)={0x18, 0x2, {0x3, @remote}}, 0x1e)
      
      Consecutive dmesg warnings will occur:
      
        unregister_netdevice: waiting for lo to become free. Usage count = 1
      
      v1->v2:
        - use rcu_dereference_protected() instead of rcu_dereference_check(),
          as suggested by Eric.
      
      Fixes: 00959ade
      
       ("PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)")
      Reported-by: default avatarXiumei Mu <xmu@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9417d81f