jffs2: Fix use-after-free bug in jffs2_iget()'s error handling path
[pandora-kernel.git] / crypto / crypto_user.c
index 5b63b8d..a1d5866 100644 (file)
@@ -390,8 +390,12 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                if (link->dump == NULL)
                        return -EINVAL;
 
-               return netlink_dump_start(crypto_nlsk, skb, nlh,
+               down_read(&crypto_alg_sem);
+               err = netlink_dump_start(crypto_nlsk, skb, nlh,
                                          link->dump, link->done, 0);
+               up_read(&crypto_alg_sem);
+
+               return err;
        }
 
        err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,