The ND_CMD_CALL format allows for a general passthrough of passlisted commands targeting a given command set. However there is no validation of the family index relative to what the bus supports. - Update the NFIT bus implementation (the only one that supports ND_CMD_CALL passthrough) to also passlist the valid set of command family indices. - Update the generic __nd_ioctl() path to validate that field on behalf of all implementations.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -245,6 +245,10 @@ struct nd_cmd_pkg { · 244 unmodified lines | |||
| 245 | #define NVDIMM_FAMILY_MSFT 3 | 245 | #define NVDIMM_FAMILY_MSFT 3 |
| 246 | #define NVDIMM_FAMILY_HYPERV 4 | 246 | #define NVDIMM_FAMILY_HYPERV 4 |
| 247 | #define NVDIMM_FAMILY_PAPR 5 | 247 | #define NVDIMM_FAMILY_PAPR 5 |
| 248 | #define NVDIMM_FAMILY_MAX NVDIMM_FAMILY_PAPR | ||
| 249 | |||
| 250 | #define NVDIMM_BUS_FAMILY_NFIT 0 | ||
| 251 | #define NVDIMM_BUS_FAMILY_MAX NVDIMM_BUS_FAMILY_NFIT | ||
| 248 | 252 | ||
| 249 | #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\ | 253 | #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\ |
| 250 | struct nd_cmd_pkg) | 254 | struct nd_cmd_pkg) |