[PATCH] Bug fixes and cleanup for the BSD Secure Levels LSM
[PATCH] Bug fixes and cleanup for the BSD Secure Levels LSM

This patch address several issues in the current BSD Secure Levels code:

o plaintext_to_sha1: Missing check for a NULL return from __get_free_page

o passwd_write_file: A page is leaked if the password is wrong.

o fix securityfs registration order

o seclvl_init is a mess and can't properly tolerate failures, failure
  path is upside down (deldif and delf should be switched)

Cleanups:

o plaintext_to_sha1: Use buffers passed in
o passwd_write_file: Use kmalloc() instead of get_zeroed_page()
o passwd_write_file: hashedPassword comparison is just memcmp
o s/ENOSYS/EINVAL/
o misc

(akpm: after some discussion it appears that the BSD secure levels feature
should be scheduled for removal.  But for now, let's fix these problems up).

Signed-off-by: Davi Arnaut <a6d9b7b26d530e46931acf2f9d1cd8673c1fca08@gmail.com>
Cc: Michael Halcrow <8c1011c9d06fc72acd93645d683782ab9543044d@us.ibm.com>
Cc: Chris Wright <e829bd48de90b6e1a1950750fa8ca2bb62f273d4@sous-sol.org>
Cc: Stephen Smalley <d6e1285e1c84d3d5885c2124fdacc780e9fc0a94@epoch.ncsc.mil>
Cc: James Morris <10d11de3abc355eabe955bb734f0f8e71da56e16@namei.org>
Cc: Serge Hallyn <dd6cacb2d07f0aa354aa6e74c149a3580e5a1db1@us.ibm.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas