Web Hosting Talk


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Linux kernel file offset pointer handling Exploit
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)

 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-04-2004, 04:12 PM
Steven Steven is offline
View Beta Profile
Temporarily Suspended
 
Join Date: Mar 2003
Location: California USA
Posts: 9,735
Linux kernel file offset pointer handling Exploit

http://isec.pl/vulnerabilities/isec-0016-procleaks.txt

Quote:
Details:
========

The Linux kernel offers a file handling API to the userland
applications. Basically a file can be identified by a file name and
opened through the open(2) system call which in turn returns a file
descriptor for the kernel file object.

One of the properties of the file object is something called 'file
offset' (f_pos member variable of the file object), which is advanced if
one reads or writtes to the file. It can also by changed through the
lseek(2) system call and identifies the current writing/reading position
inside the file image on the media.

There are two different versions of the file handling API inside recent
Linux kernels: the old 32 bit and the new (LFS) 64 bit API. We have
identified numerous places, where invalid conversions from 64 bit sized
file offsets to 32 bit ones as well as insecure access to the file
offset member variable take place.

We have found that most of the /proc entries (like /proc/version) leak
about one page of unitialized kernel memory and can be exploited to
obtain sensitive data.

We have found dozens of places with suspicious or bogus code. One of
them resides in the MTRR handling code for the i386 architecture:


static ssize_t mtrr_read(struct file *file, char *buf, size_t len,
loff_t *ppos)
{
[1] if (*ppos >= ascii_buf_bytes) return 0;
[2] if (*ppos + len > ascii_buf_bytes) len = ascii_buf_bytes - *ppos;
if ( copy_to_user (buf, ascii_buffer + *ppos, len) ) return -EFAULT;
[3] *ppos += len;
return len;
} /* End Function mtrr_read */


It is quite easy to see that since copy_to_user can sleep, the second
reference to *ppos may use another value. Or in other words, code
operating on the file->f_pos variable through a pointer must be atomic
in respect to the current thread. We expect even more troubles in the
SMP case though.

Reply With Quote
Sponsored Links
  #2  
Old 08-04-2004, 05:10 PM
GideonX GideonX is offline
View Beta Profile
Web Hosting Master
 
Join Date: Dec 2001
Location: NY
Posts: 1,902
RHEL has updated kernels already:

https://rhn.redhat.com/errata/RHSA-2004-413.html

__________________
██ SCHostPRO.com ██
º Powered by DirectAdmin with iTron
º Shared + Reseller Hosting
º Hosting with that special sauce


Reply With Quote
  #3  
Old 08-04-2004, 07:16 PM
barleduc barleduc is offline
View Beta Profile
Web Hosting Guru
 
Join Date: Jan 2002
Posts: 269
Looks pretty serious, is there a patch for those who compiled from source?

Reply With Quote
Sponsored Links
  #4  
Old 08-04-2004, 08:28 PM
Steven Steven is offline
View Beta Profile
Temporarily Suspended
 
Join Date: Mar 2003
Location: California USA
Posts: 9,735
No, but we have been using progeny.

Reply With Quote
  #5  
Old 08-05-2004, 12:35 AM
Haze Haze is offline
View Beta Profile
Web Hosting Master
 
Join Date: Apr 2001
Posts: 2,588
Anyone try the centos 3 kernel yet ? Any probs ?

__________________
Beau Henderson

Reply With Quote
  #6  
Old 08-05-2004, 12:37 AM
Steven Steven is offline
View Beta Profile
Temporarily Suspended
 
Join Date: Mar 2003
Location: California USA
Posts: 9,735
The centos kernel is fine. I just wanted to point out DO NOT USE the progeny kernel for redhat 9. Within in a hour or so the load shoots up dramatically ending up requiring a reboot. This has happened on 2 servers out of 4

Reply With Quote
  #7  
Old 08-06-2004, 03:42 PM
choon choon is offline
View Beta Profile
Retired Moderator
 
Join Date: Jul 2001
Location: Singapore
Posts: 1,783

__________________
Giam Teck Choon
:: Join choon.net Community today to share your tips and tricks on server issues please ::
:: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::


Reply With Quote
  #8  
Old 08-06-2004, 04:42 PM
trustedurl.com trustedurl.com is offline
View Beta Profile
That's all it takes?
 
Join Date: Aug 2001
Location: Canada
Posts: 1,551
Quote:
Originally posted by thelinuxguy
No, but we have been using progeny.
Just fyi:


The most recent kernel security advisory (TSSA-2004:6552-01)
contains a bug that may cause some customers machines appear
to hang during the boot process while trying to load the loopback
device or experience problems using netstat. While we have a
very thorough QA process, especially for something as important
as the kernel, sometimes a bug will slip through. We have been
working with the customers who have this problem to replicate
it on our own machines and hope to have a fix shortly.

Because the percentage of customers who have this problem appears
to be small, the kernel advisory will remain active. However, we
still recognize this as a serious problem and will continue to work
on it over the weekend if necessary.

We would like to thank our customers for their patience and help
in resolving this issue and we apologize for this inconvenience.

The Progeny Support Team
support@progeny.com

__________________
www.idologic.com - Reseller hosting - Friendly Customer Service - DirectAdmin - cPanel - PHP 4.4.x, 5.2.x & 5.3.x - mySQL 5 - clustered DNS - off-server backups - enom accounts
Follow us on Twitter for exclusive specials

Reply With Quote
  #9  
Old 08-06-2004, 04:45 PM
Steven Steven is offline
View Beta Profile
Temporarily Suspended
 
Join Date: Mar 2003
Location: California USA
Posts: 9,735
Quote:
Originally posted by idologic_dh
Just fyi:


The most recent kernel security advisory (TSSA-2004:6552-01)
contains a bug that may cause some customers machines appear
to hang during the boot process while trying to load the loopback
device or experience problems using netstat. While we have a
very thorough QA process, especially for something as important
as the kernel, sometimes a bug will slip through. We have been
working with the customers who have this problem to replicate
it on our own machines and hope to have a fix shortly.

Because the percentage of customers who have this problem appears
to be small, the kernel advisory will remain active. However, we
still recognize this as a serious problem and will continue to work
on it over the weekend if necessary.

We would like to thank our customers for their patience and help
in resolving this issue and we apologize for this inconvenience.

The Progeny Support Team
support@progeny.com
Yeap i mentioned it earlier in the post:

Quote:
The centos kernel is fine. I just wanted to point out DO NOT USE the progeny kernel for redhat 9. Within in a hour or so the load shoots up dramatically ending up requiring a reboot. This has happened on 2 servers out of 4

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement: