1. 17 7月, 2023 4 次提交
  2. 14 7月, 2023 2 次提交
    • Z
      ext4: Add debug message to notify user space is out of free · 963b3ef7
      Zhihao Cheng 提交于
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I7CBCS
      CVE: NA
      
      --------------------------------
      
      Add debug message to notify user that ext4_writepages is stuck in loop
      caused by ENOSPC.
      Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
      963b3ef7
    • Z
      Revert "ext4: Stop trying writing pages if no free blocks generated" · 62405f69
      Zhihao Cheng 提交于
      This reverts commit 6b84e9d9.
      
      When ext4 runs out of space, there could be a potential data lost in
      ext4_writepages:
      If there are many preallocated blocks for some files, e4b bitmap is
      different from block bitmap, and there are more free blocks accounted
      by block bitmap.
      
          ext4_writepages                         P2
      ext4_mb_new_blocks                  ext4_map_blocks
       ext4_mb_regular_allocator // No free bits in e4b bitmap
       ext4_mb_discard_preallocations_should_retry
        ext4_mb_discard_preallocations
         ext4_mb_discard_group_preallocations
          ext4_mb_release_inode_pa // updates e4b bitmap by pa->pa_free
           mb_free_blocks
                                           ext4_mb_new_blocks
                                            ext4_mb_regular_allocator
                                            // Got e4b bitmap's free bits
       ext4_mb_regular_allocator  // After 3 times retrying, ret ENOSPC
      
      ext4_writepages
       mpage_map_and_submit_extent
        mpage_map_one_extent // ret ENOSPC
        if (err == -ENOSPC && EXT4_SB(sb)->s_mb_free_pending)
        // s_mb_free_pending is 0
        *give_up_on_write = true  // Abandon writeback, data lost!
      
      Fixes: 6b84e9d9 ("ext4: Stop trying writing pages if no free ...")
      Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
      62405f69
  3. 13 7月, 2023 3 次提交
  4. 12 7月, 2023 3 次提交
  5. 11 7月, 2023 3 次提交
    • Z
      jbd2: Check 'jh->b_transaction' before remove it from checkpoint · a49943e0
      Zhihao Cheng 提交于
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I70WHL
      CVE: NA
      
      --------------------------------
      
      Following process will corrupt ext4 image:
      Step 1:
      jbd2_journal_commit_transaction
       __jbd2_journal_insert_checkpoint(jh, commit_transaction)
       // Put jh into trans1->t_checkpoint_list
       journal->j_checkpoint_transactions = commit_transaction
       // Put trans1 into journal->j_checkpoint_transactions
      
      Step 2:
      do_get_write_access
       test_clear_buffer_dirty(bh) // clear buffer dirty,set jbd dirty
       __jbd2_journal_file_buffer(jh, transaction) // jh belongs to trans2
      
      Step 3:
      drop_cache
       journal_shrink_one_cp_list
        jbd2_journal_try_remove_checkpoint
         if (!trylock_buffer(bh))  // lock bh, true
         if (buffer_dirty(bh))     // buffer is not dirty
         __jbd2_journal_remove_checkpoint(jh)
         // remove jh from trans1->t_checkpoint_list
      
      Step 4:
      jbd2_log_do_checkpoint
       trans1 = journal->j_checkpoint_transactions
       // jh is not in trans1->t_checkpoint_list
       jbd2_cleanup_journal_tail(journal)  // trans1 is done
      
      Step 5: Power cut, trans2 is not committed, jh is lost in next mounting.
      
      Fix it by checking 'jh->b_transaction' before remove it from checkpoint.
      
      Fixes: 80079353 ("jbd2: fix a race when checking checkpoint ...")
      Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
      (cherry picked from commit 7723e91d)
      a49943e0
    • L
      etmem: fix the div 0 problem in swapcache reclaim process · 248e7033
      liubo 提交于
      euleros inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I7JI6K
      CVE: NA
      
      ------------------------------------------------------------
      
      In the swapcache recycling process, the number of pages
      to be reclaimed on each node is obtained as follows:
      
      nr_to_reclaim[nid_num] = (swapcache_to_reclaim /
      			  (swapcache_total_reclaimable / nr[nid_num]));
      
      However, nr[nid_num] is obtained by traversing the number
      of swapcache pages on each node.
      If there are multiple nodes in the environment and
      no swap process occurs on a node, no swapcache page exists.
      The value of nr[nid_num] may be 0.
      
      Therefore, division by zero errors may occur.
      Signed-off-by: Nliubo <liubo254@huawei.com>
      248e7033
    • O
      !1361 fix CVE-2023-1295 · cb31b5b2
      openeuler-ci-bot 提交于
      Merge Pull Request from: @LiuYongQiang0816 
       
      3 patches from Li Nan 
       
      Link:https://gitee.com/openeuler/kernel/pulls/1361 
      
      Reviewed-by: Zhang Changzhong <zhangchangzhong@huawei.com> 
      Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> 
      cb31b5b2
  6. 10 7月, 2023 3 次提交
  7. 08 7月, 2023 4 次提交
  8. 07 7月, 2023 18 次提交