Forgot your password?
typodupeerror

Comment: Re:Rats! (Score 1) 457

by Barsamin (#33206690) Attached to: Claimed Proof That P != NP

You are confusing logic and meta-logic. In a a suitable logic (per Gödel theorem), p or not p is provable. Only the meta-logical statement "every proposition of the logic can be proven or refuted" is false. This doesn't make the principle of bivalence meaningless, but simply illustrates the limits of the axiomatic method. Intuitionist logic doesn't help at all since Gödel theorem apply to it as well.

There might be reasons to be intuitionist but Gödel theorem is not one of them.

Comment: Re:Wait, what? (Score 1) 391

by Barsamin (#28745639) Attached to: New Linux Kernel Flaw Allows Null Pointer Exploits

Why the fuck doesn't slashdot has an edit option.
Ignore the second post, it is complete bullshit.

In the first post, replace the second-to-last paragraph by:
If however offset is non NULL, then tun might or might not be NULL, and the test might be reached. It therefore must be preserved.

Then add at the end of the post, by test I mean both the if and its body.

Comment: Re:Wait, what? (Score 1) 391

by Barsamin (#28745423) Attached to: New Linux Kernel Flaw Allows Null Pointer Exploits

I'd like to make the last paragraph more precise,

If sk is not the first member of tun, the compiler can remove the if (since the condition is always true), but it must preserve the body of the if. If it doesn't keep the body, it is a bug.

On the other hand, if sk is the first member of tun, the compiler can remove the if and its body.

Comment: Re:Wait, what? (Score 1) 391

by Barsamin (#28745381) Attached to: New Linux Kernel Flaw Allows Null Pointer Exploits

You are correct in saying that it is tun + offset which is dereferenced (not tun itself).

(BTW tun is obviously a pointer in the code given, no need to take its address.)

That means that the compiler knows, if it reaches the if, that tun+offset is not NULL, but not necessarily that tun is not NULL.

That would be true in general. But what everyone here seems to have missed, is that offset is known at compile time.

If offset is NULL, then either tun is NULL and we enter the realm of undefined behavior and the compiler is permitted to remove the check, or tune is not NULL in which case the test is dead code.

If however offset is non NULL, then tun must be non NULL if the test is reached.

To summarize, if sk is the first member of tun (offset zero), then the compiler has all rights to remove the test. If not, this is a compiler bug.

In a consumer society there are inevitably two kinds of slaves: the prisoners of addiction and the prisoners of envy.

Working...