Also, gcc once maintained "fat" pointer to store length of array for bound 
checking but removed later due to sanitizers such as valgrind.

https://gcc.gnu.org/wiki/MIRO?action=AttachFile&do=get&target=MIRO.pdf

There are bounded for loops being discussed in new programming languages for 
data plane. A bounded for loop is "for ( i < k)" where length of vector is 
stored in type so that the compiler can unroll loop and verify bound.

Hemant

-----Original Message-----
From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of hemant via 
lists.fd.io
Sent: Wednesday, December 14, 2022 9:00 AM
To: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] vpp core & bound checking

Hi Ben,

What kind of bound failure is causing crashes? Is a for loop terminator 
exceeding bound or networking data exceeding bound? I can investigate changing 
the gcc compiler to check any bound at compile-time.

Hemant

-----Original Message-----
From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Benoit Ganne
(bganne) via lists.fd.io
Sent: Wednesday, November 30, 2022 9:30 AM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] vpp core & bound checking

Hi everyone,

I'd like to get the discussion started on the topic of bound checking in VPP:
some of us recently discussed a patch that added explicit bound checking 
within VPP core dataplane infrastructure to prevent a crash when the function 
is misused from a plugin. The bug is clearly in the plugin which calls the VPP 
infra function, but it's a hard one to track and when it happens it crashes 
VPP and break networking for users.

I think we do not want to do bound checking in the core VPP dataplane infra 
for performance reasons, and hence callers should be correct or nasty things 
will happen. In case a workaround is really needed, it should be done in the 
caller and probably maintained as a private patch until the bug is properly 
fixed.

What do people think?

Best
ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22332): https://lists.fd.io/g/vpp-dev/message/22332
Mute This Topic: https://lists.fd.io/mt/95358731/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to