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  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, 5 May 2015 10:31:47 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	"Darrick J. Wong" <darrick.wong@...cle.com>
Cc:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH 15/35] libext2fs: support atexit cleanups

On Wed, Apr 01, 2015 at 07:35:39PM -0700, Darrick J. Wong wrote:
> Use the atexit() function to provide a means for the library to clean
> itself up on program exit.  This will be used by the undo IO manager
> to flush the undo file state to disk if the program should terminate
> without closing the io channel, since most e2fsprogs clients will
> simply exit() when they hit errors.
> 
> This won't help for signal termination; client programs must set
> up signal handlers.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>

Applied, but in undo_io.c:

> @@ -769,11 +792,14 @@ static errcode_t undo_close(io_channel channel)
>  	err = write_undo_indexes(data);
>  	if (data->real)
>  		retval = io_channel_close(data->real);
> +	if (data->tdb_file)
> +		free(data->tdb_file);
>  	if (data->undo_file)
>  		io_channel_close(data->undo_file);
>  	ext2fs_free_mem(&data->keyb);
>  	if (data->written_block_map)
>  		ext2fs_free_generic_bitmap(data->written_block_map);
> +	ext2fs_remove_exit_fn(undo_atexit, data);
>  	ext2fs_free_mem(&channel->private_data);
>  	if (channel->name)
>  		ext2fs_free_mem(&channel->name);
> 

I've moved the call to ext2fs_remove_exit_fn() to right after the call
to write_undo_indexes().  This avoids a write if there is a signal
killing the process right after the call free the data->keyb and
before the call to ext2fs_remove_exit_fn().

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists