From 7d91d631e0e0249de7fd6156cce227d4c50e1c82 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Mon, 19 Nov 2018 15:19:35 -0800 Subject: [PATCH] Lock `KillAll`. Signed-off-by: Lantao Liu --- runtime/v1/linux/proc/init.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/v1/linux/proc/init.go b/runtime/v1/linux/proc/init.go index 3ce7a4341..fa23b5e88 100644 --- a/runtime/v1/linux/proc/init.go +++ b/runtime/v1/linux/proc/init.go @@ -356,6 +356,9 @@ func (p *Init) kill(ctx context.Context, signal uint32, all bool) error { // KillAll processes belonging to the init process func (p *Init) KillAll(ctx context.Context) error { + p.mu.Lock() + defer p.mu.Unlock() + err := p.runtime.Kill(ctx, p.id, int(syscall.SIGKILL), &runc.KillOpts{ All: true, })