Peter Dillinger
74b7c0d249
Fix use-after-free on implicit temporary FileOptions ( #8571 )
...
Summary:
FileOptions has an implicit conversion from EnvOptions and some
internal APIs take `const FileOptions&` and save the reference, which is
counter to Google C++ guidelines,
> Avoid defining functions that require a const reference parameter to outlive the call, because const reference parameters bind to temporaries. Instead, find a way to eliminate the lifetime requirement (for example, by copying the parameter), or pass it by const pointer and document the lifetime and non-null requirements.
This is at least a problem for repair.cc, which passes an EnvOptions to
TableCache(), which would save a reference to the temporary copy as
FileOptions. This was unfortunately only caught as a side effect of
changes in https://github.com/facebook/rocksdb/issues/8544 .
This change fixes the repair.cc case and updates the involved internal
APIs that save a reference to use `const FileOptions*` instead.
Unfortunately, I don't know how to get any of our sanitizers to reliably
report bugs like this, so I can't rule out more existing in our
codebase.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/8571
Test Plan:
Test that issues seen with https://github.com/facebook/rocksdb/issues/8544 are fixed (can reproduce on
AWS EC2)
Reviewed By: ajkr
Differential Revision: D29943890
Pulled By: pdillinger
fbshipit-source-id: 95f9c5251548777b4dc994c1a083dd2add5799c9
2021-07-27 21:49:14 -07:00
..
2021-07-23 08:38:45 -07:00
2021-07-23 11:39:24 -07:00
2021-07-22 18:29:13 -07:00
2021-06-16 16:51:38 -07:00
2021-06-16 16:51:38 -07:00
2021-07-02 05:23:02 -07:00
2021-06-18 04:57:27 -07:00
2021-07-09 16:22:48 -07:00
2021-07-09 16:22:48 -07:00
2021-06-15 03:43:48 -07:00
2021-07-27 21:49:14 -07:00
2021-07-27 21:49:14 -07:00
2021-03-29 17:10:42 -07:00
2020-10-28 23:22:27 -07:00
2021-05-05 14:00:17 -07:00
2021-06-15 03:43:48 -07:00
2021-02-06 22:34:30 -08:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-05-05 12:54:46 -07:00
2021-07-26 11:56:29 -07:00
2021-01-19 13:47:48 -08:00
2020-06-15 10:47:02 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-05-05 14:00:17 -07:00
2021-06-16 16:51:38 -07:00
2021-06-16 16:51:38 -07:00
2021-06-16 16:51:38 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2020-12-09 21:21:16 -08:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-27 21:32:11 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-16 07:58:51 -07:00
2021-07-27 07:47:02 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-07 11:14:05 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2020-10-28 23:22:27 -07:00
2020-12-02 13:00:53 -08:00
2021-03-25 21:18:08 -07:00
2021-07-23 08:38:45 -07:00
2021-07-23 08:38:45 -07:00
2021-07-20 18:09:51 -07:00
2021-03-25 21:18:08 -07:00
2021-07-27 07:47:02 -07:00
2020-08-25 10:46:11 -07:00
2020-02-20 12:09:57 -08:00
2021-07-23 08:38:45 -07:00
2021-05-18 19:33:55 -07:00
2021-03-15 04:34:11 -07:00
2021-07-23 08:38:45 -07:00
2020-12-22 23:45:58 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-10-28 23:22:27 -07:00
2021-06-10 11:02:43 -07:00
2021-07-26 11:56:29 -07:00
2021-07-26 11:56:29 -07:00
2020-02-20 12:09:57 -08:00
2021-03-19 12:09:47 -07:00
2020-02-20 12:09:57 -08:00
2021-03-25 21:18:08 -07:00
2020-04-15 17:40:44 -07:00
2021-01-25 22:09:11 -08:00
2021-03-15 04:34:11 -07:00
2021-07-23 08:38:45 -07:00
2021-07-16 14:13:08 -07:00
2021-07-16 14:13:08 -07:00
2021-06-16 16:51:38 -07:00
2021-01-29 12:18:58 -08:00
2021-07-23 08:38:45 -07:00
2020-02-20 12:09:57 -08:00
2020-11-30 18:11:38 -08:00
2020-08-26 10:39:20 -07:00
2021-01-04 16:01:01 -08:00
2021-06-25 00:47:17 -07:00
2021-03-19 12:09:47 -07:00
2020-02-20 12:09:57 -08:00
2021-03-19 12:09:47 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-12-22 23:45:58 -08:00
2021-06-10 11:02:43 -07:00
2021-07-22 18:29:13 -07:00
2021-07-26 11:56:29 -07:00
2021-07-22 18:29:13 -07:00
2021-07-26 11:56:29 -07:00
2021-05-10 12:50:25 -07:00
2020-02-20 12:09:57 -08:00
2021-06-24 18:11:30 -07:00
2021-06-24 18:11:30 -07:00
2020-02-20 12:09:57 -08:00
2021-01-21 13:13:02 -08:00
2021-07-23 08:38:45 -07:00
2020-12-23 16:55:53 -08:00
2020-11-10 23:42:13 -08:00
2021-05-19 21:41:31 -07:00
2021-03-15 04:34:11 -07:00
2021-07-23 08:38:45 -07:00
2021-03-15 04:34:11 -07:00
2021-01-25 22:09:11 -08:00
2020-02-20 12:09:57 -08:00
2021-05-05 14:00:17 -07:00
2020-02-20 12:09:57 -08:00
2021-03-15 04:34:11 -07:00
2021-03-15 04:34:11 -07:00
2020-02-20 12:09:57 -08:00
2020-10-28 10:12:58 -07:00
2021-03-25 21:18:08 -07:00
2020-02-20 12:09:57 -08:00
2021-06-18 04:57:27 -07:00
2021-06-18 04:57:27 -07:00
2020-08-14 19:20:58 -07:00
2021-07-23 08:38:45 -07:00
2021-07-27 21:49:14 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2021-03-25 21:18:08 -07:00
2021-07-27 21:49:14 -07:00
2021-07-27 21:49:14 -07:00
2021-05-17 18:28:39 -07:00
2021-03-25 15:00:45 -07:00
2021-07-06 10:14:32 -07:00
2020-12-22 23:45:58 -08:00
2020-08-12 17:31:23 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2021-06-22 09:49:44 -07:00
2021-04-19 11:56:14 -07:00
2021-04-19 11:56:14 -07:00
2021-07-22 18:29:13 -07:00
2021-06-10 12:55:20 -07:00
2021-01-19 19:27:53 -08:00
2021-05-17 15:15:23 -07:00
2021-05-17 15:15:23 -07:00
2021-06-22 09:49:44 -07:00
2021-07-22 18:29:13 -07:00
2021-07-22 18:29:13 -07:00
2020-12-09 16:02:12 -08:00
2020-12-09 16:02:12 -08:00
2020-12-09 16:02:12 -08:00
2021-06-10 11:02:43 -07:00
2021-04-22 20:43:54 -07:00
2020-08-12 17:31:23 -07:00
2020-02-20 12:09:57 -08:00
2021-01-29 12:18:58 -08:00
2021-05-05 14:00:17 -07:00
2021-03-15 04:34:11 -07:00
2021-07-07 11:14:05 -07:00
2020-02-20 12:09:57 -08:00
2021-03-18 09:47:31 -07:00
2021-03-18 09:47:31 -07:00
2021-03-18 09:47:31 -07:00
2021-04-21 13:54:02 -07:00
2021-06-18 17:14:51 -07:00