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: <20120509133607.GA26124@gmail.com>
Date:	Wed, 9 May 2012 15:36:07 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Igor Mammedov <imammedo@...hat.com>, Jiang Liu <liuj97@...il.com>,
	linux-kernel@...r.kernel.org, pjt@...gle.com, tglx@...utronix.de,
	seto.hidetoshi@...fujitsu.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC][PATCH] printk: Add %pb to print bitmaps


* Peter Zijlstra <peterz@...radead.org> wrote:

> @@ -857,15 +860,19 @@ int kptr_restrict __read_mostly;
>   *       correctness of the format string and va_list arguments.
>   * - 'K' For a kernel pointer that should be hidden from unprivileged users
>   * - 'NF' For a netdev_features_t
> + * - 'b' For a bitmap, consumes 2 args, second is int

hm, won't the second arg confuse gcc's printf format checker?

> +	case 'b':
> +		{
> +			int bits, len;
> +
> +			switch (fmt[1]) {
> +			case 'c':
> +				bits = nr_cpumask_bits;
> +				break;
> +			case 'n':
> +				bits = MAX_NUMNODES;
> +				break;
> +			default:
> +				bits = va_arg(args, int);
> +				break;
> +			}
> +		       
> +			len = bitmap_scnlistprintf(buf, end - buf, ptr, bits);

also, if the second argument is not provided, could va_arg() 
return noise or even NULL?

Thanks,

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