]> git.baikalelectronics.ru Git - kernel.git/commit
filter: add a security check at install time
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 1 Dec 2010 20:46:24 +0000 (20:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Dec 2010 20:59:09 +0000 (12:59 -0800)
commite12f790cc95f3b82cd345b0952eb6b90eaa6dd19
treed86fcab7044baa6ec41ef87b8eca186ae6f9ea89
parent8fd9bcc727aefbb962e9ce90a7150f692c9f3650
filter: add a security check at install time

We added some security checks in commit 09e8e0b17389
(filter: make sure filters dont read uninitialized memory) to close a
potential leak of kernel information to user.

This added a potential extra cost at run time, while we can perform a
check of the filter itself, to make sure a malicious user doesnt try to
abuse us.

This patch adds a check_loads() function, whole unique purpose is to
make this check, allocating a temporary array of mask. We scan the
filter and propagate a bitmask information, telling us if a load M(K) is
allowed because a previous store M(K) is guaranteed. (So that
sk_run_filter() can possibly not read unitialized memory)

Note: this can uncover application bug, denying a filter attach,
previously allowed.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Changli Gao <xiaosuo@gmail.com>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c