mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* x86/insn-eval: negative return value?
@ 2017-11-22 20:45 Kees Cook
  2017-11-22 21:22 ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2017-11-22 20:45 UTC (permalink / raw)
  To: Ricardo Neri; +Cc: LKML, Borislav Petkov

Hi,

While doing some Clang test builds, this was reported:

arch/x86/lib/insn-eval.c:780:10: warning: implicit conversion from
'int' to 'char' changes value from 132 to -124 [-Wconstant-conversion]
                return INSN_CODE_SEG_PARAMS(4, 8);
                ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/insn-eval.h:16:57: note: expanded from macro
'INSN_CODE_SEG_PARAMS'
#define INSN_CODE_SEG_PARAMS(oper_sz, addr_sz) (oper_sz | (addr_sz << 4))
                                                ~~~~~~~~^~~~~~~~~~~~~~~~

Is this really expected to wrap negative on IA-32e 64-bit mode case?

Thanks!

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-23  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 20:45 x86/insn-eval: negative return value? Kees Cook
2017-11-22 21:22 ` Borislav Petkov
2017-11-22 21:48   ` Kees Cook
2017-11-22 23:06     ` Borislav Petkov
2017-11-22 23:17       ` Kees Cook
2017-11-23  8:54         ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®