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:	Tue, 08 Sep 2009 17:26:39 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>
CC:	LKML <linux-kernel@...r.kernel.org>,
	Kay Sievers <kay.sievers@...y.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Alan Cox <alan@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...e.de>
Subject: Re: [PATCH RFC] char/tty_io: fix legacy pty name when more than 256
 pty devices are requested

On 09/08/2009 04:33 PM, Mauro Carvalho Chehab wrote:
> 
>> If you're going to do this, I would suggest using the following
>> namespace, as such:
>>
>> 	[pt]ty[p-za-e][0-9a-f]+
> 
> To be backward compatible, the format should be, at least:
> 
>  	[pt]ty[p-za-e][0-9a-f].+
> 
> otherwise, it can potentially break backward compatibility, as the first 10 devices will be like:
> 	/dev/ttyp0
> 	/dev/ttyp1
> 	...
> 
> instead of:
> 
> 	/dev/ttyp00
> 	/dev/ttyp01
> 

Correct.  You're missing the point: if you follow my recipe, the legacy
names fall out of the same algorithm.  The first 256 will have the
traditional names, fully compatible, the 256th entry will be
/dev/ttyp10, and so on.

>>
>> 	sprintf(name, "%cty%c%x", slave ? 't' : 'p',
>> 		"pqrstuvwxyzabcde"[(index >> 4) & 15],
>> 		((index >> 4) & ~15) | (index & 15));
> 
> We may use this, instead:
> 
>  	sprintf(name, "%cty%c%02x", slave ? 't' : 'p',
>  		"pqrstuvwxyzabcde"[(index >> 4) & 15],
>  		((index >> 4) & ~15) | (index & 15));
> 
>> No arbitrary limits, and it still extends the existing namespace with
>> some reasonable continuity.  It means bits [7:4] are weirdly encoded,
>> but we get straightforward backwards compatibility as a result.
> 
> But it will also be a little more weird.

IMO, no less weird than a random shift from one naming algorithm to
another in the middle of the sequence.

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