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]
Message-ID: <20141019145025.GA9593@infradead.org>
Date:	Sun, 19 Oct 2014 07:50:25 -0700
From:	Christoph Hellwig <hch@...radead.org>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	viro@...iv.linux.org.uk, hch@...radead.org, tyhicks@...onical.com,
	ecryptfs@...r.kernel.org
Subject: Re: [PATCH 3/4] ecryptfs: add fadvise/set_flags calbacks

On Sat, Oct 18, 2014 at 07:21:27PM +0400, Dmitry Monakhov wrote:
> +	if (ecryptfs_file_to_private(file))
> +		lower_file = ecryptfs_file_to_lower(file);
> +
> +	if (!lower_file || !lower_file->f_op)
> +		return rc;

At least a file without f->f_op should never happen.  How could ecryptfs
not have a lower file here?

>
> +
> +	if (lower_file->f_op && lower_file->f_op->fadvise)
> +		rc = lower_file->f_op->fadvise(lower_file, offset, len, advice);
> +	else
> +		rc = generic_fadvise(lower_file, offset, len, advice);

Seems like this should be in a vfs_fadvice helper.

> +	if (!rc)
> +		generic_fadvise(file, offset, len, advice);

Setting the advice on both files seems odd.  Which one do we actually
need them on?

> +	if (lower_file->f_op && lower_file->f_op->set_flags) {
> +		rc = lower_file->f_op->set_flags(lower_file,
> +						 flags & ECRYPTFS_FL_MASK);
> +		if (rc)
> +			return rc;
> +	} else
> +		generic_file_set_flags(file, flags & ECRYPTFS_FL_MASK);

Seems like you want a vfs_set_flags again.

--
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