Jann Horn
0d9529e1b8
aio: mark AIO pseudo-fs noexec
...
commit 22f6b4d34f upstream.
This ensures that do_mmap() won't implicitly make AIO memory mappings
executable if the READ_IMPLIES_EXEC personality flag is set. Such
behavior is problematic because the security_mmap_file LSM hook doesn't
catch this case, potentially permitting an attacker to bypass a W^X
policy enforced by SELinux.
I have tested the patch on my machine.
To test the behavior, compile and run this:
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/personality.h>
#include <linux/aio_abi.h>
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/syscall.h>
int main(void) {
personality(READ_IMPLIES_EXEC);
aio_context_t ctx = 0;
if (syscall(__NR_io_setup, 1, &ctx))
err(1, "io_setup");
char cmd[1000];
sprintf(cmd, "cat /proc/%d/maps | grep -F '/[aio]'",
(int)getpid());
system(cmd);
return 0;
}
In the output, "rw-s" is good, "rwxs" is bad.
Signed-off-by: Jann Horn <jann@thejh.net >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2016-10-07 15:23:47 +02:00
..
2016-08-10 11:49:27 +02:00
2015-06-30 19:44:57 -07:00
2016-06-07 18:14:32 -07:00
2015-05-11 10:50:17 -04:00
2016-09-30 10:18:37 +02:00
2015-07-04 19:36:06 -07:00
2015-04-26 17:22:07 -07:00
2016-09-30 10:18:38 +02:00
2015-11-16 20:38:43 -05:00
2016-10-07 15:23:42 +02:00
2016-08-20 18:09:20 +02:00
2015-09-10 13:29:01 -07:00
2015-11-20 16:17:32 -08:00
2014-08-08 15:57:25 -07:00
2016-05-04 14:48:41 -07:00
2016-08-16 09:30:49 +02:00
2015-12-01 15:45:05 -05:00
2016-09-15 08:27:47 +02:00
2016-03-03 15:07:09 -08:00
2015-06-25 17:00:42 -07:00
2015-12-12 10:15:34 -08:00
2015-02-22 11:38:41 -05:00
2015-11-16 09:43:54 -08:00
2016-09-24 10:07:35 +02:00
2016-09-24 10:07:34 +02:00
2015-11-20 16:17:32 -08:00
2015-08-07 13:59:24 +02:00
2015-11-11 02:11:02 -05:00
2016-09-24 10:07:41 +02:00
2015-11-13 18:02:30 -08:00
2015-09-10 13:29:01 -07:00
2015-11-13 20:34:32 -05:00
2016-09-30 10:18:39 +02:00
2016-06-01 12:15:54 -07:00
2016-02-25 12:01:22 -08:00
2016-05-18 17:06:54 -07:00
2016-08-20 18:09:20 +02:00
2016-03-16 08:42:58 -07:00
2015-11-09 15:11:24 -08:00
2016-09-24 10:07:36 +02:00
2015-11-11 20:11:28 -08:00
2015-11-06 17:50:42 -08:00
2015-07-04 19:36:06 -07:00
2016-03-16 08:42:59 -07:00
2016-10-07 15:23:45 +02:00
2015-08-13 10:22:06 -04:00
2016-09-24 10:07:36 +02:00
2016-08-10 11:49:25 +02:00
2014-01-25 03:14:05 -05:00
2016-09-30 10:18:37 +02:00
2015-11-06 17:50:42 -08:00
2016-09-30 10:18:34 +02:00
2015-05-28 18:25:19 -07:00
2014-03-13 10:14:33 -04:00
2016-09-15 08:27:52 +02:00
2016-09-24 10:07:36 +02:00
2016-10-07 15:23:44 +02:00
2014-03-13 10:14:33 -04:00
2015-06-23 18:02:00 -04:00
2016-04-12 09:08:56 -07:00
2015-10-16 11:42:28 -07:00
2016-09-30 10:18:34 +02:00
2015-04-11 22:29:40 -04:00
2015-11-13 20:34:33 -05:00
2016-09-07 08:32:46 +02:00
2015-11-23 21:11:08 -05:00
2015-11-04 22:13:45 -05:00
2016-09-15 08:27:53 +02:00
2016-02-25 12:01:18 -08:00
2015-09-09 10:43:12 -07:00
2016-09-30 10:18:37 +02:00
2016-10-07 15:23:47 +02:00
2014-03-27 09:52:54 -07:00
2014-06-10 13:57:22 -07:00
2015-02-20 04:03:58 -05:00
2014-11-19 13:01:20 -05:00
2015-11-10 12:07:22 -08:00
2015-11-11 09:45:24 -08:00
2014-12-13 12:42:51 -08:00
2014-06-04 16:54:21 -07:00
2015-04-26 17:22:07 -07:00
2014-12-13 12:42:51 -08:00
2015-12-04 11:02:17 -07:00
2015-11-11 02:19:33 -05:00
2015-08-05 13:49:35 -07:00
2014-03-04 08:05:21 +00:00
2015-10-23 23:26:43 +02:00
2014-10-31 17:48:54 -04:00
2016-04-12 09:08:58 -07:00
2015-11-16 23:54:45 -08:00
2016-08-16 09:30:50 +02:00
2014-01-29 16:22:40 -08:00
2016-03-03 15:07:28 -08:00
2015-08-17 18:39:46 -04:00
2015-02-17 14:34:52 -08:00
2015-02-13 21:21:40 -08:00
2015-07-10 10:39:25 -05:00
2015-01-08 15:10:52 -08:00
2016-04-12 09:08:58 -07:00
2015-08-07 04:39:40 +03:00
2015-11-05 23:05:32 -08:00
2014-04-03 16:21:05 -07:00
2015-04-09 11:39:55 -05:00
2013-11-06 12:40:26 +01:00
2016-04-12 09:09:04 -07:00
2016-08-10 11:49:30 +02:00
2015-08-17 23:38:10 -04:00
2015-02-10 14:30:30 -08:00
2015-11-16 23:54:45 -08:00
2015-04-14 16:49:05 -07:00
2015-08-12 15:28:45 -05:00
2016-08-10 11:49:27 +02:00
2015-10-15 10:33:21 -04:00
2014-06-25 22:08:29 -04:00
2015-06-30 19:44:56 -07:00
2015-11-06 17:50:42 -08:00
2016-09-15 08:27:49 +02:00
2016-08-10 11:49:27 +02:00
2015-09-11 15:21:34 -07:00
2016-05-18 17:06:48 -07:00
2016-06-07 18:14:35 -07:00
2016-05-11 11:21:19 +02:00
2015-07-22 20:33:27 -05:00
2016-07-27 09:47:30 -07:00
2016-04-12 09:08:55 -07:00
2015-04-11 22:29:46 -04:00
2014-10-31 17:48:54 -04:00
2015-05-19 08:32:00 +02:00
2016-09-07 08:32:43 +02:00
2015-08-07 04:39:40 +03:00
2016-04-12 09:08:55 -07:00
2014-08-26 09:35:56 +02:00
2015-11-09 15:11:24 -08:00
2013-10-12 13:12:31 -07:00
2016-03-09 15:34:52 -08:00
2015-11-06 17:50:42 -08:00
2016-02-25 12:01:25 -08:00
2016-03-16 08:43:01 -07:00
2013-11-09 00:16:44 -05:00
2015-11-13 20:34:33 -05:00