From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from imap.thunk.org ([74.207.234.97]:56744 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754612AbcLaO6L (ORCPT ); Sat, 31 Dec 2016 09:58:11 -0500 Date: Sat, 31 Dec 2016 00:49:59 -0500 From: Theodore Ts'o To: Eric Biggers Cc: linux-fsdevel@vger.kernel.org, Jaegeuk Kim , Richard Weinberger , Eric Biggers Subject: Re: [PATCH v2 2/5] fscrypt: fix renaming and linking special files Message-ID: <20161231054959.g2osc6trwrqbdooy@thunk.org> References: <1482186016-107643-1-git-send-email-ebiggers3@gmail.com> <1482186016-107643-2-git-send-email-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1482186016-107643-2-git-send-email-ebiggers3@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Dec 19, 2016 at 02:20:13PM -0800, Eric Biggers wrote: > From: Eric Biggers > > Attempting to link a device node, named pipe, or socket file into an > encrypted directory through rename(2) or link(2) always failed with > EPERM. This happened because fscrypt_has_permitted_context() saw that > the file was unencrypted and forbid creating the link. This behavior > was unexpected because such files are never encrypted; only regular > files, directories, and symlinks can be encrypted. > > To fix this, make fscrypt_has_permitted_context() always return true on > special files. > > This will be covered by a test in my encryption xfstests patchset. > > Fixes: 9bd8212f981e ("ext4 crypto: add encryption policy and password salt support") > Signed-off-by: Eric Biggers > Reviewed-by: Richard Weinberger > Cc: stable@vger.kernel.org Thanks, applied. - Ted