#49100 Heap use after free in dynamic plugins
Opened 2 years ago by firstyear. Modified 2 years ago

The dynamic plugins for directory server are an important future goal.

However, there is a heap use after free in the dynamic tests while disabling them. This is due to the complexity of the code and the area it's in. Locks not in the right place and no barriers means we have inconsistency. To understand the issue you must read https://www.kernel.org/doc/Documentation/memory-barriers.txt

Instead of trying to solve the problem in the plugin system, we can use something that already solves the issue. We want to allow many workers to use a plugin list that stays stable during the life of an operation, but allow the list to be altered for future operations without affecting past ones.

This sounds oddly like a copy on write b+tree ....

By storing the plugin list in this, it is able to manage the life time of the plugin items. When we "disable" a plugin, it's removed from the tree, but existing transaction can continue to use it. When the transactions finally are closed, the reference count in the plugin can drop to 0 and be freed for cleanup and shutdown.

This way, instead of needing to continually reinvent the safety properties of our server, we can use the highly parallel, safe, tested, proven parts of the COW tree, and we can use it to manage our plugins.

Another benefit is that due to the cheap read transactions, there would be minimal performance overhead (infact, it my actually be an improvement), and enable / disable would not block the other threads of the server.


Metadata Update from @firstyear:
- Issue assigned to firstyear
- Issue set to the milestone: 1.3.7 backlog

2 years ago

Metadata Update from @firstyear:
- Issue close_status updated to: None
- Issue tagged with: Complex, Performance, SDS

2 years ago

Metadata Update from @firstyear:
- Issue set to the milestone: 1.4 backlog (was: 1.3.7 backlog)

2 years ago

Login to comment on this ticket.

Metadata