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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 10 Dec 2017 19:35:00 +0100
From:   Lukas Bulwahn <lukas.bulwahn@...il.com>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     sil2review@...ts.osadl.org,
        Lukas Bulwahn <lukas.bulwahn@...il.com>,
        Ingo Molnar <mingo@...nel.org>, Jiri Slaby <jslaby@...e.cz>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] objtool: Use value of intended enum to compile with clang

Just use the right value and avoid an implicit conversion between the two
enumeration types that just happened to work in this case. It seems that
this must have just been overlooked in the new implementation of objtool
in commit baa41469a7b9 ("objtool: Implement stack validation 2.0").

I found this when compiling the kernel with clang-5.0, i.e., executing

  make HOSTCC=clang-5.0 CC=clang-5.0 defconfig && \
  make HOSTCC=clang-5.0 CC=clang-5.0

fails with:

```
arch/x86/decode.c:141:20: error: implicit conversion from enumeration type 'enum op_src_type' to different enumeration type 'enum op_dest_type' [-Werror,-Wenum-conversion]
                        op->dest.type = OP_SRC_REG;
                                      ~ ^~~~~~~~~~
1 error generated.
```

Fixes: baa41469a7b9 ("objtool: Implement stack validation 2.0")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
---
 tools/objtool/arch/x86/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 8acfc47..540a209 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -138,7 +138,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
 			*type = INSN_STACK;
 			op->src.type = OP_SRC_ADD;
 			op->src.reg = op_to_cfi_reg[modrm_reg][rex_r];
-			op->dest.type = OP_SRC_REG;
+			op->dest.type = OP_DEST_REG;
 			op->dest.reg = CFI_SP;
 		}
 		break;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ