]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cifs: extra sanity checking for cifs.idmap keys
authorJeff Layton <jlayton@redhat.com>
Mon, 5 Nov 2012 11:47:04 +0000 (06:47 -0500)
committerJeff Layton <jlayton@redhat.com>
Mon, 5 Nov 2012 11:47:04 +0000 (06:47 -0500)
commitf09b9cbbc6999dac18436d8d4355b04d05554a48
treefaf952d5f0e694214546766a24bb4ad37f4d7fc7
parent9a62c2ccbc9ea2fe7013d3f63f7a0582dc29b356
cifs: extra sanity checking for cifs.idmap keys

Now that we aren't so rigid about the length of the key being passed
in, we need to be a bit more rigorous about checking the length of
the actual data against the claimed length (a'la num_subauths field).

Check for the case where userspace sends us a seemingly valid key
with a num_subauths field that goes beyond the end of the array. If
that happens, return -EIO and invalidate the key.

Also change the other places where we check for malformed keys in this
code to invalidate the key as well.

Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
fs/cifs/cifsacl.c