1. 18 Dec, 2019 20 commits
    • Arnd Bergmann's avatar
      y2038: sh: remove timeval/timespec usage from headers · 8c709f9a
      Arnd Bergmann authored
      This header file escaped my earlier cleanups for removing
      the in-kernel usage of timeval and timespec structs.
      
      Replace them with the corresponding __kernel_old_* types.
      Acked-by: default avatarRich Felker <dalias@libc.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      8c709f9a
    • Arnd Bergmann's avatar
      y2038: sparc: remove use of struct timex · 251ec1c1
      Arnd Bergmann authored
      'struct timex' is one of the last users of 'struct timeval' and is
      only referenced in one place in the kernel any more, to convert the
      user space timex into the kernel-internal version on sparc64, with a
      different tv_usec member type.
      
      As a preparation for hiding the time_t definition and everything
      using that in the kernel, change the implementation once more
      to only convert the timeval member, and then enclose the
      struct definition in an #ifdef.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      251ec1c1
    • Arnd Bergmann's avatar
      y2038: rename itimerval to __kernel_old_itimerval · 4f9fbd89
      Arnd Bergmann authored
      Take the renaming of timeval and timespec one level further,
      also renaming itimerval to __kernel_old_itimerval, to avoid
      namespace conflicts with the user-space structure that may
      use 64-bit time_t members.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      4f9fbd89
    • Arnd Bergmann's avatar
      y2038: remove obsolete jiffies conversion functions · 751addac
      Arnd Bergmann authored
      Now that the last user of timespec_to_jiffies() is gone, these
      can just be removed, everything else is using ktime_t or timespec64
      already.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      751addac
    • Arnd Bergmann's avatar
      nfs: fscache: use timespec64 in inode auxdata · 6e31ded6
      Arnd Bergmann authored
      nfs currently behaves differently on 32-bit and 64-bit kernels regarding
      the on-disk format of nfs_fscache_inode_auxdata.
      
      That format should really be the same on any kernel, and we should avoid
      the 'timespec' type in order to remove that from the kernel later on.
      
      Using plain 'timespec64' would not be good here, since that includes
      implied padding and would possibly leak kernel stack data to the on-disk
      format on 32-bit architectures.
      
      struct __kernel_timespec would work as a replacement, but open-coding
      the two struct members in nfs_fscache_inode_auxdata makes it more
      obvious what's going on here, and keeps the current format for 64-bit
      architectures.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      6e31ded6
    • Arnd Bergmann's avatar
      nfs: fix timstamp debug prints · 057f184b
      Arnd Bergmann authored
      Starting in v5.5, the timestamps are correctly passed down as
      64-bit seconds with NFSv4 on 32-bit machines, but some debug
      statements still truncate them to 'long'.
      
      Fixes: e86d5a02 ("NFS: Convert struct nfs_fattr to use struct timespec64")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      057f184b
    • Arnd Bergmann's avatar
      nfs: use time64_t internally · f559935e
      Arnd Bergmann authored
      The timestamps for the cache are all in boottime seconds, so they
      don't overflow 32-bit values, but the use of time_t is deprecated
      because it generally does overflow when used with wall-clock time.
      
      There are multiple possible ways of avoiding it:
      
      - leave time_t, which is safe here, but forces others to
        look into this code to determine that it is over and over.
      
      - use a more generic type, like 'int' or 'long', which is known
        to be sufficient here but loses the documentation of referring
        to timestamps
      
      - use ktime_t everywhere, and convert into seconds in the few
        places where we want realtime-seconds. The conversion is
        sometimes expensive, but not more so than the conversion we
        do today.
      
      - use time64_t to clarify that this code is safe. Nothing would
        change for 64-bit architectures, but it is slightly less
        efficient on 32-bit architectures.
      
      Without a clear winner of the three approaches above, this picks
      the last one, favouring readability over a small performance
      loss on 32-bit architectures.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      f559935e
    • Arnd Bergmann's avatar
      sunrpc: convert to time64_t for expiry · 294ec5b8
      Arnd Bergmann authored
      Using signed 32-bit types for UTC time leads to the y2038 overflow,
      which is what happens in the sunrpc code at the moment.
      
      This changes the sunrpc code over to use time64_t where possible.
      The one exception is the gss_import_v{1,2}_context() function for
      kerberos5, which uses 32-bit timestamps in the protocol. Here,
      we can at least treat the numbers as 'unsigned', which extends the
      range from 2038 to 2106.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      294ec5b8
    • Arnd Bergmann's avatar
      drm/etnaviv: avoid deprecated timespec · 38c4a4cf
      Arnd Bergmann authored
      struct timespec is being removed from the kernel because it often leads
      to code that is not y2038-safe.
      
      In the etnaviv driver, monotonic timestamps are used, which do not suffer
      from overflow, but the usage of timespec here gets in the way of removing
      the interface completely.
      
      Pass down the user-supplied 64-bit value here rather than converting
      it to an intermediate timespec to avoid the conversion.
      
      The conversion is transparent for all regular CLOCK_MONOTONIC values,
      but is a small change in behavior for excessively large values: the
      existing code would treat e.g. tv_sec=0x100000000 the same as tv_sec=0
      and not block, while the new code it would block for up to 2^31
      seconds. The new behavior is more logical here, but if it causes problems,
      the truncation can be put back.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      38c4a4cf
    • Arnd Bergmann's avatar
      drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC · 245595e8
      Arnd Bergmann authored
      Most kernel interfaces that take a timespec require normalized
      representation with tv_nsec between 0 and NSEC_PER_SEC.
      
      Passing values larger than 0x100000000ull further behaves differently
      on 32-bit and 64-bit kernels, and can cause the latter to spend a long
      time counting seconds in timespec64_sub()/set_normalized_timespec64().
      
      Reject those large values at the user interface to enforce sane and
      portable behavior.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      245595e8
    • Arnd Bergmann's avatar
      drm/msm: avoid using 'timespec' · 6cedb8b3
      Arnd Bergmann authored
      The timespec structure and associated interfaces are deprecated and will
      be removed in the future because of the y2038 overflow.
      
      The use of ktime_to_timespec() in timeout_to_jiffies() does not
      suffer from that overflow, but is easy to avoid by just converting
      the ktime_t into jiffies directly.
      Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      6cedb8b3
    • Arnd Bergmann's avatar
      hfs/hfsplus: use 64-bit inode timestamps · 4ddfc3dc
      Arnd Bergmann authored
      The interpretation of on-disk timestamps in HFS and HFS+ differs
      between 32-bit and 64-bit kernels at the moment. Use 64-bit timestamps
      consistently so apply the current 64-bit behavior everyhere.
      
      According to the official documentation for HFS+ [1], inode timestamps
      are supposed to cover the time range from 1904 to 2040 as originally
      used in classic MacOS.
      
      The traditional Linux usage is to convert the timestamps into an unsigned
      32-bit number based on the Unix epoch and from there to a time_t. On
      32-bit systems, that wraps the time from 2038 to 1902, so the last
      two years of the valid time range become garbled. On 64-bit systems,
      all times before 1970 get turned into timestamps between 2038 and 2106,
      which is more convenient but also different from the documented behavior.
      
      Looking at the Darwin sources [2], it seems that MacOS is inconsistent in
      yet another way: all timestamps are wrapped around to a 32-bit unsigned
      number when written to the disk, but when read back, all numeric values
      lower than 2082844800U are assumed to be invalid, so we cannot represent
      the times before 1970 or the times after 2040.
      
      While all implementations seem to agree on the interpretation of values
      between 1970 and 2038, they often differ on the exact range they support
      when reading back values outside of the common range:
      
      MacOS (traditional):		1904-2040
      Apple Documentation:		1904-2040
      MacOS X source comments:	1970-2040
      MacOS X source code:		1970-2038
      32-bit Linux:			1902-2038
      64-bit Linux:			1970-2106
      hfsfuse:			1970-2040
      hfsutils (32 bit, old libc)	1902-2038
      hfsutils (32 bit, new libc)	1970-2106
      hfsutils (64 bit)		1904-2040
      hfsplus-utils			1904-2040
      hfsexplorer			1904-2040
      7-zip				1904-2040
      
      Out of the above, the range from 1970 to 2106 seems to be the most useful,
      as it allows using HFS and HFS+ beyond year 2038, and this matches the
      behavior that most users would see today on Linux, as few people run
      32-bit kernels any more.
      
      Link: [1] https://developer.apple.com/library/archive/technotes/tn/tn1150.html
      Link: [2] https://opensource.apple.com/source/hfs/hfs-407.30.1/core/MacOSStubs.c.auto.html
      Link: https://lore.kernel.org/lkml/20180711224625.airwna6gzyatoowe@eaf/Suggested-by: default avatar"Ernesto A. Fernández" <ernesto.mnd.fernandez@gmail.com>
      Reviewed-by: default avatarVyacheslav Dubeyko <slava@dubeyko.com>
      Reviewed-by: default avatarErnesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      ---
      v3: revert back to 1970-2106 time range
          fix bugs found in review
          merge both patches into one
          drop cc:stable tag
      v2: treat pre-1970 dates as invalid following MacOS X behavior,
          reword and expand changelog text
      4ddfc3dc
    • Arnd Bergmann's avatar
      hostfs: pass 64-bit timestamps to/from user space · bca30265
      Arnd Bergmann authored
      The use of 'struct timespec' is deprecated in the kernel, so we
      want to avoid the conversions from/to the proper timespec64
      structure.
      
      On the user space side, we have a 'struct timespec' that is defined
      by the C library and that will be incompatible with the kernel's
      view on 32-bit architectures once they move to a 64-bit time_t,
      breaking the shared binary layout of hostfs_iattr and hostfs_stat.
      
      This changes the two structures to use a new hostfs_timespec structure
      with fixed 64-bit seconds/nanoseconds for passing the timestamps
      between hostfs_kern.c and hostfs_user.c. With a new enough user
      space side, this will allow timestamps beyond year 2038.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      bca30265
    • Arnd Bergmann's avatar
      packet: clarify timestamp overflow · d413fcb4
      Arnd Bergmann authored
      The memory mapped packet socket data structure in version 1 through 3
      all contain 32-bit second values for the packet time stamps, which makes
      them suffer from the overflow of time_t in y2038 or y2106 (depending
      on whether user space interprets the value as signed or unsigned).
      
      The implementation uses the deprecated getnstimeofday() function.
      
      In order to get rid of that, this changes the code to use
      ktime_get_real_ts64() as a replacement, documenting the nature of the
      overflow. As long as the user applications treat the timestamps as
      unsigned, or only use the difference between timestamps, they are
      fine, and changing the timestamps to 64-bit wouldn't require a more
      invasive user space API change.
      
      Note: a lot of other APIs suffer from incompatible structures when
      time_t gets redefined to 64-bit in 32-bit user space, but this one
      does not.
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/lkml/CAF=yD-Jomr-gWSR-EBNKnSpFL46UeG564FLfqTCMNEm-prEaXA@mail.gmail.com/T/#uSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      d413fcb4
    • Arnd Bergmann's avatar
      tsacct: add 64-bit btime field · 352c912b
      Arnd Bergmann authored
      As there is only a 32-bit ac_btime field in taskstat and
      we should handle dates after the overflow, add a new field
      with the same information but 64-bit width that can hold
      a full time64_t.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      352c912b
    • Arnd Bergmann's avatar
      acct: stop using get_seconds() · 2d602bf2
      Arnd Bergmann authored
      In 'struct acct', 'struct acct_v3', and 'struct taskstats' we have
      a 32-bit 'ac_btime' field containing an absolute time value, which
      will overflow in year 2106.
      
      There are two possible ways to deal with it:
      
      a) let it overflow and have user space code deal with reconstructing
         the data based on the current time, or
      b) truncate the times based on the range of the u32 type.
      
      Neither of them solves the actual problem. Pick the second
      one to best document what the issue is, and have someone
      fix it in a future version.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      2d602bf2
    • Arnd Bergmann's avatar
      um: ubd: use 64-bit time_t where possible · 853bc0ab
      Arnd Bergmann authored
      The ubd code suffers from a possible y2038 overflow on 32-bit
      architectures, both for the cow header and the os_file_modtime()
      function.
      
      Replace time_t with time64_t to extend the ubd_kern side as much
      as possible.
      
      Whether this makes a difference for the user side depends on
      the host libc implementation that may use either 32-bit or 64-bit
      time_t.
      
      For the cow file format, the header contains an unsigned 32-bit
      timestamp, which is good until y2106, passing this through a
      'long long' gives us a consistent interpretation between 32-bit
      and 64-bit um kernels.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      853bc0ab
    • Arnd Bergmann's avatar
      xtensa: ISS: avoid struct timeval · 37e86e0f
      Arnd Bergmann authored
      'struct timeval' will get removed from the kernel, change the one
      user in arch/xtensa to avoid referencing it, by using a fixed-length
      array instead.
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      37e86e0f
    • Arnd Bergmann's avatar
      dlm: use SO_SNDTIMEO_NEW instead of SO_SNDTIMEO_OLD · 5311f707
      Arnd Bergmann authored
      Eliminate one more use of 'struct timeval' from the kernel so
      we can eventually remove the definition as well.
      
      The kernel supports the new format with a 64-bit time_t version
      of timeval here, so use that instead of the old timeval.
      Acked-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      5311f707
    • Arnd Bergmann's avatar
      fat: use prandom_u32() for i_generation · 74b5cab6
      Arnd Bergmann authored
      Similar to commit 46c9a946 ("shmem: use monotonic time for i_generation")
      we should not use the deprecated get_seconds() interface for i_generation.
      
      prandom_u32() is the replacement used in other file systems.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      74b5cab6
  2. 08 Dec, 2019 12 commits
    • Linus Torvalds's avatar
      Linux 5.5-rc1 · e42617b8
      Linus Torvalds authored
      e42617b8
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 95e6ba51
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) More jumbo frame fixes in r8169, from Heiner Kallweit.
      
       2) Fix bpf build in minimal configuration, from Alexei Starovoitov.
      
       3) Use after free in slcan driver, from Jouni Hogander.
      
       4) Flower classifier port ranges don't work properly in the HW offload
          case, from Yoshiki Komachi.
      
       5) Use after free in hns3_nic_maybe_stop_tx(), from Yunsheng Lin.
      
       6) Out of bounds access in mqprio_dump(), from Vladyslav Tarasiuk.
      
       7) Fix flow dissection in dsa TX path, from Alexander Lobakin.
      
       8) Stale syncookie timestampe fixes from Guillaume Nault.
      
      [ Did an evil merge to silence a warning introduced by this pull - Linus ]
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits)
        r8169: fix rtl_hw_jumbo_disable for RTL8168evl
        net_sched: validate TCA_KIND attribute in tc_chain_tmplt_add()
        r8169: add missing RX enabling for WoL on RTL8125
        vhost/vsock: accept only packets with the right dst_cid
        net: phy: dp83867: fix hfs boot in rgmii mode
        net: ethernet: ti: cpsw: fix extra rx interrupt
        inet: protect against too small mtu values.
        gre: refetch erspan header from skb->data after pskb_may_pull()
        pppoe: remove redundant BUG_ON() check in pppoe_pernet
        tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()
        tcp: tighten acceptance of ACKs not matching a child socket
        tcp: fix rejected syncookies due to stale timestamps
        lpc_eth: kernel BUG on remove
        tcp: md5: fix potential overestimation of TCP option space
        net: sched: allow indirect blocks to bind to clsact in TC
        net: core: rename indirect block ingress cb function
        net-sysfs: Call dev_hold always in netdev_queue_add_kobject
        net: dsa: fix flow dissection on Tx path
        net/tls: Fix return values to avoid ENOTSUPP
        net: avoid an indirect call in ____sys_recvmsg()
        ...
      95e6ba51
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 138f371d
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "Eleven patches, all in drivers (no core changes) that are either minor
        cleanups or small fixes.
      
        They were late arriving, but still safe for -rc1"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: MAINTAINERS: Add the linux-scsi mailing list to the ISCSI entry
        scsi: megaraid_sas: Make poll_aen_lock static
        scsi: sd_zbc: Improve report zones error printout
        scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI
        scsi: qla2xxx: unregister ports after GPN_FT failure
        scsi: qla2xxx: fix rports not being mark as lost in sync fabric scan
        scsi: pm80xx: Remove unused include of linux/version.h
        scsi: pm80xx: fix logic to break out of loop when register value is 2 or 3
        scsi: scsi_transport_sas: Fix memory leak when removing devices
        scsi: lpfc: size cpu map by last cpu id set
        scsi: ibmvscsi_tgt: Remove unneeded variable rc
      138f371d
    • Linus Torvalds's avatar
      Merge tag '5.5-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · a78f7cdd
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Nine cifs/smb3 fixes:
      
         - one fix for stable (oops during oplock break)
      
         - two timestamp fixes including important one for updating mtime at
           close to avoid stale metadata caching issue on dirty files (also
           improves perf by using SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB over the
           wire)
      
         - two fixes for "modefromsid" mount option for file create (now
           allows mode bits to be set more atomically and accurately on create
           by adding "sd_context" on create when modefromsid specified on
           mount)
      
         - two fixes for multichannel found in testing this week against
           different servers
      
         - two small cleanup patches"
      
      * tag '5.5-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: improve check for when we send the security descriptor context on create
        smb3: fix mode passed in on create for modetosid mount option
        cifs: fix possible uninitialized access and race on iface_list
        cifs: Fix lookup of SMB connections on multichannel
        smb3: query attributes on file close
        smb3: remove unused flag passed into close functions
        cifs: remove redundant assignment to pointer pneg_ctxt
        fs: cifs: Fix atime update check vs mtime
        CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
      a78f7cdd
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 5bf9a06a
      Linus Torvalds authored
      Pull misc vfs cleanups from Al Viro:
       "No common topic, just three cleanups".
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        make __d_alloc() static
        fs/namespace: add __user to open_tree and move_mount syscalls
        fs/fnctl: fix missing __user in fcntl_rw_hint()
      5bf9a06a
    • Linus Torvalds's avatar
      Merge tag 'ntb-5.5' of git://github.com/jonmason/ntb · 9455d25f
      Linus Torvalds authored
      Pull NTB update from Jon Mason:
       "Just a simple patch to add a new Hygon Device ID to the AMD NTB device
        driver"
      
      * tag 'ntb-5.5' of git://github.com/jonmason/ntb:
        NTB: Add Hygon Device ID
      9455d25f
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 73721451
      Linus Torvalds authored
      Pull more input updates from Dmitry Torokhov:
      
       - fixups for Synaptics RMI4 driver
      
       - a quirk for Goodinx touchscreen on Teclast tablet
      
       - a new keycode definition for activating privacy screen feature found
         on a few "enterprise" laptops
      
       - updates to snvs_pwrkey driver
      
       - polling uinput device for writing (which is always allowed) now works
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers
        Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash
        Input: goodix - add upside-down quirk for Teclast X89 tablet
        Input: add privacy screen toggle keycode
        Input: uinput - fix returning EPOLLOUT from uinput_poll
        Input: snvs_pwrkey - remove gratuitous NULL initializers
        Input: snvs_pwrkey - send key events for i.MX6 S, DL and Q
      73721451
    • Linus Torvalds's avatar
      Merge tag 'iomap-5.5-merge-14' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 95207d55
      Linus Torvalds authored
      Pull iomap fixes from Darrick Wong:
       "Fix a race condition and a use-after-free error:
      
         - Fix a UAF when reporting writeback errors
      
         - Fix a race condition when handling page uptodate on fragmented file
           with blocksize < pagesize"
      
      * tag 'iomap-5.5-merge-14' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        iomap: stop using ioend after it's been freed in iomap_finish_ioend()
        iomap: fix sub-page uptodate handling
      95207d55
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.5-merge-17' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 50caca9d
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "Fix a couple of resource management errors and a hang:
      
         - fix a crash in the log setup code when log mounting fails
      
         - fix a hang when allocating space on the realtime device
      
         - fix a block leak when freeing space on the realtime device"
      
      * tag 'xfs-5.5-merge-17' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix mount failure crash on invalid iclog memory access
        xfs: don't check for AG deadlock for realtime files in bunmapi
        xfs: fix realtime file data space leak
      50caca9d
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.5-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 316933cf
      Linus Torvalds authored
      Pull orangefs update from Mike Marshall:
       "orangefs: posix open permission checking...
      
        Orangefs has no open, and orangefs checks file permissions on each
        file access. Posix requires that file permissions be checked on open
        and nowhere else. Orangefs-through-the-kernel needs to seem posix
        compliant.
      
        The VFS opens files, even if the filesystem provides no method. We can
        see if a file was successfully opened for read and or for write by
        looking at file->f_mode.
      
        When writes are flowing from the page cache, file is no longer
        available. We can trust the VFS to have checked file->f_mode before
        writing to the page cache.
      
        The mode of a file might change between when it is opened and IO
        commences, or it might be created with an arbitrary mode.
      
        We'll make sure we don't hit EACCES during the IO stage by using
        UID 0"
      
      [ This is "posixish", but not a great solution in the long run, since a
        proper secure network server shouldn't really trust the client like this.
        But proper and secure POSIX behavior requires an open method and a
        resulting cookie for IO of some kind, or similar.    - Linus ]
      
      * tag 'for-linus-5.5-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        orangefs: posix open permission checking...
      316933cf
    • Linus Torvalds's avatar
      Merge tag 'nfsd-5.5' of git://linux-nfs.org/~bfields/linux · 911d137a
      Linus Torvalds authored
      Pull nfsd updates from Bruce Fields:
       "This is a relatively quiet cycle for nfsd, mainly various bugfixes.
      
        Possibly most interesting is Trond's fixes for some callback races
        that were due to my incomplete understanding of rpc client shutdown.
        Unfortunately at the last minute I've started noticing a new
        intermittent failure to send callbacks. As the logic seems basically
        correct, I'm leaving Trond's patches in for now, and hope to find a
        fix in the next week so I don't have to revert those patches"
      
      * tag 'nfsd-5.5' of git://linux-nfs.org/~bfields/linux: (24 commits)
        nfsd: depend on CRYPTO_MD5 for legacy client tracking
        NFSD fixing possible null pointer derefering in copy offload
        nfsd: check for EBUSY from vfs_rmdir/vfs_unink.
        nfsd: Ensure CLONE persists data and metadata changes to the target file
        SUNRPC: Fix backchannel latency metrics
        nfsd: restore NFSv3 ACL support
        nfsd: v4 support requires CRYPTO_SHA256
        nfsd: Fix cld_net->cn_tfm initialization
        lockd: remove __KERNEL__ ifdefs
        sunrpc: remove __KERNEL__ ifdefs
        race in exportfs_decode_fh()
        nfsd: Drop LIST_HEAD where the variable it declares is never used.
        nfsd: document callback_wq serialization of callback code
        nfsd: mark cb path down on unknown errors
        nfsd: Fix races between nfsd4_cb_release() and nfsd4_shutdown_callback()
        nfsd: minor 4.1 callback cleanup
        SUNRPC: Fix svcauth_gss_proxy_init()
        SUNRPC: Trace gssproxy upcall results
        sunrpc: fix crash when cache_head become valid before update
        nfsd: remove private bin2hex implementation
        ...
      911d137a
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.5-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · fb9bf40c
      Linus Torvalds authored
      Pull NFS client updates from Trond Myklebust:
       "Highlights include:
      
        Features:
      
         - NFSv4.2 now supports cross device offloaded copy (i.e. offloaded
           copy of a file from one source server to a different target
           server).
      
         - New RDMA tracepoints for debugging congestion control and Local
           Invalidate WRs.
      
        Bugfixes and cleanups
      
         - Drop the NFSv4.1 session slot if nfs4_delegreturn_prepare waits for
           layoutreturn
      
         - Handle bad/dead sessions correctly in nfs41_sequence_process()
      
         - Various bugfixes to the delegation return operation.
      
         - Various bugfixes pertaining to delegations that have been revoked.
      
         - Cleanups to the NFS timespec code to avoid unnecessary conversions
           between timespec and timespec64.
      
         - Fix unstable RDMA connections after a reconnect
      
         - Close race between waking an RDMA sender and posting a receive
      
         - Wake pending RDMA tasks if connection fails
      
         - Fix MR list corruption, and clean up MR usage
      
         - Fix another RPCSEC_GSS issue with MIC buffer space"
      
      * tag 'nfs-for-5.5-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (79 commits)
        SUNRPC: Capture completion of all RPC tasks
        SUNRPC: Fix another issue with MIC buffer space
        NFS4: Trace lock reclaims
        NFS4: Trace state recovery operation
        NFSv4.2 fix memory leak in nfs42_ssc_open
        NFSv4.2 fix kfree in __nfs42_copy_file_range
        NFS: remove duplicated include from nfs4file.c
        NFSv4: Make _nfs42_proc_copy_notify() static
        NFS: Fallocate should use the nfs4_fattr_bitmap
        NFS: Return -ETXTBSY when attempting to write to a swapfile
        fs: nfs: sysfs: Remove NULL check before kfree
        NFS: remove unneeded semicolon
        NFSv4: add declaration of current_stateid
        NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn
        NFSv4.x: Handle bad/dead sessions correctly in nfs41_sequence_process()
        nfsv4: Move NFSPROC4_CLNT_COPY_NOTIFY to end of list
        SUNRPC: Avoid RPC delays when exiting suspend
        NFS: Add a tracepoint in nfs_fh_to_dentry()
        NFSv4: Don't retry the GETATTR on old stateid in nfs4_delegreturn_done()
        NFSv4: Handle NFS4ERR_OLD_STATEID in delegreturn
        ...
      fb9bf40c
  3. 07 Dec, 2019 8 commits
    • Steve French's avatar
      smb3: improve check for when we send the security descriptor context on create · 231e2a0b
      Steve French authored
      We had cases in the previous patch where we were sending the security
      descriptor context on SMB3 open (file create) in cases when we hadn't
      mounted with with "modefromsid" mount option.
      
      Add check for that mount flag before calling ad_sd_context in
      open init.
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      231e2a0b
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.5-rc1' of git://github.com/awilliam/linux-vfio · 94e89b40
      Linus Torvalds authored
      Pull VFIO updates from Alex Williamson:
      
       - Remove hugepage checks for reserved pfns (Ben Luo)
      
       - Fix irq-bypass unregister ordering (Jiang Yi)
      
      * tag 'vfio-v5.5-rc1' of git://github.com/awilliam/linux-vfio:
        vfio/pci: call irq_bypass_unregister_producer() before freeing irq
        vfio/type1: remove hugepage checks in is_invalid_reserved_pfn()
      94e89b40
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.5b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · f74fd13f
      Linus Torvalds authored
      Pull more xen updates from Juergen Gross:
      
       - a patch to fix a build warning
      
       - a cleanup of no longer needed code in the Xen event handling
      
       - a small series for the Xen grant driver avoiding high order
         allocations and replacing an insane global limit by a per-call one
      
       - a small series fixing Xen frontend/backend module referencing
      
      * tag 'for-linus-5.5b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen-blkback: allow module to be cleanly unloaded
        xen/xenbus: reference count registered modules
        xen/gntdev: switch from kcalloc() to kvcalloc()
        xen/gntdev: replace global limit of mapped pages by limit per call
        xen/gntdev: remove redundant non-zero check on ret
        xen/events: remove event handling recursion detection
      f74fd13f
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 6dc517a3
      Linus Torvalds authored
      Merge misc Kconfig updates from Andrew Morton:
       "A number of changes to Kconfig files under lib/ from Changbin Du and
        Krzysztof Kozlowski"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        lib/: fix Kconfig indentation
        kernel-hacking: move DEBUG_FS to 'Generic Kernel Debugging Instruments'
        kernel-hacking: move DEBUG_BUGVERBOSE to 'printk and dmesg options'
        kernel-hacking: create a submenu for scheduler debugging options
        kernel-hacking: move SCHED_STACK_END_CHECK after DEBUG_STACK_USAGE
        kernel-hacking: move Oops into 'Lockups and Hangs'
        kernel-hacking: move kernel testing and coverage options to same submenu
        kernel-hacking: group kernel data structures debugging together
        kernel-hacking: create submenu for arch special debugging options
        kernel-hacking: group sysrq/kgdb/ubsan into 'Generic Kernel Debugging Instruments'
      6dc517a3
    • Heiner Kallweit's avatar
      r8169: fix rtl_hw_jumbo_disable for RTL8168evl · 0fc75219
      Heiner Kallweit authored
      In referenced fix we removed the RTL8168e-specific jumbo config for
      RTL8168evl in rtl_hw_jumbo_enable(). We have to do the same in
      rtl_hw_jumbo_disable().
      
      v2: fix referenced commit id
      
      Fixes: 14012c9f ("r8169: fix jumbo configuration for RTL8168evl")
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fc75219
    • Linus Torvalds's avatar
      pipe: don't use 'pipe_wait() for basic pipe IO · 85190d15
      Linus Torvalds authored
      pipe_wait() may be simple, but since it relies on the pipe lock, it
      means that we have to do the wakeup while holding the lock.  That's
      unfortunate, because the very first thing the waked entity will want to
      do is to get the pipe lock for itself.
      
      So get rid of the pipe_wait() usage by simply releasing the pipe lock,
      doing the wakeup (if required) and then using wait_event_interruptible()
      to wait on the right condition instead.
      
      wait_event_interruptible() handles races on its own by comparing the
      wakeup condition before and after adding itself to the wait queue, so
      you can use an optimistic unlocked condition for it.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      85190d15
    • Jiasen Lin's avatar
      NTB: Add Hygon Device ID · 9b5b99a8
      Jiasen Lin authored
      Signed-off-by: default avatarJiasen Lin <linjiasen@hygon.cn>
      Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
      9b5b99a8
    • Linus Torvalds's avatar
      pipe: remove 'waiting_writers' merging logic · a28c8b9d
      Linus Torvalds authored
      This code is ancient, and goes back to when we only had a single page
      for the pipe buffers.  The exact history is hidden in the mists of time
      (ie "before git", and in fact predates the BK repository too).
      
      At that long-ago point in time, it actually helped to try to merge big
      back-and-forth pipe reads and writes, and not limit pipe reads to the
      single pipe buffer in length just because that was all we had at a time.
      
      However, since then we've expanded the pipe buffers to multiple pages,
      and this logic really doesn't seem to make sense.  And a lot of it is
      somewhat questionable (ie "hmm, the user asked for a non-blocking read,
      but we see that there's a writer pending, so let's wait anyway to get
      the extra data that the writer will have").
      
      But more importantly, it makes the "go to sleep" logic much less
      obvious, and considering the wakeup issues we've had, I want to make for
      less of those kinds of things.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a28c8b9d