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] [day] [month] [year] [list]
Message-Id: <20150522124403.bb11b61c21f6ca19e7435c85@linux-foundation.org>
Date:	Fri, 22 May 2015 12:44:03 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Randy Dunlap <rdunlap@...radead.org>
Cc:	Vishnu Pratap Singh <vishnu.ps@...sung.com>,
	linux-kernel@...r.kernel.org, cpgs@...sung.com
Subject: Re: [PATCH] init/do_mounts: Add create_dev() failure log

On Fri, 22 May 2015 09:48:24 -0700 Randy Dunlap <rdunlap@...radead.org> wrote:

> On 05/22/15 05:37, Vishnu Pratap Singh wrote:
> > if create_dev() function fails to create the root mount device (/dev/root),
> > then it goes to panic as root device not found but there is no check/log
> > present in case of failure, So i have added the log in case it fails to create
> > the root device. It will help in debugging.
> > 
> > Signed-off-by: Vishnu Pratap Singh <vishnu.ps@...sung.com>
> > ---
> >  init/do_mounts.h |    6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/init/do_mounts.h b/init/do_mounts.h
> > index f5b978a..40c85e9 100644
> > --- a/init/do_mounts.h
> > +++ b/init/do_mounts.h
> > @@ -15,8 +15,12 @@ extern int root_mountflags;
> >  
> >  static inline int create_dev(char *name, dev_t dev)
> >  {
> > +	int ret;
> >  	sys_unlink(name);
> > -	return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
> > +	ret = sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
> > +	if(ret < 0)
> 
> 	if (ret < 0)
> 
> > +		printk(KERN_ERR " Failed to create %s device !! err: %d\n", name, ret);
> 
> Don't need space before 'Failed'.
> 
> > +	return ret;
> >  }

Yup.

And there's no reason for it to be inlined.  Let's move it into
do_mounts.c please.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ