-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FIX Prevents segfault in SVC when internals are altered #21336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
There is an issue in building the docs, maybe the following suggestion would fix it. Ortherwise LGTM. Thanks @thomasjpfan !
I think checking before calling the low level functions, as done currently, is better, since this is also an issue without pickling. |
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.
I think checking before calling the low level functions, as done currently, is better, since this is also an issue without pickling.
Or we could do it at the beginning of the native code function itself.
Anyways, I am fine the current fix if it allows to get rid of the CVE.
I find this CVE hypocrite because of course, if you write a program that mutates the internal datastructures of this same program using private API you will always be able to make it segfault.
You can even do that with the Python standard library (e.g. with the ctypes module for instance) without the need for the compiled code of scikit-learn if you wish...
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
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com> Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
I moved the entry of the changelog in 1.0.1 and tag it for backport |
Reference Issues/PRs
Fixes #18891
What does this implement/fix? Explain your changes.
As stated in #18891 (comment), as a CVE (CVE-2020-28975) it would be good to fix this.
We normally do not perform checks on internal attributes that was set during
fit
.Any other comments?
The check can also be performed in
__setstate__
.CC @rth