1
0
Fork 0

plugin_net: validate nf_conntrack_hashsize before converting to int

Signed-off-by: xiejing <xiejing@kylinos.cn>
This commit is contained in:
xiejing 2026-06-09 21:09:18 +08:00
parent 0eb28ac3d8
commit 4f1de6aa7b

View file

@ -503,7 +503,12 @@ class NetTuningPlugin(hotplug.Plugin):
if value is None:
return None
hashsize = int(value)
try:
hashsize = int(value)
except ValueError:
log.warning("nf_conntrack_hashsize value '%s' is not integer" % value)
return None
if hashsize >= 0:
if not sim:
self._cmd.write_to_file(self._nf_conntrack_hashsize_path(), hashsize, \