ecryptfs: avoid ctx initialization race
authorKees Cook <keescook@chromium.org>
Tue, 13 Aug 2013 22:02:27 +0000 (15:02 -0700)
committerTyler Hicks <tyhicks@canonical.com>
Fri, 6 Sep 2013 23:58:18 +0000 (16:58 -0700)
It might be possible for two callers to race the mutex lock after the
NULL ctx check. Instead, move the lock above the check so there isn't
the possibility of leaking a crypto ctx. Additionally, report the full
algo name when failing.

Signed-off-by: Kees Cook <keescook@chromium.org>
[tyhicks: remove out label, which is no longer used]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>

No differences found