aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/tomoyo/common.c17
-rw-r--r--security/tomoyo/common.h2
-rw-r--r--security/tomoyo/securityfs_if.c14
3 files changed, 33 insertions, 0 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 65c18af3ffe5..bff63929e53d 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -1898,6 +1898,23 @@ int tomoyo_open_control(const u8 type, struct file *file)
1898} 1898}
1899 1899
1900/** 1900/**
1901 * tomoyo_poll_control - poll() for /sys/kernel/security/tomoyo/ interface.
1902 *
1903 * @file: Pointer to "struct file".
1904 * @wait: Pointer to "poll_table".
1905 *
1906 * Waits for read readiness.
1907 * /sys/kernel/security/tomoyo/query is handled by /usr/sbin/tomoyo-queryd .
1908 */
1909int tomoyo_poll_control(struct file *file, poll_table *wait)
1910{
1911 struct tomoyo_io_buffer *head = file->private_data;
1912 if (!head->poll)
1913 return -ENOSYS;
1914 return head->poll(file, wait);
1915}
1916
1917/**
1901 * tomoyo_read_control - read() for /sys/kernel/security/tomoyo/ interface. 1918 * tomoyo_read_control - read() for /sys/kernel/security/tomoyo/ interface.
1902 * 1919 *
1903 * @file: Pointer to "struct file". 1920 * @file: Pointer to "struct file".
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index b8b2dac656f1..2ffad6138555 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -705,6 +705,8 @@ void tomoyo_check_profile(void);
705int tomoyo_open_control(const u8 type, struct file *file); 705int tomoyo_open_control(const u8 type, struct file *file);
706/* Close /sys/kernel/security/tomoyo/ interface. */ 706/* Close /sys/kernel/security/tomoyo/ interface. */
707int tomoyo_close_control(struct file *file); 707int tomoyo_close_control(struct file *file);
708/* Poll operation for /sys/kernel/security/tomoyo/ interface. */
709int tomoyo_poll_control(struct file *file, poll_table *wait);
708/* Read operation for /sys/kernel/security/tomoyo/ interface. */ 710/* Read operation for /sys/kernel/security/tomoyo/ interface. */
709int tomoyo_read_control(struct file *file, char __user *buffer, 711int tomoyo_read_control(struct file *file, char __user *buffer,
710 const int buffer_len); 712 const int buffer_len);
diff --git a/security/tomoyo/securityfs_if.c b/security/tomoyo/securityfs_if.c
index 5eb53510c4a7..9967c1c5c713 100644
--- a/security/tomoyo/securityfs_if.c
+++ b/security/tomoyo/securityfs_if.c
@@ -38,6 +38,19 @@ static int tomoyo_release(struct inode *inode, struct file *file)
38} 38}
39 39
40/** 40/**
41 * tomoyo_poll - poll() for /proc/ccs/ interface.
42 *
43 * @file: Pointer to "struct file".
44 * @wait: Pointer to "poll_table".
45 *
46 * Returns 0 on success, negative value otherwise.
47 */
48static unsigned int tomoyo_poll(struct file *file, poll_table *wait)
49{
50 return tomoyo_poll_control(file, wait);
51}
52
53/**
41 * tomoyo_read - read() for /sys/kernel/security/tomoyo/ interface. 54 * tomoyo_read - read() for /sys/kernel/security/tomoyo/ interface.
42 * 55 *
43 * @file: Pointer to "struct file". 56 * @file: Pointer to "struct file".
@@ -79,6 +92,7 @@ static ssize_t tomoyo_write(struct file *file, const char __user *buf,
79static const struct file_operations tomoyo_operations = { 92static const struct file_operations tomoyo_operations = {
80 .open = tomoyo_open, 93 .open = tomoyo_open,
81 .release = tomoyo_release, 94 .release = tomoyo_release,
95 .poll = tomoyo_poll,
82 .read = tomoyo_read, 96 .read = tomoyo_read,
83 .write = tomoyo_write, 97 .write = tomoyo_write,
84}; 98};