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:   Wed, 30 Aug 2017 16:28:55 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Christoph Hellwig <hch@....de>
Cc:     arve@...roid.com, riandrews@...roid.com,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/16] ashmem: switch to ->read_iter

On Wed, Aug 30, 2017 at 04:59:52PM +0200, Christoph Hellwig wrote:
> And use the proper VFS helper for using the backing file.

Actually, I wonder if that update of ->f_pos of the underlying file is
correct.  That's unrelated to this patch, but might be worth sorting
out while we are at it.

How about
        mutex_unlock(&ashmem_mutex);
        /*
         * asma and asma->file are used outside the lock here.  We assume
         * once asma->file is set it will never be changed, and will not
         * be destroyed until all references to the file are dropped and
         * ashmem_release is called.
         */
	ret = vfs_iter_read(asma->file, iter, &iocb->ki_pos, 0);
        mutex_lock(&ashmem_mutex);
        if (ret >= 0)
                asma->file->f_pos = *pos;
out_unlock:
        mutex_unlock(&ashmem_mutex);
        return ret;

in there?

Powered by blists - more mailing lists