Issue Fix on 11g ($ORACLE_HOME/libnnz11.so)

环境:
Oracle Linux 5.2 32bit
Oracle Database 11g 11.1.0.7.0

现象:
执行sqlplus报错,
sqlplus: error while loading shared libraries: $ORACLE_HOME/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied

解决过程:
# tail -f /var/log/message
Sep 12 12:50:33 node1 setroubleshoot: SELinux is preventing sqlplus from loading /u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so which requires text relocation. For complete SELinux messages. run sealert -l 3485ff82- 7fb5- 4150-b246- 2dd3e2cf679e

根据提示,执行:
# sealert -l 3485ff82-7fb5-4150-b246-2dd3e2cf679e
得到进一步信息

点击(此处)折叠或打开

  1. Summary:
  2. SELinux is preventing sqlplus from loading
  3. /u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so which requires text
  4. relocation.
  5. Detailed Description:
  6. The sqlplus application attempted to load
  7. /u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so which requires text
  8. relocation. This is a potential security problem. Most libraries do not need
  9. this permission. Libraries are sometimes coded incorrectly and request this
  10. permission. The SELinux Memory Protection Tests
  11. (http://people.redhat.com/drepper/selinux-mem.html) web page explains how to
  12. remove this requirement. You can configure SELinux temporarily to allow
  13. /u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so to use relocation as a
  14. workaround, until the library is fixed. Please file a bug report
  15. (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package.
  16. Allowing Access:
  17. If you trust /u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so to run
  18. correctly, you can change the file context to textrel_shlib_t. \"chcon -t
  19. textrel_shlib_t \'/u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so\'\" You
  20. must also change the default file context files on the system in order to
  21. preserve them even on a full relabel. \"semanage fcontext -a -t textrel_shlib_t
  22. \'/u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so\'\"
  23. The following command will allow this access:
  24. chcon -t textrel_shlib_t \'/u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so\'
  25. Additional Information:
  26. Source Context user_u:system_r:unconfined_t
  27. Target Context user_u:object_r:default_t
  28. Target Objects /u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz
  29. 11.so [ file ]
  30. Source sqlplus
  31. Source Path /u01/app/oracle/product/11.1.0/dbhome_1/bin/sqlplu
  32. s
  33. Port
  34. Host node1.ocm.com
  35. Source RPM Packages
  36. Target RPM Packages
  37. Policy RPM selinux-policy-2.4.6-137.el5
  38. Selinux Enabled True
  39. Policy Type targeted
  40. MLS Enabled True
  41. Enforcing Mode Enforcing
  42. Plugin Name allow_execmod
  43. Host Name node1.ocm.com
  44. Platform Linux node1.ocm.com 2.6.18-92.el5PAE #1 SMP Fri
  45. May 23 22:26:05 EDT 2008 i686 i686
  46. Alert Count 2
  47. First Seen Fri Sep 12 12:47:19 2014
  48. Last Seen Fri Sep 12 12:50:31 2014
  49. Local ID 3485ff82-7fb5-4150-b246-2dd3e2cf679e
  50. Line Numbers
  51. Raw Audit Messages
  52. host=node1.ocm.com type=AVC msg=audit(1410497431.868:19): avc: denied { execmod } for pid=7697 comm=\"sqlplus\" path=\"/u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so\" dev=dm-0 ino=8647328 scontext=user_u:system_r:unconfined_t:s0 tcontext=user_u:object_r:default_t:s0 tclass=file
  53. host=node1.ocm.com type=SYSCALL msg=audit(1410497431.868:19): arch=40000003 syscall=125 success=no exit=-13 a0=308000 a1=184000 a2=5 a3=bf9df450 items=0 ppid=7671 pid=7697 auid=500 uid=500 gid=12000 euid=500 suid=500 fsuid=500 egid=12000 sgid=12000 fsgid=12000 tty=pts1 ses=2 comm=\"sqlplus\" exe=\"/u01/app/oracle/product/11.1.0/dbhome_1/bin/sqlplus\" subj=user_u:system_r:unconfined_t:s0 key=(null)
根据以上信息逐步修改后的后续提示执行下列指令:
$ chcon -t textrel_shlib_t '/u01/app/oracle/product/11.1.0/dbhome_1/lib/libnnz11.so'
$ chcon -t textrel_shlib_t '/u01/app/oracle/product/11.1.0/dbhome_1/lib/libclntsh.so.11.1'
$ chcon -t textrel_shlib_t '/u01/app/oracle/product/11.1.0/dbhome_1/lib/libsqlplus.so'
$ chcon -t textrel_shlib_t '/u01/app/oracle/product/11.1.0/dbhome_1/lib/libnque11.so'

关闭SELinux也可以解决:
# getenforce
Enforcing
# setenforce 0
# getenforce
Permissive

也可永久关闭SELinux:
# vim /etc/sysconfig/selinux
SELINUX=disabled

附,SELinux的三种状态:
  1. enforcing     检测并执行SELinux条目值
  2. permissive    检测SELinux条目值,不执行,但会弹出警告
  3. disabled      彻底关闭SELinux

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24644775/viewspace-1268413/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24644775/viewspace-1268413/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值