News for hackers. Stuff that matters.
Re:Security flaws caused by compiler optimizations by tinus_hn on Wednesday August 21, 2019 @02:30PM (#20760035)
The assignment merely takes the address of tun and adds a small value. That wouldn’t cause a crash.

The surprise is that the if (!tun) check is optimized sway because if tun is NULL the assignment causes undefined behavior which the compiler does not have to take into account.

Re:Security flaws caused by compiler optimizations by tom_ on Wednesday August 21, 2019 @02:32PM (#20760058)
No, it fetches it - tun->sk is copied. The address calculation case would be something more like struct sock * * p=&tun->sk.