[bug report] chcr: Add support for Inline IPSec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Atul Gupta,

The patch 6dad4e8ab3ec: "chcr: Add support for Inline IPSec" from Nov
16, 2017, leads to the following static checker warning:

	drivers/crypto/chelsio/chcr_ipsec.c:431 copy_key_cpltx_pktxt()
	warn: potential pointer math issue ('q->q.desc' is a 512 bit pointer)

drivers/crypto/chelsio/chcr_ipsec.c
   419  
   420          if (likely(len <= left)) {
   421                  memcpy(key_ctx->key, sa_entry->key, key_len);
   422                  pos += key_len;
   423          } else {
   424                  if (key_len <= left) {
   425                          memcpy(pos, sa_entry->key, key_len);
   426                          pos += key_len;
   427                  } else {
   428                          memcpy(pos, sa_entry->key, left);
   429                          memcpy(q->q.desc, sa_entry->key + left,
   430                                 key_len - left);
   431                          pos = q->q.desc + (key_len - left);
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This does look like a pointer math issue.  It should probably be:

				pos = (u8 *)q->q.desc + (key_len - left);

But I can't test this.

   432                  }
   433          }
   434          /* Copy CPL TX PKT XT */
   435          pos = copy_cpltx_pktxt(skb, dev, pos);

regards,
dan carpenter



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux