Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Re:News flash (Score 1) 470

If you want a "this cannot happen" with core dump in C, just use abort(). Unless its behaviour is specifically overriden, it's specified to exit the program as unsuccessful termination by the C standards (e.g. 7.22.4.1p2 of C11), and to core dump by POSIX (about as portable as you can get where core dumps are concerned; in straight C, they might not necessarily exist). It also has the benefit of being pretty short, and not undefined behaviour at all.

Of course, that doesn't work in the kernel, but then neither would the other methods you suggested.

Comment Re:Really? (Score 1) 240

It's worse than that. In general, there's nothing stopping anyone sending an email from any address they like; the From: address is simply written onto the email by the sender, much the same way as there's nothing preventing someone sending physical mail writing any return address they like on the envelope. Of course, this makes it kind-of easy to spam, so various methods have sprung up over the years for people to validate the From: address on an email, but there's no universal method that will work for every email you might ever receive.

In general, you should never trust the From: address on an email for any purpose whatsoever other than determining who the sender wants you to think they are.

Comment Re:C/C++ operator = (Score 1) 360

It's best known for working in some old, buggy FORTRAN situations. Nowadays, it's legal INTERCAL too, albeit mostly to be perverse (and in some compilers, you may have to alias the constant to a variable to be able to assign to it without the compiler complaining).

Comment Re:Type safety (Score 1) 360

I like this trick, and am glad that you're publicising it. It was a pretty clever addition to many compilers; the compilers that don't understand it won't reject the code, the compilers that do will know it's intentional. And maintenance programmers reading the code will know it's intentional, too.

Comment Re:Nothing you can do? (Score 1) 99

You have to do this no matter what privilege escalation method you use, because a rogue administrator might have left a random setuid binary around somewhere. Or has put a logic bomb in the script. Or something like that. Having only one door to guard is no use when the inside of the building carries a bunch of materials for building extra doors.

Comment Re:Go, France! (Score 1) 88

Not every site does. For instance, I vaguely remembered that Microsoft EULAs have jurisdiction based on the country where you live, with the "you consent to jurisdiction in Washington" bit only applying to Americans. I checked the Terms of Service for Bing, and I was right. (For instance, for Europeans, it uses Luxembourg law for breaches of the ToS specifically, and the local jurisdiction for other claims.) Microsoft seems to have local companies set up for the purpose of sorting out contracts with people in countries other than the US. Many other sites don't seem to consider jurisdictional issues in their TOS at all. I suspect that that might lead to complications if they ever have to sue someone, but it's nicer for their users. Incidentally, local jurisdiction clauses in a ToS are actually one reason that causes me to avoid agreeing to them, unless they're set up in such a way that they only apply if I invoke them, they can't be invoked against me. (I end up avoiding a large number of major websites because of this.)

Comment Re:This is straight from Microsoft's playbook (Score 1) 510

More to the point, it's trivial to break a chroot on Linux if you have root access; it's not designed to be secure against someone with root permissions. (You create a second chroot inside the original chroot, and move your shell inside it but keep the working directory between the two chroots. Then you can just do cd .. until you reach the original root, and chroot again to reset the root to its original value.) I think this is intentional; there are plenty of other ways to break a chroot as root, but they tend to be more destructive, so having an easy way out is nice. (This is also the reason that chroots can only be created as root; otherwise, they'd be no security even against unprivileged users.)

Comment Re:Slip the backdoor into a precompiled GCC instea (Score 1) 576

Not at all. You only apply the "patch" when debugging symbols are off and optimisation is on, which would cover nearly any production build. Even if you left in debugging symbols, you would still have a hard time discovering it with a debugger since optimisation is supposed do change the output.

You would also make it trigger under very special circumstances and as others have pointed out, the error you introduce could be a subtle change of behaviour of the random number generator.

If you did that, the backdoor would disappear over the course of time whenever someone released a production compiler that was compiled with a debugging-symbol version of the same compiler. (This is a lot more likely than it seems; the people who actually develop compilers, and thus compile them, are likely to have debugging symbols on for their compilers as a matter of course, because they frequently make changes that break them.)

Comment Re:Got your feelings hurt? (Score 1) 566

/dev/random blocks if it feels that there wasn't enough entropy gathered from the environment to produce a truly random number. /dev/urandom will never block; rather, if there isn't enough entropy gathered from the environment, it will give you a cryptographically secure pseudorandom number instead. So the difference basically depends on what level of true randomness you need; in general, /dev/urandom is just fine for all applications except cryptography, and if you're doing cryptography, you shouldn't be using either directly but rather relying on a crypto library anyway (and the library probably uses /dev/random, possibly among other things).

Slashdot Top Deals

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...