kernel-ark/security/tomoyo
Tetsuo Handa e0b057b406 TOMOYO: Fix incomplete read after seek.
Commit f23571e8 "TOMOYO: Copy directly to userspace buffer." introduced
tomoyo_flush() that flushes data to be read as soon as possible.
tomoyo_select_domain() (which is called by write()) enqueues data which meant
to be read by next read(), but previous read()'s read buffer's size was not
cleared. As a result, since 2.6.36, sequence like

   char *cp = "select global-pid=1\n";
   read(fd, buf1, sizeof(buf1));
   write(fd, cp, strlen(cp));
   read(fd, buf2, sizeof(buf2));

causes enqueued data to be flushed to buf1 rather than buf2.
Fix this bug by clearing read buffer's size upon write() request.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
2011-10-22 21:55:26 +02:00
..
audit.c TOMOYO: Allow controlling generation of access granted logs for per an entry basis. 2011-09-14 08:27:06 +10:00
common.c TOMOYO: Fix incomplete read after seek. 2011-10-22 21:55:26 +02:00
common.h TOMOYO: Remove tomoyo_policy_memory_lock spinlock. 2011-09-26 10:46:22 +10:00
condition.c TOMOYO: Simplify garbage collector. 2011-09-26 10:46:20 +10:00
domain.c TOMOYO: Fix domain transition failure warning. 2011-09-28 11:53:15 +10:00
environ.c TOMOYO: Add environment variable name restriction support. 2011-09-14 08:27:05 +10:00
file.c TOMOYO: Fix make namespacecheck warnings. 2011-09-26 10:46:19 +10:00
gc.c TOMOYO: Fix quota and garbage collector. 2011-10-12 12:15:20 +11:00
group.c TOMOYO: Add socket operation restriction support. 2011-09-14 08:27:05 +10:00
Kconfig TOMOYO: Add socket operation restriction support. 2011-09-14 08:27:05 +10:00
load_policy.c TOMOYO: Update kernel-doc. 2011-07-14 17:50:03 +10:00
Makefile TOMOYO: Bump version. 2011-09-15 08:14:21 +10:00
memory.c TOMOYO: Remove tomoyo_policy_memory_lock spinlock. 2011-09-26 10:46:22 +10:00
mount.c TOMOYO: Update kernel-doc. 2011-07-14 17:50:03 +10:00
network.c TOMOYO: Add socket operation restriction support. 2011-09-14 08:27:05 +10:00
realpath.c TOMOYO: Add socket operation restriction support. 2011-09-14 08:27:05 +10:00
securityfs_if.c TOMOYO: Fix make namespacecheck warnings. 2011-09-26 10:46:19 +10:00
tomoyo.c TOMOYO: Add socket operation restriction support. 2011-09-14 08:27:05 +10:00
util.c TOMOYO: Fix quota and garbage collector. 2011-10-12 12:15:20 +11:00