diff options
| author | Sana Kazi <sanakazi720@gmail.com> | 2025-07-14 19:34:36 +0530 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-09-06 16:26:53 +0200 |
| commit | 89b98ccbfb7c52577ebab7c4306c9fdb8aee81a6 (patch) | |
| tree | a66b335ff71953aae8dd47ef3bdcc5bbf2ca8382 /meta-oe | |
| parent | a626bfdf31d5c3414605cacfa58d756fd9f400a6 (diff) | |
| download | meta-openembedded-89b98ccbfb7c52577ebab7c4306c9fdb8aee81a6.tar.gz | |
imagemagick: Fix patch-fuzz for fix-cipher-leak.patch
Refresh fix-cipher-leak.patch to fix patch-fuzz issue.
Signed-off-by: Sana Kazi <sanakazi720@gmail.com>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-oe')
| -rw-r--r-- | meta-oe/recipes-support/imagemagick/files/fix-cipher-leak.patch | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/meta-oe/recipes-support/imagemagick/files/fix-cipher-leak.patch b/meta-oe/recipes-support/imagemagick/files/fix-cipher-leak.patch index a8985757f2..28fbd9e9ea 100644 --- a/meta-oe/recipes-support/imagemagick/files/fix-cipher-leak.patch +++ b/meta-oe/recipes-support/imagemagick/files/fix-cipher-leak.patch | |||
| @@ -9,7 +9,7 @@ Subject: [PATCH] possible divide by zero + clear buffers | |||
| 9 | MagickCore/memory.c | 22 ++++++++++++++++------ | 9 | MagickCore/memory.c | 22 ++++++++++++++++------ |
| 10 | MagickCore/signature.c | 2 +- | 10 | MagickCore/signature.c | 2 +- |
| 11 | coders/thumbnail.c | 3 ++- | 11 | coders/thumbnail.c | 3 ++- |
| 12 | 5 files changed, 41 insertions(+), 25 deletions(-) | 12 | 5 files changed, 33 insertions(+), 22 deletions(-) |
| 13 | 13 | ||
| 14 | CVE: CVE-2021-20311 | 14 | CVE: CVE-2021-20311 |
| 15 | CVE: CVE-2021-20312 | 15 | CVE: CVE-2021-20312 |
| @@ -19,35 +19,34 @@ Upstream-Status: Backport[https://github.com/ImageMagick/ImageMagick/commit/70aa | |||
| 19 | Comment: Refreshed patch based on the codebase | 19 | Comment: Refreshed patch based on the codebase |
| 20 | 20 | ||
| 21 | Signed-off-by: Sana Kazi Sana.Kazi@kpit.com | 21 | Signed-off-by: Sana Kazi Sana.Kazi@kpit.com |
| 22 | |||
| 22 | diff --git a/MagickCore/cipher.c b/MagickCore/cipher.c | 23 | diff --git a/MagickCore/cipher.c b/MagickCore/cipher.c |
| 23 | index 057b11c4720..91ad1d1d662 100644 | 24 | index 908266457..4548f0d60 100644 |
| 24 | --- a/MagickCore/cipher.c | 25 | --- a/MagickCore/cipher.c |
| 25 | +++ b/MagickCore/cipher.c | 26 | +++ b/MagickCore/cipher.c |
| 26 | @@ -484,8 +484,8 @@ static void EncipherAESBlock(AESInfo *ae | 27 | @@ -482,8 +482,8 @@ static void EncipherAESBlock(AESInfo *aes_info,const unsigned char *plaintext, |
| 27 | Reset registers. | 28 | Reset registers. |
| 28 | */ | 29 | */ |
| 29 | alpha=0; | 30 | alpha=0; |
| 30 | - (void) memset(key,0,sizeof(key)); | 31 | - (void) memset(key,0,sizeof(key)); |
| 31 | - (void) memset(text,0,sizeof(text)); | 32 | - (void) memset(text,0,sizeof(text)); |
| 32 | + (void) ResetMagickMemory(key,0,sizeof(key)); | 33 | + (void) ResetMagickMemory(key,0,sizeof(key)); |
| 33 | + (void) ResetMagickMemory(text,0,sizeof(text)); | 34 | + (void) ResetMagickMemory(text,0,sizeof(text)); |
| 34 | } | 35 | } |
| 35 | 36 | ||
| 36 | |||
| 37 | /* | 37 | /* |
| 38 | @@ -708,8 +708,8 @@ MagickExport MagickBooleanType PasskeyDe | 38 | @@ -706,8 +706,8 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image, |
| 39 | */ | 39 | */ |
| 40 | quantum_info=DestroyQuantumInfo(quantum_info); | 40 | quantum_info=DestroyQuantumInfo(quantum_info); |
| 41 | aes_info=DestroyAESInfo(aes_info); | 41 | aes_info=DestroyAESInfo(aes_info); |
| 42 | - (void) memset(input_block,0,sizeof(input_block)); | 42 | - (void) memset(input_block,0,sizeof(input_block)); |
| 43 | - (void) memset(output_block,0,sizeof(output_block)); | 43 | - (void) memset(output_block,0,sizeof(output_block)); |
| 44 | + (void) ResetMagickMemory(input_block,0,sizeof(input_block)); | 44 | + (void) ResetMagickMemory(input_block,0,sizeof(input_block)); |
| 45 | + (void) ResetMagickMemory(output_block,0,sizeof(output_block)); | 45 | + (void) ResetMagickMemory(output_block,0,sizeof(output_block)); |
| 46 | return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse); | 46 | return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | 49 | @@ -923,8 +923,8 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image, | |
| 50 | @@ -925,8 +925,8 @@ MagickExport MagickBooleanType PasskeyEn | ||
| 51 | */ | 50 | */ |
| 52 | quantum_info=DestroyQuantumInfo(quantum_info); | 51 | quantum_info=DestroyQuantumInfo(quantum_info); |
| 53 | aes_info=DestroyAESInfo(aes_info); | 52 | aes_info=DestroyAESInfo(aes_info); |
| @@ -57,13 +56,12 @@ index 057b11c4720..91ad1d1d662 100644 | |||
| 57 | + (void) ResetMagickMemory(output_block,0,sizeof(output_block)); | 56 | + (void) ResetMagickMemory(output_block,0,sizeof(output_block)); |
| 58 | return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse); | 57 | return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse); |
| 59 | } | 58 | } |
| 60 | 59 | ||
| 61 | |||
| 62 | diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c | 60 | diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c |
| 63 | index 2ffc72f88fa..e3b7df339f6 100644 | 61 | index ac9f7e91b..b78b84b47 100644 |
| 64 | --- a/MagickCore/colorspace.c | 62 | --- a/MagickCore/colorspace.c |
| 65 | +++ b/MagickCore/colorspace.c | 63 | +++ b/MagickCore/colorspace.c |
| 66 | @@ -940,15 +940,15 @@ static MagickBooleanType sRGBTransformImage(Image *image, | 64 | @@ -850,15 +850,15 @@ static MagickBooleanType sRGBTransformImage(Image *image, |
| 67 | if (logmap == (Quantum *) NULL) | 65 | if (logmap == (Quantum *) NULL) |
| 68 | ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", | 66 | ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", |
| 69 | image->filename); | 67 | image->filename); |
| @@ -83,7 +81,7 @@ index 2ffc72f88fa..e3b7df339f6 100644 | |||
| 83 | image_view=AcquireAuthenticCacheView(image,exception); | 81 | image_view=AcquireAuthenticCacheView(image,exception); |
| 84 | #if defined(MAGICKCORE_OPENMP_SUPPORT) | 82 | #if defined(MAGICKCORE_OPENMP_SUPPORT) |
| 85 | #pragma omp parallel for schedule(static) shared(status) \ | 83 | #pragma omp parallel for schedule(static) shared(status) \ |
| 86 | @@ -2502,14 +2502,14 @@ static MagickBooleanType TransformsRGBImage(Image *image, | 84 | @@ -2394,14 +2394,14 @@ static MagickBooleanType TransformsRGBImage(Image *image, |
| 87 | if (logmap == (Quantum *) NULL) | 85 | if (logmap == (Quantum *) NULL) |
| 88 | ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", | 86 | ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", |
| 89 | image->filename); | 87 | image->filename); |
| @@ -103,10 +101,10 @@ index 2ffc72f88fa..e3b7df339f6 100644 | |||
| 103 | logmap[i]=QuantumRange; | 101 | logmap[i]=QuantumRange; |
| 104 | if (image->storage_class == PseudoClass) | 102 | if (image->storage_class == PseudoClass) |
| 105 | diff --git a/MagickCore/memory.c b/MagickCore/memory.c | 103 | diff --git a/MagickCore/memory.c b/MagickCore/memory.c |
| 106 | index 2598044486a..01bc80d86c5 100644 | 104 | index 060b05e71..5db57acc7 100644 |
| 107 | --- a/MagickCore/memory.c | 105 | --- a/MagickCore/memory.c |
| 108 | +++ b/MagickCore/memory.c | 106 | +++ b/MagickCore/memory.c |
| 109 | @@ -1269,26 +1269,36 @@ MagickExport MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info) | 107 | @@ -1230,26 +1230,36 @@ MagickExport MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info) |
| 110 | % % | 108 | % % |
| 111 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | 109 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 112 | % | 110 | % |
| @@ -144,13 +142,13 @@ index 2598044486a..01bc80d86c5 100644 | |||
| 144 | assert(memory != (void *) NULL); | 142 | assert(memory != (void *) NULL); |
| 145 | - return(memset(memory,byte,size)); | 143 | - return(memset(memory,byte,size)); |
| 146 | + while (n-- != 0) | 144 | + while (n-- != 0) |
| 147 | + *p++=(unsigned char) c; | 145 | + *p++=(unsigned char) c; |
| 148 | + return(memory); | 146 | + return(memory); |
| 149 | } | 147 | } |
| 150 | 148 | ||
| 151 | /* | 149 | /* |
| 152 | diff --git a/MagickCore/signature.c b/MagickCore/signature.c | 150 | diff --git a/MagickCore/signature.c b/MagickCore/signature.c |
| 153 | index 2d9b0801523..1f79c91b11b 100644 | 151 | index f0f0e42e0..f21feda27 100644 |
| 154 | --- a/MagickCore/signature.c | 152 | --- a/MagickCore/signature.c |
| 155 | +++ b/MagickCore/signature.c | 153 | +++ b/MagickCore/signature.c |
| 156 | @@ -736,7 +736,7 @@ RestoreMSCWarning | 154 | @@ -736,7 +736,7 @@ RestoreMSCWarning |
| @@ -160,10 +158,10 @@ index 2d9b0801523..1f79c91b11b 100644 | |||
| 160 | - (void) memset(W,0,sizeof(W)); | 158 | - (void) memset(W,0,sizeof(W)); |
| 161 | + (void) ResetMagickMemory(W,0,sizeof(W)); | 159 | + (void) ResetMagickMemory(W,0,sizeof(W)); |
| 162 | } | 160 | } |
| 163 | 161 | ||
| 164 | /* | 162 | /* |
| 165 | diff --git a/coders/thumbnail.c b/coders/thumbnail.c | 163 | diff --git a/coders/thumbnail.c b/coders/thumbnail.c |
| 166 | index 59d97380d9e..e92dd312011 100644 | 164 | index 1f7900aef..169bcfea8 100644 |
| 167 | --- a/coders/thumbnail.c | 165 | --- a/coders/thumbnail.c |
| 168 | +++ b/coders/thumbnail.c | 166 | +++ b/coders/thumbnail.c |
| 169 | @@ -199,7 +199,8 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info, | 167 | @@ -199,7 +199,8 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info, |
| @@ -172,7 +170,10 @@ index 59d97380d9e..e92dd312011 100644 | |||
| 172 | } | 170 | } |
| 173 | - if ((q+length) > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) | 171 | - if ((q+length) > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) |
| 174 | + if ((q > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) || | 172 | + if ((q > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) || |
| 175 | + (length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q))) | 173 | + (length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q))) |
| 176 | ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail"); | 174 | ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail"); |
| 177 | thumbnail_image=BlobToImage(image_info,q,length,exception); | 175 | thumbnail_image=BlobToImage(image_info,q,length,exception); |
| 178 | if (thumbnail_image == (Image *) NULL) | 176 | if (thumbnail_image == (Image *) NULL) |
| 177 | -- | ||
| 178 | 2.25.1 | ||
| 179 | |||
