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]
Message-ID: <20191030150302.GA965@suse.de>
Date:   Wed, 30 Oct 2019 16:03:02 +0100
From:   Torsten Duwe <duwe@...e.de>
To:     Mark Rutland <mark.rutland@....com>
Cc:     linux-arm-kernel@...ts.infradead.org, Jessica Yu <jeyu@...nel.org>,
        Helge Deller <deller@....de>,
        "James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
        linux-kernel@...r.kernel.org, amit.kachhap@....com,
        catalin.marinas@....com, james.morse@....com, jpoimboe@...hat.com,
        jthierry@...hat.com, linux-parisc@...r.kernel.org,
        mingo@...hat.com, peterz@...radead.org, rostedt@...dmis.org,
        svens@...ckframe.org, takahiro.akashi@...aro.org, will@...nel.org
Subject: Re: [PATCHv2 2/8] module/ftrace: handle patchable-function-entry

On Tue, Oct 29, 2019 at 04:58:26PM +0000, Mark Rutland wrote:
> When using patchable-function-entry, the compiler will record the
> callsites into a section named "__patchable_function_entries" rather
> than "__mcount_loc". Let's abstract this difference behind a new
> FTRACE_CALLSITE_SECTION, so that architectures don't have to handle this
> explicitly (e.g. with custom module linker scripts).
> 
> As parisc currently handles this explicitly, it is fixed up accordingly,
> with its custom linker script removed. Since FTRACE_CALLSITE_SECTION is
> only defined when DYNAMIC_FTRACE is selected, the parisc module loading
> code is updated to only use the definition in that case. When
> DYNAMIC_FTRACE is not selected, modules shouldn't have this section, so
> this removes some redundant work in that case.
> 
> I built parisc generic-{32,64}bit_defconfig with DYNAMIC_FTRACE enabled,
> and verified that the section made it into the .ko files for modules.

This is because of remaining #ifdeffery in include/asm-generic/vmlinux.lds.h:

#ifdef CC_USING_PATCHABLE_FUNCTION_ENTRY
#define MCOUNT_REC()    . = ALIGN(8);                           \
                        __start_mcount_loc = .;                 \
                        KEEP(*(__patchable_function_entries))   \
                        __stop_mcount_loc = .;
#else
#define MCOUNT_REC()    . = ALIGN(8);                           \
                        __start_mcount_loc = .;                 \
                        KEEP(*(__mcount_loc))                   \
                        __stop_mcount_loc = .;
#endif

Maybe you want to tackle that as well? I suggest to have at least one
FTRACE_CALLSITE_SECTION definition without double quotes. Alternatively, my
earlier solution just kept both sections, in case either one or both are
present.

                        KEEP(*(__patchable_function_entries))   \
                        KEEP(*(__mcount_loc))                   \

	Torsten

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ