[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

Burakov, Anatoly anatoly.burakov at intel.com
Mon Dec 8 19:47:26 CET 2014


Hi Michael

> I don't think so, if we check module "vfio", but if given  module name is
> "vfio_xx", it will also correct if use strncmp.

Sorry I missed this the last time. I don't think that is the case. If you do strncmp on sizeof(buffer), strncmp will always check 30 bytes. That way if you check vfio against vfio_xx, you'll get a mismatch. Of course, replacing fscanf with fgets would be better too, to make sure we never go over our buffer size when dealing with /proc/modules. 

Thanks,
Anatoly 


More information about the dev mailing list