Thank you for the detailed review! I updated the fix to be more targeted.
/*enable_extra_handles_validation=*/true, GetUIThreadTaskRunner({}));TzarialThis will break chrome os and linux. There is reason why we added this bool and not just turned the validation everywhere and it is because we don't know the memory layout that fd points to, so knowing format+size is not enough to validate the file descriptor size.
Removed this and added more targeted logic.
base::CheckedNumeric<uint64_t> min_required = size.width();TzarialNot sure I understood the logic here. This checks that fd has size that is at least width*height bytes, while we know that in most cases we'd need more? How does this help?
If the assumption that we need _at least_ this amount, it's not true either in general case, it can be smaller.
Changed to use GetMemoryRequirements(0), so that it gets the size the driver expects for the specific image format, tiling, and modifiers.
if (static_cast<uint64_t>(fd_size) < handle.planes[i].size) {TzarialThis can't work because we don't know the size unfortunately. On ChromeOS is might be somewhat usable, it's completely made up number on linux.
Removed this query.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (static_cast<uint64_t>(fd_size) < requirements.size) {I guess it's as good as it gets, though it's not quite the right thing either, because:
We did see both in the past, so please add a kill-switch and DumpWithoutCrashing so we can see early if this actually breaks legit flows.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |