]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/buffer: fix SIGABRT in rebuild_aligned_size_and_memory 42975/head
authorYin Congmin <congmin.yin@intel.com>
Wed, 30 Jun 2021 08:56:23 +0000 (16:56 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 30 Aug 2021 13:37:22 +0000 (15:37 +0200)
commit4b8be4fcac6d54967e44a450546036df0e682ffd
tree5389d10faab5b100dbf0f34377ef0323847a141f
parent8b7c3fee571cce43bfec1dd1c867addf0af1de65
common/buffer: fix SIGABRT in  rebuild_aligned_size_and_memory

There is such a bl, which needs to satisfy two conditions:
1)all ptrs' length sum except last ptr is aligned with 4K;
2)the length of last ptr is 0.
This bl will cause stack corruption when calling
bufferlist::rebuild_aligned_size_and_memory().

Deal with this special scenario in rebuild_aligned_size_and_memory() to
solve the bug. And added a specialtest-case to reproduce this scenario.

Fixes: https://tracker.ceph.com/issues/51419
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
(cherry picked from commit 05a49aeeb3897a41e26d005c5143fdfe739d5c1b)
src/common/buffer.cc
src/test/bufferlist.cc