7821 Commits

Author SHA1 Message Date
Gao Feng
bfbbb1855e ip: reassembly: fix one possible use-after-free
When use the kv->v.memory_owner_thread_index as the index to get the
reass in pool, maybe this element is freed by the owner thread because
of timeout, too many fragments, and so on.

So we should check if do_handoff with kv->v.memory_owner_thread_index
before get the reass from pool.

Type: fix

Signed-off-by: Gao Feng <davidfgao@tencent.com>
Change-Id: Ie0f1dc368f86d0fd65292ca0c5e1908348015e09
(cherry picked from commit 9165e0365cc21575fd3e4a98be59317a839553f4)
2020-08-13 17:20:47 +00:00
Benoît Ganne
d549129538 vppinfra: selectively disable false-positive GCC-10 warnings
GCC-10 increase overflows-related warnings but failed to infer that
b->n_cached_bytes is always < sizeof(uword).

Type: fix

Change-Id: I956ae609abc9e39d4a932e5801510999d7d27b79
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ffbcf6178891bd68a97543ac91d28f37256d5e13)
2020-08-13 17:20:47 +00:00
Benoît Ganne
44d5dd7c1e build: add vppinfra/warnings.h to exported headers list
To allow the use of WARN_ON/OFF macros to selectively disable build
warnings.

Type: fix

Change-Id: Iceb9d28b2b80c373afb51900880c23041be836db
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit be7dbbbfdd49fcfff851f38d1d36d08fc9710604)
2020-08-13 17:20:47 +00:00
Matthew Smith
069411cd5e devices: allow link state down with netlink
Type: fix

Use the up parameter in vnet_netlink_set_link_state(). It was
ignoring the parameter and always setting IFF_UP on an interface.

Change-Id: I0d44406d982afbdc43bc6b26d0f22c0bdd47abdc
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 81284163a293759bc5c2d6a124639c6796589d15)
2020-08-13 17:20:47 +00:00
Florin Coras
138d43ce77 vcl: generate select events on read/write errors
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3429f9d0406b6d710846fc82d77400f26f77fdf4
(cherry picked from commit 5e6222a0332e38316b5a58b23c35cca69bb72025)
2020-08-13 17:20:47 +00:00
Dave Barach
3b49dc6cc8 vppinfra: finish deprecating qsort.c
Minor change to vec_sort_with_function(...): don't depend on the qsort
implementation to deal with null, zero-long, or 1-long vectors

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7bd7b0421673d2a025363089562aa7c6266fba66
(cherry picked from commit f593b5792031b3797cdcdfd3fbb33ac4de8c9a5d)
2020-08-13 17:20:47 +00:00
Klement Sekera
eaef2de7f9 nat: fix extended unit tests
Type: fix
Fixes: b86437b79b82493c2e9728929df417f55b153824

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2c833928dcdceb4d23dfc161bcc3358272076980
(cherry picked from commit e7f420177620868275add23ba5fcea7c7d18c91a)
2020-08-13 17:20:47 +00:00
Neale Ranns
66cb17227c vapi: packed enum type generation
Type: fix

if the ,api/.json specifies that a enum should be u8/u16 that the
generated c enum needs to be packed.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ia0497b45e4c510a5c63cd02e966769bf20686838
(cherry picked from commit b5c0d35f9445d4d99f2c5c7bd3175e68721a8ee5)
2020-08-13 17:20:47 +00:00
Dave Barach
4e138bf173 misc: update INFO.yaml
Add Benoit Ganne to the committer list, remove committers who have
resigned, list committers in alphabetical order.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic51092df774464e228cd875acf118827e9cd1923
(cherry picked from commit 0e2751cc1d246145cee6b1e4a588c30270c7ce21)
2020-08-13 17:20:47 +00:00
Andreas Schultz
b7bbd6a1fe session: fix session_table_get_or_alloc
Extending the fib_index_to_table_index could leave entries uninitialized,
pointing to the session tables at index 0. That session index exists by
default, but it is a IPv4 session table. That would break all IPv6 on
the unitilized fib indexes.

Type: fix

Change-Id: Ie3f0a87a7f829ceb39f75ec06658b0ad1d3813ae
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
(cherry picked from commit 30a28c187b0eb9216d5d7918712d98a4b7a5ba6a)
2020-08-13 17:20:47 +00:00
Florin Coras
b72e494f39 tcp: avoid bt sample access after possible pool realloc
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I98f943c8862fa74fb576f9ec1fb9186289b1216b
(cherry picked from commit c17ff6ec3b69ef228047bf346e0b524c48d2c96e)
2020-08-13 17:20:47 +00:00
Benoît Ganne
0115d1b511 vcl: fix use-after-free
Make sure we disconnect from vlib prior to free-ing the last worker, as
we'll need to access it.

Type: fix

Change-Id: Id5bdd17f0f5efa1ce52021b4270eb4f1e95cc61d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 38ab5672b599df8ef201ca6733c9b008c37fdfa3)
2020-08-13 17:20:47 +00:00
Benoît Ganne
2c801f7ffb tcp: fix use-after-free
bts can be freed by the call to bt_fix_overlapped(). Save flags for
later use.

Type: fix

Change-Id: If8b48c96ce39e38f2ed7f4db2815122523eb2e05
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a04adbf5368f9ec907508ff36d42fbd72d287120)
2020-08-13 17:20:47 +00:00
Dave Barach
367d6d86b6 vat: fix increment_address(...)
vl_api_address_t uses a packed enum for the address family, compare
a->af directly with ADDRESS_IP4 / ADDRESS_IP6 instead of running a->af
through clib_host_to_net_u32(...) before compare.

Indirectly fixes api_ip_route_add_del(...) w/ count > 1.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib7f562ec9e92ee63e52a338d318fcf1ce6221755
(cherry picked from commit 54582663ab7d7105bc2407036a311d68707e5ab9)
2020-08-13 17:20:47 +00:00
Elias Rudberg
99c6344d75 vlib: queue_hi_thresh fix to avoid deadlock
Adapt queue_hi_thresh value using num_threads to avoid risk of deadlock
between threads which could happen for example when different NAT
threads try to handoff work to each other at the same time when their
frame queues are congested. This change ensures that each thread can
reserve a queue entry without causing problems even in the most extreme
case when all threads attempt to add to the same queue simultaneously
when the queue is nearly full.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I9e02f753bd00833d8dd500d181b0d4f9a454d703
(cherry picked from commit 368104d06ad6d667a8cce152426916fc654b6627)
2020-08-13 17:20:47 +00:00
Benoît Ganne
2bd7f560c6 sr: fix non-NULL terminated string overflow
Type: fix

Change-Id: Ia5ae0e893a5358f61353d20f444d88d79953e482
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b9753540d2a69bbab807653fc3d0c1b43ec4d6d5)
2020-08-13 17:20:47 +00:00
Benoît Ganne
36f12ac682 session: fix use-after-free in input node
Type: fix

Change-Id: Ie60b07abe76ad166f048f5885accd7038d8153b2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7ce23f25bbc01d534ca294ce88ab0d709e3e03a7)
2020-08-13 17:20:47 +00:00
Florin Coras
3ef5447282 session: avoid rx notifications on accepting sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba37e528e968104c3ba9c8324438ba695ddddfd1
(cherry picked from commit da302e4fce1003a2fdd2ace7e1ae09987399092c)
2020-08-13 17:20:47 +00:00
Florin Coras
188d2c481e vcl: ensure sessions are open on select events
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d56b61af574dfdaf6028160ce331606bdf65609
(cherry picked from commit f49cf470c583507fa1b5b841887107071701ef5e)
2020-08-13 17:20:47 +00:00
Florin Coras
00eac4a8f8 vcl: expand vcl select maps in ldp if needed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I56c487821233cebf2146745a4706cb573cc088a5
(cherry picked from commit cbce80aaa3f1853856d4d64c95f10d65caa4d786)
2020-08-13 17:20:47 +00:00
Benoît Ganne
a9a33884d2 gbp: fix l3-out anonymous test cleanup
Type: fix

Change-Id: Ib455b0a57f9b4f9cb82bb295c220270d0c6e5fe5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 040d47c2cce87255a101f301239192c5599b0db5)
2020-08-13 17:20:47 +00:00
Benoît Ganne
cc16d5eb8a lisp: fix use-after-free
Type: fix

Change-Id: I42c3e3514ba50d40e09ee688d083f3e78fa0713a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 101fc278c3b7009c42574a25b96c4fb7fcd15e39)
2020-08-13 17:20:47 +00:00
Andreas Schultz
8c35542aa4 vat: fix static analysis warning
replace hand crafted version with existing vector function

Type: fix

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I94834852469ed316c7bdbd48bb7f479648b2c8e5
(cherry picked from commit 63551351b75d1363b57ed1810b0d7065ca5cd600)
2020-08-13 17:20:47 +00:00
Alexander Chernavin
ec50d9ff1e dpdk: fix udp-encap for esp in transport mode
Now UDP encapsulation doesn't work in transport mode because:
 - the encrypt node misses filling of UDP header and it gets sent with
   all zeros;
 - the decrypt node misses filling of new IP header and it contains
   garbage data.

With this commit, fill UDP header during encryption and fill IP header
during decryption.

Change-Id: I87a7bd594f0e312b16d3e5eb19e568b4e3164d36
Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 82fc98fa4578dbbfb156effb11dea6a4e2d0b898)
2020-08-13 17:20:47 +00:00
Florin Coras
8f8c625f21 vcl: fix app destroy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I21daa87b1a301142270a1bf20680dd9e9395aac9
(cherry picked from commit ce815deb72fd3941b000aecec931131afc9d6c34)
2020-08-13 17:20:47 +00:00
Benoît Ganne
5854884d54 fib: fix use-after-free
Type: fix

Change-Id: Ie7081d977dd0d3e7d09bc0d1b4d53863288e443b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 95eb01fdc65b692065ace6d76870d8cc9f3e2c84)
2020-08-13 17:20:47 +00:00
Benoît Ganne
346e6e186a bier: fix vector size confusing ASan
The vector is initialized to 1024 entries which is guaranteed to be
enough, but as its size can shrink between calls, make sure ASan is
aware of the expected size before using it.

Type: fix

Change-Id: I4bcc39867a886b3cb463854d2cda0b32155650e9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 77100efb37f7cb333f9ab55dc206bf1431e3ae50)
2020-08-13 17:20:47 +00:00
Benoît Ganne
8453fb7509 igmp: fix igmp proxy group merge
When merging proxy groups in igmp_proxy_device_merge_group(), the call
to igmp_proxy_device_merge_src() can end up removing the current proxy
group via igmp_group_clear(). When that happens, it must returns NULL so
that igmp_proxy_device_merge_config() does not send a IGMPv3 report for
a dead proxy group.
Make igmp_group_clear() reset the group pointer to NULL to fix this bug
and to detect similar bugs more easily.

Type: fix

Change-Id: I229e55b5bfa71734d7844893f5209a66fa3cc8ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit bd7f3422bbe38ba87888b765e94b56bfcbb9602c)
2020-08-13 17:20:47 +00:00
Florin Coras
7e5733ad17 session: detach session from app on cleanup
Type: fix

Avoids unwanted notifications.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff27fb0d3644194e3bb3f91d7ed1fd02c6730cd
(cherry picked from commit 77ea42b31ae12f0aef829097225e353199360f30)
2020-08-13 17:20:47 +00:00
ShivaShankarK
c36a90318c fib: fix accessing empty dpo pool elements
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: Iee88a2101ce42d7f1cdb65df532c349d14829e4c
(cherry picked from commit 35acaac1843839f94e9bd40ad45a8d170a155f22)
2020-08-13 17:20:47 +00:00
Florin Coras
e8a333e2f2 udp: fix local node no port error counter
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie0c5a86aedfa38fdcbb835aee7c9e91d59b222d6
(cherry picked from commit bc1a1a7347d689aa7043d4d7f15a7db657230216)
2020-08-13 17:20:47 +00:00
ShivaShankarK
c9750bfcaf fib: fix adjacency cli command issue
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I193023705003e664c50487fdfaa42b813604a078
(cherry picked from commit ae9c45938bdf6e180f83f02aed31113e60db20a9)
2020-08-13 17:20:47 +00:00
Dave Barach
83be6cb790 misc: fix error handling in punt_replicate
If vlib_buffer_clone (...) fails due to a buffer allocation error, update
*n_dispatched with the actual number of clones, not the requested
number of clones.

Punt_replicate(...) should not set *to_next[0] = bi0. The original
buffer is enqueued separately in punt_dispatch_node(...)

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I774ad8f8c1a0633de4cf8ae5530629201c229347
(cherry picked from commit 1adc7e78ad3eb7e800d0ce3ace56f53ab7aebffe)
2020-08-13 17:20:47 +00:00
Ray Kinsella
22fb6e6ef8 vat: fix vat strncpy stringop-overflow
Fix GCC 9.0 barf on vat strncpy.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I5e41225d6ac9673a9d953046720df55e7b69c479
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit b1bb513792fecd735effebbd07d867ea93adc9f6)
2020-08-13 17:20:47 +00:00
Dave Barach
25e24e522d vat: fix static analysis warning
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia46f865082dcf0cf06af99a7c958c4a5b02193ce
(cherry picked from commit 032a5e3da0f4350390d97d6011160fe0d34a8d6e)
2020-08-13 17:20:47 +00:00
Dave Barach
3d57cfdfb5 misc: strcpy be gone
Causes static analysis "vulnerability" warnings

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I272fa69251d70f62178e6dff0423c16f99937af1
(cherry picked from commit 0250090fc0c24214cb1fa969f6e2f585099ee36b)
2020-08-13 17:20:47 +00:00
Dave Barach
d13034a6d1 misc: sprintf be gone
Along with related static analysis warnings...

Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2c6949c7a2250b8f76a63508c7c210daecfe0f91
(cherry picked from commit 3e07a4a1e843267892dc291a833d93bd70597011)
2020-08-13 17:20:36 +00:00
Dave Wallace
11903b8db6 misc: fix sonarcloud html issue
Type: fix

Change-Id: I3691c310fa6336bf2c103c42bccd94c27aab4878
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 39aa7a5202a6a875bd6f5d341cb07f19ab0bf51e)
2020-08-13 10:39:40 +00:00
Steven Luong
69d79baa08 dpdk: VM VHOST tests with rxq>1 failing
DPDK recently added a check in the virtio driver to make sure that
rxmode->mq_mode == ETH_MQ_RX_NONE. We were passing ETH_MQ_RX_RSS
and the device initialization was not accepted.

The reason for the change in DPDK was that there is no controls
(algorithm, redirection table, hash function). So they thought ETH_MQ_RX_NONE
was the best choice for the value of mq_mode.

Type: fix
Ticket: VPP-1853

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ifa0fc4206cedc56a851f94f6434a2a7500bbd419
(cherry picked from commit b32436aab9626cb8b7bc4099142135c5c9e19beb)
2020-08-13 10:39:40 +00:00
Dave Barach
fd24cea65c misc: fix static analysis warnings
One actual bugfix.

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icef25167f97a70cc795c0a481174de319ed79ad5
(cherry picked from commit c35f3e835b4078fedabc1ff5013bc4727f533e16)
2020-08-13 10:39:40 +00:00
Aloys Augustin
3c3d43b950 session: fix fifos display
This prevents a crash with quic listeners, and enables the display
of udp fifo status.

Change-Id: Ib9f48818ee3e51a3fa43ad8ab175e8aa7750df8f
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 6eef40bce3f5ae2b06ba75d5b4cf32f168a801e4)
2020-08-13 10:39:40 +00:00
Florin Coras
faab8a17b8 udp: validate input data length
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3f34011ca61ded310d0411e7b50548982bd164ac
(cherry picked from commit 936197467aac08b7620c9cb0614817b90466968e)
2020-08-13 10:39:40 +00:00
Matthew Smith
df16414818 ipsec: use id in ipsec_tunnel_protect_details
Type: fix

The data populated into an ipsec_tunnel_protect_details message includes
an outbound SA and a list of inbound SAs for a tunnel interface. These
are populated with SA indices. The values used by an API client
to refer to an SA in other messages is the SA id rather than the index.
Use the SA id instead of the index.

Change-Id: Ifaad32801092a7f87bd0dcf19de418d36613f8dd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 5cee0bca5d0f01d3f26e90dee79780382e843d04)
2020-08-13 10:39:40 +00:00
Dave Barach
08c6ea544f session: fix coverity warning
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib5da600b7a40f775de7dc5b9aaa8d967e49e8632
(cherry picked from commit 4897d77c6d4d5d04eb7e02bda57dc6c7005a609f)
2020-08-13 10:39:40 +00:00
Neale Ranns
deafa73731 ip: Adding IP tables is no MP safe
Type: fix

it was marked MP safe in the CLI (which it shouldn't be) but
it it not marked MP safe on the API.

Change-Id: I4bdea498a510a8b406d13d62a899b6d03656f7e8
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 31d6c738c20d3baa619dbbb08af6125fab32bc08)
2020-08-13 10:39:40 +00:00
Damjan Marion
1c8b63069c avf: fix rx queue refill on buffer alloc failure
If buffer alloc fails, it may happend that rx queue will be stuck
as old code only refills if at least one packet is received.

Type: fix
Change-Id: I388c4f8a9fb2c208bdc222e31b443cbe6b94af82
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit e7f7190381c66cca6c1c3c77b3d43148818a5a4e)
2020-08-13 10:39:40 +00:00
Florin Coras
8d3ba7eab4 vcl: fix ldp recv return on error
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0875705d3a0c95f2781b0595ef27a30486438aae
(cherry picked from commit 2a6642e95dc18d7c56f87b74a70658b8312b8c08)
2020-08-13 10:39:40 +00:00
Florin Coras
a086cb8674 vcl: fix ldp writev 0 vecs
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iec5db8dcf3a019b731e15fd79d0208d6eb10943b
(cherry picked from commit eda1b8c32f9857bb749835b0189af002b224927d)
2020-08-13 10:39:40 +00:00
Damjan Marion
e896fcf610 avf: proper promisc handling
Type: fix
Change-Id: Id20a0fe77372602fd211156ccee01c18d829d8df
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 1839fe165c7ffb834775b8582fe0ee2321ff2ab6)
2020-08-13 10:39:40 +00:00
Steven Luong
203fe37125 virtio: vhost gso checksum error when both indirect and mrg_rxbuf are off
Turn on gso, turn off both indirect and mrg_rxbuf caused traffic received
and sent with checksum error. The problem is we are not mapping the hdr
correctly in the shared memory address.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I7ef3bc2755544167b0e624365988111b17399e89
(cherry picked from commit b232d192f2f77114e26cf7f99b57bcd6140872d0)
2020-08-13 10:39:40 +00:00