Skip to content

vine: manager link can be NULL when worker tries to send a message #4250

@JinZhou5042

Description

@JinZhou5042

When the worker decides to send a message to manager, the link to that manager could be invalid, and this could be intentional. So we must verify that manager link is valid, otherwise the worker would run into segfault.

For example, the code in vine_cache_prune looks like:

if (f->cache_level <= level) {
	vine_cache_remove(c, cachename, 0);
}

It passes a NULL pointer as the manager link argument:

int vine_cache_remove(struct vine_cache *c, const char *cachename, struct link *manager)

When vine_cache_remove invokes vine_worker_send_cache_invalid, a segmentation fault can occur if we don't check if that link is valid.

A gdb screeshot for this error captured on a worker process:

Image

Metadata

Metadata

Assignees

Labels

bugFor modifications that fix a flaw in the code.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions