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:	Thu, 26 Jan 2012 09:17:25 +0000
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>
Cc:	<socketpair@...il.com>, <xen-devel@...ts.xensource.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] Fwd: BUG in
 linux+v3.2.1/drivers/xen/xen-pciback/pci_stub.c

>>> On 25.01.12 at 22:22, Konrad Rzeszutek Wilk <konrad.wilk@...cle.com> wrote:
> --- a/drivers/xen/xen-pciback/xenbus.c
> +++ b/drivers/xen/xen-pciback/xenbus.c
> @@ -206,8 +206,9 @@ static int xen_pcibk_publish_pci_dev(struct 
> xen_pcibk_device *pdev,
>  		goto out;
>  	}
>  
> +	/* TODO: implement feature-use-decimal-for-devfn */
>  	err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str,
> -			    "%04x:%02x:%02x.%02x", domain, bus,
> +			    "%04x:%02x:%02x.%1x", domain, bus,
>  			    PCI_SLOT(devfn), PCI_FUNC(devfn));
>  
>  out:

If you are concerned about compatibility (as the added comment
suggests), then removing the leading zero is not an option either.

However, as long as all parsers of the string use plain %x or %d,
there's no issue here and you could as well use %d here too (as
PCI functions are always in the 0-7 range, which is identically
represented in octal [important for the case of a leading zero],
decimal, and hex).

Bottom line - just add the comment here, and leave the format
unchanged, or change the format to %d right away.

Jan

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