| JREF Homepage | Swift Blog | Events Calendar | $1 Million Paranormal Challenge | The Amaz!ng Meeting | Useful Links | Support Us |
![]() |
|
|
|
|||||||
| Notices |
| Welcome to the JREF Forum, where we discuss skepticism, critical thinking, the paranormal and science in a friendly but lively way. You are currently viewing the forum as a guest, which means you are missing out on discussing matters that are of interest to you. Please consider registering so you can gain full use of the forum features and interact with other Members. Registration is simple, fast and free! Click here to register today. |
|
|
#1 |
|
Guest
Posts: n/a
|
Yet Another Buffer Overflow
The latest Flash player has a security problem:
http://www.cnn.com/2003/TECH/interne...rns/index.html Programmer types, notice that it's a buffer overflow exploit. How on Earth can programmers in 2003 still be creating buffer overflows? That's darn near simply irresponsible in my book.
|
|
|
|
|
#2 |
|
Illuminator
Join Date: Mar 2002
Location: USA
Posts: 3,252
|
Re: Yet Another Buffer Overflow
Quote:
On one of the shelves at work, we have a book on server programming that actually says not to bother worrying about memory use because it's cheaper to just buy more RAM than to pay a programmer to write efficient code. Jeremy |
|
|
|
|
#3 |
|
Wayne's Words
Join Date: Jul 2002
Location: Ottawa, ON
Posts: 2,442
|
Re: Yet Another Buffer Overflow
Quote:
Walt |
|
|
|
|
#4 |
|
by Charles M. Schulz
Join Date: Aug 2001
Posts: 15,990
|
It's not just Microsoft C++. The Linux "file" command and "sendmail" daemon both have had recent buffer overflows detected and fixed. C and C++ are lower-level languages where bounds checking is up to the programmer, and I agree it's lazy. With higher-level languages, it is indeed a function of the compiler to make sure proper bounds checking is implemented.
I haven't taken the Microsoft Foundation class, but I would hope that "bounds checking" would be drilled into the students' heads and tattooed on the back of their eyelids. |
|
__________________
"James Randi is awesome!" —Ian Bernard, primary host of Free Talk Live "It really does take people like Penn & Teller or James Randi to be able to see through these deceptions, and so those are perhaps the people we should be paying the most attention to." —Harry Browne, 4/10/2004 I know there is a lesson to be learned here somewhere, but I don't know what it is. |
|
|
|
|
|
#5 |
|
Persnickety Insect
Join Date: Dec 2002
Location: Sunny Munuvia
Posts: 14,914
|
Right. Sendmail in particular is infamous for buffer overflows - which is why I don't run sendmail on any of my servers.
It's a problem to do with C's string handling and the C standard library. There are safe alternatives for all the library functions now, but people don't use them and/or write their own crappy code to put the buffer overflows back in. Take away their C compilers and give them Ada. If they complain, give them Fortran IV. |
|
__________________
Free blogs for skeptics... And everyone else. mee.nu What, in the Holy Name of Gzortch, are you people doing?!?!!? - TGHO |
|
|
|
|
|
#6 |
|
Thinker
Join Date: Sep 2001
Posts: 130
|
(programming rant)
The problem is, those "safe" alternatives haven't been proven to be any safer. Sure, they sound good, but all too often the claims don't match reality (where are the tests?). I did a review on Scott Meyer's paper on handwritten loops and found that two out of three of his points were incorrect just based on HIS examples. The "right" way was much slower and his "right" way had more obscure bugs that doing it the wrong way. The scary trend I see from people such as Boost is that in no uncertain terms they are saying that programmers are too stupid to write software. I had a long and drawn out argument with one of the Boost contributors about his own contribution where his "safe" method was known to be problematic and he made totally illogical and incorrect statements about the "wrong" way of doing things. What was so strange was that he repeatedly pointed to a paper saying it supported his claim when in fact the paper devoted an entire section on how to do it the "wrong" way. The paper even pointed out the exact same non-critical problems that I had discussed when using the "wrong" way. Then you take a look at the standards committee. They included that great "export" (?) feature for templates. Even though they had papers discussing all the problems with the feature and all the compiler vendors voted against it, the feature was included. Why? Because: 1. It would be embarrassing if the feature wasn't there. 2. Many other languages had the feature 3. (and one other totally silly reason that had nothing to do with science). (Doesn't that sound like a woo-woo?) What a great example of computer science at work. I was so furious that I even wrote Randi to see if he thought I could do anything to help them to see how flawed the process was. (BTW: Even though they now admit the error, they still don't realize that the process that caused this problem is flawed.) Even Herb Sutter warns against some of the garbage we are seeing today. People are told things are "right" or "wrong" and are never told WHY. Thus they don't realize that things aren't as black and white as they have been told. "Gotos are evil". "Global variables are evil". Even Dikstra in his famous article says that gotos have their place. Be we all have been taught the 5 second lesson and not the whole story. I once took a standard part of C++ and rewrote it to improve performance by a factor of 4. When I told people that under certain conditions the standard implementation of a hash map we all know and love performs poorly, people accused me of not knowing how to use it or being too stupid to test it properly. So I had to explain in great detail the implementation assumptions that SGI made and how they can impact certain applications. I have another example of how lower_bound performs worse than brute for on some containers because the iterator addition operator performs worse than the actual comparison. (BTW: lower_bounds is documented as being O(logn) but it is actually O(n) on some containers due to the iterator problem. It is assumed that the iterator adjustment executes in O(1) when for some containers it doesn't.) I use a mix of C and C++ because I understand the limitations of both. Time and time again on programming boards I see people who say "my program is running like a dog, what can I do." I look at the code and they are using standard STL the way they should. I point out that if they used more tradition C in SPECIFIC cases then performance goes through the roof. They have been taught the "right" way without being taught that the right way comes at a price. Sometimes when all aspects of a problem is reviewed, the "wrong" way is much better than the "right" way. |
|
|
|
|
#7 |
|
Thinker
Join Date: Sep 2001
Posts: 130
|
Quote:
Now many people would say "well, what do you expect, they didn't use them properly". Well, C strings work perfectly when used properly. I have yet to see a real case study in the real world to see if any of this new fancy "safe" stuff is really producing better code. |
|
|
|
|
#8 |
|
Persnickety Insect
Join Date: Dec 2002
Location: Sunny Munuvia
Posts: 14,914
|
Quote:
Quote:
You can make a language that doesn't let a programmer do anything harmful, but such a language won't let you do anything useful either. But you can work to improve things. |
|
__________________
Free blogs for skeptics... And everyone else. mee.nu What, in the Holy Name of Gzortch, are you people doing?!?!!? - TGHO |
|
|
|
|
|
#9 |
|
by Charles M. Schulz
Join Date: Aug 2001
Posts: 15,990
|
Quote:
|
|
__________________
"James Randi is awesome!" —Ian Bernard, primary host of Free Talk Live "It really does take people like Penn & Teller or James Randi to be able to see through these deceptions, and so those are perhaps the people we should be paying the most attention to." —Harry Browne, 4/10/2004 I know there is a lesson to be learned here somewhere, but I don't know what it is. |
|
|
|
|
|
#10 |
|
Guest
Posts: n/a
|
Quote:
|
|
|
|
|
#11 |
|
Muse
Join Date: Nov 2002
Posts: 513
|
Quote:
And what's so bad about FORTRAN??? {removes chemical engineering hat} ![]() edited to add: In my experience, people who hate FORTRAN just aren't using it for the right thing. |
|
__________________
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/apache/htdocs/vbulletin/admin/db_mysql.php on line 38 |
|
|
|
|
|
#12 |
|
Breaker of Icons
Join Date: Sep 2001
Posts: 1,797
|
Re: Re: Yet Another Buffer Overflow
Quote:
I'm interested in what you base this theory on. I'm assuming you know what MFC is, so what makes you say that this particular set of class libraries inherently causes programming errors. I'm also assuming (hoping) that you're not trying to say that the Win32 APIs are preferable to MFC, since a quick glance at the MFC source reveals it countains a very large amount of error checking, since that's why it was created, to build a wrapper around the APIs that's safer and more convenient than using the APIs directly. |
|
__________________
A gun is not a weapon Marge, it's a tool, like a butcher knife or a harpoon or... ah... ah... an alligator. You just need more education on the subject. -- Homer Simpson |
|
|
|
|
|
#14 |
|
Muse
Join Date: Nov 2002
Posts: 513
|
Quote:
It's not THAT bad - for the right applications. We're not going to write a web browser in it.
|
|
__________________
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/apache/htdocs/vbulletin/admin/db_mysql.php on line 38 |
|
|
|
|
|
#15 |
|
Persnickety Insect
Join Date: Dec 2002
Location: Sunny Munuvia
Posts: 14,914
|
Quote:
Just thought I'd mention that. Yes, I've been thoroughly enjoying my new job as a web designer and the delightful way that every browser is broken, but no two share the same set of brokennesses. BLEAH! The desire to just make everything one big gif becomes overwhelming after a few hours and I have to go and have a lie down
|
|
__________________
Free blogs for skeptics... And everyone else. mee.nu What, in the Holy Name of Gzortch, are you people doing?!?!!? - TGHO |
|
|
|
|
|
#16 |
|
Muse
Join Date: Oct 2002
Location: Vancouver
Posts: 991
|
|
|
__________________
"Great spirits have always encountered violent opposition from mediocre minds." --Albert Einstein "The common man marvels at the uncommon; the wise man marvels at the commonplace." --Confucious "The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." --Bertrand Russell |
|
|
|
|
|
#17 |
|
Wayne's Words
Join Date: Jul 2002
Location: Ottawa, ON
Posts: 2,442
|
Re: Re: Re: Yet Another Buffer Overflow
Quote:
I never tracked to the leaks, but it appeared I ran out of memory faster when said application was run then when not. However, it may have been MSVC++ and not the classes as I nearly always ran my app from there. Having said that, my comment was half tongue-in-cheek. Walt |
|
|
|
|
#18 |
|
by Charles M. Schulz
Join Date: Aug 2001
Posts: 15,990
|
Quote:
|
|
__________________
"James Randi is awesome!" —Ian Bernard, primary host of Free Talk Live "It really does take people like Penn & Teller or James Randi to be able to see through these deceptions, and so those are perhaps the people we should be paying the most attention to." —Harry Browne, 4/10/2004 I know there is a lesson to be learned here somewhere, but I don't know what it is. |
|
|
|
|
|
#19 |
|
by Charles M. Schulz
Join Date: Aug 2001
Posts: 15,990
|
Quote:
The HTML Validator is of invaluable help here. And PHP is by far and above the best scripting language for making web pages that work, providing you stay clear of a very few caveats. |
|
__________________
"James Randi is awesome!" —Ian Bernard, primary host of Free Talk Live "It really does take people like Penn & Teller or James Randi to be able to see through these deceptions, and so those are perhaps the people we should be paying the most attention to." —Harry Browne, 4/10/2004 I know there is a lesson to be learned here somewhere, but I don't know what it is. |
|
|
|
|
|
#20 |
|
Critical Thinker
Join Date: Mar 2003
Posts: 358
|
Hi all,
I have the solution for all your buffer overflow exploits - hardware buffer protection. I work on Unisys ClearPath NX's, previously known as Burroughs mainframes. All words of memory are marked as data, code, pointers, etc., and all data buffers are surrounded by memory-protect words. Try to walk off a buffer, or index off into la-la land, and you will generate a memory-protect hardware interrupt. No range-checking compiler code required. Not only that, only a program marked as a compiler by a privileged user like myself can generate code, and only a compiler-generated codefile can be executed, so no user program can be built that itself builds code and then branches into it. Combining these two features, you just can't get a buffer overflow exploit. And this has been around since the '60s. bPer |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|