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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 11 Nov 2013 16:45:48 -0800
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Caizhiyong <caizhiyong@...ilicon.com>,
	Brian Norris <computersforpeace@...il.com>,
	"Wanglin (Albert)" <albert.wanglin@...ilicon.com>,
	Artem Bityutskiy <dedekind1@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
	Karel Zak <kzak@...hat.com>,
	Shmulik Ladkani <shmulik.ladkani@...il.com>,
	Randy Dunlap <rdunlap@...radead.org>,
	"fengguang.wu@...el.com" <fengguang.wu@...el.com>
Subject: Re: [PATCH] block: cmdline-parser: perfect cmdline format checking

On Mon, 2013-11-11 at 15:34 -0800, Andrew Morton wrote:
> On Sat, 9 Nov 2013 11:45:14 +0000 Caizhiyong <caizhiyong@...ilicon.com> wrote:
[]
> >  -perfect cmdline format checking, make the error information clear
> >   for understand, make this lib fully equivalent to the old parser
> >   in drivers/mtd/cmdlinepart.c
> > 
> > ...
> >
> > +#define PARSER                       "cmdline-parser: "
> > ...
> > -			pr_warn("cmdline partition size is invalid.");
> > +			pr_warn(PARSER "partition '%s' size '0x%llx' too small.",
> 
> You can use the standard pr_fmt() mechanism instead of this.
[]
> diff -puN block/cmdline-parser.c~mtd-cmdlinepart-use-cmdline-partition-parser-lib-fix block/cmdline-parser.c
[]
> @@ -21,10 +26,12 @@ static int parse_subpart(struct cmdline_
>  	if (*partdef == '-') {
>  		new_subpart->size = (sector_t)(~0ULL);
>  		partdef++;
> +		lastpart = 1;
>  	} else {
>  		new_subpart->size = (sector_t)memparse(partdef, &partdef);
>  		if (new_subpart->size < (sector_t)PAGE_SIZE) {
> -			pr_warn("cmdline partition size is invalid.");
> +			pr_warn(PARSER "partition '%s' size '0x%llx' too small.",
> +				partorg, new_subpart->size);

As well, please add terminating '\n' newlines to all the formats.
This helps avoid possible logging message interleaving.


--
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