diff --git a/VERSION-openeuler b/VERSION-openeuler index 7ec2de2..744e840 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -18.09.0.302 +18.09.0.303 diff --git a/docker.spec b/docker.spec index 190693b..29524e3 100644 --- a/docker.spec +++ b/docker.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 302 +Release: 303 Summary: The open-source application container engine Group: Tools/Docker @@ -212,6 +212,12 @@ fi %endif %changelog +* Wed Jun 29 2022 zjw - 18.09.0-303 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:close channel in write side to avoid panic in docker stats + * Tue Jun 28 2022 zjw - 18.09.0-302 - Type:bugfix - CVE:NA diff --git a/git-commit b/git-commit index 0d22777..8a3eaa5 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -9168ea3a0f5f112a9cca9c63f33766cbcb7a58cc +7e7815ae0b96872d235f46c6624cc4b695d04dfa diff --git a/patch/0225-docker-close-channel-in-write-side-to-avoid-panic-in.patch b/patch/0225-docker-close-channel-in-write-side-to-avoid-panic-in.patch new file mode 100644 index 0000000..6376c67 --- /dev/null +++ b/patch/0225-docker-close-channel-in-write-side-to-avoid-panic-in.patch @@ -0,0 +1,38 @@ +From 548078b9e76e34c6994830ce35bee1c15e3c091f Mon Sep 17 00:00:00 2001 +From: chenjiankun +Date: Mon, 21 Mar 2022 11:05:43 +0800 +Subject: [PATCH] docker: close channel in write side to avoid panic in docker + stats + +there is a situation when write event to chan c, chan c is close, +and that will cause a panic. Close chan c in write side can avaid +panic. +--- + components/cli/cli/command/container/stats.go | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/components/cli/cli/command/container/stats.go b/components/cli/cli/command/container/stats.go +index 8387fc988..daab91627 100644 +--- a/components/cli/cli/command/container/stats.go ++++ b/components/cli/cli/command/container/stats.go +@@ -60,6 +60,9 @@ func runStats(dockerCli command.Cli, opts *statsOptions) error { + // monitorContainerEvents watches for container creation and removal (only + // used when calling `docker stats` without arguments). + monitorContainerEvents := func(started chan<- struct{}, c chan events.Message) { ++ // close channel in write side to avoid panic ++ defer close(c) ++ + f := filters.NewArgs() + f.Add("type", "container") + options := types.EventsOptions{ +@@ -150,7 +153,6 @@ func runStats(dockerCli command.Cli, opts *statsOptions) error { + eventChan := make(chan events.Message) + go eh.Watch(eventChan) + go monitorContainerEvents(started, eventChan) +- defer close(eventChan) + <-started + + // Start a short-lived goroutine to retrieve the initial list of +-- +2.23.0 + diff --git a/series.conf b/series.conf index bf9a26a..cda2c9a 100644 --- a/series.conf +++ b/series.conf @@ -222,4 +222,5 @@ patch/0221-docker-fix-Up-292-years-in-status-in-docker-ps-a.patch patch/0222-docker-Use-original-process-spec-for-execs.patch patch/0223-docker-fix-CVE-2022-24769.patch patch/0224-fix-rwlayer-umountd-after-container-restart.patch +patch/0225-docker-close-channel-in-write-side-to-avoid-panic-in.patch #end