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, 16 Mar 2010 16:25:49 +0100
From:	Denys Vlasenko <vda.linux@...glemail.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	James Bottomley <James.Bottomley@...e.de>,
	Arnd Bergmann <arnd@...db.de>,
	"linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	Daniel Taylor <Daniel.Taylor@....com>,
	Jeff Garzik <jeff@...zik.org>, Mark Lord <kernel@...savvy.com>,
	tytso@....edu, "H. Peter Anvin" <hpa@...or.com>,
	hirofumi@...l.parknet.co.jp,
	Andrew Morton <akpm@...ux-foundation.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>, irtiger@...il.com,
	Matthew Wilcox <matthew@....cx>, aschnell@...e.de,
	knikanth@...e.de, jdelvare@...e.de
Subject: Re: ATA 4 KiB sector issues.

On Tue, Mar 16, 2010 at 4:12 PM, Tejun Heo <tj@...nel.org> wrote:
>> The "end of partition" is expected to be at the last head and sector.
>> Of course this heuristic fails if there are more than one primary
>> partition and they have differing last head and sector.
>>
>> But on most "sanely" partitioned disks they are the same:
>>
>> Disk /dev/sda: 255 heads, 63 sectors, 36481 cylinders
>>
>> Nr AF  Hd Sec  Cyl  Hd Sec  Cyl      Start       Size ID
>>  1 00   1   1    0 254  63  850         63   13671252 0b
>>  2 80   0   1  851 254  63 1023   13671315  572395950 05
>>  3 00   0   0    0   0   0    0          0          0 00
>>  4 00   0   0    0   0   0    0          0          0 00
>>  5 00   1   1  851 254  63  972         63    1959867 83
>>  6 00   1   1  973 254  63 1023         63   31246362 83
>>  7 00 254  63 1023 254  63 1023         63  195318207 83
>>  8 00 254  63 1023 254  63 1023         63  343871262 83
>>                    ^^^  ^^
>
> C/H/S of 1023/254/63 is a special marker indicating the value there is
> out-of-range.

You misunderstood my ^^^ markers. I was trying to highlight
the whole columns of "end head" and "end sector", not the
last partition's 1023/254/63 values.

In the partition table like shown above it is obvious
that geometry is 255/63.

>> Which suggests another idea how to align a partition: since there is
>> no requirement on the partition *start*, we don't have to start at
>> head1,sector1 or head0,sector1
>
> We don't have to align to cylinders either.

If neither the start nor the end is aligned to cylinder's end
and disk has just one partition and it's bigger than 8G,
there is not way to determine geometry.

If everybody adopts the convention of ending the partitions
at the cylinder end, geometry can be trivially determined by
looking at partition end values. Sans "no of cylinders" value,
which can be easily determined by other means.

>> In the example above, 1st partition might be modified to start at
>> head1,sector2, IOW, LBA 64, thus making it 32k aligned.
>>
>> As long as partition *ends* adhere to the convention of being
>> exactly at last_head,last_sector, nothing should break.
>
> That has almost nothing to do with compatibility.  Just let the
> cylinder alignment go.

Then (some) bootloaders will stop working.

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