diff options
author | Hyotaek Shim <hyotaek.shim@samsung.com> | 2017-01-31 17:25:36 -0800 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2017-01-31 17:28:11 -0800 |
commit | 3cd1cf51706d2df8256cf8014d01b3d23d553f44 (patch) | |
tree | 0f2ea3f10e03052d2cf04fd39aaf4884b6023d9b /ipc/kdbus/metadata.h | |
parent | e0c79de8722ecd91b1642c4a7f58f43118615f71 (diff) |
Revert "Revert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)""
This reverts commit 80b9e0d4a216cabc94399cc0f7dbb3064fd350ff.
Change-Id: I72edcdc79d93b5b888deb5c210b537cef52fff11
Diffstat (limited to 'ipc/kdbus/metadata.h')
-rw-r--r-- | ipc/kdbus/metadata.h | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/ipc/kdbus/metadata.h b/ipc/kdbus/metadata.h index dba7cc7fdbcb..e8d8433d4b0f 100644 --- a/ipc/kdbus/metadata.h +++ b/ipc/kdbus/metadata.h @@ -16,14 +16,76 @@ #define __KDBUS_METADATA_H #include <linux/kernel.h> +#include <linux/kref.h> +#include <linux/path.h> +#include <linux/sched.h> struct kdbus_conn; struct kdbus_pool_slice; -struct kdbus_meta_proc; struct kdbus_meta_conn; /** + * struct kdbus_meta_proc - Process metadata + * @kref: Reference counting + * @lock: Object lock + * @collected: Bitmask of collected items + * @valid: Bitmask of collected and valid items + * @cred: Credentials + * @pid: PID of process + * @tgid: TGID of process + * @ppid: PPID of process + * @tid_comm: TID comm line + * @pid_comm: PID comm line + * @exe_path: Executable path + * @root_path: Root-FS path + * @cmdline: Command-line + * @cgroup: Full cgroup path + * @seclabel: Seclabel + * @audit_loginuid: Audit login-UID + * @audit_sessionid: Audit session-ID + */ +struct kdbus_meta_proc { + struct kref kref; + struct mutex lock; + u64 collected; + u64 valid; + + /* KDBUS_ITEM_CREDS */ + /* KDBUS_ITEM_AUXGROUPS */ + /* KDBUS_ITEM_CAPS */ + const struct cred *cred; + + /* KDBUS_ITEM_PIDS */ + struct pid *pid; + struct pid *tgid; + struct pid *ppid; + + /* KDBUS_ITEM_TID_COMM */ + char tid_comm[TASK_COMM_LEN]; + /* KDBUS_ITEM_PID_COMM */ + char pid_comm[TASK_COMM_LEN]; + + /* KDBUS_ITEM_EXE */ + struct path exe_path; + struct path root_path; + + /* KDBUS_ITEM_CMDLINE */ + char *cmdline; + + /* KDBUS_ITEM_CGROUP */ + char *cgroup; + + /* KDBUS_ITEM_SECLABEL */ + char *seclabel; + + /* KDBUS_ITEM_AUDIT */ + kuid_t audit_loginuid; + unsigned int audit_sessionid; +}; + + +/** * struct kdbus_meta_fake - Fake metadata * @valid: Bitmask of collected and valid items * @uid: UID of process @@ -56,6 +118,7 @@ struct kdbus_meta_fake { struct kdbus_meta_proc *kdbus_meta_proc_new(void); struct kdbus_meta_proc *kdbus_meta_proc_ref(struct kdbus_meta_proc *mp); struct kdbus_meta_proc *kdbus_meta_proc_unref(struct kdbus_meta_proc *mp); +void kdbus_meta_proc_free(struct kref *mpkref); int kdbus_meta_proc_collect(struct kdbus_meta_proc *mp, u64 what); struct kdbus_meta_fake *kdbus_meta_fake_new(void); |