You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If somebody does this, it will lead to silent intermittent data corruptions that are always incredibly painful to debug. How hard is this to fix? I think it would be worth fixing for 3.0.
If somebody does this, it will lead to silent intermittent data corruptions that are always incredibly painful to debug. How hard is this to fix? I think it would be worth fixing for 3.0.
I just did a "file & forget" and didn't actually look at how difficult it is to fix.
Will load just fine, even though we would have blocked loading this if the ByReference<T> field was actually a reference type.
It seems blocking this might be a good thing. We can either block this by specifically looking for ByReference<T> fields recursively, or David suggested we could just disallow overlaying byref-like structs with anything (we don't dig into the byref-like struct to find ByReference<T> fields and instead treat the whole struct as something that cannot be unioned with anything). The latter would be a more breaking change.
One argument for not doing anything for this is that the GC doesn't actually mind if the interior pointer points at junk. So maybe we don't need to block this...
Activity
jkotas commentedon Jun 11, 2019
If somebody does this, it will lead to silent intermittent data corruptions that are always incredibly painful to debug. How hard is this to fix? I think it would be worth fixing for 3.0.
MichalStrehovsky commentedon Jun 11, 2019
I just did a "file & forget" and didn't actually look at how difficult it is to fix.
I'll move it to 3.0 and have a look.
Cc @sergiy-k
Prevent loading byref-like types with invalid layout (#25200)
MichalStrehovsky commentedon Jun 18, 2019
I fixed part of this bug described in the initial issue, but this still has a leftover piece:
We currently don't check for people overlaying byref-like things with other things. So:
Will load just fine, even though we would have blocked loading this if the
ByReference<T>field was actually a reference type.It seems blocking this might be a good thing. We can either block this by specifically looking for
ByReference<T>fields recursively, or David suggested we could just disallow overlaying byref-like structs with anything (we don't dig into the byref-like struct to findByReference<T>fields and instead treat the whole struct as something that cannot be unioned with anything). The latter would be a more breaking change.One argument for not doing anything for this is that the GC doesn't actually mind if the interior pointer points at junk. So maybe we don't need to block this...
Thoughts?
Cc @davidwrighton @jkotas
jkotas commentedon Jun 18, 2019
I do not have a strong opinion on this. I would be ok with doing nothing.
MichalStrehovsky commentedon Jun 19, 2019
Happy to close then - this part was grey zone for me. The part we really cared about was fixed with dotnet/coreclr#25200.