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: <61beb54b-399b-442d-bfdb-bad23cefa586@app.fastmail.com>
Date: Thu, 25 Jul 2024 17:30:58 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Christoph Hellwig" <hch@...radead.org>,
 "Youling Tang" <youling.tang@...ux.dev>
Cc: "Luis Chamberlain" <mcgrof@...nel.org>, "Chris Mason" <clm@...com>,
 "Josef Bacik" <josef@...icpanda.com>, "David Sterba" <dsterba@...e.com>,
 "Theodore Ts'o" <tytso@....edu>, "Andreas Dilger" <adilger.kernel@...ger.ca>,
 "Jaegeuk Kim" <jaegeuk@...nel.org>, "Chao Yu" <chao@...nel.org>,
 Linux-Arch <linux-arch@...r.kernel.org>, linux-kernel@...r.kernel.org,
 linux-modules@...r.kernel.org, linux-btrfs@...r.kernel.org,
 linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
 "Youling Tang" <tangyouling@...inos.cn>
Subject: Re: [PATCH 1/4] module: Add module_subinit{_noexit} and module_subeixt helper
 macros

On Thu, Jul 25, 2024, at 16:39, Christoph Hellwig wrote:
> On Thu, Jul 25, 2024 at 11:01:33AM +0800, Youling Tang wrote:
>> - It doesn't feel good to have only one subinit/exit in a file.
>>   Assuming that there is only one file in each file, how do we
>>   ensure that the files are linked in order?(Is it sorted by *.o
>>   in the Makefile?)
>
> Yes, link order already matterns for initialization order for built-in
> code, so this is a well known concept.

Note: I removed the old way of entering a module a few
years ago, which allowed simply defining a function called
init_module(). The last one of these was a07d8ecf6b39
("ethernet: isa: convert to module_init/module_exit").

Now I think we could just make the module_init() macro
do the same thing as a built-in initcall() and put
an entry in a special section, to let you have multiple
entry points in a loadable module.

There are still at least two problems though:

- while link order is defined between files in a module,
  I don't think there is any guarantee for the order between
  two initcalls of the same level within a single file.

- For built-in code we don't have to worry about matching
  the order of the exit calls since they don't exist there.
  As I understand, the interesting part of this patch
  series is about making sure the order matches between
  init and exit, so there still needs to be a way to
  express a pair of such calls.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ