08What is a TOCTOU race, how does it turn into privilege escalation through files, and how do you write privileged code that avoids it?▼hardNewGoogleMicrosoftApple○ sign inCheck, then use: two system calls, and an attacker in between. The answer interviewers want replaces names with handles and checks with atomic operations, and can show it in code.Open full answer →
35A gift card can be redeemed twice if two requests arrive at the same moment. Explain the bug class and fix it properly.▼hardNewAmazonMicrosoftSalesforce◆ premiumEvery check passed and every write succeeded. The money still left twice, because the check and the write were two steps and another request got between them.Open full answer →