33-Year-Old Unix Bug Fixed In OpenBSD
Ste sends along the cheery little story of Otto Moerbeek, one of the OpenBSD developers, who recently found and fixed a 33-year-old buffer overflow bug in Yacc. "But if the stack is at maximum size, this will overflow if an entry on the stack is larger than the 16 bytes leeway my malloc allows. In the case of of C++ it is 24 bytes, so a SEGV occurred. Funny thing is that I traced this back to Sixth Edition UNIX, released in 1975."
Wouldn't want to let anyone take over your system with yacc. Seriously.
Unix beards were Unix stubble
a 33 year old bug, plus a 25 year old bug (http://it.slashdot.org/article.pl?sid=08/05/11/1339228)....
if we keep going backwards, will the world implode? or will daemons start spewing out of cracks in time and space?
The reason girls and Windows users don't understand UNIX is because all the documentation is in Man files.
Any word on when they're going to fix the even older "Too many arguments" bug?
Sorry, but any modern system where a command like "ls a*" may or may not work, based exclusively on the number of files in the directory, is broken.
But this code just seems wrong. What is C code doing referencing the stack pointer directly?
Damn. Ignore that, it's a different ancient Unix bug.
Hail Eris, full of mischief...
E pluribus sanguinem
I bet you they're not talking about the system stack pointer. Remember, yacc is a parser generator; parsing algorithms always use some sort of stack data structure. So, the "stack pointer" in question is just a plain old pointer, pointing into a stack that yacc's generated code uses.
Are you adequate?
Does anyone know if there's a way to make bsd.slashdot.org show up as a section on the main lefthand menu?
Was this a bug when it was originally written, or is it only because of recent developments that it could become exploitable? For instance, the summary mentions stack size. I could imagine that a system written in 1975 would be physically incapable of the process limits we use today, so maybe the program wasn't written to check for them.
Does your software ensure that it doesn't use more than an exabyte of memory? If it doesn't, would you really call it a bug?
Dewey, what part of this looks like authorities should be involved?
Forgive me if this is obvious but if the bug goes that far back will it not affect all other unixes that are based on this same source code - not just OpenBSD?
http://projectleader.wordpress.com
Sorry that message was me, didnt seem to want to keep me signed in :|
Sorry that message was me, didnt seem to want to keep me signed in :|
For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
Sorry that message was me, doesn't seem to want to keep me signed in :|
It is not broken. The fact that it complains "too many arguments" is evidence that it is not broken, since the program (ls) is doing bounds checks on the input. If it was broken, you wouldn't get the message; there would be a buffer overflow because the programmer didn't do constraints checking.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
Mod parent -1 Bullshit.
yacc is not a compiler, go read the link you posted.
This links to what you probably means, but yacc has nothing to do with it.
English is not my first language. Corrections and suggestions are welcome.
yacc is not a compiler,
Excuse me?
Yet Another Compiler Compiler most definitely is a compiler.
How we know is more important than what we know.
I'll catch myself before someone else does. Everything I said above is true, except that ls isn't complaining. The OS, specifically exec() and friends, is complaining because the command line length when the shell expands the wildcard exceeds ARG_MAX. Increase ARG_MAX if you want to allow more files, or use a variation of find with the -exec option or xargs, etc.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
Sorry, I'm not a native speaker. Not a C compiler, as GP said.
English is not my first language. Corrections and suggestions are welcome.
Note to self: Don't worry about having that extra 2k of core memory as the buffer overrun does not work anymore. Sweet.
"Computers are a lot like Air Conditioners" "They both work great until you start opening Windows"
Mod parent -1 Horseshit.
yacc is a compiler, what do you think the two c's stand for?
OpenBSD still uses GCC, version 3.3.5 on i386. I can't say which version is used on the other platforms.
You are talking of PCC, which is being worked on by some of the OpenBSD developers, but I think its a parallel project, see http://pcc.ludd.ltu.se/
for more information.
Jem Matzen talked of this too, see http://www.thejemreport.com/mambo/content/view/369/
gcc still is the default. pcc isn't ready yet, and I don't expect it to be for at least a couple years, and I say that with zero confidence (I'm just an OpenBSD user; I have no idea how the progress is going on pcc).
Sorry that ^U I am Spartacus.
Sam ty sig.
Funny thing is that I traced this back to Sixth Edition UNIX, released in 1975
My sides are completely split! Invite this guy to more parties.
This sig is part of your complete breakfast.
You're correct that's it's not the right way to do it. The problem is *why* it's not the right way to do it. It's not the right way to do it because the arg mechanism chokes on it due to arbitrary limits, and/or because your favorite shell chokes on it first, forcing you to use workarounds. Choking on arbitrary limits is a bad behaviour, leading to buggy results and occasional security holes. That's separate from the question of whether it's more efficient to feed a list of names to xargs or use ugly syntax with find.
Now, if you were running v7 on a PDP-11, there wasn't really enough memory around to do everything without arbitrary limits, so documenting them and raising error conditions when they get exceeded is excusable, and if you were running on a VAX 11/780 which had per-process memory limits around 6MB for some early operating systems, or small-model Xenix or Venix on a 286, it's similarly excusable to have some well-documented arbitrary limits. But certainly this stuff should have been fixed by around 1990.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Will any proprietary business be ready to accept that their product had a bug for the past 3 decades which was identified only now? Does this mean the community is not very active? But somehow this do not seem to bring negative impact in the minds of people as most of the open source consumers know that this means that even the old code is continuously tuned and open source guys have realistic sensible expectations.
Any word on when they're going to fix the even older "Too many arguments" bug?
Use linux instead.
CHANGELOG
git commit
Soft limits can actually mitigate bugs. If we limit processes by default to 1,024 file descriptors, and one of them hits the limit, that process probably has a bug, and would have brought the system to its knees had it continued to allocate file descriptors. Programs designed to use more descriptors could to increase the limit.
Yet Another Compiler Compiler most definitely is a compiler.
While it may be, it's not something you use to compile your everyday programs with and it's certainly not something OpenBSD uses instead of GCC (they will most likely use PCC when it's gets to an acceptable level).
- Peder
Meh, the pcc project was a stupid idea anyway. A modern optimizing multi-platform C compiler is complicated as shit (let alone C++), they have no clue what is ahead. Hell, look at TinyCC, it's not so tiny any more and is not optimizing nor multi-platform.
I'm wondering why they'd go with pcc over llvm. llvm is under a BSD-like license and actively being developed (by Apple as well as others).
Do you even lift?
These aren't the 'roids you're looking for.
Uhh... It generates C parser code for the grammar you specify. It does not generate assembly language code, perform optimisations, type checking etc., that you expect from a compiler. Lets just stick with its proper name shall we? Its a parser generator. It creates a compiler compiler from the grammar you give.
Alternate and equivalent volume to 1 ml?
I just finished reading the "The A-Z of Programming Languages" series on Computerworld (found out about it in here), and now the next article in the series just came up and it's a chat with the creator of Yacc.
Coincidence?
And for those that want to read the interview, it can be found here.
/ The Arrow
"How lovely you are. So lovely in my straightjacket..." - Nny
Only two or three remote holes in the default install not from 33 years ago, in more than 10 years but not less than 33 years!
Kriston
While xargs is a great little workaround/workhorse, it is needed in far too many cases. Why on earth would it be so hard to increase the limits every once in a while? After all, the limit in question was probably perfectly acceptable back in the day when 20mb was a lot of space and 500 files was more files than you could imagine ever creating.
Stop the brainwash