]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: pad nla_memcpy dest buffer with zeroes
authorJiri Benc <jbenc@redhat.com>
Sun, 29 Mar 2015 14:05:28 +0000 (16:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 18:07:24 +0000 (14:07 -0400)
commitbcc32e3a85f72d257ecd75cb82c92cb2d1ae7e69
treeb260bb0d9c9089954268ba60a625f0d995334060
parent0eff935ac0768884041c08d3301511dd9201e204
netlink: pad nla_memcpy dest buffer with zeroes

This is especially important in cases where the kernel allocs a new
structure and expects a field to be set from a netlink attribute. If such
attribute is shorter than expected, the rest of the field is left containing
previous data. When such field is read back by the user space, kernel memory
content is leaked.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/nlattr.c