netif.c (3d5271f9883cba7b54762bc4fe027d4172f06db7) netif.c (e9dc86534051b78e41e5b746cccc291b57a3a311)
1/*
2 * Network interface table.
3 *
4 * Network interfaces (devices) do not have a security field, so we
5 * maintain a table associating each interface with a SID.
6 *
7 * Author: James Morris <jmorris@redhat.com>
8 *

--- 6 unchanged lines hidden (view full) ---

15#include <linux/init.h>
16#include <linux/types.h>
17#include <linux/stddef.h>
18#include <linux/kernel.h>
19#include <linux/list.h>
20#include <linux/notifier.h>
21#include <linux/netdevice.h>
22#include <linux/rcupdate.h>
1/*
2 * Network interface table.
3 *
4 * Network interfaces (devices) do not have a security field, so we
5 * maintain a table associating each interface with a SID.
6 *
7 * Author: James Morris <jmorris@redhat.com>
8 *

--- 6 unchanged lines hidden (view full) ---

15#include <linux/init.h>
16#include <linux/types.h>
17#include <linux/stddef.h>
18#include <linux/kernel.h>
19#include <linux/list.h>
20#include <linux/notifier.h>
21#include <linux/netdevice.h>
22#include <linux/rcupdate.h>
23#include <net/net_namespace.h>
23
24#include "security.h"
25#include "objsec.h"
26#include "netif.h"
27
28#define SEL_NETIF_HASH_SIZE 64
29#define SEL_NETIF_HASH_MAX 1024
30

--- 198 unchanged lines hidden (view full) ---

229 return 0;
230}
231
232static int sel_netif_netdev_notifier_handler(struct notifier_block *this,
233 unsigned long event, void *ptr)
234{
235 struct net_device *dev = ptr;
236
24
25#include "security.h"
26#include "objsec.h"
27#include "netif.h"
28
29#define SEL_NETIF_HASH_SIZE 64
30#define SEL_NETIF_HASH_MAX 1024
31

--- 198 unchanged lines hidden (view full) ---

230 return 0;
231}
232
233static int sel_netif_netdev_notifier_handler(struct notifier_block *this,
234 unsigned long event, void *ptr)
235{
236 struct net_device *dev = ptr;
237
238 if (dev->nd_net != &init_net)
239 return NOTIFY_DONE;
240
237 if (event == NETDEV_DOWN)
238 sel_netif_kill(dev);
239
240 return NOTIFY_DONE;
241}
242
243static struct notifier_block sel_netif_netdev_notifier = {
244 .notifier_call = sel_netif_netdev_notifier_handler,

--- 25 unchanged lines hidden ---
241 if (event == NETDEV_DOWN)
242 sel_netif_kill(dev);
243
244 return NOTIFY_DONE;
245}
246
247static struct notifier_block sel_netif_netdev_notifier = {
248 .notifier_call = sel_netif_netdev_notifier_handler,

--- 25 unchanged lines hidden ---