Skip to content
  1. Mar 17, 2022
  2. Mar 16, 2022
  3. Mar 15, 2022
  4. Mar 14, 2022
    • Brian Masney's avatar
      crypto: qcom-rng - ensure buffer for generate is completely filled · a680b183
      Brian Masney authored
      The generate function in struct rng_alg expects that the destination
      buffer is completely filled if the function returns 0. qcom_rng_read()
      can run into a situation where the buffer is partially filled with
      randomness and the remaining part of the buffer is zeroed since
      qcom_rng_generate() doesn't check the return value. This issue can
      be reproduced by running the following from libkcapi:
      
          kcapi-rng -b 9000000 > OUTFILE
      
      The generated OUTFILE will have three huge sections that contain all
      zeros, and this is caused by the code where the test
      'val & PRNG_STATUS_DATA_AVAIL' fails.
      
      Let's fix this issue by ensuring that qcom_rng_read() always returns
      with a full buffer if the function returns success. Let's also have
      qcom_rng_generate() return the correct value.
      
      Here's some statistics from the ent project
      (https://www.fourmilab.ch/random/
      
      ) that shows information about the
      quality of the generated numbers:
      
          $ ent -c qcom-random-before
          Value Char Occurrences Fraction
            0           606748   0.067416
            1            33104   0.003678
            2            33001   0.003667
          ...
          253   �        32883   0.003654
          254   �        33035   0.003671
          255   �        33239   0.003693
      
          Total:       9000000   1.000000
      
          Entropy = 7.811590 bits per byte.
      
          Optimum compression would reduce the size
          of this 9000000 byte file by 2 percent.
      
          Chi square distribution for 9000000 samples is 9329962.81, and
          randomly would exceed this value less than 0.01 percent of the
          times.
      
          Arithmetic mean value of data bytes is 119.3731 (127.5 = random).
          Monte Carlo value for Pi is 3.197293333 (error 1.77 percent).
          Serial correlation coefficient is 0.159130 (totally uncorrelated =
          0.0).
      
      Without this patch, the results of the chi-square test is 0.01%, and
      the numbers are certainly not random according to ent's project page.
      The results improve with this patch:
      
          $ ent -c qcom-random-after
          Value Char Occurrences Fraction
            0            35432   0.003937
            1            35127   0.003903
            2            35424   0.003936
          ...
          253   �        35201   0.003911
          254   �        34835   0.003871
          255   �        35368   0.003930
      
          Total:       9000000   1.000000
      
          Entropy = 7.999979 bits per byte.
      
          Optimum compression would reduce the size
          of this 9000000 byte file by 0 percent.
      
          Chi square distribution for 9000000 samples is 258.77, and randomly
          would exceed this value 42.24 percent of the times.
      
          Arithmetic mean value of data bytes is 127.5006 (127.5 = random).
          Monte Carlo value for Pi is 3.141277333 (error 0.01 percent).
          Serial correlation coefficient is 0.000468 (totally uncorrelated =
          0.0).
      
      This change was tested on a Nexus 5 phone (msm8974 SoC).
      
      Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
      Fixes: ceec5f5b ("crypto: qcom-rng - Add Qcom prng driver")
      Cc: stable@vger.kernel.org # 4.19+
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      a680b183
    • Linus Torvalds's avatar
      Linux 5.17-rc8 · 09688c01
      Linus Torvalds authored
      09688c01
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.17_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f0e18b03
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Free shmem backing storage for SGX enclave pages when those are
         swapped back into EPC memory
      
       - Prevent do_int3() from being kprobed, to avoid recursion
      
       - Remap setup_data and setup_indirect structures properly when
         accessing their members
      
       - Correct the alternatives patching order for modules too
      
      * tag 'x86_urgent_for_v5.17_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/sgx: Free backing memory after faulting the enclave page
        x86/traps: Mark do_int3() NOKPROBE_SYMBOL
        x86/boot: Add setup_indirect support in early_memremap_is_setup_data()
        x86/boot: Fix memremap of setup_indirect structures
        x86/module: Fix the paravirt vs alternative order
      f0e18b03
  5. Mar 13, 2022
  6. Mar 12, 2022
  7. Mar 11, 2022
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-03-11' of git://anongit.freedesktop.org/drm/drm · 79b00034
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "As expected at this stage its pretty quiet, one sun4i mixer fix and
        one i915 display flicker fix:
      
        i915:
         - fix psr screen flicker
      
        sun4i:
         - mixer format fix"
      
      * tag 'drm-fixes-2022-03-11' of git://anongit.freedesktop.org/drm/drm:
        drm/sun4i: mixer: Fix P010 and P210 format numbers
        drm/i915/psr: Set "SF Partial Frame Enable" also on full update
      79b00034
    • Emil Renner Berthing's avatar
      riscv: Fix auipc+jalr relocation range checks · 0966d385
      Emil Renner Berthing authored
      
      
      RISC-V can do PC-relative jumps with a 32bit range using the following
      two instructions:
      
      	auipc	t0, imm20	; t0 = PC + imm20 * 2^12
      	jalr	ra, t0, imm12	; ra = PC + 4, PC = t0 + imm12
      
      Crucially both the 20bit immediate imm20 and the 12bit immediate imm12
      are treated as two's-complement signed values. For this reason the
      immediates are usually calculated like this:
      
      	imm20 = (offset + 0x800) >> 12
      	imm12 = offset & 0xfff
      
      ..where offset is the signed offset from the auipc instruction. When
      the 11th bit of offset is 0 the addition of 0x800 doesn't change the top
      20 bits and imm12 considered positive. When the 11th bit is 1 the carry
      of the addition by 0x800 means imm20 is one higher, but since imm12 is
      then considered negative the two's complement representation means it
      all cancels out nicely.
      
      However, this addition by 0x800 (2^11) means an offset greater than or
      equal to 2^31 - 2^11 would overflow so imm20 is considered negative and
      result in a backwards jump. Similarly the lower range of offset is also
      moved down by 2^11 and hence the true 32bit range is
      
      	[-2^31 - 2^11, 2^31 - 2^11)
      
      Signed-off-by: default avatarEmil Renner Berthing <kernel@esmil.dk>
      Fixes: e2c0cdfb ("RISC-V: User-facing API")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      0966d385
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2022-03-10' of... · 30eb13a2
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-intel
      
       into drm-fixes
      
      - Fix PSR2 when selective fetch is enabled and cursor at (-1, -1) (Jouni Högander)
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/YinTFSFg++HvuFpZ@tursulin-mobl2
      30eb13a2
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 1f37299b
      Dave Airlie authored
      
      
       * drm/sun4i: Fix P010 and P210 format numbers
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/YipS65Iuu7RMMlAa@linux-uq9g
      1f37299b
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · dda64ead
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Minor tracing fixes:
      
         - Fix unregistering the same event twice. A user could disable the
           same event that osnoise will disable on unregistering.
      
         - Inform RCU of a quiescent state in the osnoise testing thread.
      
         - Fix some kerneldoc comments"
      
      * tag 'trace-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace: Fix some W=1 warnings in kernel doc comments
        tracing/osnoise: Force quiescent states while tracing
        tracing/osnoise: Do not unregister events twice
      dda64ead
    • Linus Torvalds's avatar
      Merge tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 186d32bb
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bluetooth, and ipsec.
      
        Current release - regressions:
      
         - Bluetooth: fix unbalanced unlock in set_device_flags()
      
         - Bluetooth: fix not processing all entries on cmd_sync_work, make
           connect with qualcomm and intel adapters reliable
      
         - Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
      
         - xdp: xdp_mem_allocator can be NULL in trace_mem_connect()
      
         - eth: ice: fix race condition and deadlock during interface enslave
      
        Current release - new code bugs:
      
         - tipc: fix incorrect order of state message data sanity check
      
        Previous releases - regressions:
      
         - esp: fix possible buffer overflow in ESP transformation
      
         - dsa: unlock the rtnl_mutex when dsa_master_setup() fails
      
         - phy: meson-gxl: fix interrupt handling in forced mode
      
         - smsc95xx: ignore -ENODEV errors when device is unplugged
      
        Previous releases - always broken:
      
         - xfrm: fix tunnel mode fragmentation behavior
      
         - esp: fix inter address family tunneling on GSO
      
         - tipc: fix null-deref due to race when enabling bearer
      
         - sctp: fix kernel-infoleak for SCTP sockets
      
         - eth: macb: fix lost RX packet wakeup race in NAPI receive
      
         - eth: intel stop disabling VFs due to PF error responses
      
         - eth: bcmgenet: don't claim WOL when its not available"
      
      * tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (50 commits)
        xdp: xdp_mem_allocator can be NULL in trace_mem_connect().
        ice: Fix race condition during interface enslave
        net: phy: meson-gxl: improve link-up behavior
        net: bcmgenet: Don't claim WOL when its not available
        net: arc_emac: Fix use after free in arc_mdio_probe()
        sctp: fix kernel-infoleak for SCTP sockets
        net: phy: correct spelling error of media in documentation
        net: phy: DP83822: clear MISR2 register to disable interrupts
        gianfar: ethtool: Fix refcount leak in gfar_get_ts_info
        selftests: pmtu.sh: Kill nettest processes launched in subshell.
        selftests: pmtu.sh: Kill tcpdump processes launched by subshell.
        NFC: port100: fix use-after-free in port100_send_complete
        net/mlx5e: SHAMPO, reduce TIR indication
        net/mlx5e: Lag, Only handle events from highest priority multipath entry
        net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE
        net/mlx5: Fix a race on command flush flow
        net/mlx5: Fix size field in bufferx_reg struct
        ax25: Fix NULL pointer dereference in ax25_kill_by_device
        net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr
        net: ethernet: lpc_eth: Handle error for clk_enable
        ...
      186d32bb