* re: ext4 crypto: enforce context consistency
@ 2015-04-15 19:10 Dan Carpenter
2015-04-16 6:15 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-04-15 19:10 UTC (permalink / raw)
To: tytso; +Cc: linux-ext4
Hello Theodore Ts'o,
The patch faac02be2843: "ext4 crypto: enforce context consistency"
from Apr 12, 2015, leads to the following static checker warning:
fs/ext4/namei.c:1646 ext4_lookup()
error: 'inode' dereferencing possible ERR_PTR()
fs/ext4/namei.c
1638 inode = ext4_iget_normal(dir->i_sb, ino);
1639 if (inode == ERR_PTR(-ESTALE)) {
We normally check ext4_iget() against -ESTALE, but then we changed this
to ext4_iget_normal() which returns several error values.
1640 EXT4_ERROR_INODE(dir,
1641 "deleted inode referenced: %u",
1642 ino);
1643 return ERR_PTR(-EIO);
1644 }
1645 if (ext4_encrypted_inode(dir) &&
1646 (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
1647 S_ISLNK(inode->i_mode)) &&
1648 !ext4_is_child_context_consistent_with_parent(dir,
1649 inode)) {
1650 iput(inode);
1651 ext4_warning(inode->i_sb,
1652 "Inconsistent encryption contexts: %lu/%lu\n",
1653 (unsigned long) dir->i_ino,
1654 (unsigned long) inode->i_ino);
1655 return ERR_PTR(-EPERM);
1656 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ext4 crypto: enforce context consistency
2015-04-15 19:10 ext4 crypto: enforce context consistency Dan Carpenter
@ 2015-04-16 6:15 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2015-04-16 6:15 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-ext4
On Wed, Apr 15, 2015 at 10:10:07PM +0300, Dan Carpenter wrote:
> Hello Theodore Ts'o,
>
> The patch faac02be2843: "ext4 crypto: enforce context consistency"
> from Apr 12, 2015, leads to the following static checker warning:
>
> fs/ext4/namei.c:1646 ext4_lookup()
> error: 'inode' dereferencing possible ERR_PTR()
>
> fs/ext4/namei.c
> 1638 inode = ext4_iget_normal(dir->i_sb, ino);
> 1639 if (inode == ERR_PTR(-ESTALE)) {
>
> We normally check ext4_iget() against -ESTALE, but then we changed this
> to ext4_iget_normal() which returns several error values.
Thanks for pointing that out. That's not quite what had happened. We
were using ext4_iget_normal() before (and both ext4_iget() and
ext4_iget_normal() can return multiple error values), but before we
fell out to the bottof of the function where we called
d_splice_alias() which would take care of ERR_PTR versions of inode.
We added some additional code between the ext4_iget_normal() and the
d_splice_alias() lines, which is what introduced the problem.
I'll take care of fixing it.
Cheers,
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-16 6:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15 19:10 ext4 crypto: enforce context consistency Dan Carpenter
2015-04-16 6:15 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).