提交 701ad061 编写于 作者: D Dennis Zhou 提交者: Yang Yingliang

percpu: update free path with correct new free region

mainline inclusion
from mainline-5.2-rc1
commit 8e5a2b98
category: bugfix
bugzilla: 34611
CVE: NA

-------------------------------------------------
When updating the chunk's contig_hint on the free path of a hint that
does not touch the page boundaries, it was incorrectly using the
starting offset of the free region and the block's contig_hint. This
could lead to incorrect assumptions about fit given a size and better
alignment of the start. Fix this by using (end - start) as this is only
called when updating a hint within a block.
Signed-off-by: NDennis Zhou <dennis@kernel.org>
Reviewed-by: NPeng Fan <peng.fan@nxp.com>
(cherry picked from commit 8e5a2b98)
Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5c44571b
...@@ -871,7 +871,7 @@ static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off, ...@@ -871,7 +871,7 @@ static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off,
pcpu_chunk_refresh_hint(chunk); pcpu_chunk_refresh_hint(chunk);
else else
pcpu_chunk_update(chunk, pcpu_block_off_to_off(s_index, start), pcpu_chunk_update(chunk, pcpu_block_off_to_off(s_index, start),
s_block->contig_hint); end - start);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册