netlabel_user.c (59458f40e25915a355d8b1d701425fe9f4f9ea23) netlabel_user.c (de64688ffb952a65ddbc5295ccd235d35f292593)
1/*
2 * NetLabel NETLINK Interface
3 *
4 * This file defines the NETLINK interface for the NetLabel system. The
5 * NetLabel system manages static and dynamic label mappings for network
6 * protocols such as CIPSO and RIPSO.
7 *
8 * Author: Paul Moore <paul.moore@hp.com>

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

41#include <net/netlabel.h>
42#include <asm/bug.h>
43
44#include "netlabel_mgmt.h"
45#include "netlabel_unlabeled.h"
46#include "netlabel_cipso_v4.h"
47#include "netlabel_user.h"
48
1/*
2 * NetLabel NETLINK Interface
3 *
4 * This file defines the NETLINK interface for the NetLabel system. The
5 * NetLabel system manages static and dynamic label mappings for network
6 * protocols such as CIPSO and RIPSO.
7 *
8 * Author: Paul Moore <paul.moore@hp.com>

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

41#include <net/netlabel.h>
42#include <asm/bug.h>
43
44#include "netlabel_mgmt.h"
45#include "netlabel_unlabeled.h"
46#include "netlabel_cipso_v4.h"
47#include "netlabel_user.h"
48
49/* do not do any auditing if audit_enabled == 0, see kernel/audit.c for
50 * details */
51extern int audit_enabled;
52
49/*
50 * NetLabel NETLINK Setup Functions
51 */
52
53/**
54 * netlbl_netlink_init - Initialize the NETLINK communication channel
55 *
56 * Description:

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

96struct audit_buffer *netlbl_audit_start_common(int type,
97 struct netlbl_audit *audit_info)
98{
99 struct audit_context *audit_ctx = current->audit_context;
100 struct audit_buffer *audit_buf;
101 char *secctx;
102 u32 secctx_len;
103
53/*
54 * NetLabel NETLINK Setup Functions
55 */
56
57/**
58 * netlbl_netlink_init - Initialize the NETLINK communication channel
59 *
60 * Description:

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

100struct audit_buffer *netlbl_audit_start_common(int type,
101 struct netlbl_audit *audit_info)
102{
103 struct audit_context *audit_ctx = current->audit_context;
104 struct audit_buffer *audit_buf;
105 char *secctx;
106 u32 secctx_len;
107
108 if (audit_enabled == 0)
109 return NULL;
110
104 audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
105 if (audit_buf == NULL)
106 return NULL;
107
108 audit_log_format(audit_buf, "netlabel: auid=%u", audit_info->loginuid);
109
110 if (audit_info->secid != 0 &&
111 security_secid_to_secctx(audit_info->secid,
112 &secctx,
113 &secctx_len) == 0)
114 audit_log_format(audit_buf, " subj=%s", secctx);
115
116 return audit_buf;
117}
111 audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
112 if (audit_buf == NULL)
113 return NULL;
114
115 audit_log_format(audit_buf, "netlabel: auid=%u", audit_info->loginuid);
116
117 if (audit_info->secid != 0 &&
118 security_secid_to_secctx(audit_info->secid,
119 &secctx,
120 &secctx_len) == 0)
121 audit_log_format(audit_buf, " subj=%s", secctx);
122
123 return audit_buf;
124}