Bug 435610 - RHEL5.2: ecryptfs ecryptfs_prepare_write does not decrypt page
RHEL5.2: ecryptfs ecryptfs_prepare_write does not decrypt page
Status: CLOSED DUPLICATE of bug 449668
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.2
All Linux
medium Severity high
: rc
: ---
Assigned To: Eric Sandeen
Martin Jenner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-02 10:04 EST by Eric Sandeen
Modified: 2008-06-04 15:59 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-04 15:59:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Mike's patch, backported for RHEL5.2 (4.00 KB, patch)
2008-03-02 10:04 EST, Eric Sandeen
no flags Details | Diff

  None (edit)
Description Eric Sandeen 2008-03-02 10:04:17 EST
From Mike:

------------

When the page is not up to date, ecryptfs_prepare_write() should be
acting much like ecryptfs_readpage(). This includes the painfully
obvious step of actually decrypting the page contents read from the
lower encrypted file.

Note that this patch resolves a bug in eCryptfs in 2.6.24 that one can
produce with these steps:

# mount -t ecryptfs /secret /secret
# echo "abc" > /secret/file.txt
# umount /secret
# mount -t ecryptfs /secret /secret
# echo "def" >> /secret/file.txt
# cat /secret/file.txt

Without this patch, the resulting data returned from cat is likely to
be something other than "abc\ndef\n".

(Thanks to Benedikt Driessen for reporting this.)

------------

Verified the problem and the fix on RHEL5.2... backported patch attached.
Comment 1 Eric Sandeen 2008-03-02 10:04:17 EST
Created attachment 296513 [details]
Mike's patch, backported for RHEL5.2
Comment 2 Eric Sandeen 2008-06-04 15:59:10 EDT
The 2.6.26 rebase in bug #449668 will include this.

*** This bug has been marked as a duplicate of 449668 ***

Note You need to log in before you can comment on or make changes to this bug.