每日一PATCH——CVE-2015-8961

本文详细分析了Linux内核中CVE-2015-8961的安全漏洞,该漏洞可能导致use-after-free情况。在__ext4_journal_stop()函数中,由于错误的代码顺序,导致在释放句柄后仍尝试使用已释放的内存。通过提供补丁链接和分析,解释了解决此问题的方法,即调整使用和释放内存的顺序,避免对已释放句柄的引用。
摘要由CSDN通过智能技术生成

漏洞链接

https://nvd.nist.gov/vuln/detail/CVE-2015-8961

patch链接

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6934da9238da947628be83635e365df41064b09b

漏洞分析

漏洞描述

There is a use-after-free possibility in __ext4_journal_stop() in the
case that we free the handle in the first jbd2_journal_stop() because
we’re referencing handle->h_err afterwards. This was introduced in
9705acd63b125dee8b15c705216d7186daea4625 and it is wrong. Fix it by storing the handle->h_err value beforehand and avoid referencing potentially freed handle.

patch

patch
jbd2_journal_stop():free handle指向的内存,handle变为悬挂指针,但是下面依然有对handle的使用:handle->h_err,所以会发生use-after-free。

patch方法

改变use和free的顺序,两个步骤:
1、把handle->h_err移到free的前面
2、删除在free之后对handle的解引用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值