<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font size="+2">Hi,<br>
      <br>
      The output of the AES-GCM encryption or decryption  is corrupted
      if the buffer crosses a page boundary.<br>
      The culprit appears to be omap_crypto_cleanup(),
      scatterwalk_map_and_copy should only be called in the
      OMAP_CRYPTO_DATA_COPIED case.<br>
      Currently the copy is also done in the
      OMAP_CRYPTO_BAD_DATA_LENGTH, resulting in random kernel data in
      the user output buffer.<br>
      <br>
      With the patch below, the operations are fine.<br>
      <br>
      diff --git a/drivers/crypto/omap-crypto.c
      b/drivers/crypto/omap-crypto.c                                          
      <br>
      index 2c42e4b..cde56ea
100644                                                                                     
      <br>
      ---
a/drivers/crypto/omap-crypto.c                                                                                
      <br>
      +++
b/drivers/crypto/omap-crypto.c                                                                                
      <br>
      @@ -173,7 +173,7 @@ void omap_crypto_cleanup(struct scatterlist
      *sg, struct scatterlist *orig,<br>
              buf =
sg_virt(sg);                                                                                        
      <br>
              pages =
get_order(len);                                                                                   
      <br>
                                                                                                                  
      <br>
      -       if (orig && (flags &
OMAP_CRYPTO_COPY_MASK))                                                              
      <br>
      +       if (orig && (flags &
OMAP_CRYPTO_DATA_COPIED))                                                            
      <br>
                      scatterwalk_map_and_copy(buf, orig, offset, len,
      1);                                               <br>
                                                                                                                  
      <br>
              if (flags &
OMAP_CRYPTO_DATA_COPIED)                                                                      
      <br>
      <br>
      <br>
       <br>
      <br>
       <br>
    </font>
  </body>
</html>