-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[v1.9.x] [BUGFIX] Upgrade numpy to <1.20.0 to avoid security vulnerabilities affecting numpy<1.19.1 #20940
Conversation
Hey @DickJC123 , Thanks for submitting the PR
CI supported jobs: [edge, website, windows-cpu, clang, centos-cpu, unix-cpu, sanity, centos-gpu, windows-gpu, unix-gpu, miscellaneous] Note: |
FYI, issue #20869 discussing the numpy upgrade motivation had the comment from @huubvh95:
My feeling on this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @DickJC123 !
…ilities affecting numpy<1.19.1 (apache#20940) * Pin numpy==1.19.1 to demonstrate issues * Relax min numpy version * Make test_np_array_function_protocol delete() testing work with numpy>=1.19 * Fix test_np_delete to also work with numpy>=1.19 * Pip install python module 'packaging' * More pip-install 'packaging' * Update windows requirements.txt * Allow numpy as advanced as 1.19.5
…ilities affecting numpy<1.19.1 (apache#20940) * Pin numpy==1.19.1 to demonstrate issues * Relax min numpy version * Make test_np_array_function_protocol delete() testing work with numpy>=1.19 * Fix test_np_delete to also work with numpy>=1.19 * Pip install python module 'packaging' * More pip-install 'packaging' * Update windows requirements.txt * Allow numpy as advanced as 1.19.5
* [v1.9.x] [BUGFIX] Upgrade numpy to <1.20.0 to avoid security vulnerabilities affecting numpy<1.19.1 (#20940) * Pin numpy==1.19.1 to demonstrate issues * Relax min numpy version * Make test_np_array_function_protocol delete() testing work with numpy>=1.19 * Fix test_np_delete to also work with numpy>=1.19 * Pip install python module 'packaging' * More pip-install 'packaging' * Update windows requirements.txt * Allow numpy as advanced as 1.19.5 * Trigger CI
#20957) * Stop skipping tests mentioned in issue 18600 * Reenable test_np_random_chisquare also * [v1.9.x] [BUGFIX] Upgrade numpy to <1.20.0 to avoid security vulnerabilities affecting numpy<1.19.1 (#20940) * Pin numpy==1.19.1 to demonstrate issues * Relax min numpy version * Make test_np_array_function_protocol delete() testing work with numpy>=1.19 * Fix test_np_delete to also work with numpy>=1.19 * Pip install python module 'packaging' * More pip-install 'packaging' * Update windows requirements.txt * Allow numpy as advanced as 1.19.5 * Fix test_np_random_{beta,f,chisquare}
Description
There are vulnerabilities reported in numpy versions currently used in our CI system, as mentioned in issue #20869:
https://nvd.nist.gov/vuln/detail/CVE-2021-41495
https://nvd.nist.gov/vuln/detail/CVE-2021-41496
These issues require a numpy version >= 1.19.1 to avoid. This PR takes the somewhat conservative approach of only advancing the numpy version to 1.19.5 (actually <1.20.0) in order to avoid the issues, without advancing numpy farther and risking creating additional issues. Note that the numpy version is not restricted to >=1.19.1, since some of the build and test environments do not support numpy 1.19. Thus, with this PR, MXNet will be built to avoid the vulnerabilities if the system supports it.
The unittests that started failing on numpy 1.19 were test_np_delete and test_np_array_function_protocol, due to the change in the way numpy 1.19 delete() interprets the indices-to-delete when supplied as an array. The tests were modified to pass for all versions of numpy, both 1.19 and earlier. See https://numpy.org/doc/stable/release.html for more details.
Checklist
Essentials