blob: 821b2f2609926636a6b88c5e25cb23ecc8f92806 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX_IPC_H
3#define _LINUX_IPC_H
4
Robert P. J. Day0a3021f2007-07-15 23:39:57 -07005#include <linux/spinlock.h>
Eric W. Biederman1efdb692012-02-07 16:54:11 -08006#include <linux/uidgid.h>
Guillaume Knispel0cfb6ae2017-09-08 16:17:55 -07007#include <linux/rhashtable.h>
David Howells607ca462012-10-13 10:46:48 +01008#include <uapi/linux/ipc.h>
Elena Reshetova9405c032017-09-08 16:17:45 -07009#include <linux/refcount.h>
Cedric Le Goaterb119f132006-10-04 02:15:19 -070010
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
12
13/* used by in-kernel data structures */
Davidlohr Bueso60f3e002017-05-08 15:57:06 -070014struct kern_ipc_perm {
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 spinlock_t lock;
Rafael Aquini72a8ff22014-01-27 17:07:02 -080016 bool deleted;
Nadia Derbey7ca7e562007-10-18 23:40:48 -070017 int id;
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 key_t key;
Eric W. Biederman1efdb692012-02-07 16:54:11 -080019 kuid_t uid;
20 kgid_t gid;
21 kuid_t cuid;
22 kgid_t cgid;
Davidlohr Bueso60f3e002017-05-08 15:57:06 -070023 umode_t mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 unsigned long seq;
25 void *security;
Manfred Sprauldba4cdd2017-07-12 14:34:41 -070026
Guillaume Knispel0cfb6ae2017-09-08 16:17:55 -070027 struct rhash_head khtnode;
28
Manfred Sprauldba4cdd2017-07-12 14:34:41 -070029 struct rcu_head rcu;
Elena Reshetova9405c032017-09-08 16:17:45 -070030 refcount_t refcount;
Kees Cook3859a272016-10-28 01:22:25 -070031} ____cacheline_aligned_in_smp __randomize_layout;
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#endif /* _LINUX_IPC_H */