From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-07 16:50:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sunqbc.risq.qc.ca!torn!news.ccs.queensu.ca!not-for-mail From: Chris Wolfe Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Date: Tue, 07 Aug 2001 19:32:04 -0400 Organization: Queen's University, Kingston Message-ID: <3B707A74.66F48D60@globetrotter.qc.ca> References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <3b6a453c.1193942215@news.worldonline.nl> <9keejl$fhj@augusta.math.psu.edu> <3c30da40.0108060848.796d9bd9@posting.google.com> <3B6F3216.F410BBFF@home.com> <3B6F3FAE.B9B9FFCF@globetrotter.qc.ca> <3B6F5BB2.A879B933@worldnet.att.net> <3B7077A3.77D2BBE5@globetrotter.qc.ca> NNTP-Posting-Host: d150-159-162.home.cgocable.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:11557 comp.lang.c++:80815 comp.lang.c:72784 Date: 2001-08-07T19:32:04-04:00 List-Id: Chris Wolfe wrote: > > James Rogers wrote: [snip] > > The entry may only execute when the boundary condition is true, and > > no other entry is concurrently accessing the protected object. > > And when boundary condition is false? I'm assuming a runtime > error of some sort, unless the wait is clearly documented. Fixing the parameter, and adding a safe wait: void Put(const Item &item) { Access::Ptr ptr = Parts_Buf_Ptr.Enqueue(); while (Size >= Buffer.Last) ptr.Wait(); // etc... } void Get(Item &item) { Access::Ptr ptr = Parts_Buf_Ptr.Enqueue(); while (Size < 0) ptr.Wait(); // etc... } Chris