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, 11 Jan 2007 09:34:31 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Kiyoshi Ueda <k-ueda@...jp.nec.com>
Cc:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	dm-devel@...hat.com, j-nomura@...jp.nec.com
Subject: Re: [RFC PATCH 3/3] blk_end_request: caller change

On Wed, Jan 10 2007, Kiyoshi Ueda wrote:
> +static int end_request_callback(void *arg)
> +{
> +	struct request *req = (struct request *)arg;
> +
> +	add_disk_randomness(req->rq_disk);
> +	blkdev_dequeue_request(req);
> +
> +	return 0;
> +}

This is bad, don't pass void * around.

> +static int cdrom_newpc_intr_dma_callback(void *arg)
> +{
> +	void **argv = (void **)arg;
> +	struct request *rq = (struct request *)*argv++;
> +	ide_drive_t *drive = (ide_drive_t *)argv++;
> +	spinlock_t *ide_lock = (spinlock_t *)argv;
> +
> +	rq->data_len = 0;
> +
> +	cdrom_newpc_intr_callback_common(rq, drive, ide_lock);
> +
> +	return 0;
> +}

And this is why, down right horrible. The callback should be correctly
typed, pass down a request pointer ALWAYS.

-- 
Jens Axboe

-
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