]> git.baikalelectronics.ru Git - kernel.git/commit
fs: fix lock initialization
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 6 Jul 2011 10:33:55 +0000 (12:33 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 6 Jul 2011 17:41:13 +0000 (10:41 -0700)
commit93f89dd7b796fef4d7206e044e3a2152051d8cce
treeb6289a258d552b9c0daea02b898425d911f4fee9
parentc3d1943aaf966cfb0081b511d73c46f5ec9c43e0
fs: fix lock initialization

locks_alloc_lock() assumed that the allocated struct file_lock is
already initialized to zero members.  This is only true for the first
allocation of the structure, after reuse some of the members will have
random values.

This will for example result in passing random fl_start values to
userspace in fuse for FL_FLOCK locks, which is an information leak at
best.

Fix by reinitializing those members which may be non-zero after freeing.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/locks.c