Skip to content

Commit eecd71d

Browse files
[PATCH] Tensorflow Training 2.18 CVE Patch (#5024)
* build tensorflow 2.18 training sm * build tensorflow 2.18 training ec2 * build tensorflow 2.19 training sm * build tensorflow 2.19 training sm * build tensorflow 2.18 training sm * build tensorflow 2.18 training ec2 * build tensorflow 2.18 with opencv pinned version ec2 * build tensorflow 2.18 with opencv pinned version sm * build tensorflow 2.18 sm * build tensorflow 2.18 ec2 * build tensorflow 2.19 sm * build tensorflow 2.18 sm * build tensorflow 2.18 ec2 * build tensorflow 2.19 sm with open cv pinned * retry build for tensorflow 2.18 sm * retry build for tensorflow 2.18 ec2 * retry build for tensorflow 2.18 ec2 * retry build for tensorflow 2.18 sm * retry build for tensorflow 2.18 sm * retry build for tensorflow 2.18 ec2 * revert toml * build 2.18 cve sagemaker image with protobuf 6 * build 2.18 cve sagemaker image with protobuf 6 * build 2.18 cve sagemaker image with protobuf 6 * build 2.18 cve ec2 image with protobuf 6 * build ec2 * build ec2 * build ec2 * run securtiy tests * run securtiy tests * rerun security * build ec2 * build sm * build ec2 * build ec2 * build sm * rebuild sm * rebuild sm * remove version pins * removed sm version pins * rebuild sm * sagemaker version pins * tf build sm * build sm * build sm * build sm * build sm with only sagemaker * build sm with only sagemaker * build sm with only sagemaker * repin versions * typo fix sg build * typo fix sg build * build sm, split package installation * build sm, make ssae 0.1.4 * rebuild sm with lesser protobuf version * protobuf and numpy pin, build sm * numpy pin, build sm * rebuild with numpy * rebuild with numpy * rebuild sm * fix numpy, rebuild * fix installation command, rebuild * build ec2 again * revert toml * test ec2 build * revert toml * comment out autpatch build
1 parent e132c0b commit eecd71d

13 files changed

+92
-41
lines changed

dlc_developer_config.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,12 @@ ec2_benchmark_tests = false
7272
### These tests are run in EC2 test jobs, so ec2_tests must be true if ec2_tests_on_heavy_instances is true.
7373
### Off by default (set to false)
7474
ec2_tests_on_heavy_instances = false
75-
7675
### SM specific tests
7776
### On by default
7877
sagemaker_local_tests = true
79-
8078
### Set enable_ipv6 = true to run tests with IPv6-enabled resources
8179
### Off by default (set to false)
8280
enable_ipv6 = false
83-
8481
### Set the VPC name to be used for IPv6 testing, this variable is empty by default
8582
### To create an IPv6-enabled VPC and its related resources:
8683
### 1. Follow this AWS doc: https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html#create-vpc-and-other-resources

tensorflow/training/buildspec-2-18-ec2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ framework: &FRAMEWORK tensorflow
55
version: &VERSION 2.18.0
66
short_version: &SHORT_VERSION "2.18"
77
arch_type: x86
8-
autopatch_build: "True"
8+
# autopatch_build: "True"
99

1010
repository_info:
1111
training_repository: &TRAINING_REPOSITORY

tensorflow/training/buildspec-2-18-sm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ framework: &FRAMEWORK tensorflow
55
version: &VERSION 2.18.0
66
short_version: &SHORT_VERSION "2.18"
77
arch_type: x86
8-
autopatch_build: "True"
8+
# autopatch_build: "True"
99

1010
repository_info:
1111
training_repository: &TRAINING_REPOSITORY

tensorflow/training/docker/2.18/py3/Dockerfile.cpu

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,8 @@ RUN ${PIP} install --no-cache-dir -U \
159159
absl-py \
160160
opencv-python \
161161
werkzeug \
162-
psutil \
163-
"protobuf<4"
164-
162+
psutil
163+
165164
ADD https://raw.githubusercontent.com/aws/deep-learning-containers/master/src/deep_learning_container.py /usr/local/bin/deep_learning_container.py
166165

167166
RUN chmod +x /usr/local/bin/deep_learning_container.py
@@ -189,7 +188,7 @@ ARG TF_URL
189188
RUN ${PIP} install --no-cache-dir -U \
190189
${TF_URL} \
191190
"tensorflow-io==0.37.*" \
192-
tensorflow-datasets
191+
"tensorflow-datasets==4.9.7"
193192

194193
RUN HOME_DIR=/root \
195194
&& curl -o ${HOME_DIR}/oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \
@@ -261,26 +260,41 @@ RUN ${PIP} install --no-cache-dir -U \
261260
&& ${PIP} install --no-cache-dir -U \
262261
${TF_URL} \
263262
"tensorflow-io==0.37.*" \
264-
tensorflow-datasets
263+
"tensorflow-datasets==4.9.7"
265264

266265
RUN $PYTHON -m pip install --no-cache-dir -U \
267-
numba \
266+
numba==0.61.0 \
268267
bokeh \
269268
imageio \
270269
opencv-python \
271270
plotly \
272271
seaborn \
273-
shap
272+
shap
273+
274+
RUN $PYTHON -m pip install --no-cache-dir -U \
275+
"sagemaker<3"
274276

275277
RUN $PYTHON -m pip install --no-cache-dir -U \
276-
"sagemaker<3" \
277-
sagemaker-experiments==0.* \
278-
sagemaker-tensorflow-training \
279-
sagemaker-training \
280-
"sagemaker-studio-analytics-extension<1" \
281-
"sparkmagic<1" \
282-
"sagemaker-studio-sparkmagic-lib<1" \
283-
smclarify
278+
sagemaker-experiments==0.1.45
279+
280+
RUN $PYTHON -m pip install --no-cache-dir -U \
281+
sagemaker-tensorflow-training
282+
283+
RUN $PYTHON -m pip install --no-cache-dir -U \
284+
sagemaker-training
285+
286+
RUN $PYTHON -m pip install --no-cache-dir -U \
287+
sagemaker-studio-analytics-extension==0.1.4
288+
289+
RUN $PYTHON -m pip install --no-cache-dir -U \
290+
sagemaker-studio-sparkmagic-lib==0.2.0
291+
292+
RUN $PYTHON -m pip install --no-cache-dir -U \
293+
sparkmagic==0.21.0 \
294+
smclarify
295+
296+
#pin numpy version because of sagemaker-tensorflow-training dependency
297+
RUN $PYTHON -m pip install --no-cache-dir numpy==1.26.4
284298

285299
# Remove python kernel installed by sparkmagic
286300
RUN /usr/local/bin/jupyter-kernelspec remove -f python3

tensorflow/training/docker/2.18/py3/Dockerfile.ec2.cpu.core_packages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version_specifier": ">=1.33.13,<2"
44
},
55
"protobuf": {
6-
"version_specifier": ">=3.20.3,<4"
6+
"version_specifier": ">=4.21.12"
77
},
88
"pyyaml": {
99
"version_specifier": ">=6.0,<6.1"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"77740": "[Package: protobuf] Affected versions of this package are vulnerable to a potential Denial of Service (DoS) attack due to unbounded recursion when parsing untrusted Protocol Buffers data. The pure-Python implementation fails to enforce recursion depth limits when processing recursive groups, recursive messages, or a series of SGROUP tags, leading to stack overflow conditions that can crash the application by exceeding Python's recursion limit."
3+
}

tensorflow/training/docker/2.18/py3/Dockerfile.sagemaker.cpu.core_packages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"version_specifier": "<3.0"
77
},
88
"protobuf": {
9-
"version_specifier": ">=3.20.3,<4"
9+
"version_specifier": ">=5.29.5"
1010
},
1111
"pyyaml": {
1212
"version_specifier": ">=6.0,<6.1"
@@ -18,7 +18,7 @@
1818
"version_specifier": ">=20.4.1,<21"
1919
},
2020
"sagemaker-training": {
21-
"version_specifier": ">=4.7.4,<5"
21+
"version_specifier": ">=5"
2222
},
2323
"sagemaker-studio-analytics-extension": {
2424
"version_specifier": "<1"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"77740": "[Package: protobuf] Affected versions of this package are vulnerable to a potential Denial of Service (DoS) attack due to unbounded recursion when parsing untrusted Protocol Buffers data. The pure-Python implementation fails to enforce recursion depth limits when processing recursive groups, recursive messages, or a series of SGROUP tags, leading to stack overflow conditions that can crash the application by exceeding Python's recursion limit."
3+
}

tensorflow/training/docker/2.18/py3/cu125/Dockerfile.ec2.gpu.core_packages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version_specifier": ">=1.33.13,<2"
44
},
55
"protobuf": {
6-
"version_specifier": ">=3.20.3,<4"
6+
"version_specifier": ">=4.21.12"
77
},
88
"pyyaml": {
99
"version_specifier": ">=6.0,<6.1"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"77740": "[Package: protobuf] Affected versions of this package are vulnerable to a potential Denial of Service (DoS) attack due to unbounded recursion when parsing untrusted Protocol Buffers data. The pure-Python implementation fails to enforce recursion depth limits when processing recursive groups, recursive messages, or a series of SGROUP tags, leading to stack overflow conditions that can crash the application by exceeding Python's recursion limit."
3+
}

0 commit comments

Comments
 (0)