DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Sanford <rsanford2@gmail.com>
To: dev@dpdk.org
Cc: vladimir.medvedkin@intel.com, Robert Sanford <rsanford@akamai.com>
Subject: [PATCH v2 0/5] fib: fix full table overwrite on address wraparound
Date: Tue, 27 Oct 2026 10:54:00 -0400	[thread overview]
Message-ID: <20261027145405.3454251-1-rsanford2@gmail.com> (raw)
In-Reply-To: <20261027001423.3028072-1-rsanford2@gmail.com>

From: Robert Sanford <rsanford@akamai.com>

Both FIB dataplanes can overwrite their entire lookup table when a
prefix whose range ends at the top of the address space is added,
deleted, or has its next hop changed, while more-specific routes cover
its range up to that point. The call returns 0, so the corruption is
silent.

One real-world trigger is a default route coexisting with explicit /1
routes: with 0.0.0.0/0, 0.0.0.0/1 and 128.0.0.0/1 installed, deleting
0.0.0.0/0 makes every lookup miss. IPv6 behaves the same with ::/0,
::/1 and 8000::/1.

In modify_fib() (dir24_8.c) and modify_dp() (trie.c), the branch that
skips a route starting exactly at the current left edge has no
wraparound check, while the branch that installs a gap does. Patches 2
and 3 add the missing check. Patches 4 and 5 add unit tests that fail
without the fixes and pass with them.

Patch 1 fixes undefined behavior in rte_rib.c that the new IPv4 test
reaches: its bit test computes 1 << 31 on a signed int for nodes at
depth 0. No existing test adds a depth-0 route.

v2:
- Add patch 1. The CI UBSan build reported the undefined behavior in
  rte_rib.c when running the v1 test/fib wraparound test.
- Patches 2-5 are unchanged from v1.

Robert Sanford (5):
  rib: fix undefined behavior in bit test
  fib: fix full table overwrite on address wraparound
  fib6: fix full table overwrite on address wraparound
  test/fib: reproduce table overwrite on address wraparound
  test/fib6: reproduce table overwrite on address wraparound

 app/test/test_fib.c  |  94 +++++++++++++++++++++++++++++++++++++++
 app/test/test_fib6.c | 103 +++++++++++++++++++++++++++++++++++++++++++
 lib/fib/dir24_8.c    |   6 +++
 lib/fib/trie.c       |   6 +++
 lib/rib/rte_rib.c    |   8 ++--
 5 files changed, 213 insertions(+), 4 deletions(-)

-- 
2.34.1


  parent reply	other threads:[~2026-10-27 14:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27  0:14 [PATCH v1 0/4] fib: fix full table overwrite on address wraparound Robert Sanford
2026-10-27  0:14 ` [PATCH v1 1/4] " Robert Sanford
2026-10-27  0:14 ` [PATCH v1 2/4] fib6: " Robert Sanford
2026-10-27  0:14 ` [PATCH v1 3/4] test/fib: reproduce " Robert Sanford
2026-10-27  0:14 ` [PATCH v1 4/4] test/fib6: " Robert Sanford
2026-10-27 14:54 ` Robert Sanford [this message]
2026-10-27 14:54   ` [PATCH v2 1/5] rib: fix undefined behavior in bit test Robert Sanford
2026-10-27 14:54   ` [PATCH v2 2/5] fib: fix full table overwrite on address wraparound Robert Sanford
2026-10-27 14:54   ` [PATCH v2 3/5] fib6: " Robert Sanford
2026-10-27 14:54   ` [PATCH v2 4/5] test/fib: reproduce " Robert Sanford
2026-10-27 14:54   ` [PATCH v2 5/5] test/fib6: " Robert Sanford

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=20261027145405.3454251-1-rsanford2@gmail.com \
    --to=rsanford2@gmail.com \
    --cc=dev@dpdk.org \
    --cc=rsanford@akamai.com \
    --cc=vladimir.medvedkin@intel.com \
    /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