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, 11 Mar 2008 07:40:10 +0100
From:	Borislav Petkov <petkovbb@...glemail.com>
To:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-ide@...r.kernel.org
Subject: Re: [PATCH 1/4] ide-tape: remove tape->cache_stage

On Tue, Mar 11, 2008 at 12:24:51AM +0100, Bartlomiej Zolnierkiewicz wrote:
> On Sunday 09 March 2008, Borislav Petkov wrote:
> > Prior to allocating a new pipeline stage, the code checked for the existence of
> > a cached pipeline stage to use. Do away with and stick to normal pipeline
> > stages only.
> > 
> > Signed-off-by: Borislav Petkov <petkovbb@...il.com>
> 
> I modified it slightly while merging since AFAICS we still need to check
> 'tape->nr_stages >= tape_max_stages' for idetape_add_chrdev_write_request().

Yep, thanks for spotting that landmine. By the way this driver is full of it :).

> From: Borislav Petkov <petkovbb@...glemail.com>
> Subject: [PATCH 1/4] ide-tape: remove tape->cache_stage
> 
> Prior to allocating a new pipeline stage, the code checked for the existence of
> a cached pipeline stage to use. Do away with and stick to normal pipeline
> stages only.
> 
> [bart: keep idetape_kmalloc_stage() for now]
> 
> Signed-off-by: Borislav Petkov <petkovbb@...il.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> ---
>  drivers/ide/ide-tape.c |   13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> Index: b/drivers/ide/ide-tape.c
> ===================================================================
> --- a/drivers/ide/ide-tape.c
> +++ b/drivers/ide/ide-tape.c
> @@ -365,8 +365,6 @@ typedef struct ide_tape_obj {
>  	idetape_stage_t *next_stage;
>  	/* New requests will be added to the pipeline here */
>  	idetape_stage_t *last_stage;
> -	/* Optional free stage which we can use */
> -	idetape_stage_t *cache_stage;
>  	int pages_per_stage;
>  	/* Wasted space in each stage */
>  	int excess_bh_size;
> @@ -1686,16 +1684,10 @@ abort:
>  
>  static idetape_stage_t *idetape_kmalloc_stage(idetape_tape_t *tape)
>  {
> -	idetape_stage_t *cache_stage = tape->cache_stage;
> -
>  	debug_log(DBG_PROCS, "Enter %s\n", __func__);
>  
>  	if (tape->nr_stages >= tape->max_stages)
>  		return NULL;
> -	if (cache_stage != NULL) {
> -		tape->cache_stage = NULL;
> -		return cache_stage;
> -	}
>  	return __idetape_kmalloc_stage(tape, 0, 0);
>  }
>  
> @@ -3245,10 +3237,7 @@ static int idetape_chrdev_release(struct
>  		else
>  			idetape_wait_for_pipeline(drive);
>  	}
> -	if (tape->cache_stage != NULL) {
> -		__idetape_kfree_stage(tape->cache_stage);
> -		tape->cache_stage = NULL;
> -	}
> +
>  	if (minor < 128 && test_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags))
>  		(void) idetape_rewind_tape(drive);
>  	if (tape->chrdev_dir == IDETAPE_DIR_NONE) {

-- 
Regards/Gruß,
    Boris.
--
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