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:
 <15428e7e4dd2c548a3d4b6d8503a2d01070d3583.camel@cyberus-technology.de>
Date: Mon, 24 Mar 2025 09:35:02 +0000
From: Julian Stecklina <julian.stecklina@...erus-technology.de>
To: "hch@....de" <hch@....de>, "brauner@...nel.org" <brauner@...nel.org>,
	"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>
CC: "torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"rafael@...nel.org" <rafael@...nel.org>, "linux-fsdevel@...r.kernel.org"
	<linux-fsdevel@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "xiang@...nel.org" <xiang@...nel.org>,
	"linux-erofs@...ts.ozlabs.org" <linux-erofs@...ts.ozlabs.org>
Subject: Re: [PATCH v2 3/9] initrd: add a generic mechanism to add fs
 detectors

On Sat, 2025-03-22 at 21:34 +0100, Julian Stecklina via B4 Relay wrote:
> 
>  #ifdef CONFIG_BLK_DEV_INITRD
>  extern void __init reserve_initrd_mem(void);
>  extern void wait_for_initramfs(void);
> +
> +/*
> + * Detect a filesystem on the initrd. You get 1 KiB (BLOCK_SIZE) of
> + * data to work with. The offset of the block is specified in
> + * initrd_fs_detect().
> + *
> + * @block_data: A pointer to BLOCK_SIZE of data
> + *
> + * Returns the size of the filesystem in bytes or 0, if the filesystem
> + * was not detected.
> + */
> +typedef size_t initrd_fs_detect_fn(void * const block_data);
> +
> +struct initrd_detect_fs {
> + initrd_fs_detect_fn *detect_fn;
> + loff_t detect_byte_offset;
> +};
> +
> +extern struct initrd_detect_fs __start_initrd_fs_detect[];
> +extern struct initrd_detect_fs __stop_initrd_fs_detect[];
> +
> +/*
> + * Add a filesystem detector for initrds. See the documentation of
> + * initrd_fs_detect_fn above.
> + */
> +#define initrd_fs_detect(fn, byte_offset) \
> + static const struct initrd_detect_fs __initrd_fs_detect_ ## fn \
> + __used __section("_initrd_fs_detect") = \
> + { .detect_fn = fn, .detect_byte_offset = byte_offset}
> +
>  #else
>  static inline void __init reserve_initrd_mem(void) {}
>  static inline void wait_for_initramfs(void) {}
> +
> +#define initrd_fs_detect(detectfn)

The !CONFIG_BLK_DEV_INITRD path is broken. Will fix in v3 and add it to my test
plan.

Julian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ