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] [day] [month] [year] [list]
Message-Id: <20070207131952.681c6775.akpm@linux-foundation.org>
Date:	Wed, 7 Feb 2007 13:19:52 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Sumant Patro <sumantp@...l.com>
Cc:	James.Bottomley@...elEye.com, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, neela.kolli@....com, bo.yang@....com,
	sumant.patro@....com
Subject: Re: [PATCH 2/5] scsi: megaraid_sas - added bios_param in
 scsi_host_template

On Tue, 06 Feb 2007 13:57:23 -0800
Sumant Patro <sumantp@...l.com> wrote:

> +static int
> +megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
> +		 sector_t capacity, int geom[])
> +{
> +	int 		heads;
> +	int 		sectors;
> +	sector_t	cylinders;
> +	ulong		dummy;

Plain old `unsigned long' is preferred.

> +	/* Default heads (64) & sectors (32) */
> +	heads 		= 64;
> +	sectors 	= 32;
> +
> +	dummy		= heads * sectors;
> +	cylinders	=  capacity;
> +
> +	sector_div(cylinders, dummy);
> +
> +	/*
> +	 * Handle extended translation size for logical drives > 1Gb
> +	 */
> +	
> +	if ((ulong)capacity >= 0x200000) {

Here we're casting a sector_t down to a 32-bit number.  Are you sure that
`capacity' here can never exceed 0xffffffff?

-
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