lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5j+T64FFfAj26Sts=Dwqqwks-nj_TArmjgwLzapmj-Gk_w@mail.gmail.com>
Date:   Wed, 22 Nov 2017 12:45:17 -0800
From:   Kees Cook <keescook@...gle.com>
To:     Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, Borislav Petkov <bp@...e.de>
Subject: x86/insn-eval: negative return value?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ