Blame SOURCES/docker-1804024.patch

3aa8f6
From 8a8a10b7f2864827730225328a61278183c093a5 Mon Sep 17 00:00:00 2001
3aa8f6
From: Valentin Rothberg <rothberg@redhat.com>
3aa8f6
Date: Mon, 2 Mar 2020 15:45:54 +0100
3aa8f6
Subject: [PATCH] pull: don't continue when exceeding max size
3aa8f6
3aa8f6
When hitting an error that we exceeded the maximum allowed size, do not
3aa8f6
continue to the next pull endpoint and let the error bubble up the stack
3aa8f6
to the client.  This way, we correctly report the error and do not hide
3aa8f6
it in the logs.
3aa8f6
3aa8f6
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
3aa8f6
---
3aa8f6
 distribution/errors.go | 6 ++++++
3aa8f6
 1 file changed, 6 insertions(+)
3aa8f6
3aa8f6
diff --git a/distribution/errors.go b/distribution/errors.go
3aa8f6
index b8cf9fb9e803..b0dccd01b079 100644
3aa8f6
--- a/distribution/errors.go
3aa8f6
+++ b/distribution/errors.go
3aa8f6
@@ -113,6 +113,12 @@ func continueOnError(err error) bool {
3aa8f6
 	case ImageConfigPullError:
3aa8f6
 		return false
3aa8f6
 	case error:
3aa8f6
+		if strings.Contains(err.Error(), "exceeded maximum allowed size of ") {
3aa8f6
+			// This error comes from c/image and protects against CVE-2020-1702.
3aa8f6
+			// We should not continue on this error and let it bubble up to the
3aa8f6
+			// client.
3aa8f6
+			return false
3aa8f6
+		}
3aa8f6
 		return !strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error()))
3aa8f6
 	}
3aa8f6
 	// let's be nice and fallback if the error is a completely