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: <1ea36b32-9bbc-a611-402d-9fa196eda166@arm.com>
Date:   Thu, 22 Jul 2021 11:10:24 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     Anthony Iliopoulos <ailiop@...e.com>,
        Christoph Hellwig <hch@....de>,
        Marek Szyprowski <m.szyprowski@...sung.com>
Cc:     iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma-debug: fix debugfs initialization order

On 2021-07-22 10:18, Anthony Iliopoulos wrote:
> Due to link order, dma_debug_init is called before debugfs has a chance
> to initialize (via debugfs_init which also happens in the core initcall
> stage), so the directories for dma-debug are never created.
> 
> Move the dma_debug_init initcall from core to postcore stage so that
> debugfs will already be initialized by the time this is called, making
> it oblivious to link-ordering.

Playing initcall chicken here doesn't work so well - the later you 
initialise dma-debug itself, the more chance it has to miss early 
mappings and raise false positives later. As discussed previously[1] the 
better solution would be to decouple the debugfs setup so that just that 
part can be deferred until core_initcall_sync or later.

Robin.

[1] https://lore.kernel.org/linux-iommu/YIgGa6yF%2Fadg8OSN@kroah.com/

> Fixes: 15b28bbcd567 ("dma-debug: move initialization to common code")
> Signed-off-by: Anthony Iliopoulos <ailiop@...e.com>
> ---
>   kernel/dma/debug.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
> index 14de1271463f..49d80ef7f995 100644
> --- a/kernel/dma/debug.c
> +++ b/kernel/dma/debug.c
> @@ -915,7 +915,7 @@ static int dma_debug_init(void)
>   	pr_info("debugging enabled by kernel config\n");
>   	return 0;
>   }
> -core_initcall(dma_debug_init);
> +postcore_initcall(dma_debug_init);
>   
>   static __init int dma_debug_cmdline(char *str)
>   {
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ