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]
Date:   Fri, 8 Dec 2017 11:12:25 +0900
From:   "Prashant Bhole" <bhole_prashant_q7@....ntt.co.jp>
To:     "'Jakub Kicinski'" <jakub.kicinski@...ronome.com>
Cc:     "'David S . Miller'" <davem@...emloft.net>,
        <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next] netdevsim: correctly check return value of debugfs_create_dir



> From: Jakub Kicinski [mailto:jakub.kicinski@...ronome.com]
> 
> On Fri,  8 Dec 2017 09:52:50 +0900, Prashant Bhole wrote:
> > Return value is now checked with IS_ERROR_OR_NULL because
> > debugfs_create_dir doesn't return error value. It either returns NULL
> > or a valid pointer.
> >
> > Signed-off-by: Prashant Bhole <bhole_prashant_q7@....ntt.co.jp>
> > ---
> >  drivers/net/netdevsim/netdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/netdevsim/netdev.c
> > b/drivers/net/netdevsim/netdev.c index eb8c679fca9f..88d8ee2c89da
> > 100644
> > --- a/drivers/net/netdevsim/netdev.c
> > +++ b/drivers/net/netdevsim/netdev.c
> > @@ -469,7 +469,7 @@ static int __init nsim_module_init(void)
> >  	int err;
> >
> >  	nsim_ddir = debugfs_create_dir(DRV_NAME, NULL);
> > -	if (IS_ERR(nsim_ddir))
> > +	if (IS_ERR_OR_NULL(nsim_ddir))
> >  		return PTR_ERR(nsim_ddir);
> 
> PTR_ERR() will not be good in case of NULL, no?  But it's anyone's guess
what
> the correct error code would then be... the EEXIST from
> start_creating() I was after is dropped in debugfs_create_dir(), as you
previously
> pointed out.
> 
> Maybe just drop this error handling here and in nsim_bpf_create_prog().
> Let's consistently ignore all DebugFS errors.  Sorry about going back and
forth on
> this a little bit.

Ok. I am sending a patch to remove this error handling. Thank you.

-Prashant


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ