Inappropriate ioctl for device while reading flags on

Bug #469664 reported by James Dupin
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
eCryptfs
Fix Released
Low
Tyler Hicks
ecryptfs-utils (Ubuntu)
Invalid
Low
Unassigned
linux (Ubuntu)
Won't Fix
Low
Unassigned

Bug Description

karmic

using lsattr on any files in my home gives me the following msg
Inappropriate ioctl for device while reading flags on test-file

the system is ext4.

weird thing is if I try on a file outside /home/$USER it works correctly.

outside /home/$USER means for example /home/otheruser, /etc ...

I just filed another bug (https://bugs.launchpad.net/bugs/469571). I don't know if there is something connected as in the other bug it's about the opposite. everything I try to trash in my /home goes to the trash while everything for elsewhere can only be deleted direclty.

Tags: kernel patch
Revision history for this message
James Dupin (james.dupin) wrote :

I did a clean install and it is still the same.

all partitions in ext4 over LVM with encrypted /home/$USER and unencrypted for otheruser

will try with ext3

Revision history for this message
James Dupin (james.dupin) wrote :
Revision history for this message
James Dupin (james.dupin) wrote :
Revision history for this message
James Dupin (james.dupin) wrote :

tested on a different machine. have the same problem.

It is related to the use of encrypted home or not. I believe it will be the same for files in any encrypted folder (will test).

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

kirkland@x200:~$ lsattr .profile
lsattr: Inappropriate ioctl for device While reading flags on .profile

I'm seeing the same thing.

affects: ubuntu → ecryptfs-utils (Ubuntu)
Changed in ecryptfs-utils (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in ecryptfs:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Tyler-

Ideas?

Revision history for this message
Tyler Hicks (tyhicks) wrote :

eCryptfs doesn't support lsattr. It is an ext[345] specific tool that is shipped in e2fsprogs. It simply just isn't supposed to work on eCryptfs.

Revision history for this message
Tyler Hicks (tyhicks) wrote :

Well, I may have jumped the gun. It looks like we should be passing this ioctl down to the lower fs in ecryptfs_ioctl. I'm looking into it now.

Changed in ecryptfs:
assignee: nobody → Tyler Hicks (tyhicks)
status: Confirmed → In Progress
assignee: Tyler Hicks (tyhicks) → nobody
status: In Progress → Confirmed
status: Confirmed → In Progress
Revision history for this message
Tyler Hicks (tyhicks) wrote :

I have tested chattr/lsattr on eCryptfs on top of ext3. More testing is needed, then I'll commit it to the eCryptfs -next branch.

James, let me know if you'd prefer that I drop the 'Reported-by' tag at the bottom of the commit message.

Changed in ecryptfs:
assignee: nobody → Tyler Hicks (tyhicks)
Tyler Hicks (tyhicks)
tags: added: kernel
Revision history for this message
James Dupin (james.dupin) wrote : Re: [Bug 469664] Re: Inappropriate ioctl for device while reading flags on

whatever seems appropriate to you suits me.

On Tue, Nov 3, 2009 at 8:29 PM, Tyler Hicks <email address hidden>wrote:

> I have tested chattr/lsattr on eCryptfs on top of ext3. More testing is
> needed, then I'll commit it to the eCryptfs -next branch.
>
> James, let me know if you'd prefer that I drop the 'Reported-by' tag at
> the bottom of the commit message.
>
> ** Changed in: ecryptfs
> Assignee: (unassigned) => Tyler Hicks (tyhicks)
>
> ** Attachment added: "[PATCH] eCryptfs: Handle ioctl calls with unlocked
> and compat functions"
>
> http://launchpadlibrarian.net/35047418/0001-eCryptfs-Handle-ioctl-calls-with-unlocked-and-compa.patch
>
> --
> Inappropriate ioctl for device while reading flags on
> https://bugs.launchpad.net/bugs/469664
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Marking the ecryptfs-utils Ubuntu package invalid. This will be solved kernel side.

Changed in ecryptfs-utils (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Adding a task for the Ubuntu kernel. Marking triaged/low. Upstream is aware of it, working the issue. Should land in a future kernel.

Changed in linux (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Lorenzo De Liso (blackz)
tags: added: patch
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

lsattr is for on ext2 (and extX) files. ecryptfs just doesn't support the
EXT2_IOC_GETFLAGS ioctl.

On Thu, Apr 29, 2010 at 3:59 PM, Lorenzo De Liso <email address hidden> wrote:
> ** Tags added: patch
>
> --
> Inappropriate ioctl for device while reading flags on
> https://bugs.launchpad.net/bugs/469664
> You received this bug notification because you are a member of eCryptfs
> Developers, which is subscribed to eCryptfs.
>
> Status in eCryptfs - Enterprise Cryptographic Filesystem: In Progress
> Status in “ecryptfs-utils” package in Ubuntu: Invalid
> Status in “linux” package in Ubuntu: Triaged
>
> Bug description:
> karmic
>
> using lsattr on any files in my home gives me the following msg
> Inappropriate ioctl for device while reading flags on test-file
>
> the system is ext4.
>
> weird thing is if I try on a file outside /home/$USER it works correctly.
>
> outside /home/$USER means for example /home/otheruser, /etc ...
>
> I just filed another bug (https://bugs.launchpad.net/bugs/469571). I don't know if there is something connected as in the other bug it's about the opposite. everything I try to trash in my /home goes to the trash while everything for elsewhere can only be deleted direclty.
>
>
>

Revision history for this message
Tyler Hicks (tyhicks) wrote :

Updated and tested version of the fix.

Revision history for this message
Tyler Hicks (tyhicks) wrote : Re: [Bug 469664] Re: Inappropriate ioctl for device while reading flags on

On 04/29/2010 05:17 PM, Serge Hallyn wrote:
> lsattr is for on ext2 (and extX) files. ecryptfs just doesn't support the
> EXT2_IOC_GETFLAGS ioctl.

We should be passing ioctls down to the lower file system. If the lower
file system is extX, then lsattr will work.

Revision history for this message
Steven (stebalien) wrote :

You should note that there is a very small potential security risk here. Most files don't have extended attributes on them and therefore any file having an extended attribute would raise a red flag. Due to the way ecryptfs works, these attributes would be visible (and settable/unsettable) in the encrypted ".Private" directory. This problem is minimal but I felt that it should be noted.

Revision history for this message
Tyler Hicks (tyhicks) wrote :
Changed in ecryptfs:
status: In Progress → Fix Released
Revision history for this message
Brad Figg (brad-figg) wrote : Unsupported series, setting status to "Won't Fix".

This bug was filed against a series that is no longer supported and so is being marked as Won't Fix. If this issue still exists in a supported series, please file a new bug.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.