inet_diag: Make sure we actually run the same bytecode we audited.
commit2dbba29d47e24703420d9331fb9bddeba4a38506
authorNelson Elhage <nelhage@ksplice.com>
Wed, 3 Nov 2010 16:35:41 +0000 (3 16:35 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 14 Apr 2011 23:53:52 +0000 (14 16:53 -0700)
treecfc7804832f3dfc720ddf9489fd15322bd74f1df
parent4312007ec44ba76536bd660a236701a7de21e98b
inet_diag: Make sure we actually run the same bytecode we audited.

commit 22e76c849d505d87c5ecf3d3e6742a65f0ff4860 upstream.

We were using nlmsg_find_attr() to look up the bytecode by attribute when
auditing, but then just using the first attribute when actually running
bytecode. So, if we received a message with two attribute elements, where only
the second had type INET_DIAG_REQ_BYTECODE, we would validate and run different
bytecode strings.

Fix this by consistently using nlmsg_find_attr everywhere.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: Thomas Graf <tgraf@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[jmm: Slightly adapted to apply against 2.6.32]
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/inet_diag.c