From 5d4c935b8a1ea8bb0efed11b204de06f96fdb6b1 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Fri, 8 Jan 2016 21:31:04 +0800 Subject: [PATCH] crypto: algif_hash - Require setkey before accept(2) commit 6de62f15b581f920ade22d758f4c338311c2f0d4 upstream. Hash implementations that require a key may crash if you use them without setting a key. This patch adds the necessary checks so that if you do attempt to use them without a key that we return -ENOKEY instead of proceeding. This patch also adds a compatibility path to support old applications that do acept(2) before setkey. Signed-off-by: Herbert Xu [bwh: Backported to 3.2: - Add struct kiocb * parameter to {recv,send}msg ops - Adjust context] Signed-off-by: Ben Hutchings --- Reading git-format-patch failed