From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10733 invoked by alias); 3 Sep 2009 12:25:15 -0000 Received: (qmail 10527 invoked by uid 48); 3 Sep 2009 12:24:59 -0000 Date: Thu, 03 Sep 2009 12:25:00 -0000 From: "mjw at redhat dot com" To: systemtap@sources.redhat.com Message-ID: <20090903122458.10595.mjw@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug uprobes/10595] New: uprobe return probes causes selinux failures X-Bugzilla-Reason: AssignedTo Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00536.txt.bz2 When selinux is in enforcing mode and allow_execstack=false trying to set uprobe return probes on an executable causes selinux denials (and failing to insert the probe). Take for example the bz10078.exp testcase, which simply does: probe process("./bz10078").function("mkpoint*").return { printf("%s returns\n", probefunc()) } With selinux in enforcing mode and disallowing executable stacks: $ setenforce Enforcing $ setsebool allow_execstack=false $ stap systemtap.base/bz10078.stp -c ./bz10078 /var/log/messages: setroubleshoot: SELinux is preventing bz10078 from changing a writable memory segment executable. For complete SELinux messages. run sealert -l 725eeb90-824c-4e00-b0c5-3575cdf7d070 $ sealert -l 725eeb90-824c-4e00-b0c5-3575cdf7d070 Summary: SELinux is preventing bz10078 from changing a writable memory segment executable. Detailed Description: The bz10078 application attempted to change the access protection of memory (e.g., allocated using malloc). This is a potential security problem. Applications should not be doing this. Applications are sometimes coded incorrectly and request this permission. The SELinux Memory Protection Tests (http://people.redhat.com/drepper/selinux-mem.html) web page explains how to remove this requirement. If bz10078 does not work and you need it to work, you can configure SELinux temporarily to allow this access until the application is fixed. Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package. Allowing Access: If you trust bz10078 to run correctly, you can change the context of the executable to execmem_exec_t. "chcon -t execmem_exec_t ''". You must also change the default file context files on the system in order to preserve them even on a full relabel. "semanage fcontext -a -t execmem_exec_t ''" Fix Command: chcon -t execmem_exec_t '' Additional Information: Source Context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1 023 Target Context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1 023 Target Objects None [ process ] Source bz10078 Source Path Port Host springer.wildebeest.org Source RPM Packages Target RPM Packages Policy RPM selinux-policy-3.6.12-80.fc11 Selinux Enabled True Policy Type targeted MLS Enabled True Enforcing Mode Enforcing Plugin Name allow_execmem Host Name springer.wildebeest.org Platform Linux springer.wildebeest.org 2.6.29.6-217.2.16.fc11.x86_64 #1 SMP Mon Aug 24 17:17:40 EDT 2009 x86_64 x86_64 Alert Count 2 First Seen Thu Sep 3 14:08:51 2009 Last Seen Thu Sep 3 14:10:20 2009 Local ID 725eeb90-824c-4e00-b0c5-3575cdf7d070 Line Numbers Raw Audit Messages node=springer.wildebeest.org type=AVC msg=audit(1251979820.974:270): avc: denied { execmem } for pid=12251 comm="bz10078" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process -- Summary: uprobe return probes causes selinux failures Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: uprobes AssignedTo: systemtap at sources dot redhat dot com ReportedBy: mjw at redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=10595 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.