lkml.org 
[lkml]   [2020]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] x86/insn: Fix some potential undefined behavior.
On Wed, Oct 14, 2020 at 11:21:47PM -0700, Ian Rogers wrote:
> From: Numfor Mbiziwo-Tiapo <nums@google.com>
>
> If insn_init is given a NULL kaddr and 0 buflen then validate_next will
> perform arithmetic on NULL, add a guard to avoid this.

How is this a problem? NULL is (void *)0, you can do arithmetic on that
just fine.

Is UBSAN taking drugs again?

> Don't perform unaligned loads in __get_next and __peek_nbyte_next as
> these are forms of undefined behavior.

Fair enough; that could actually be a problem when we start to
cross-build this stuff. A RISC hosted version of the x86 decoder could
indeed trip this up.


But also, these are two changes in one patch.

\
 
 \ /
  Last update: 2020-10-15 12:06    [W:1.839 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site