Open
Description
Version affected: c7da937
Problematic code:
https://github.com/svinota/pyroute2/blob/c7da937999dc59167f81f9466c80e891fb7be736/pyroute2/ethtool/ioctl.py#L284C14-L284C14
It turns out that comment
# If you have more than 256 features on your NIC
# they will not be seen by it
... is not correct. The code outright segfaults if number of strings returned exceeds hardcoded value. Easiest way to test is to manually drop the number to a small value, but it is practical problem e.g. in AWS VM type c5n.18xlarge
which can return 1105 strings.
We already know the correct values from ioctl ETHTOOL_GSSET_INFO
but it is not used in structure definition or checked anywhere. I might try to fix it but it will require redefining array sizes dynamically, I think.
Activity