DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/cryptodev Bug 1537] Failure to enqueue packets for cryptodev-scheduler_multicore can lead to program crashes
Date: Mon, 09 Sep 2024 08:58:46 +0000	[thread overview]
Message-ID: <bug-1537-3@http.bugs.dpdk.org/> (raw)

[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]

https://bugs.dpdk.org/show_bug.cgi?id=1537

            Bug ID: 1537
           Summary: Failure to enqueue packets for
                    cryptodev-scheduler_multicore can lead to program
                    crashes
           Product: DPDK
           Version: 22.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: Normal
         Component: cryptodev
          Assignee: dev@dpdk.org
          Reporter: 1269690261@qq.com
  Target Milestone: ---

Created attachment 288
  --> https://bugs.dpdk.org/attachment.cgi?id=288&action=edit
Incorrect Variable Usage

Failure Scenario:
   The `cryptodev` scheduler is running in Multi-core mode, with OpenSSL PMD
attached as workers.
   When a batch of packets to be enqueued contains invalid encrypted ESP
(Encapsulating Security Payload) packets, the program crashes.



---------------------------------
Specific Issues:
1. Incorrect Variable Usage:
   - The variable `pending_deq_ops` was incorrectly used instead of
`pending_enq_ops`. This leads to failed condition checks and prevents the
`scheduler_retrieve_session` function from executing. Consequently, the content
of the `op->sym->session` variable becomes abnormal, causing the program to
crash when the OpenSSL PMD accesses this variable.
2. Lack of Exception Handling:
   - There is no handling for exceptional cases when enqueuing packets. When
invalid packets are enqueued, the `rte_cryptodev_enqueue_burst` function always
returns a value of `processed_ops` that is less than `pending_enq_ops`, leading
the program into an infinite retry loop.



--------------------------------
Resolution Suggestions:
1. Correct Variable Usage:
   - In the faulty code, replace `pending_deq_ops` with `pending_enq_ops`.

2. Documentation Update:
   - Add documentation stating that packets should always be added to the
processed operations queue in the worker PMD.

   - Alternatively, implement a maximum retry count check to prevent the
program from entering an infinite retry loop.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #2: Type: text/html, Size: 4219 bytes --]

                 reply	other threads:[~2024-09-09  8:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-1537-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@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;
as well as URLs for NNTP newsgroup(s).