已开启
Fix CVE-2021-41201 #131
XingSongSun创建于 6月2日
Fix CVE-2021-41201 #131
已开启
共 2 个文件变更+43-2
| @@ -0,0 +1,37 @@ | |||
| 1 | +From f09caa532b6e1ac8d2aa61b7832c78c5b79300c6 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Bixia Zheng <bixia@google.com> | ||
| 3 | +Date: Thu, 19 Aug 2021 09:05:04 -0700 | ||
| 4 | +Subject: [PATCH] Fix EinsumHelper::ParseEquation to avoid uninitialized | ||
| 5 | + accesses. | ||
| 6 | + | ||
| 7 | +EinsumHelper::ParseEquation is supposed to return true or false in | ||
| 8 | +input_has_ellipsis and output_has_ellipsis to indicate whether there is | ||
| 9 | +ellipsis in the inputs and output. Previously, when there is no ellipsis in the | ||
| 10 | +inputs or output, the routine doesn't assign false to the variables. This | ||
| 11 | +change initializes the two variables with false to fix the problem. | ||
| 12 | +PiperOrigin-RevId: 391772004 | ||
| 13 | +Change-Id: I17b6c88aadef4131470378e48cced054bf252e86 | ||
| 14 | +--- | ||
| 15 | + tensorflow/core/kernels/linalg/einsum_op_impl.h | 2 ++ | ||
| 16 | + 1 file changed, 2 insertions(+) | ||
| 17 | + | ||
| 18 | +diff --git a/tensorflow/core/kernels/linalg/einsum_op_impl.h b/tensorflow/core/kernels/linalg/einsum_op_impl.h | ||
| 19 | +index 5c41e38954d626..6f64334555131c 100644 | ||
| 20 | +--- a/tensorflow/core/kernels/linalg/einsum_op_impl.h | ||
| 21 | ++++ b/tensorflow/core/kernels/linalg/einsum_op_impl.h | ||
| 22 | + struct EinsumHelper { | ||
| 23 | + input_has_ellipsis->resize(num_inputs); | ||
| 24 | + for (int i = 0; i < num_inputs; ++i) { | ||
| 25 | + input_label_counts->at(i).resize(num_labels); | ||
| 26 | ++ input_has_ellipsis->at(i) = false; | ||
| 27 | + for (const int label : input_labels->at(i)) { | ||
| 28 | + if (label != kEllipsisLabel) | ||
| 29 | + input_label_counts->at(i)[label] += 1; | ||
| 30 | + struct EinsumHelper { | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + output_label_counts->resize(num_labels); | ||
| 34 | ++ *output_has_ellipsis = false; | ||
| 35 | + for (const int label : *output_labels) { | ||
| 36 | + if (label != kEllipsisLabel) | ||
| 37 | + output_label_counts->at(label) += 1; | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | %global _empty_manifest_terminate_build 0 | 1 | %global _empty_manifest_terminate_build 0 |
| 2 | Name: tensorflow | 2 | Name: tensorflow |
| 3 | Version: 2.12.1 | 3 | Version: 2.12.1 |
| 4 | -Release: 5 | 4 | +Release: 6 |
| 5 | Summary: An Open Source Machine Learning Framework for Everyone | 5 | Summary: An Open Source Machine Learning Framework for Everyone |
| 6 | License: Apache License 2.0 | 6 | License: Apache License 2.0 |
| 7 | URL: https://www.tensorflow.org/ | 7 | URL: https://www.tensorflow.org/ |
| @@ -17,6 +17,7 @@ Patch1000: aarch64_external_files.patch | |||
| 17 | %endif | 17 | %endif |
| 18 | %ifarch riscv64 | 18 | %ifarch riscv64 |
| 19 | Patch1100: riscv64_external_files.patch | 19 | Patch1100: riscv64_external_files.patch |
| 20 | +Patch1101: backport-CVE-2021-41201.patch | ||
| 20 | %endif | 21 | %endif |
| 21 | Requires: python3-future python3-numpy python3-six python3-astunparse python3-google-pasta python3-opt-einsum | 22 | Requires: python3-future python3-numpy python3-six python3-astunparse python3-google-pasta python3-opt-einsum |
| 22 | Requires: python3-typing-extensions python3-wrapt python3-h5py python3-protobuf python3-grpcio python3-absl-py | 23 | Requires: python3-typing-extensions python3-wrapt python3-h5py python3-protobuf python3-grpcio python3-absl-py |
| @@ -45,6 +46,7 @@ TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backwa | |||
| 45 | 46 | ||
| 46 | %prep | 47 | %prep |
| 47 | %setup -n %{name}-%{version} | 48 | %setup -n %{name}-%{version} |
| 49 | +%patch -P 1101 -p1 | ||
| 48 | %patch 0 -p1 | 50 | %patch 0 -p1 |
| 49 | %patch 1 -p1 | 51 | %patch 1 -p1 |
| 50 | %patch 2 -p1 | 52 | %patch 2 -p1 |
| @@ -84,6 +86,8 @@ bazel --output_user_root=`pwd`/../output_user_root build --nofetch --host_copt=- | |||
| 84 | %{_bindir}/* | 86 | %{_bindir}/* |
| 85 | 87 | ||
| 86 | %changelog | 88 | %changelog |
| 89 | +* Tue Jun 02 2026 sunwenhan <sunwenhan@xfusion.com> - 2.12.1-6 | ||
| 90 | +- Fix CVE-2021-41201 | ||
| 87 | * Tue Mar 03 2026 megranate wangkunjie@xfuison.com - 2.12.1-5 | 91 | * Tue Mar 03 2026 megranate wangkunjie@xfuison.com - 2.12.1-5 |
| 88 | - fix CVE-2026-2492 | 92 | - fix CVE-2026-2492 |
| 89 | 93 | ||
| @@ -122,4 +126,4 @@ bazel --output_user_root=`pwd`/../output_user_root build --nofetch --host_copt=- | |||
| 122 | - fix some cves | 126 | - fix some cves |
| 123 | 127 | ||
| 124 | * Wed Sep 30 2020 Zhipeng Xie<xiezhipeng1@huawei.com> - 2.3.1-1 | 128 | * Wed Sep 30 2020 Zhipeng Xie<xiezhipeng1@huawei.com> - 2.3.1-1 |
| 125 | -- Package init | 129 | +- Package init |