Skip to content
Snippets Groups Projects
  1. Jan 19, 2020
  2. Jan 18, 2020
    • Christian Brauner's avatar
      ptrace: reintroduce usage of subjective credentials in ptrace_has_cap() · 6b3ad664
      Christian Brauner authored
      Commit 69f594a3 ("ptrace: do not audit capability check when outputing /proc/pid/stat")
      introduced the ability to opt out of audit messages for accesses to various
      proc files since they are not violations of policy.  While doing so it
      somehow switched the check from ns_capable() to
      has_ns_capability{_noaudit}(). That means it switched from checking the
      subjective credentials of the task to using the objective credentials. This
      is wrong since. ptrace_has_cap() is currently only used in
      ptrace_may_access() And is used to check whether the calling task (subject)
      has the CAP_SYS_PTRACE capability in the provided user namespace to operate
      on the target task (object). According to the cred.h comments this would
      mean the subjective credentials of the calling task need to be used.
      This switches ptrace_has_cap() to use security_capable(). Because we only
      call ptrace_has_cap() in ptrace_may_access() and in there we already have a
      stable ref...
      6b3ad664
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.5-2020-01-16' of git://git.kernel.dk/linux-block · 25e73aad
      Linus Torvalds authored
      Pull io_uring fixes form Jens Axboe:
      
       - Ensure ->result is always set when IO is retried (Bijan)
      
       - In conjunction with the above, fix a regression in polled IO issue
         when retried (me/Bijan)
      
       - Don't setup async context for read/write fixed, otherwise we may
         wrongly map the iovec on retry (me)
      
       - Cancel io-wq work if we fail getting mm reference (me)
      
       - Ensure dependent work is always initialized correctly (me)
      
       - Only allow original task to submit IO, don't allow it from a passed
         ring fd (me)
      
      * tag 'io_uring-5.5-2020-01-16' of git://git.kernel.dk/linux-block:
        io_uring: only allow submit from owning task
        io_uring: ensure workqueue offload grabs ring mutex for poll list
        io_uring: clear req->result always before issuing a read/write request
        io_uring: be consistent in assigning next work from handler
        io-wq: cancel work if we fail getting a mm reference
        io_uring: don't setup async context for read/write fixed
      25e73aad
    • Linus Torvalds's avatar
      Merge tag 'for-5.5-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · effaf901
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "A few more fixes that have been in the works during last twp weeks.
        All have a user visible effect and are stable material:
      
         - scrub: properly update progress after calling cancel ioctl, calling
           'resume' would start from the beginning otherwise
      
         - fix subvolume reference removal, after moving out of the original
           path the reference is not recognized and will lead to transaction
           abort
      
         - fix reloc root lifetime checks, could lead to crashes when there's
           subvolume cleaning running in parallel
      
         - fix memory leak when quotas get disabled in the middle of extent
           accounting
      
         - fix transaction abort in case of balance being started on degraded
           mount on eg. RAID1"
      
      * tag 'for-5.5-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: check rw_devices, not num_devices for balance
        Btrfs: always copy scrub arguments back to user space
        btrfs: relocation: fix reloc_root lifespan and access
        btrfs: fix memory leak in qgroup accounting
        btrfs: do not delete mismatched root refs
        btrfs: fix invalid removal of root ref
        btrfs: rework arguments of btrfs_unlink_subvol
      effaf901
    • Greg Kroah-Hartman's avatar
      Merge tag 'usb-serial-5.5-rc7' of... · 453495d4
      Greg Kroah-Hartman authored
      Merge tag 'usb-serial-5.5-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial
      
       into usb-linus
      
      Johan writes:
      
      USB-serial fixes for 5.5-rc7
      
      Here are a few fixes for issues related to unbound port devices which
      could lead to NULL-pointer dereferences. Notably the bind attributes for
      usb-serial (port) drivers are removed as almost none of the drivers can
      handle individual ports going away once they've been bound.
      
      Included are also some new device ids.
      
      All but the unbound-port fixes have been in linux-next with no reported
      issues.
      
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      * tag 'usb-serial-5.5-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
        USB: serial: quatech2: handle unbound ports
        USB: serial: keyspan: handle unbound ports
        USB: serial: io_edgeport: add missing active-port sanity check
        USB: serial: io_edgeport: handle unbound ports on URB completion
        USB: serial: ch341: handle unbound port at reset_resume
        USB: serial: suppress driver bind attributes
        USB: serial: option: add support for Quectel RM500Q in QDL mode
        USB: serial: opticon: fix control-message timeouts
        USB: serial: option: Add support for Quectel RM500Q
        USB: serial: simple: Add Motorola Solutions TETRA MTP3xxx and MTP85xx
      453495d4
    • Linus Torvalds's avatar
      Merge tag 'fuse-fixes-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · ab7541c3
      Linus Torvalds authored
      Pull fuse fix from Miklos Szeredi:
       "Fix a regression in the last release affecting the ftp module of the
        gvfs filesystem"
      
      * tag 'fuse-fixes-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: fix fuse_send_readpages() in the syncronous read case
      ab7541c3
    • Linus Torvalds's avatar
      Merge tag 'sound-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 07d5ac6a
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This became bigger than I have hoped for rc7. But, the only large LOC
        is for stm32 fixes that are simple rewriting of register access
        helpers, while the rest are all nice and small fixes:
      
         - A few ASoC fixes for the remaining probe error handling bugs
      
         - ALSA sequencer core fix for racy proc file accesses
      
         - Revert the option rename of snd-hda-intel to make compatible again
      
         - Various device-specific fixes"
      
      * tag 'sound-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: seq: Fix racy access for queue timer in proc read
        ALSA: usb-audio: fix sync-ep altsetting sanity check
        ASoC: msm8916-wcd-digital: Reset RX interpolation path after use
        ASoC: msm8916-wcd-analog: Fix MIC BIAS Internal1
        ASoC: cros_ec_codec: Make the device acpi compatible
        ASoC: sti: fix possible sleep-in-atomic
        ASoC: msm8916-wcd-analog: Fix selected events for MIC...
      07d5ac6a
  3. Jan 17, 2020
  4. Jan 16, 2020
    • Reinhard Speyerer's avatar
      USB: serial: option: add support for Quectel RM500Q in QDL mode · f3eaabbf
      Reinhard Speyerer authored
      
      Add support for Quectel RM500Q in QDL mode.
      
      T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 24 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=2c7c ProdID=0800 Rev= 0.00
      S:  Manufacturer=Qualcomm CDMA Technologies MSM
      S:  Product=QUSB_BULK_SN:xxxxxxxx
      S:  SerialNumber=xxxxxxxx
      C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=  2mA
      I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=10 Driver=option
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      It is assumed that the ZLP flag required for other Qualcomm-based
      5G devices also applies to Quectel RM500Q.
      
      Signed-off-by: default avatarReinhard Speyerer <rspmn@arcor.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      f3eaabbf
    • Takashi Iwai's avatar
      Merge tag 'asoc-fix-v5.5-rc6' of... · e5dbdcb3
      Takashi Iwai authored
      Merge tag 'asoc-fix-v5.5-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v5.5
      
      This is mostly driver specific fixes, plus an error handling fix
      in the core.  There is a rather large diffstat for the stm32 SAI
      driver, this is a very large but mostly mechanical update which
      wraps every register access in the driver to allow a fix to the
      locking which avoids circular locks, the active change is much
      smaller and more reasonably sized.
      e5dbdcb3
    • Miklos Szeredi's avatar
      fuse: fix fuse_send_readpages() in the syncronous read case · 7df1e988
      Miklos Szeredi authored
      
      Buffered read in fuse normally goes via:
      
       -> generic_file_buffered_read()
         -> fuse_readpages()
           -> fuse_send_readpages()
             ->fuse_simple_request() [called since v5.4]
      
      In the case of a read request, fuse_simple_request() will return a
      non-negative bytecount on success or a negative error value.  A positive
      bytecount was taken to be an error and the PG_error flag set on the page.
      This resulted in generic_file_buffered_read() falling back to ->readpage(),
      which would repeat the read request and succeed.  Because of the repeated
      read succeeding the bug was not detected with regression tests or other use
      cases.
      
      The FTP module in GVFS however fails the second read due to the
      non-seekable nature of FTP downloads.
      
      Fix by checking and ignoring positive return value from
      fuse_simple_request().
      
      Reported-by: default avatarOndrej Holy <oholy@redhat.com>
      Link: https://gitlab.gnome.org/GNOME/gvfs/issues/441
      
      
      Fixes: 134831e3 ("fuse: convert readpages to simple api")
      Cc: <stable@vger.kernel.org> # v5.4
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      7df1e988
    • Jens Axboe's avatar
      io_uring: ensure workqueue offload grabs ring mutex for poll list · 11ba820b
      Jens Axboe authored
      
      A previous commit moved the locking for the async sqthread, but didn't
      take into account that the io-wq workers still need it. We can't use
      req->in_async for this anymore as both the sqthread and io-wq workers
      set it, gate the need for locking on io_wq_current_is_worker() instead.
      
      Fixes: 8a4955ff ("io_uring: sqthread should grab ctx->uring_lock for submissions")
      Reported-by: default avatarBijan Mottahedeh <bijan.mottahedeh@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      11ba820b
    • Mikulas Patocka's avatar
      block: fix an integer overflow in logical block size · ad6bf88a
      Mikulas Patocka authored
      
      Logical block size has type unsigned short. That means that it can be at
      most 32768. However, there are architectures that can run with 64k pages
      (for example arm64) and on these architectures, it may be possible to
      create block devices with 64k block size.
      
      For exmaple (run this on an architecture with 64k pages):
      
      Mount will fail with this error because it tries to read the superblock using 2-sector
      access:
        device-mapper: writecache: I/O is not aligned, sector 2, size 1024, block size 65536
        EXT4-fs (dm-0): unable to read superblock
      
      This patch changes the logical block size from unsigned short to unsigned
      int to avoid the overflow.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ad6bf88a
    • Bijan Mottahedeh's avatar
      io_uring: clear req->result always before issuing a read/write request · 797f3f53
      Bijan Mottahedeh authored
      
      req->result is cleared when io_issue_sqe() calls io_read/write_pre()
      routines.  Those routines however are not called when the sqe
      argument is NULL, which is the case when io_issue_sqe() is called from
      io_wq_submit_work().  io_issue_sqe() may then examine a stale result if
      a polled request had previously failed with -EAGAIN:
      
              if (ctx->flags & IORING_SETUP_IOPOLL) {
                      if (req->result == -EAGAIN)
                              return -EAGAIN;
      
                      io_iopoll_req_issued(req);
              }
      
      and in turn cause a subsequently completed request to be re-issued in
      io_wq_submit_work().
      
      Signed-off-by: default avatarBijan Mottahedeh <bijan.mottahedeh@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      797f3f53
    • Dan Carpenter's avatar
      scsi: mptfusion: Fix double fetch bug in ioctl · 28d76df1
      Dan Carpenter authored
      Tom Hatskevich reported that we look up "iocp" then, in the called
      functions we do a second copy_from_user() and look it up again.
      The problem that could cause is:
      
      drivers/message/fusion/mptctl.c
         674          /* All of these commands require an interrupt or
         675           * are unknown/illegal.
         676           */
         677          if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0)
                                                     ^^^^
      We take this lock.
      
         678                  return ret;
         679
         680          if (cmd == MPTFWDOWNLOAD)
         681                  ret = mptctl_fw_download(arg);
                                                       ^^^
      Then the user memory changes and we look up "iocp" again but a different
      one so now we are holding the incorrect lock and have a race condition.
      
         682          else if (cmd == MPTCOMMAND)
         683                  ret = mptctl_mpt_command(arg);
      
      The security impact of this bug is not as bad as it could have been
      because these operations are all privileged and root already has
      enormous destructive power.  But it's still worth fixing.
      
      This patch passes the "iocp" pointer to the functions to avoid the
      second lookup.  That deletes 100 lines of code from the driver so
      it's a nice clean up as well.
      
      Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam
      
      
      Reported-by: default avatarTom Hatskevich <tom2001tom.23@gmail.com>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      28d76df1