1. 25 Apr, 2016 1 commit
    • Andrew Gabbasov's avatar
      udf: Fix conversion of 'dstring' fields to UTF8 · c26f6c61
      Andrew Gabbasov authored
      Commit 9293fcfb
      ("udf: Remove struct ustr as non-needed intermediate storage"),
      while getting rid of 'struct ustr', does not take any special care
      of 'dstring' fields and effectively use fixed field length instead
      of actual string length, encoded in the last byte of the field.
      
      Also, commit 484a10f4
      ("udf: Merge linux specific translation into CS0 conversion function")
      introduced checking of the length of the string being converted,
      requiring proper alignment to number of bytes constituing each
      character.
      
      The UDF volume identifier is represented as a 32-bytes 'dstring',
      and needs to be converted from CS0 to UTF8, while mounting UDF
      filesystem. The changes in mentioned commits can in some cases
      lead to incorrect handling of volume identifier:
      - if the actual string in 'dstring' is of maximal length and
      does not have zero bytes separating it from dstring encoded
      length in last byte, that last byte may be included in conversion,
      thus making incorrect resulting string;
      - if the identifier is encoded with 2-bytes characters (compression
      code is 16), the length of 31 bytes (32 bytes of field length minus
      1 byte of compression code), taken as the string length, is reported
      as an incorrect (unaligned) length, and the conversion fails, which
      in its turn leads to volume mounting failure.
      
      This patch introduces handling of 'dstring' encoded length field
      in udf_CS0toUTF8 function, that is used in all and only cases
      when 'dstring' fields are converted. Currently these cases are
      processing of Volume Identifier and Volume Set Identifier fields.
      The function is also renamed to udf_dstrCS0toUTF8 to distinctly
      indicate that it handles 'dstring' input.
      Signed-off-by: default avatarAndrew Gabbasov <andrew_gabbasov@mentor.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      c26f6c61
  2. 18 Apr, 2016 2 commits
  3. 17 Apr, 2016 5 commits
  4. 16 Apr, 2016 7 commits
  5. 15 Apr, 2016 20 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 2e572599
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A few fixes for the current series. This contains:
      
         - Two fixes for NVMe:
      
           One fixes a reset race that can be triggered by repeated
           insert/removal of the module.
      
           The other fixes an issue on some platforms, where we get probe
           timeouts since legacy interrupts isn't working.  This used not to
           be a problem since we had the worker thread poll for completions,
           but since that was killed off, it means those poor souls can't
           successfully probe their NVMe device.  Use a proper IRQ check and
           probe (msi-x -> msi ->legacy), like most other drivers to work
           around this.  Both from Keith.
      
         - A loop corruption issue with offset in iters, from Ming Lei.
      
         - A fix for not having the partition stat per cpu ref count
           initialized before sending out the KOBJ_ADD, which could cause user
           space to access the counter prior to initialization.  Also from
           Ming Lei.
      
         - A fix for using the wrong congestion state, from Kaixu Xia"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        block: loop: fix filesystem corruption in case of aio/dio
        NVMe: Always use MSI/MSI-x interrupts
        NVMe: Fix reset/remove race
        writeback: fix the wrong congested state variable definition
        block: partition: initialize percpuref before sending out KOBJ_ADD
      2e572599
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · f3c9a1ab
      Linus Torvalds authored
      Pull libnvdimm fixes from Ross Zwisler:
       "Two fixes:
      
         - Fix memcpy_from_pmem() to fallback to memcpy() for architectures
           where CONFIG_ARCH_HAS_PMEM_API=n.
      
         - Add a comment explaining why we write data twice when clearing
           poison in pmem_do_bvec().
      
        This has passed a boot test on an X86_32 config, which was the
        architecture where issue #1 above was first noticed"
      
      Dan Williams adds:
       "We're giving this multi-maintainer setup a shot, so expect libnvdimm
        pull requests from either Ross or I going forward"
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm, pmem: clarify the write+clear_poison+write flow
        pmem: fix BUG() error in pmem.h:48 on X86_32
      f3c9a1ab
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20160415' of git://git.infradead.org/linux-mtd · 29dde7c2
      Linus Torvalds authored
      Pull MTD fix from Brian Norris:
       "One MTD fix for v4.6-rc4:
      
        In the v4.4 cycle, we relaxed the requirement for assigning
        mtd->owner, but we didn't remove this error case.  It's hit only
        by drivers that are both:
      
         (a) using nand_scan() directly
        and
         (b) built as modules
      
        We haven't seen explicit complaints about this (most use cases don't
        fit one or both of the above), but we should definitely not be
        BUG()'ing here"
      
      * tag 'for-linus-20160415' of git://git.infradead.org/linux-mtd:
        mtd: nand: Drop mtd.owner requirement in nand_scan
      29dde7c2
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.6-rc3' of git://git.linaro.org/people/ulf.hansson/mmc · 2fffad12
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "Here are a couple of mmc fixes intended for v4.6 rc4.
      
        Regarding the fix for the regression about mmcblk device indexes.  The
        approach taken to solve the problem seems to be good enough.  There
        were some discussions around the solution, but it seems like people
        were happy about it in the end.
      
        MMC core:
         - Restore similar old behaviour when assigning mmcblk device indexes
      
        MMC host:
         - tegra: Disable UHS-I modes for Tegra124 to fix regression"
      
      * tag 'mmc-v4.6-rc3' of git://git.linaro.org/people/ulf.hansson/mmc:
        mmc: tegra: Disable UHS-I modes for Tegra124
        mmc: block: Use the mmc host device index as the mmcblk device index
      2fffad12
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · ab5f9eba
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This contains fixes for exynos, amdgpu, radeon, i915 and qxl.
      
        It also contains some fixes to the core drm edid parser.
      
        qxl:
         - fix for a cursor hotspot issue
      
        radeon:
         - some MST fixes that I've been running locally and make my monitor a
           bit happier
      
        exynos:
         - fix some regressions and build fixes
      
        amdgpu:
         - a couple of small fixes
      
        i915:
         - two DP MST fixes and a couple of other regression fixes
      
        Nothing too out of the ordinary or surprising at this point"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/exynos: Use VIDEO_SAMSUNG_S5P_G2D=n as G2D Kconfig dependency
        drm/exynos: fix a warning message
        drm/exynos: mic: fix an error code
        drm/exynos: fimd: fix broken dp_clock control
        drm/exynos: build fbdev code conditionally
        drm/exynos: fix adjusted_mode pointer in exynos_plane_mode_set
        drm/exynos: fix error handling in exynos_drm_subdrv_open
        drm/amd/amdgpu: fix irq domain remove for tonga ih
        drm/i915: fix deadlock on lid open
        drm/radeon: use helper for mst connector dpms.
        drm/radeon/mst: port some MST setup code from DAL.
        drm/amdgpu: add invisible pin size statistic
        drm/edid: Fix DMT 1024x768@43Hz (interlaced) timings
        drm/i915: Exit cherryview_irq_handler() after one pass
        drm/i915: Call intel_dp_mst_resume() before resuming displays
        drm/i915: Fix race condition in intel_dp_destroy_mst_connector()
        drm/edid: Fix parsing of EDID 1.4 Established Timings III descriptor
        drm/edid: Fix EDID Established Timings I and II
        drm/qxl: fix cursor position with non-zero hotspot
      ab5f9eba
    • Linus Torvalds's avatar
      Merge branch 'parisc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 60ea7bb0
      Linus Torvalds authored
      Pull parisc ftrace fixes from Helge Deller:
       "This is (most likely) the last pull request for v4.6 for the parisc
        architecture.
      
        It fixes the FTRACE feature for parisc, which is horribly broken since
         quite some time and doesn't even compile.  This patch just fixes the
        bare minimum (it actually removes more lines than it adds), so that
        the function tracer works again on 32- and 64bit kernels.
      
        I've queued up additional patches on top of this patch which e.g. add
        the syscall tracer, but those have to wait for the merge window for
        v4.7."
      
      * 'parisc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Fix ftrace function tracer
      60ea7bb0
    • Dan Williams's avatar
      libnvdimm, pmem: clarify the write+clear_poison+write flow · 0a370d26
      Dan Williams authored
      The ACPI specification does not specify the state of data after a clear
      poison operation.  Potential future libnvdimm bus implementations for
      other architectures also might not specify or disagree on the state of
      data after clear poison.  Clarify why we write twice.
      Reported-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Reported-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Reviewed-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      0a370d26
    • Heiko Carstens's avatar
      s390: add CPU_BIG_ENDIAN config option · 2fd92273
      Heiko Carstens authored
      Make sure that s390 appears to be a big endian machine by defining
      this config option.
      
      Without this s390 appears to be little endian as seen by e.g. the
      recordmount script: "perl ./scripts/recordmcount.pl "s390" "little"
      "64""
      This has no practical impact within the script since the endian
      variable is only evaluated for mips. However there are already a
      couple of common code places which evaluate this config option. None
      of them is relevant for s390 currently though.
      
      To avoid any issues in the future (and fix the recordmcount oddity)
      add the new config option.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      2fd92273
    • Heiko Carstens's avatar
      s390/spinlock: avoid yield to non existent cpu · 84976952
      Heiko Carstens authored
      arch_spin_lock_wait_flags() checks if a spinlock is not held before
      trying a compare and swap instruction. If the lock is unlocked it
      tries the compare and swap instruction, however if a different cpu
      grabbed the lock in the meantime the instruction will fail as
      expected.
      
      Subsequently the arch_spin_lock_wait_flags() incorrectly tries to
      figure out if the cpu that holds the lock is running. However it is
      using the wrong cpu number for this (-1) and then will also yield the
      current cpu to the wrong cpu.
      
      Fix this by adding a missing continue statement.
      
      Fixes: 470ada6b ("s390/spinlock: refactor arch_spin_lock_wait[_flags]")
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      84976952
    • Gerald Schaefer's avatar
      s390/dcssblk: fix possible deadlock in remove vs. per-device attributes · 1378a683
      Gerald Schaefer authored
      dcssblk_remove_store() holds the dcssblk_devices_sem semaphore while
      calling device_unregister(), which in turn tries to acquire the kernfs
      kn->dev_map rwsem for the device sysfs subtree. The same rwsem is also
      acquired when using the per-device sysfs attributes in the device sub-tree,
      and the attribute handlers then also acquire the dcssblk_devices_sem.
      
      This can lead to a deadlock when removing a DCSS while concurrently
      reading from / writing to one of its sysfs attributes. The following
      lockdep warning hinted towards the issue (CPU0 = dcssblk_remove_store,
      CPU1 = dcssblk_shared_store):
      
      [   76.496047]  Possible unsafe locking scenario:
      
      [   76.496054]        CPU0                    CPU1
      [   76.496059]        ----                    ----
      [   76.496087]   lock(&dcssblk_devices_sem);
      [   76.496090]                                lock(s_active#175);
      [   76.496106]                                lock(&dcssblk_devices_sem);
      [   76.496110]   lock(s_active#175);
      [   76.496115]
       *** DEADLOCK ***
      
      Fix this by releasing the dcssblk_devices_sem semaphore, which only
      protects internal DCSS data, before calling device_unregister().
      Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      1378a683
    • Ming Lei's avatar
      block: loop: fix filesystem corruption in case of aio/dio · a7297a6a
      Ming Lei authored
      Starting from commit e36f6204(block: split bios to max possible length),
      block core starts to split bio in the middle of bvec.
      
      Unfortunately loop dio/aio doesn't consider this situation, and
      always treat 'iter.iov_offset' as zero. Then filesystem corruption
      is observed.
      
      This patch figures out the offset of the base bvevc via
      'bio->bi_iter.bi_bvec_done' and fixes the issue by passing the offset
      to iov iterator.
      
      Fixes: e36f6204 (block: split bios to max possible length)
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org (4.5)
      Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      a7297a6a
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 806fdcce
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes: a binutils fix, an lguest fix, an mcelog fix and a missing
        documentation fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce: Avoid using object after free in genpool
        lguest, x86/entry/32: Fix handling of guest syscalls using interrupt gates
        x86/build: Build compressed x86 kernels as PIE
        x86/mm/pkeys: Add missing Documentation
      806fdcce
    • Linus Torvalds's avatar
      Merge branch 'mm-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a1f98317
      Linus Torvalds authored
      Pull mm gup cleanup from Ingo Molnar:
       "This removes the ugly get-user-pages API hack, now that all upstream
        code has been migrated to it"
      
      ("ugly" is putting it mildly. But it worked.. - Linus)
      
      * 'mm-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        mm/gup: Remove the macro overload API migration helpers from the get_user*() APIs
      a1f98317
    • Linus Torvalds's avatar
      Merge tag 'dm-4.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm · 63a1281b
      Linus Torvalds authored
      Pull device mapper fixes from Mike Snitzer:
      
       - fix a 4.6-rc1 bio-based DM 'struct dm_target_io' leak in an error
         path
      
       - stable@ fix for DM cache metadata's READ_LOCK macros that were
         incorrectly returning error if the block manager was in read-only
         mode; also cleanup multi-statement macros to use do {} while(0)
      
      * tag 'dm-4.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm cache metadata: fix READ_LOCK macros and cleanup WRITE_LOCK macros
        dm: fix dm_target_io leak if clone_bio() returns an error
      63a1281b
    • Linus Torvalds's avatar
      Merge tag 'pwm/for-4.6-rc4' of... · 0a3f5af1
      Linus Torvalds authored
      Merge tag 'pwm/for-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm fix from Thierry Reding:
       "A single one-line fix to turn the regmap cache from an RB-tree to a
        flat cache to avoid lockdep and abort issues"
      
      * tag 'pwm/for-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
        pwm: fsl-ftm: Use flat regmap cache
      0a3f5af1
    • Linus Torvalds's avatar
      Merge tag 'sound-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · c8c52850
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "We've had a very calm development cycle, so far.  Here are the few
        fixes for HD-audio and USB-audio, all of which are small and easy"
      
      * tag 'sound-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix inconsistent monitor_present state until repoll
        ALSA: hda - Fix regression of monitor_present flag in eld proc file
        ALSA: usb-audio: Skip volume controls triggers hangup on Dell USB Dock
        ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T460s
        ALSA: sscape: Use correct format identifier for size_t
        ALSA: usb-audio: Add a quirk for Plantronics BT300
        ALSA: usb-audio: Add a sample rate quirk for Phoenix Audio TMX320
        ALSA: hda - Bind with i915 only when Intel graphics is present
      c8c52850
    • Linus Torvalds's avatar
      Merge branch 'mailbox-devel' of git://git.linaro.org/landing-teams/working/fujitsu/integration · a7109a2c
      Linus Torvalds authored
      Pull mailbox fixes from Jussi Brar:
       "Misc fixes:
      
        mailbox-test driver:
         - prevent memory leak and another cosmetic change
      
        mailbox:
         - change the returned error code
      
        Xgene driver:
         - return -ENOMEM instead of PTR_ERR for failed devm_kzalloc"
      
      * 'mailbox-devel' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        mailbox: Stop using ENOSYS for anything other than unimplemented syscalls
        mailbox: mailbox-test: Prevent memory leak
        mailbox: mailbox-test: Use more consistent format for calling copy_from_user()
        mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
      a7109a2c
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · dfe70581
      Linus Torvalds authored
      Pull f2fs/fscrypto fixes from Jaegeuk Kim:
       "In addition to f2fs/fscrypto fixes, I've added one patch which
        prevents RCU mode lookup in d_revalidate, as Al mentioned.
      
        These patches fix f2fs and fscrypto based on -rc3 bug fixes in ext4
        crypto, which have not yet been fully propagated as follows.
      
         - use of dget_parent and file_dentry to avoid crashes
         - disallow RCU-mode lookup in d_invalidate
         - disallow -ENOMEM in the core data encryption path"
      
      * tag 'for-linus-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:
        ext4/fscrypto: avoid RCU lookup in d_revalidate
        fscrypto: don't let data integrity writebacks fail with ENOMEM
        f2fs: use dget_parent and file_dentry in f2fs_file_open
        fscrypto: use dget_parent() in fscrypt_d_revalidate()
      dfe70581
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 16382ed9
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This fixes an NFS regression caused by the skcipher/hash conversion in
        sunrpc.  It also fixes a build problem in certain configurations with
        bcm63xx"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        hwrng: bcm63xx - fix device tree compilation
        sunrpc: Fix skcipher/shash conversion
      16382ed9
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 4c0b1c67
      Linus Torvalds authored
      Pull keys bugfixes from James Morris:
       "Two bugfixes for Keys related code"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        ASN.1: fix open failure check on headername
        assoc_array: don't call compare_object() on a node
      4c0b1c67
  6. 14 Apr, 2016 5 commits
    • Mike Snitzer's avatar
      dm cache metadata: fix READ_LOCK macros and cleanup WRITE_LOCK macros · 9567366f
      Mike Snitzer authored
      The READ_LOCK macro was incorrectly returning -EINVAL if
      dm_bm_is_read_only() was true -- it will always be true once the cache
      metadata transitions to read-only by dm_cache_metadata_set_read_only().
      
      Wrap READ_LOCK and WRITE_LOCK multi-statement macros in do {} while(0).
      Also, all accesses of the 'cmd' argument passed to these related macros
      are now encapsulated in parenthesis.
      
      A follow-up patch can be developed to eliminate the use of macros in
      favor of pure C code.  Avoiding that now given that this needs to apply
      to stable@.
      Reported-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Fixes: d14fcf3d ("dm cache: make sure every metadata function checks fail_io")
      Cc: stable@vger.kernel.org
      9567366f
    • Keith Busch's avatar
      NVMe: Always use MSI/MSI-x interrupts · a5229050
      Keith Busch authored
      Multiple users have reported device initialization failure due the driver
      not receiving legacy PCI interrupts. This is not unique to any particular
      controller, but has been observed on multiple platforms.
      
      There have been no issues reported or observed when with message signaled
      interrupts, so this patch attempts to use MSI-x during initialization,
      falling back to MSI. If that fails, legacy would become the default.
      
      The setup_io_queues error handling had to change as a result: the admin
      queue's msix_entry used to be initialized to the legacy IRQ. The case
      where nr_io_queues is 0 would fail request_irq when setting up the admin
      queue's interrupt since re-enabling MSI-x fails with 0 vectors, leaving
      the admin queue's msix_entry invalid. Instead, return success immediately.
      Reported-by: default avatarTim Muhlemmer <muhlemmer@gmail.com>
      Reported-by: default avatarJon Derrick <jonathan.derrick@intel.com>
      Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      a5229050
    • Linus Torvalds's avatar
      /proc/iomem: only expose physical resource addresses to privileged users · 51d7b120
      Linus Torvalds authored
      In commit c4004b02 ("x86: remove the kernel code/data/bss resources
      from /proc/iomem") I was hoping to remove the phyiscal kernel address
      data from /proc/iomem entirely, but that had to be reverted because some
      system programs actually use it.
      
      This limits all the detailed resource information to properly
      credentialed users instead.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      51d7b120
    • Linus Torvalds's avatar
      pci-sysfs: use proper file capability helper function · ab0fa82b
      Linus Torvalds authored
      The PCI config access checked the file capabilities correctly, but used
      the itnernal security capability check rather than the helper function
      that is actually meant for that.
      
      The security_capable() has unusual return values and is not meant to be
      used elsewhere (the only other use is in the capability checking
      functions that we actually intend people to use, and this odd PCI usage
      really stood out when looking around the capability code.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ab0fa82b
    • Linus Torvalds's avatar
      Make file credentials available to the seqfile interfaces · 34dbbcdb
      Linus Torvalds authored
      A lot of seqfile users seem to be using things like %pK that uses the
      credentials of the current process, but that is actually completely
      wrong for filesystem interfaces.
      
      The unix semantics for permission checking files is to check permissions
      at _open_ time, not at read or write time, and that is not just a small
      detail: passing off stdin/stdout/stderr to a suid application and making
      the actual IO happen in privileged context is a classic exploit
      technique.
      
      So if we want to be able to look at permissions at read time, we need to
      use the file open credentials, not the current ones.  Normal file
      accesses can just use "f_cred" (or any of the helper functions that do
      that, like file_ns_capable()), but the seqfile interfaces do not have
      any such options.
      
      It turns out that seq_file _does_ save away the user_ns information of
      the file, though.  Since user_ns is just part of the full credential
      information, replace that special case with saving off the cred pointer
      instead, and suddenly seq_file has all the permission information it
      needs.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      34dbbcdb