google / google/sanitizers

Asm instrumentation does not preserve flags

Open
#307 5 comments 0 reactions 1 assignee Claimed by @eugenis View on GitHub
Priority-Medium ProjectAddressSanitizer Status-Accepted Type-Defect
Dominant language
C
Stars
12.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 307

```
0x00007fbddec82e6c <+44>: sub $0x80,%rsp
0x00007fbddec82e73 <+51>: push %rdi
0x00007fbddec82e74 <+52>: lea (%rsi),%rdi
0x00007fbddec82e77 <+55>: callq 0x7fbddec66380 <__sanitizer_sanitize_store4@plt>
0x00007fbddec82e7c <+60>: pop %rdi
=> 0x00007fbddec82e7d <+61>: add $0x80,%rsp

^^^ This instruction clobbers flags.

(gdb) disassemble __sanitizer_sanitize_store4
Dump of assembler code for function __sanitizer_sanitize_store4:
0x00000000004a9a48 <+0>: sub $0x80,%rsp

^^^ This instruction clobbers flags, too.

0x00000000004a9a4f <+7>: push %rax
0x00000000004a9a50 <+8>: push %rcx
0x00000000004a9a51 <+9>: pushfq

^^^ This pushfq is too late (and corresponding popfq is too early).

```

Reported by `eugenis@google.com` on 2014-05-07 09:30:02

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.