Bug 128260 - Cannot autoload driver when running application with debugger
Summary: Cannot autoload driver when running application with debugger
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-07-20 22:05 UTC by John Klingler
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-07-22 23:30:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Klingler 2004-07-20 22:05:58 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4)
Gecko/20030624 Netscape/7.1

Description of problem:
I am debugging an application and device driver.When my application 
attempts to open the device file associated with my driver, autoload
fails with the message:

"request_module[char-major-253]: fork failed, errno 1". 

request_module calls kernel_thread to execve modprobe to load my
driver. kernel_thread detects that the current task is running
under gdb and refuses load the module:
	/* lock out any potential ptracer */
	task_lock(task);
	if (task->ptrace) {
		task_unlock(task);
		return -EPERM;
	}
EPERM, of course, is error number 1, Operation not permitted

This code snippit was added after Red Hat 9.0. Is this supposed
to correct a security vulnerability, or is there some problem
with threads this was meant to prevent? I don't see how.



Version-Release number of selected component (if applicable):
2.4.21-4.ELsmp

How reproducible:
Always

Steps to Reproduce:
1. Use the debugger to run an application that opens a device whose
module is not loaded. 
2.
3.
    

Actual Results:  The open failed and the following message appeared in
/var/log/messages:
"request_module[char-major-253]: fork failed, errno 1"

Expected Results:  I expected the module to be automatically loaded,
as is the case if I run the application without using the debugger. 

Additional info:

Comment 1 Arjan van de Ven 2004-07-21 02:27:56 UTC
this indeed is a security fix, for a direct user->root privilege
escalation problem. 


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