Skip to content
Snippets Groups Projects
  1. May 15, 2021
  2. May 14, 2021
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · bd3c9cdb
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       "Fixes and cpucaps.h automatic generation:
      
         - Generate cpucaps.h at build time rather than carrying lots of
           #defines. Merged at -rc1 to avoid some conflicts during the merge
           window.
      
         - Initialise RGSR_EL1.SEED in __cpu_setup() as it may be left as 0
           out of reset and the IRG instruction would not function as expected
           if only the architected pseudorandom number generator is
           implemented.
      
         - Fix potential race condition in __sync_icache_dcache() where the
           PG_dcache_clean page flag is set before the actual cache
           maintenance.
      
         - Fix header include in BTI kselftests"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Fix race condition on PG_dcache_clean in __sync_icache_dcache()
        arm64: tools: Add __ASM_CPUCAPS_H to the endif in cpucaps.h
        arm64: mte: initialize RGSR_EL1.SEED in __cpu_setup
        kselftest/arm64: Add missing stddef.h include to BTI tests
        arm64: Generate cpucaps.h
      bd3c9cdb
    • Linus Torvalds's avatar
      Merge tag 'f2fs-5.13-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · ac524ece
      Linus Torvalds authored
      Pull f2fs fixes from Jaegeuk Kim:
       "This fixes some critical bugs such as memory leak in compression
        flows, kernel panic when handling errors, and swapon failure due to
        newly added condition check"
      
      * tag 'f2fs-5.13-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:
        f2fs: return EINVAL for hole cases in swap file
        f2fs: avoid swapon failure by giving a warning first
        f2fs: compress: fix to assign cc.cluster_idx correctly
        f2fs: compress: fix race condition of overwrite vs truncate
        f2fs: compress: fix to free compress page correctly
        f2fs: support iflag change given the mask
        f2fs: avoid null pointer access when handling IPU error
      ac524ece
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2021-05-14' of git://anongit.freedesktop.org/drm/drm · b5304a4f
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Not much here, mostly amdgpu fixes, with a couple of radeon, and a
        cosmetic vc4.
      
        Two MAINTAINERS file updates also.
      
        amdgpu:
         - Fixes for flexible array conversions
         - Fix sysfs attribute init
         - Harvesting fixes
         - VCN CG/PG fixes for Picasso
      
        radeon:
         - Fixes for flexible array conversions
         - Fix for flickering on Oland with multiple 4K displays
      
        vc4:
         - drop unused function"
      
      * tag 'drm-fixes-2021-05-14' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu: update vcn1.0 Non-DPG suspend sequence
        drm/amdgpu: set vcn mgcg flag for picasso
        drm/radeon/dpm: Disable sclk switching on Oland when two 4K 60Hz monitors are connected
        drm/amdgpu: update the method for harvest IP for specific SKU
        drm/amdgpu: add judgement when add ip blocks (v2)
        drm/amd/display: Initialize attribute for hdcp_srm sysfs file
        drm/amd/pm: Fix out-of-bounds bug
        drm/radeon/si_dpm: Fix SMU power state load
        drm/radeon/ni_dpm: Fix booting bug
        MAINTAINERS: Update address for Emma Anholt
        MAINTAINERS: Update my e-mail
        drm/vc4: remove unused function
        drm/ttm: Do not add non-system domain BO into swap list
      b5304a4f
    • Catalin Marinas's avatar
      arm64: Fix race condition on PG_dcache_clean in __sync_icache_dcache() · 588a513d
      Catalin Marinas authored
      
      To ensure that instructions are observable in a new mapping, the arm64
      set_pte_at() implementation cleans the D-cache and invalidates the
      I-cache to the PoU. As an optimisation, this is only done on executable
      mappings and the PG_dcache_clean page flag is set to avoid future cache
      maintenance on the same page.
      
      When two different processes map the same page (e.g. private executable
      file or shared mapping) there's a potential race on checking and setting
      PG_dcache_clean via set_pte_at() -> __sync_icache_dcache(). While on the
      fault paths the page is locked (PG_locked), mprotect() does not take the
      page lock. The result is that one process may see the PG_dcache_clean
      flag set but the I/D cache maintenance not yet performed.
      
      Avoid test_and_set_bit(PG_dcache_clean) in favour of separate test_bit()
      and set_bit(). In the rare event of a race, the cache maintenance is
      done twice.
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Cc: <stable@vger.kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Steven Price <steven.price@arm.com>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20210514095001.13236-1-catalin.marinas@arm.com
      
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      588a513d
  3. May 13, 2021
  4. May 12, 2021
  5. May 11, 2021
    • Chao Yu's avatar
      f2fs: compress: fix to assign cc.cluster_idx correctly · 8bfbfb0d
      Chao Yu authored
      
      In f2fs_destroy_compress_ctx(), after f2fs_destroy_compress_ctx(),
      cc.cluster_idx will be cleared w/ NULL_CLUSTER, f2fs_cluster_blocks()
      may check wrong cluster metadata, fix it.
      
      Fixes: 4c8ff709 ("f2fs: support data compression")
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      8bfbfb0d
    • Chao Yu's avatar
      f2fs: compress: fix race condition of overwrite vs truncate · a949dc5f
      Chao Yu authored
      
      pos_fsstress testcase complains a panic as belew:
      
      ------------[ cut here ]------------
      kernel BUG at fs/f2fs/compress.c:1082!
      invalid opcode: 0000 [#1] SMP PTI
      CPU: 4 PID: 2753477 Comm: kworker/u16:2 Tainted: G           OE     5.12.0-rc1-custom #1
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
      Workqueue: writeback wb_workfn (flush-252:16)
      RIP: 0010:prepare_compress_overwrite+0x4c0/0x760 [f2fs]
      Call Trace:
       f2fs_prepare_compress_overwrite+0x5f/0x80 [f2fs]
       f2fs_write_cache_pages+0x468/0x8a0 [f2fs]
       f2fs_write_data_pages+0x2a4/0x2f0 [f2fs]
       do_writepages+0x38/0xc0
       __writeback_single_inode+0x44/0x2a0
       writeback_sb_inodes+0x223/0x4d0
       __writeback_inodes_wb+0x56/0xf0
       wb_writeback+0x1dd/0x290
       wb_workfn+0x309/0x500
       process_one_work+0x220/0x3c0
       worker_thread+0x53/0x420
       kthread+0x12f/0x150
       ret_from_fork+0x22/0x30
      
      The root cause is truncate() may race with overwrite as below,
      so that one reference count left in page can not guarantee the
      page attaching in mapping tree all the time, after truncation,
      later find_lock_page() may return NULL pointer.
      
      - prepare_compress_overwrite
       - f2fs_pagecache_get_page
       - unlock_page
      					- f2fs_setattr
      					 - truncate_setsize
      					  - truncate_inode_page
      					   - delete_from_page_cache
       - find_lock_page
      
      Fix this by avoiding referencing updated page.
      
      Fixes: 4c8ff709 ("f2fs: support data compression")
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      a949dc5f
Loading