]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/buffer: fix SIGABRT in rebuild_aligned_size_and_memory 42112/head
authorYin Congmin <congmin.yin@intel.com>
Wed, 30 Jun 2021 08:56:23 +0000 (16:56 +0800)
committerYin Congmin <congmin.yin@intel.com>
Fri, 9 Jul 2021 10:00:44 +0000 (18:00 +0800)
commit05a49aeeb3897a41e26d005c5143fdfe739d5c1b
tree89d64a31b281ff31ce78b3cca70914d519e09d1f
parentc42712dd18032d9651e2ca5f6fb9ae5a078378df
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>
src/common/buffer.cc
src/test/bufferlist.cc