|
Bugzilla – Full Text Bug Listing |
| Summary: | VUL-0: kernel: leak of kernel memory through /proc files | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Marcus Meissner <meissner> |
| Component: | Kernel | Assignee: | Marcus Meissner <meissner> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | security-team |
| Version: | RC 4 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Other | ||
| Whiteboard: | affected:9.2,9.3,10.0 applied:9.2,9.3,10.0 released: - CVE-2005-4605: CVSS v2 Base Score: 2.1 (AV:L/AC:L/Au:N/C:P/I:N/A:N ) | ||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Marcus Meissner
2005-12-30 09:04:26 UTC
linus confirmed it in a later mail: From: Linus Torvalds <torvalds@osdl.org> To: Solar Designer <solar@openwall.com> Cc: Thomas Biege <thomas@suse.de>, vendor-sec@lst.de, davej@redhat.com, security@kernel.org Subject: Re: [Security] Re: [vendor-sec] [tom@electric-sheep.org: Fwd: [Full-disclosure] linux procfs vulnerablity] On Fri, 30 Dec 2005, Solar Designer wrote: > > I'm not sure the EOF check in proc_calc_metrics() is to blame, though. > I did not investigate this for real, but I feel that it's primarily the > code in proc_file_read() that can use some hardening on both 2.4 and > 2.6. Yeah. The correct thing would be to get rid of it entirely, and rely on seqfiles. Of course, that has been the correct thing for a long time, so.. Oh, and proc_file_lseek() is a piece of crap too. The only big /proc file is kcore, which has special read/write logic and uses the default lseek. Everything else should check s_maxbytes or something (which for /proc should always be MAX_NON_LFS, which is essentially INT_MAX). Does this stupid patch (which is partly just whitespace cleanups too, I can't edit 4-space-tab code) look reasonable? Linus --- diff --git a/fs/proc/generic.c b/fs/proc/generic.c index b638fb5..78ab861 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -54,11 +54,23 @@ proc_file_read(struct file *file, char _ ssize_t n, count; char *start; struct proc_dir_entry * dp; + unsigned long long pos; dp = PDE(inode); if (!(page = (char*) __get_free_page(GFP_KERNEL))) return -ENOMEM; + /* + * Gaah, please just use "seq_file" instead. The legacy /proc .... I will attach GIT urls / the final patches once they are available. 2.6 commit from Linus: http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b90db0df7187a01fb7177f1f812123138f562cf The patch looks reasonably contained. The first hunk is obviously correct. The second hunk makes me a little nervous though as it removes use of the BKL. It *probably* just did that because it checked "offset + file->f_pos" first and then updated "file->f_pos += offset" which would have a race. Can anyone confirm that? Apart from the BKL change, the second hunk should be equivalent to the original code. Lars, can you please drive this bug and apply the patch to all affected trees (once we're sure the BKL removal is harmless)? All other llseek occurances in 2.6.14 are also protected by the BKL. I can see dropping the BKL for user-initiated llseeks though (coming in via vfs_llseek), because these are protected by fget/fput_light(), so that removal should be correct (though potentially unnecessary). However, this seems to be addressed already (though differently) in SLES9: patches.fixes/proc-info-leak(-2). Both of which don't seem to have patch headers. This is related to bug #56074 / SUSE41074 which I'm not allowed to access for inspection. Could the security team please give me access to that bugzilla? Casually, 9.2, 9.3, 10.0 seem affected, but I'd probably drop the chunk which removes the BKL. It may be unneeded, but it's obviously an optimisation and not a correctness issue. CVE-2005-4605 i opened the referenced bug. if this is sufficient info, please drop NEEDINFO state. i guess it is sufficient. Adjusting products so it does show up on the SLES radar. Committed to SL10.0, SL9.3, SL9.2. The other releases seem unaffected. reopen for tracking updates + advisory released. CVE-2005-4605: CVSS v2 Base Score: 2.1 (AV:L/AC:L/Au:N/C:P/I:N/A:N) |