1. 21 2月, 2022 18 次提交
    • J
      random: make credit_entropy_bits() always safe · a49c010e
      Jason A. Donenfeld 提交于
      This is called from various hwgenerator drivers, so rather than having
      one "safe" version for userspace and one "unsafe" version for the
      kernel, just make everything safe; the checks are cheap and sensible to
      have anyway.
      Reported-by: NSultan Alsawaf <sultan@kerneltoast.com>
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      a49c010e
    • J
      random: always wake up entropy writers after extraction · 489c7fc4
      Jason A. Donenfeld 提交于
      Now that POOL_BITS == POOL_MIN_BITS, we must unconditionally wake up
      entropy writers after every extraction. Therefore there's no point of
      write_wakeup_threshold, so we can move it to the dustbin of unused
      compatibility sysctls. While we're at it, we can fix a small comparison
      where we were waking up after <= min rather than < min.
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Suggested-by: NEric Biggers <ebiggers@kernel.org>
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      489c7fc4
    • J
      random: use linear min-entropy accumulation crediting · c5704490
      Jason A. Donenfeld 提交于
      30e37ec5 ("random: account for entropy loss due to overwrites")
      assumed that adding new entropy to the LFSR pool probabilistically
      cancelled out old entropy there, so entropy was credited asymptotically,
      approximating Shannon entropy of independent sources (rather than a
      stronger min-entropy notion) using 1/8th fractional bits and replacing
      a constant 2-2/√𝑒 term (~0.786938) with 3/4 (0.75) to slightly
      underestimate it. This wasn't superb, but it was perhaps better than
      nothing, so that's what was done. Which entropy specifically was being
      cancelled out and how much precisely each time is hard to tell, though
      as I showed with the attack code in my previous commit, a motivated
      adversary with sufficient information can actually cancel out
      everything.
      
      Since we're no longer using an LFSR for entropy accumulation, this
      probabilistic cancellation is no longer relevant. Rather, we're now
      using a computational hash function as the accumulator and we've
      switched to working in the random oracle model, from which we can now
      revisit the question of min-entropy accumulation, which is done in
      detail in <https://eprint.iacr.org/2019/198>.
      
      Consider a long input bit string that is built by concatenating various
      smaller independent input bit strings. Each one of these inputs has a
      designated min-entropy, which is what we're passing to
      credit_entropy_bits(h). When we pass the concatenation of these to a
      random oracle, it means that an adversary trying to receive back the
      same reply as us would need to become certain about each part of the
      concatenated bit string we passed in, which means becoming certain about
      all of those h values. That means we can estimate the accumulation by
      simply adding up the h values in calls to credit_entropy_bits(h);
      there's no probabilistic cancellation at play like there was said to be
      for the LFSR. Incidentally, this is also what other entropy accumulators
      based on computational hash functions do as well.
      
      So this commit replaces credit_entropy_bits(h) with essentially `total =
      min(POOL_BITS, total + h)`, done with a cmpxchg loop as before.
      
      What if we're wrong and the above is nonsense? It's not, but let's
      assume we don't want the actual _behavior_ of the code to change much.
      Currently that behavior is not extracting from the input pool until it
      has 128 bits of entropy in it. With the old algorithm, we'd hit that
      magic 128 number after roughly 256 calls to credit_entropy_bits(1). So,
      we can retain more or less the old behavior by waiting to extract from
      the input pool until it hits 256 bits of entropy using the new code. For
      people concerned about this change, it means that there's not that much
      practical behavioral change. And for folks actually trying to model
      the behavior rigorously, it means that we have an even higher margin
      against attacks.
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NJean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      c5704490
    • J
      random: simplify entropy debiting · 9c07f578
      Jason A. Donenfeld 提交于
      Our pool is 256 bits, and we only ever use all of it or don't use it at
      all, which is decided by whether or not it has at least 128 bits in it.
      So we can drastically simplify the accounting and cmpxchg loop to do
      exactly this.  While we're at it, we move the minimum bit size into a
      constant so it can be shared between the two places where it matters.
      
      The reason we want any of this is for the case in which an attacker has
      compromised the current state, and then bruteforces small amounts of
      entropy added to it. By demanding a particular minimum amount of entropy
      be present before reseeding, we make that bruteforcing difficult.
      
      Note that this rationale no longer includes anything about /dev/random
      blocking at the right moment, since /dev/random no longer blocks (except
      for at ~boot), but rather uses the crng. In a former life, /dev/random
      was different and therefore required a more nuanced account(), but this
      is no longer.
      
      Behaviorally, nothing changes here. This is just a simplification of
      the code.
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      9c07f578
    • J
      random: use computational hash for entropy extraction · 6e8ec255
      Jason A. Donenfeld 提交于
      The current 4096-bit LFSR used for entropy collection had a few
      desirable attributes for the context in which it was created. For
      example, the state was huge, which meant that /dev/random would be able
      to output quite a bit of accumulated entropy before blocking. It was
      also, in its time, quite fast at accumulating entropy byte-by-byte,
      which matters given the varying contexts in which mix_pool_bytes() is
      called. And its diffusion was relatively high, which meant that changes
      would ripple across several words of state rather quickly.
      
      However, it also suffers from a few security vulnerabilities. In
      particular, inputs learned by an attacker can be undone, but moreover,
      if the state of the pool leaks, its contents can be controlled and
      entirely zeroed out. I've demonstrated this attack with this SMT2
      script, <https://xn--4db.cc/5o9xO8pb>, which Boolector/CaDiCal solves in
      a matter of seconds on a single core of my laptop, resulting in little
      proof of concept C demonstrators such as <https://xn--4db.cc/jCkvvIaH/c>.
      
      For basically all recent formal models of RNGs, these attacks represent
      a significant cryptographic flaw. But how does this manifest
      practically? If an attacker has access to the system to such a degree
      that he can learn the internal state of the RNG, arguably there are
      other lower hanging vulnerabilities -- side-channel, infoleak, or
      otherwise -- that might have higher priority. On the other hand, seed
      files are frequently used on systems that have a hard time generating
      much entropy on their own, and these seed files, being files, often leak
      or are duplicated and distributed accidentally, or are even seeded over
      the Internet intentionally, where their contents might be recorded or
      tampered with. Seen this way, an otherwise quasi-implausible
      vulnerability is a bit more practical than initially thought.
      
      Another aspect of the current mix_pool_bytes() function is that, while
      its performance was arguably competitive for the time in which it was
      created, it's no longer considered so. This patch improves performance
      significantly: on a high-end CPU, an i7-11850H, it improves performance
      of mix_pool_bytes() by 225%, and on a low-end CPU, a Cortex-A7, it
      improves performance by 103%.
      
      This commit replaces the LFSR of mix_pool_bytes() with a straight-
      forward cryptographic hash function, BLAKE2s, which is already in use
      for pool extraction. Universal hashing with a secret seed was considered
      too, something along the lines of <https://eprint.iacr.org/2013/338>,
      but the requirement for a secret seed makes for a chicken & egg problem.
      Instead we go with a formally proven scheme using a computational hash
      function, described in sections 5.1, 6.4, and B.1.8 of
      <https://eprint.iacr.org/2019/198>.
      
      BLAKE2s outputs 256 bits, which should give us an appropriate amount of
      min-entropy accumulation, and a wide enough margin of collision
      resistance against active attacks. mix_pool_bytes() becomes a simple
      call to blake2s_update(), for accumulation, while the extraction step
      becomes a blake2s_final() to generate a seed, with which we can then do
      a HKDF-like or BLAKE2X-like expansion, the first part of which we fold
      back as an init key for subsequent blake2s_update()s, and the rest we
      produce to the caller. This then is provided to our CRNG like usual. In
      that expansion step, we make opportunistic use of 32 bytes of RDRAND
      output, just as before. We also always reseed the crng with 32 bytes,
      unconditionally, or not at all, rather than sometimes with 16 as before,
      as we don't win anything by limiting beyond the 16 byte threshold.
      
      Going for a hash function as an entropy collector is a conservative,
      proven approach. The result of all this is a much simpler and much less
      bespoke construction than what's there now, which not only plugs a
      vulnerability but also improves performance considerably.
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: NJean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      6e8ec255
    • L
      Linux 5.17-rc5 · cfb92440
      Linus Torvalds 提交于
      cfb92440
    • L
      Merge tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3324e6e8
      Linus Torvalds 提交于
      Pull locking fix from Borislav Petkov:
       "Fix a NULL ptr dereference when dumping lockdep chains through
        /proc/lockdep_chains"
      
      * tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        lockdep: Correct lock_classes index mapping
      3324e6e8
    • L
      Merge tag 'x86_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 22217739
      Linus Torvalds 提交于
      Pull x86 fixes from Borislav Petkov:
      
       - Fix the ptrace regset xfpregs_set() callback to behave according to
         the ABI
      
       - Handle poisoned pages properly in the SGX reclaimer code
      
      * tag 'x86_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing
        x86/sgx: Fix missing poison handling in reclaimer
      22217739
    • L
      Merge tag 'sched_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0b0894ff
      Linus Torvalds 提交于
      Pull scheduler fix from Borislav Petkov:
       "Fix task exposure order when forking tasks"
      
      * tag 'sched_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched: Fix yet more sched_fork() races
      0b0894ff
    • L
      Merge tag 'edac_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · 6e8e752f
      Linus Torvalds 提交于
      Pull EDAC fix from Borislav Petkov:
       "Fix a long-standing struct alignment bug in the EDAC struct allocation
        code"
      
      * tag 'edac_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        EDAC: Fix calculation of returned address and next offset in edac_align_ptr()
      6e8e752f
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · e268d708
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "Three fixes, all in drivers.
      
        The ufs and qedi fixes are minor; the lpfc one is a bit bigger because
        it involves adding a heuristic to detect and deal with common but not
        standards compliant behaviour"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ufs: core: Fix divide by zero in ufshcd_map_queues()
        scsi: lpfc: Fix pt2pt NVMe PRLI reject LOGO loop
        scsi: qedi: Fix ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp()
      e268d708
    • L
      Merge tag 'dmaengine-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 77478077
      Linus Torvalds 提交于
      Pull dmaengine fixes from Vinod Koul:
       "A bunch of driver fixes for:
      
         - ptdma error handling in init
      
         - lock fix in at_hdmac
      
         - error path and error num fix for sh dma
      
         - pm balance fix for stm32"
      
      * tag 'dmaengine-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: shdma: Fix runtime PM imbalance on error
        dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size
        dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe
        dmaengine: sh: rcar-dmac: Check for error num after setting mask
        dmaengine: at_xdmac: Fix missing unlock in at_xdmac_tasklet()
        dmaengine: ptdma: Fix the error handling path in pt_core_init()
      77478077
    • L
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · dacec3e7
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
       "Some driver updates, a MAINTAINERS fix, and additions to COMPILE_TEST
        (so we won't miss build problems again)"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        MAINTAINERS: remove duplicate entry for i2c-qcom-geni
        i2c: brcmstb: fix support for DSL and CM variants
        i2c: qup: allow COMPILE_TEST
        i2c: imx: allow COMPILE_TEST
        i2c: cadence: allow COMPILE_TEST
        i2c: qcom-cci: don't put a device tree node before i2c_add_adapter()
        i2c: qcom-cci: don't delete an unregistered adapter
        i2c: bcm2835: Avoid clock stretching timeouts
      dacec3e7
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 961af9db
      Linus Torvalds 提交于
      Pull input fixes from Dmitry Torokhov:
      
       - a fix for Synaptics touchpads in RMI4 mode failing to suspend/resume
         properly because I2C client devices are now being suspended and
         resumed asynchronously which changed the ordering
      
       - a change to make sure we do not set right and middle buttons
         capabilities on touchpads that are "buttonpads" (i.e. do not have
         separate physical buttons)
      
       - a change to zinitix touchscreen driver adding more compatible
         strings/IDs
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: psmouse - set up dependency between PS/2 and SMBus companions
        Input: zinitix - add new compatible strings
        Input: clear BTN_RIGHT/MIDDLE on buttonpads
      961af9db
    • L
      Merge tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · 70d2bec7
      Linus Torvalds 提交于
      Pull power supply fixes from Sebastian Reichel:
       "Three regression fixes for the 5.17 cycle:
      
         - build warning fix for power-supply documentation
      
         - pointer size fix in cw2015 battery driver
      
         - OOM handling in bq256xx charger driver"
      
      * tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
        power: supply: bq256xx: Handle OOM correctly
        power: supply: core: fix application of sizeof to pointer
        power: supply: fix table problem in sysfs-class-power
      70d2bec7
    • L
      Merge tag 'fs.mount_setattr.v5.17-rc4' of... · 7f25f041
      Linus Torvalds 提交于
      Merge tag 'fs.mount_setattr.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux
      
      Pull mount_setattr test/doc fixes from Christian Brauner:
       "This contains a fix for one of the selftests for the mount_setattr
        syscall to create idmapped mounts, an entry for idmapped mounts for
        maintainers, and missing kernel documentation for the helper we split
        out some time ago to get and yield write access to a mount when
        changing mount properties"
      
      * tag 'fs.mount_setattr.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        fs: add kernel doc for mnt_{hold,unhold}_writers()
        MAINTAINERS: add entry for idmapped mounts
        tests: fix idmapped mount_setattr test
      7f25f041
    • L
      Merge tag 'pidfd.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · c1034d24
      Linus Torvalds 提交于
      Pull pidfd fix from Christian Brauner:
       "This fixes a problem reported by lockdep when installing a pidfd via
        fd_install() with siglock and the tasklisk write lock held in
        copy_process() when calling clone()/clone3() with CLONE_PIDFD.
      
        Originally a pidfd was created prior to holding any of these locks but
        this required a call to ksys_close(). So quite some time ago in
        6fd2fe49 ("copy_process(): don't use ksys_close() on cleanups") we
        switched to a get_unused_fd_flags() + fd_install() model.
      
        As part of that we moved fd_install() as late as possible. This was
        done for two main reasons. First, because we needed to ensure that we
        call fd_install() past the point of no return as once that's called
        the fd is live in the task's file table. Second, because we tried to
        ensure that the fd is visible in /proc/<pid>/fd/<pidfd> right when the
        task is visible.
      
        This fix moves the fd_install() to an even later point which means
        that a task will be visible in proc while the pidfd isn't yet under
        /proc/<pid>/fd/<pidfd>.
      
        While this is a user visible change it's very unlikely that this will
        have any impact. Nobody should be relying on that and if they do we
        need to come up with something better but again, it's doubtful this is
        relevant"
      
      * tag 'pidfd.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        copy_process(): Move fd_install() out of sighand->siglock critical section
      c1034d24
    • L
      Merge branch 'ucount-rlimit-fixes-for-v5.17' of... · 2d3409eb
      Linus Torvalds 提交于
      Merge branch 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull ucounts fixes from Eric Biederman:
       "Michal Koutný recently found some bugs in the enforcement of
        RLIMIT_NPROC in the recent ucount rlimit implementation.
      
        In this set of patches I have developed a very conservative approach
        changing only what is necessary to fix the bugs that I can see
        clearly. Cleanups and anything that is making the code more consistent
        can follow after we have the code working as it has historically.
      
        The problem is not so much inconsistencies (although those exist) but
        that it is very difficult to figure out what the code should be doing
        in the case of RLIMIT_NPROC.
      
        All other rlimits are only enforced where the resource is acquired
        (allocated). RLIMIT_NPROC by necessity needs to be enforced in an
        additional location, and our current implementation stumbled it's way
        into that implementation"
      
      * 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ucounts: Handle wrapping in is_ucounts_overlimit
        ucounts: Move RLIMIT_NPROC handling after set_user
        ucounts: Base set_cred_ucounts changes on the real user
        ucounts: Enforce RLIMIT_NPROC not RLIMIT_NPROC+1
        rlimit: Fix RLIMIT_NPROC enforcement failure caused by capability calls in set_user
      2d3409eb
  2. 19 2月, 2022 13 次提交
  3. 18 2月, 2022 9 次提交
    • A
      x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing · 44cad52c
      Andy Lutomirski 提交于
      xfpregs_set() handles 32-bit REGSET_XFP and 64-bit REGSET_FP. The actual
      code treats these regsets as modern FX state (i.e. the beginning part of
      XSTATE). The declarations of the regsets thought they were the legacy
      i387 format. The code thought they were the 32-bit (no xmm8..15) variant
      of XSTATE and, for good measure, made the high bits disappear by zeroing
      the wrong part of the buffer. The latter broke ptrace, and everything
      else confused anyone trying to understand the code. In particular, the
      nonsense definitions of the regsets confused me when I wrote this code.
      
      Clean this all up. Change the declarations to match reality (which
      shouldn't change the generated code, let alone the ABI) and fix
      xfpregs_set() to clear the correct bits and to only do so for 32-bit
      callers.
      
      Fixes: 6164331d ("x86/fpu: Rewrite xfpregs_set()")
      Reported-by: NLuís Ferreira <contact@lsferreira.net>
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: <stable@vger.kernel.org>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215524
      Link: https://lore.kernel.org/r/YgpFnZpF01WwR8wU@zn.tnic
      44cad52c
    • R
      i2c: brcmstb: fix support for DSL and CM variants · 834cea3a
      Rafał Miłecki 提交于
      DSL and CM (Cable Modem) support 8 B max transfer size and have a custom
      DT binding for that reason. This driver was checking for a wrong
      "compatible" however which resulted in an incorrect setup.
      
      Fixes: e2e5a2c6 ("i2c: brcmstb: Adding support for CM and DSL SoCs")
      Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@kernel.org>
      834cea3a
    • L
      Merge tag 'linux-kselftest-fixes-5.17-rc5' of... · 9195e5e0
      Linus Torvalds 提交于
      Merge tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fixes from Shuah Khan:
       "Fixes to ftrace, exec, and seccomp tests build, run-time and install
        bugs. These bugs are in the way of running the tests"
      
      * tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/ftrace: Do not trace do_softirq because of PREEMPT_RT
        selftests/seccomp: Fix seccomp failure by adding missing headers
        selftests/exec: Add non-regular to TEST_GEN_PROGS
      9195e5e0
    • L
      Merge tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm · b3d971ec
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Regular fixes for rc5, nothing really stands out, mostly some amdgpu
        and i915 fixes with mediatek, radeon and some misc fixes.
      
        cma-helper:
         - set VM_DONTEXPAND
      
        atomic:
         - error handling fix
      
        mediatek:
         - fix probe defer loop with external bridge
      
        amdgpu:
         - Stable pstate clock fixes for Dimgrey Cavefish and Beige Goby
         - S0ix SDMA fix
         - Yellow Carp GPU reset fix
      
        radeon:
         - Backlight fix for iMac 12,1
      
        i915:
         - GVT kerneldoc cleanup.
         - GVT Kconfig should depend on X86
         - Prevent out of range access in SWSCI display code
         - Fix mbus join and dbuf slice config lookup
         - Fix inverted priority selection in the TTM backend
         - Fix FBC plane end Y offset check"
      
      * tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm:
        drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
        drm/radeon: Fix backlight control on iMac 12,1
        drm/amd/pm: correct the sequence of sending gpu reset msg
        drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
        drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby
        drm/i915/fbc: Fix the plane end Y offset check
        drm/i915/opregion: check port number bounds for SWSCI display power state
        drm/i915/ttm: tweak priority hint selection
        drm/i915: Fix mbus join config lookup
        drm/i915: Fix dbuf slice config lookup
        drm/cma-helper: Set VM_DONTEXPAND for mmap
        drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge
        drm/i915/gvt: Make DRM_I915_GVT depend on X86
        drm/i915/gvt: clean up kernel-doc in gtt.c
      b3d971ec
    • D
      Merge tag 'drm-intel-fixes-2022-02-17' of... · 5666b610
      Dave Airlie 提交于
      Merge tag 'drm-intel-fixes-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - GVT kerneldoc cleanup. (Randy Dunlap)
      - GVT Kconfig should depend on X86. (Siva Mullati)
      - Prevent out of range access in SWSCI display code. (Jani Nikula)
      - Fix mbus join and dbuf slice config lookup. (Ville Syrjälä)
      - Fix inverted priority selection in the TTM backend. (Matthew Auld)
      - Fix FBC plane end Y offset check. (Ville Syrjälä)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/Yg4lA6k8+xp8u3aB@tursulin-mobl2
      5666b610
    • D
      Merge tag 'drm-misc-fixes-2022-02-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · babb1fc3
      Dave Airlie 提交于
       * drm/cma-helper: Set VM_DONTEXPAND
       * drm/atomic: Fix error handling in drm_atomic_set_mode_for_crtc()
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/Yg4mzQALMX69UmA3@linux-uq9g
      babb1fc3
    • L
      Merge tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 8b97cae3
      Linus Torvalds 提交于
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from wireless and netfilter.
      
        Current release - regressions:
      
         - dsa: lantiq_gswip: fix use after free in gswip_remove()
      
         - smc: avoid overwriting the copies of clcsock callback functions
      
        Current release - new code bugs:
      
         - iwlwifi:
            - fix use-after-free when no FW is present
            - mei: fix the pskb_may_pull check in ipv4
            - mei: retry mapping the shared area
            - mvm: don't feed the hardware RFKILL into iwlmei
      
        Previous releases - regressions:
      
         - ipv6: mcast: use rcu-safe version of ipv6_get_lladdr()
      
         - tipc: fix wrong publisher node address in link publications
      
         - iwlwifi: mvm: don't send SAR GEO command for 3160 devices, avoid FW
           assertion
      
         - bgmac: make idm and nicpm resource optional again
      
         - atl1c: fix tx timeout after link flap
      
        Previous releases - always broken:
      
         - vsock: remove vsock from connected table when connect is
           interrupted by a signal
      
         - ping: change destination interface checks to match raw sockets
      
         - crypto: af_alg - get rid of alg_memory_allocated to avoid confusing
           semantics (and null-deref) after SO_RESERVE_MEM was added
      
         - ipv6: make exclusive flowlabel checks per-netns
      
         - bonding: force carrier update when releasing slave
      
         - sched: limit TC_ACT_REPEAT loops
      
         - bridge: multicast: notify switchdev driver whenever MC processing
           gets disabled because of max entries reached
      
         - wifi: brcmfmac: fix crash in brcm_alt_fw_path when WLAN not found
      
         - iwlwifi: fix locking when "HW not ready"
      
         - phy: mediatek: remove PHY mode check on MT7531
      
         - dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN
      
         - dsa: lan9303:
            - fix polarity of reset during probe
            - fix accelerated VLAN handling"
      
      * tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits)
        bonding: force carrier update when releasing slave
        nfp: flower: netdev offload check for ip6gretap
        ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt
        ipv4: fix data races in fib_alias_hw_flags_set
        net: dsa: lan9303: add VLAN IDs to master device
        net: dsa: lan9303: handle hwaccel VLAN tags
        vsock: remove vsock from connected table when connect is interrupted by a signal
        Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname"
        ping: fix the dif and sdif check in ping_lookup
        net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990
        net: sched: limit TC_ACT_REPEAT loops
        tipc: fix wrong notification node addresses
        net: dsa: lantiq_gswip: fix use after free in gswip_remove()
        ipv6: per-netns exclusive flowlabel checks
        net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled
        CDC-NCM: avoid overflow in sanity checking
        mctp: fix use after free
        net: mscc: ocelot: fix use-after-free in ocelot_vlan_del()
        bonding: fix data-races around agg_select_timer
        dpaa2-eth: Initialize mutex used in one step timestamping path
        ...
      8b97cae3
    • Z
      bonding: force carrier update when releasing slave · a6ab75ce
      Zhang Changzhong 提交于
      In __bond_release_one(), bond_set_carrier() is only called when bond
      device has no slave. Therefore, if we remove the up slave from a master
      with two slaves and keep the down slave, the master will remain up.
      
      Fix this by moving bond_set_carrier() out of if (!bond_has_slaves(bond))
      statement.
      
      Reproducer:
      $ insmod bonding.ko mode=0 miimon=100 max_bonds=2
      $ ifconfig bond0 up
      $ ifenslave bond0 eth0 eth1
      $ ifconfig eth0 down
      $ ifenslave -d bond0 eth1
      $ cat /proc/net/bonding/bond0
      
      Fixes: ff59c456 ("[PATCH] bonding: support carrier state for master")
      Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
      Acked-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Link: https://lore.kernel.org/r/1645021088-38370-1-git-send-email-zhangchangzhong@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      a6ab75ce
    • R
      x86/sgx: Fix missing poison handling in reclaimer · e5733d8c
      Reinette Chatre 提交于
      The SGX reclaimer code lacks page poison handling in its main
      free path. This can lead to avoidable machine checks if a
      poisoned page is freed and reallocated instead of being
      isolated.
      
      A troublesome scenario is:
       1. Machine check (#MC) occurs (asynchronous, !MF_ACTION_REQUIRED)
       2. arch_memory_failure() is eventually called
       3. (SGX) page->poison set to 1
       4. Page is reclaimed
       5. Page added to normal free lists by sgx_reclaim_pages()
          ^ This is the bug (poison pages should be isolated on the
          sgx_poison_page_list instead)
       6. Page is reallocated by some innocent enclave, a second (synchronous)
          in-kernel #MC is induced, probably during EADD instruction.
          ^ This is the fallout from the bug
      
      (6) is unfortunate and can be avoided by replacing the open coded
      enclave page freeing code in the reclaimer with sgx_free_epc_page()
      to obtain support for poison page handling that includes placing the
      poisoned page on the correct list.
      
      Fixes: d6d261bd ("x86/sgx: Add new sgx_epc_page flag bit to mark free pages")
      Fixes: 992801ae ("x86/sgx: Initial poison handling for dirty and free pages")
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NDave Hansen <dave.hansen@linux.intel.com>
      Reviewed-by: NJarkko Sakkinen <jarkko@kernel.org>
      Link: https://lkml.kernel.org/r/dcc95eb2aaefb042527ac50d0a50738c7c160dac.1643830353.git.reinette.chatre@intel.com
      e5733d8c