DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Konyukhov <Alexander.Konyukhov@kaspersky.com>
Cc: <sdl.dpdk@linuxtesting.org>, <dev@dpdk.org>, <stable@dpdk.org>,
	<roy.fan.zhang@intel.com>,
	Konyukhov Aleksandr <Alexander.Konyukhov@kaspersky.com>
Subject: [PATCH] crypto/ipsec_mb: fix Null ptr dereference in set_mb_job_params()
Date: Fri, 25 Sep 2026 14:23:53 +0300	[thread overview]
Message-ID: <20260925112355.3878168-1-Alexander.Konyukhov@kaspersky.com> (raw)

From: Konyukhov Aleksandr <Alexander.Konyukhov@kaspersky.com>

In function set_mb_job_params pmd_aesni_mb.c:1742 check
(cipher_mode == IMB_CIPHER_NULL && oop)
is not enath to garanteed job->dst != 0, which in turn could lead to
NULL ptr dereference.

Add new check for (sgl == 0) to be shure that job->dst
was set in pmd_aesni_mb.c:1610

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 03944ff5e3df ("crypto/ipsec_mb: support null auth/cipher for aesni_mb")
Cc: roy.fan.zhang@intel.com

Signed-off-by: Konyukhov Aleksandr <Alexander.Konyukhov@kaspersky.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 05dc1a039f..57d8925a87 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -1738,7 +1738,7 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
 		job->msg_len_to_cipher_in_bytes = op->sym->cipher.data.length;
 	}
 
-	if (cipher_mode == IMB_CIPHER_NULL && oop) {
+	if (cipher_mode == IMB_CIPHER_NULL && oop && !sgl) {
 		memcpy(job->dst + job->cipher_start_src_offset_in_bytes,
 			job->src + job->cipher_start_src_offset_in_bytes,
 			job->msg_len_to_cipher_in_bytes);
-- 
2.55.0.windows.2


             reply	other threads:[~2026-09-26  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 11:23 Alexander Konyukhov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-09-25 13:17 [PATCH] crypto/ipsec_mb: fix Null ptr dereference in set_mb_job_params() Konyukhov Aleksandr
2026-09-28 15:04 ` Radu Nicolau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260925112355.3878168-1-Alexander.Konyukhov@kaspersky.com \
    --to=alexander.konyukhov@kaspersky.com \
    --cc=dev@dpdk.org \
    --cc=roy.fan.zhang@intel.com \
    --cc=sdl.dpdk@linuxtesting.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox