30 Apr, 2013
1 commit
-
This patch allows to dump BPF filters attached to a socket with
SO_ATTACH_FILTER.
Note that we check CAP_SYS_ADMIN before allowing to dump this info.For now, only AF_PACKET sockets use this feature.
Signed-off-by: Nicolas Dichtel
Signed-off-by: David S. Miller
24 Feb, 2013
2 commits
-
The sock_diag_lock_handler() and sock_diag_unlock_handler() actually
make the code less readable. Get rid of them and make the lock usage
and access to sock_diag_handlers[] clear on the first sight.Signed-off-by: Mathias Krause
Signed-off-by: David S. Miller -
Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
with a family greater or equal then AF_MAX -- the array size of
sock_diag_handlers[]. The current code does not test for this
condition therefore is vulnerable to an out-of-bound access opening
doors for a privilege escalation.Signed-off-by: Mathias Krause
Acked-by: Eric Dumazet
Signed-off-by: David S. Miller
09 Sep, 2012
1 commit
-
This patch defines netlink_kernel_create as a wrapper function of
__netlink_kernel_create to hide the struct module *me parameter
(which seems to be THIS_MODULE in all existing netlink subsystems).Suggested by David S. Miller.
Signed-off-by: Pablo Neira Ayuso
Signed-off-by: David S. Miller
17 Jul, 2012
1 commit
-
Before this patch sock_diag works for init_net only and dumps
information about sockets from all namespaces.This patch expands sock_diag for all name-spaces.
It creates a netlink kernel socket for each netns and filters
data during dumping.v2: filter accoding with netns in all places
remove an unused variable.Cc: "David S. Miller"
Cc: Alexey Kuznetsov
Cc: James Morris
Cc: Hideaki YOSHIFUJI
Cc: Patrick McHardy
Cc: Pavel Emelyanov
CC: Eric Dumazet
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Andrew Vagin
Acked-by: Pavel Emelyanov
Signed-off-by: David S. Miller
30 Jun, 2012
1 commit
-
This patch adds the following structure:
struct netlink_kernel_cfg {
unsigned int groups;
void (*input)(struct sk_buff *skb);
struct mutex *cb_mutex;
};That can be passed to netlink_kernel_create to set optional configurations
for netlink kernel sockets.I've populated this structure by looking for NULL and zero parameters at the
existing code. The remaining parameters that always need to be set are still
left in the original interface.That includes optional parameters for the netlink socket creation. This allows
easy extensibility of this interface in the future.This patch also adapts all callers to use this new interface.
Signed-off-by: Pablo Neira Ayuso
Signed-off-by: David S. Miller
28 Jun, 2012
1 commit
-
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller
04 Jun, 2012
1 commit
-
Adding socket backlog len in INET_DIAG_SKMEMINFO is really useful to
diagnose various TCP problems.Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
26 Apr, 2012
1 commit
-
read only, so change it to const.
Signed-off-by: Shan Wei
Acked-by: Pavel Emelyanov
Signed-off-by: David S. Miller
31 Dec, 2011
1 commit
-
Add a routine that dumps memory-related values of a socket.
It's made as an array to make it possible to add more stuff
here later without breaking compatibility.Since v1: The SK_MEMINFO_ constants are in userspace
visible part of sock_diag.h, the rest is under __KERNEL__.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller
17 Dec, 2011
2 commits
-
The sk address is used as a cookie between dump/get_exact calls.
It will be required for unix socket sdumping, so move it from
inet_diag to sock_diag.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
I've made a mistake when fixing the sock_/inet_diag aliases :(
1. The sock_diag layer should request the family-based alias,
not just the IPPROTO_IP one;
2. The inet_diag layer should request for AF_INET+protocol alias,
not just the protocol one.Thus fix this.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller
09 Dec, 2011
1 commit
-
These tests are off by one because sock_diag_handlers[] only has AF_MAX
elements.Signed-off-by: Dan Carpenter
Acked-by: Pavel Emelyanov
Signed-off-by: David S. Miller
07 Dec, 2011
1 commit
-
This patch moves the sock_ code from inet_diag.c to generic sock_diag.c
file and provides necessary request_module-s calls and a pointer on
inet_diag_compat dumping routine.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller