Skip to content

Commit

Permalink
!14942 fix CVE-2024-57892
Browse files Browse the repository at this point in the history
Merge Pull Request from: @ci-robot 
 
PR sync from: Xiangwei Li <[email protected]>
https://mailweb.openeuler.org/hyperkitty/list/[email protected]/message/5J7EAGHLYD4OULZMM74NN6U4A72ESHY6/ 
Dennis Lam (1):
  ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv

Joseph Qi (1):
  ocfs2: correct return value of ocfs2_local_free_info()


-- 
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/IBID30 
 
Link:https://gitee.com/openeuler/kernel/pulls/14942 

Reviewed-by: Yuan Can <[email protected]> 
Signed-off-by: Yuan Can <[email protected]>
  • Loading branch information
openeuler-ci-bot authored and gitee-org committed Jan 23, 2025
2 parents 797ab00 + 12486ef commit da51139
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fs/ocfs2/quota_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
int status = 0;

trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
if (!sb_has_quota_loaded(sb, type)) {
if (!sb_has_quota_active(sb, type)) {
status = -ESRCH;
goto out;
}
Expand Down
10 changes: 4 additions & 6 deletions fs/ocfs2/quota_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)
struct ocfs2_quota_chunk *chunk;
struct ocfs2_local_disk_chunk *dchunk;
int mark_clean = 1, len;
int status;
int status = 0;

iput(oinfo->dqi_gqinode);
ocfs2_simple_drop_lockres(OCFS2_SB(sb), &oinfo->dqi_gqlock);
Expand Down Expand Up @@ -853,17 +853,15 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)
oinfo->dqi_libh,
olq_update_info,
info);
if (status < 0) {
if (status < 0)
mlog_errno(status);
goto out;
}

out:
ocfs2_inode_unlock(sb_dqopt(sb)->files[type], 1);
brelse(oinfo->dqi_libh);
brelse(oinfo->dqi_lqi_bh);
kfree(oinfo);
return 0;
info->dqi_priv = NULL;
return status;
}

static void olq_set_dquot(struct buffer_head *bh, void *private)
Expand Down

0 comments on commit da51139

Please sign in to comment.