* [PATCH v2] crypto/ipsec_mb: fix Null ptr dereference in set_mb_job_params()
@ 2026-10-02 11:20 Konyukhov Aleksandr
2026-10-06 10:57 ` Radu Nicolau
0 siblings, 1 reply; 2+ messages in thread
From: Konyukhov Aleksandr @ 2026-10-02 11:20 UTC (permalink / raw)
To: Kai Ji, Pablo de Lara, Declan Doherty, Radu Nicolau, Fan Zhang
Cc: sdl.dpdk, dev, stable, roy.fan.zhang, Konyukhov Aleksandr
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 | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 05dc1a039f..e3a53d9a14 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -1739,9 +1739,13 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
}
if (cipher_mode == IMB_CIPHER_NULL && oop) {
- 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);
+ if (!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);
+ } else {
+ return -1;
+ }
}
/* Set user data to be crypto operation data struct */
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] crypto/ipsec_mb: fix Null ptr dereference in set_mb_job_params()
2026-10-02 11:20 [PATCH v2] crypto/ipsec_mb: fix Null ptr dereference in set_mb_job_params() Konyukhov Aleksandr
@ 2026-10-06 10:57 ` Radu Nicolau
0 siblings, 0 replies; 2+ messages in thread
From: Radu Nicolau @ 2026-10-06 10:57 UTC (permalink / raw)
To: Konyukhov Aleksandr, Kai Ji, Pablo de Lara, Declan Doherty,
Fan Zhang
Cc: sdl.dpdk, dev, stable, roy.fan.zhang
On 02-Oct-26 12:20 PM, Konyukhov Aleksandr wrote:
> 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>
> ---
Hi, I send a patch that is basically your first fix and a comment and
CC'd stable dpdk mailing list - the NULL SGL OOP case was actually
handled by the existing code, your initial fix was fine, thanks for
taking the time.
I also added test cases to verify the fix and cover this case.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-06 10:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 11:20 [PATCH v2] crypto/ipsec_mb: fix Null ptr dereference in set_mb_job_params() Konyukhov Aleksandr
2026-10-06 10:57 ` Radu Nicolau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox