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]
Message-ID: <ZG8YY/r8BLCzw93q@corigine.com>
Date:   Thu, 25 May 2023 10:12:19 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Osama Muhammad <osmtendev@...il.com>
Cc:     krzysztof.kozlowski@...aro.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, nbd@....name, ryder.lee@...iatek.com,
        lorenzo@...nel.org, shayne.chen@...iatek.com, davem@...emloft.net,
        linux-wireless@...r.kernel.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] nfcsim.c: Fix error checking for debugfs_create_dir

On Wed, May 24, 2023 at 08:55:06PM +0500, Osama Muhammad wrote:
> This patch fixes the error checking in nfcsim.c in
> debugfs_create_dir. The correct way to check if an error occurred
> is using 'IS_ERR' inline function.
> 
> Signed-off-by: Osama Muhammad <osmtendev@...il.com>

...

On Wed, May 24, 2023 at 09:03:52PM +0500, Osama Muhammad wrote:
> This patch fixes the error checking in debugfs.c in
> debugfs_create_dir. The correct way to check if an error occurred
> is using 'IS_ERR' inline function.
> 
> Signed-off-by: Osama Muhammad <osmtendev@...il.com>

...

The comment above debugfs_create_dir includes the following text.

 * NOTE: it's expected that most callers should _ignore_ the errors returned
 * by this function. Other debugfs functions handle the fact that the "dentry"
 * passed to them could be an error and they don't crash in that case.
 * Drivers should generally work fine even if debugfs fails to init anyway.

And I notice that in this same file there are calls to debugfs_create_dir()
where that advice is followed: the return value is ignored.

So I think the correct approaches here are to either:

1. Do nothing, the code isn't really broken
2. Remove the error checking

-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ