Bug 128260 - Cannot autoload driver when running application with debugger
Cannot autoload driver when running application with debugger
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-20 18:05 EDT by John Klingler
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-07-22 19:30:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Klingler 2004-07-20 18:05:58 EDT
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-20 22:27:56 EDT
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.