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]
Date:   Fri, 8 Oct 2021 19:48:21 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Yinan Liu <yinan@...ux.alibaba.com>
Cc:     mark-pk.tsai@...iatek.com, peterz@...radead.org, mingo@...hat.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] scripts: ftrace - move the sort-processing in
 ftrace_init to compile time

On Sun, 3 Oct 2021 21:42:10 +0800
Yinan Liu <yinan@...ux.alibaba.com> wrote:

> Sorry for my slow progress . I have encountered some problems with the 
> sorting
> of the module's mcount in compile time. The .ko file will be relocated 
> after insmod
> or modprobe, most of the mcount relocation is based on .text section, 
> but there are
> also a small part of mcount relocation based on .init.text section such 
> as module_init().
> The loading position of .init.text and .text does not seem to be in a 
> definite order.

Right, there's no guarantee that the .text portion of a module is
placed before or after the .init.text portion.

> 
> For example, when I insmod ip_tables.ko twice, the front and back 
> positions of init.text
> and .text are different, so we cannot sort the mcounts in the two 
> sections, which makes
> the mcount sorting in the module meaningless.
> 
> What is your opinion on this?

Probably just keep the sorting algorithm in the kernel and take place
on module load.

If you still want to sort at compile time, then do the sort for .init
functions separate from the .text ones, and have a way to extract this
information (shouldn't be too hard) in the kernel at module load, and
then just swap the init and text functions if they were added in the
reverse order that was expect.

The functions in .init will either be before all the functions in .text
or after. They wont be intermingled. Thus, if they are both sorted,
then they are placed correctly or the two groups of functions need to
be switched. No other sorting should be necessary.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ