[CRYPTO] Add alignmask for low-level cipher implementations
[deliverable/linux.git] / crypto / api.c
index 394169a8577d0643df6b9995abbfbb2049039228..f55856b219927e082b83627e4564c7ef3879bef2 100644 (file)
@@ -168,6 +168,12 @@ int crypto_register_alg(struct crypto_alg *alg)
 {
        int ret = 0;
        struct crypto_alg *q;
+
+       if (alg->cra_alignmask & (alg->cra_alignmask + 1))
+               return -EINVAL;
+
+       if (alg->cra_alignmask > PAGE_SIZE)
+               return -EINVAL;
        
        down_write(&crypto_alg_sem);
        
This page took 0.025778 seconds and 5 git commands to generate.