]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/buffer: fix SIGABRT in rebuild_aligned_size_and_memory 42976/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:38:35 +0000 (15:38 +0200)
commitae7366f7bd363c178dd8d9eb1a0a5c1f3c91cbb3
tree8630a30f6dc721a1b86bdf2d046fa96d65944c3c
parent929fab5a4c649ad783b02716cc2bae49741a438f
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