test/librados_test_stub: add IoCtx::{set,get}_pool_full_try() stubs

Because unittest_librbd links not just with librados_test_stub.a but
also with librados.so (why?), these were sneakily picked up from the
latter.  This resulted in get_pool_full_try() reading from invalid
memory and every once in a while returning true, prompting librbd to
write to invalid memory through set_pool_full_try() in create_ioctx()
and cause random crashes.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Ilya Dryomov 2021-10-17 13:09:14 +02:00
parent 7cc7efae2a
commit b387fdeeb3

View File

@ -791,6 +791,13 @@ std::string IoCtx::get_namespace() const {
return ctx->get_namespace();
}
void IoCtx::set_pool_full_try() {
}
bool IoCtx::get_pool_full_try() {
return false;
}
static int save_operation_result(int result, int *pval) {
if (pval != NULL) {
*pval = result;