]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: tunnels: check the return value of nla_nest_start()
authorLi Zhong <floridsleeves@gmail.com>
Wed, 21 Sep 2022 18:17:16 +0000 (11:17 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Sep 2022 02:28:10 +0000 (19:28 -0700)
commit5be70f0eda7b585d4e4b89d7b0977e0a9f2f2a87
tree4a94325226d760e9fd9aea976676f47e74850979
parent4ab727bf493316a1a33502f496b706b695ce7165
ethtool: tunnels: check the return value of nla_nest_start()

Check the return value of nla_nest_start(). When starting the entry
level nested attributes, if the tailroom of socket buffer is
insufficient to store the attribute header and payload, the return value
will be NULL.

There is, however, no real bug here since if the skb is full
nla_put_be16() will fail as well and we'll error out.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
Link: https://lore.kernel.org/r/20220921181716.1629541-1-floridsleeves@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/tunnels.c