BUG() when opened miscdev fd's are used after being inherited/passed
Bug #994247 reported by
Tyler Hicks
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eCryptfs |
Fix Released
|
Medium
|
Tyler Hicks | ||
linux (Ubuntu) |
Fix Released
|
Medium
|
Colin Ian King | ||
Lucid |
Fix Released
|
Medium
|
Colin Ian King | ||
Natty |
Fix Released
|
Medium
|
Colin Ian King |
Bug Description
Originally reported by Sasha Levin and discovered by the Trinity syscall fuzzer:
https:/
The problem is that the /dev/ecryptfs code doesn't expect file operations to be performed by processes other than the one that originally opened the /dev/ecryptfs file. Operations on files inherited across fork() or passed through IPC mechanisms are poorly handled with a kernel BUG().
Related branches
no longer affects: | ecryptfs-utils (Ubuntu) |
no longer affects: | linux (Ubuntu Natty) |
no longer affects: | linux (Ubuntu Precise) |
no longer affects: | linux (Ubuntu Quantal) |
Changed in linux (Ubuntu Lucid): | |
status: | Incomplete → Confirmed |
Changed in linux (Ubuntu Oneiric): | |
status: | Incomplete → Confirmed |
Changed in linux (Ubuntu Lucid): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Oneiric): | |
importance: | Undecided → Medium |
assignee: | nobody → Colin King (colin-king) |
Changed in linux (Ubuntu Lucid): | |
assignee: | nobody → Colin King (colin-king) |
no longer affects: | linux (Ubuntu Oneiric) |
Changed in linux (Ubuntu): | |
status: | Incomplete → In Progress |
Changed in linux (Ubuntu): | |
status: | In Progress → Confirmed |
no longer affects: | linux (Ubuntu) |
no longer affects: | linux (Ubuntu Lucid) |
no longer affects: | linux (Ubuntu Quantal) |
no longer affects: | linux (Ubuntu Precise) |
no longer affects: | linux (Ubuntu Oneiric) |
Changed in linux (Ubuntu Lucid): | |
status: | New → Fix Released |
Changed in linux (Ubuntu Natty): | |
status: | New → Fix Released |
Changed in linux (Ubuntu Lucid): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Natty): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu): | |
status: | New → Fix Released |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Lucid): | |
assignee: | nobody → Colin King (colin-king) |
Changed in linux (Ubuntu): | |
assignee: | nobody → Colin King (colin-king) |
Changed in linux (Ubuntu Natty): | |
assignee: | nobody → Colin King (colin-king) |
Changed in linux (Ubuntu Lucid): | |
status: | Fix Released → Fix Committed |
Changed in linux (Ubuntu Natty): | |
status: | Fix Released → Fix Committed |
tags: | added: verification-needed-lucid |
Changed in linux (Ubuntu Natty): | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
My original attempt at fixing this simply converted all of the BUG_ON() calls in ecryptfs_ miscdev_ *() to if statements that gracefully handled the various conditions. This mostly worked (and will probably be a part of the final solution) except for handling the case where a passed fd was the last one closed. In that situation, ecryptfs_ miscdev_ release( ) cannot do its job because we may not be able to look up the daemon with ecryptfs_ find_daemon_ by_euid( ) since the current euid may not match the original euid.