diff options
author | Anton Ivanov <anton.ivanov@cambridgegreys.com> | 2019-08-09 08:40:19 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2019-09-15 21:37:09 +0200 |
commit | 5853193103e6e3be983cc86d61b204ed27a22716 (patch) | |
tree | 1310c29e079015940dba8441b428f0423c551bf0 /arch/um | |
parent | 77f1073c2c1bbea7ba8794103924ecd0d3961ffe (diff) |
um: Add checks to mtu parameter parsing
Adds a sanity check to the parsing of mtu command line param
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/vector_kern.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 8fa094770965..45ec9bc2430f 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -121,7 +121,8 @@ static int get_mtu(struct arglist *def) if (mtu != NULL) { if (kstrtoul(mtu, 10, &result) == 0) - return result; + if ((result < (1 << 16) - 1) && (result >= 576)) + return result; } return ETH_MAX_PACKET; } |