* [bug report] chcr: Add support for Inline IPSec
@ 2017-12-04 11:44 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-12-04 11:44 UTC (permalink / raw)
To: atul.gupta; +Cc: linux-crypto
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-12-04 11:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-04 11:44 [bug report] chcr: Add support for Inline IPSec Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox