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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADJ6UvOZz=WZ18wYVhZcH0u58u_snDxmgbwsfTOS2ski-4O7tg@mail.gmail.com>
Date:   Sun, 14 Jan 2018 23:24:53 -0800
From:   "Stefan O'Rear" <sorear2@...il.com>
To:     patches@...ups.riscv.org
Cc:     Palmer Dabbelt <palmer@...ive.com>, Albert Ou <albert@...ive.com>,
        Christoph Hellwig <hch@....de>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...hat.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Kamil Rytarowski <n54@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, Alan Kao <alankao@...estech.com>,
        Greentime Hu <greentime@...estech.com>
Subject: Re: [patches] [PATCH v2 2/6] riscv/ftrace: Add dynamic function
 tracer support

On Sun, Jan 14, 2018 at 10:47 PM, Alan Kao <nonerkao@...il.com> wrote:
> +       /*
> +        * For the dynamic ftrace to work, here we should reserve at least
> +        * 8 bytes for a functional auipc-jalr pair. Pseudo inst nop may be
> +        * interpreted as different length in different models, so we manually
> +        * *expand* two 4-byte nops here.
> +        *
> +        * Calling ftrace_update_ftrace_func would overwrite the nops below.
> +        * Check ftrace_modify_all_code for details.
> +        */
> +       addi    x0, x0, 0
> +       addi    x0, x0, 0

This relies on behavior of the assembler which is undocumented and, if
my reading of the specification is correct, a bug.

The documented way to assemble an sequence of 2 4-byte NOPs regardless
of subtarget is as follows:

.option push
.option norvc
    nop
    nop
.option pop

I have filed https://github.com/riscv/riscv-binutils-gdb/issues/135 to
get clarity on the assembler behavior; the explicit approach may be
preferable even if the assembler behavior turns out to be correct.

-s

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ