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
Currently virtio_media_dispatch_ioctl tries to validate the passed input and returns EINVAL it is doesn't pass. The problem is that if the ioctl handler does not override the ioctl, it is supposed to return ENOTTY - which won't happen here, making the driver believe that the ioctl is in fact supported.
I cannot find an ideal solution to this, but the less worse is probably to define a bool constant for each ioctl in the VirtioMediaIoctlHandler trait that defaults to false, and which implementers need to flip to true if they are overriding the ioctl. That way the dispatch method can check if the constant is true, return ENOTTY if it isn't, and then proceed with the validation and handler calling otherwise.
If we go that route the default ioctl implementation should probably panic, as it won't be called unless the implementer overriddes the constant of the ioctl without reimplementing the handler as well.
The text was updated successfully, but these errors were encountered:
Currently
virtio_media_dispatch_ioctl
tries to validate the passed input and returnsEINVAL
it is doesn't pass. The problem is that if the ioctl handler does not override the ioctl, it is supposed to returnENOTTY
- which won't happen here, making the driver believe that the ioctl is in fact supported.I cannot find an ideal solution to this, but the less worse is probably to define a bool constant for each ioctl in the
VirtioMediaIoctlHandler
trait that defaults tofalse
, and which implementers need to flip totrue
if they are overriding the ioctl. That way the dispatch method can check if the constant istrue
, returnENOTTY
if it isn't, and then proceed with the validation and handler calling otherwise.If we go that route the default ioctl implementation should probably panic, as it won't be called unless the implementer overriddes the constant of the ioctl without reimplementing the handler as well.
The text was updated successfully, but these errors were encountered: