mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
genetlink: optionally validate strictly/dumps
Add options to strictly validate messages and dump messages,
sometimes perhaps validating dump messages non-strictly may
be required, so add an option for that as well.
Since none of this can really be applied to existing commands,
set the options everwhere using the following spatch:
@@
identifier ops;
expression X;
@@
struct genl_ops ops[] = {
...,
{
.cmd = X,
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
...
},
...
};
For new commands one should just not copy the .validate 'opt-out'
flags and thus get strict validation.
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
56738f4608
commit
ef6243acb4
37 changed files with 405 additions and 3 deletions
|
|
@ -441,21 +441,25 @@ static int tcmu_genl_set_features(struct sk_buff *skb, struct genl_info *info)
|
|||
static const struct genl_ops tcmu_genl_ops[] = {
|
||||
{
|
||||
.cmd = TCMU_CMD_SET_FEATURES,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.doit = tcmu_genl_set_features,
|
||||
},
|
||||
{
|
||||
.cmd = TCMU_CMD_ADDED_DEVICE_DONE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.doit = tcmu_genl_add_dev_done,
|
||||
},
|
||||
{
|
||||
.cmd = TCMU_CMD_REMOVED_DEVICE_DONE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.doit = tcmu_genl_rm_dev_done,
|
||||
},
|
||||
{
|
||||
.cmd = TCMU_CMD_RECONFIG_DEVICE_DONE,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.doit = tcmu_genl_reconfig_dev_done,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue