linux/drivers/ata
Roland Dreier ba14a9c291 libata: Avoid overflow in ata_tf_to_lba48() when tf->hba_lbal > 127
In ata_tf_to_lba48(), when evaluating

	(tf->hob_lbal & 0xff) << 24

the expression is promoted to signed int (since int can hold all values
of u8).  However, if hob_lbal is 128 or more, then it is treated as a
negative signed value and sign-extended when promoted to u64 to | into
sectors, which leads to the MSB 32 bits of section getting set
incorrectly.

For example, Phillip O'Donnell <phillip.odonnell@gmail.com> reported
that a 1.5GB drive caused:

    ata3.00: HPA detected: current 2930277168, native 18446744072344861488

where 2930277168 == 0xAEA87B30 and 18446744072344861488 == 0xffffffffaea87b30
which shows the problem when hob_lbal is 0xae.

Fix this by adding a cast to u64, just as is used by for hob_lbah and
hob_lbam in the function.

Reported-by: Phillip O'Donnell <phillip.odonnell@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-10-31 01:42:59 -04:00
..
ahci.c libata: ahci enclosure management bit mask 2008-10-28 00:37:15 -04:00
ata_generic.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
ata_piix.c ATA: remove excess kernel-doc notation 2008-10-31 01:42:49 -04:00
Kconfig Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-11 12:39:35 -07:00
libata-acpi.c dock: introduce .uevent for devices in dock, eg libata 2008-09-23 23:23:00 -04:00
libata-core.c libata: Avoid overflow in ata_tf_to_lba48() when tf->hba_lbal > 127 2008-10-31 01:42:59 -04:00
libata-eh.c libata: clear saved xfer_mode and ncq_enabled on device detach 2008-10-27 23:55:40 -04:00
libata-pmp.c libata: improve EH retry delay handling 2008-07-14 15:59:32 -04:00
libata-scsi.c libata: fix NCQ devices behind port multipliers 2008-10-27 19:25:30 +01:00
libata-sff.c libata-sff: fix ata_sff_post_internal_cmd() 2008-10-22 20:40:15 -04:00
libata.h libata: switch to using block layer tagging support 2008-10-23 16:05:26 -07:00
Makefile libata: Add Intel SCH PATA driver 2008-05-06 11:33:58 -04:00
pata_acpi.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_ali.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_amd.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_artop.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_at32.c avr32: Use <mach/foo.h> instead of <asm/arch/foo.h> 2008-08-05 14:36:57 +02:00
pata_atiixp.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_bf54x.c [libata] pata_bf54x: Add proper PM operation 2008-09-29 00:28:29 -04:00
pata_cmd64x.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_cmd640.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_cs5520.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_cs5530.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_cs5535.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_cs5536.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_cypress.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_efar.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_hpt3x2n.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_hpt3x3.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_hpt37x.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_hpt366.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_icside.c libata-sff: Fix oops reported in kerneloops.org for pnp devices with no ctl 2008-06-04 06:40:41 -04:00
pata_isapnp.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_it821x.c libata: Fix LBA48 on pata_it821x RAID volumes. 2008-10-27 23:56:33 -04:00
pata_it8213.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_ixp4xx_cf.c [ARM] 5179/1: Replace obsolete IRQT_* and __IRQT_* values with IRQ_TYPE_* 2008-07-27 09:46:18 +01:00
pata_jmicron.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_legacy.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_marvell.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_mpc52xx.c powerpc/pata_mpc52xx: use linux/of_platform.h instead of asm 2008-07-12 12:10:52 -06:00
pata_mpiix.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_netcell.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_ninja32.c pata_ninja32: suspend/resume support 2008-10-28 00:35:59 -04:00
pata_ns87410.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_ns87415.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_of_platform.c powerpc: Fix no interrupt handling in pata_of_platform 2008-10-10 15:55:17 +11:00
pata_oldpiix.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_opti.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_optidma.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_pcmcia.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_pdc202xx_old.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_pdc2027x.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_platform.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_qdi.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_radisys.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_rb532_cf.c libata-sff: Fix oops reported in kerneloops.org for pnp devices with no ctl 2008-06-04 06:40:41 -04:00
pata_rz1000.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
pata_sc1200.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_scc.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_sch.c libata: Add Intel SCH PATA driver 2008-05-06 11:33:58 -04:00
pata_serverworks.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_sil680.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_sis.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_sl82c105.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_triflex.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_via.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pata_winbond.c ata: Switch all my stuff to a common address 2008-10-27 23:54:50 -04:00
pdc_adma.c libata: rename SFF functions 2008-04-17 15:44:21 -04:00
sata_fsl.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_inic162x.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_mv.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_nv.c Merge branch 'upstream-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev 2008-10-10 07:46:45 -07:00
sata_promise.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_promise.h libata annotations and fixes 2008-01-23 05:24:15 -05:00
sata_qstor.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_sil24.c sata_sil24: configure max read request size to 4k 2008-10-27 23:55:27 -04:00
sata_sil.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_sis.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_svw.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_sx4.c libata: add qc_fill_rtf port operation 2008-04-17 15:44:23 -04:00
sata_uli.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sata_via.c sata_via: load DEVICE register when CTL changes 2008-10-22 20:42:47 -04:00
sata_vsc.c libata: make SCR access ops per-link 2008-09-29 00:22:28 -04:00
sis.h libata: PATA-mode fixes for sis_sata 2007-07-02 10:17:42 -04:00