]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: do not write error flag to user structure we cannot copy from/to
authorBen Hutchings <ben@decadent.org.uk>
Thu, 26 Jun 2014 00:42:22 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:22 +0000 (10:42 +1000)
commit4c6d0e4201a12822fe927cddfd357b60e1107b87
treee206ce4c450386f3a1075b9351d10d2cff8a3c9b
parent931f878e69365bf157625bda7d05cb67b9ecc54b
ocfs2: do not write error flag to user structure we cannot copy from/to

If we failed to copy from the structure, writing back the flags leaks 31
bits of kernel memory (the rest of the ir_flags field).

In any case, if we cannot copy from/to the structure, why should we expect
putting just the flags to work?

Also make sure ocfs2_info_handle_freeinode() returns the right error code
if the copy_to_user() fails.

Fixes: ddee5cdb70e6 ('Ocfs2: Add new OCFS2_IOC_INFO ioctl for ocfs2 v8.')
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/ioctl.c