diff options
| author | Nick Desaulniers <[email protected]> | 2017-12-28 22:11:36 -0500 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2018-01-04 14:57:10 +0100 |
| commit | 29f1b2b0fecfae69e31833836f1da3136696eee5 (patch) | |
| tree | 4c299cbdc55a3cc3236e8ef3cc80e6af51ee4a57 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | 00a5ae218d57741088068799b810416ac249a9ce (diff) | |
posix-timers: Prevent UB from shifting negative signed value
Shifting a negative signed number is undefined behavior. Looking at the
macros MAKE_PROCESS_CPUCLOCK and FD_TO_CLOCKID, it seems that the
subexpression:
(~(clockid_t) (pid) << 3)
where clockid_t resolves to a signed int, which once negated, is
undefined behavior to shift the value of if the results thus far are
negative.
It was further suggested to make these macros into inline functions.
Suggested-by: Thomas Gleixner <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Dimitri Sivanich <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Al Viro <[email protected]>
Cc: [email protected]
Cc: Shuah Khan <[email protected]>
Cc: Deepa Dinamani <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions