mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
fib, fib6: reject invalid feature bits
Feature bits that are invalid should not be accepted by the kernel, only the lower 4 bits may be configured, but not the remaining ones. Even from these 4, 2 of them are unused. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
1bb14807bc
commit
b8d3e4163a
3 changed files with 11 additions and 4 deletions
|
|
@ -908,6 +908,8 @@ fib_convert_metrics(struct fib_info *fi, const struct fib_config *cfg)
|
|||
val = 65535 - 40;
|
||||
if (type == RTAX_MTU && val > 65535 - 15)
|
||||
val = 65535 - 15;
|
||||
if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK))
|
||||
return -EINVAL;
|
||||
fi->fib_metrics[type - 1] = val;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue