From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 113F6138286 for ; Thu, 3 Jan 2013 16:51:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECE4721C13D; Thu, 3 Jan 2013 16:49:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2A28621C13D for ; Thu, 3 Jan 2013 16:49:55 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6A65833D990 for ; Thu, 3 Jan 2013 16:49:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7F347E5457 for ; Thu, 3 Jan 2013 16:49:51 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1357230239.c2097b396b8301c8fbea6c7e0ccf894f5a469f29.SwifT@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/services/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/services/postgresql.te X-VCS-Directories: policy/modules/services/ X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: c2097b396b8301c8fbea6c7e0ccf894f5a469f29 X-VCS-Branch: master Date: Thu, 3 Jan 2013 16:49:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0d1d1cc7-7a29-40e4-adc2-bec2d9537733 X-Archives-Hash: 8200f28f269da58a6a0ef3f1f626179a commit: c2097b396b8301c8fbea6c7e0ccf894f5a469f29 Author: Sven Vermeulen siphos be> AuthorDate: Mon Dec 17 09:42:43 2012 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Thu Jan 3 16:23:59 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=c2097b39 Postgresql 9.2 connects to its unix stream socket When starting postgresql, it fails with the (little saying) error message: pg_ctl: could not start server In the denials, we notice: Nov 24 10:41:52 lerya kernel: [1628900.540506] type=1400 audit(1353750112.021:10143): avc: denied { connectto } for pid=20481 comm="pg_ctl" path="/run/postgresql/.s.PGSQL.5432" ipaddr=... scontext=system_u:system_r:postgresql_t tcontext=system_u:system_r:postgresql_t tclass=unix_stream_socket Hence, allow postgresql to connect to its own stream socket. Signed-off-by: Sven Vermeulen siphos.be> --- policy/modules/services/postgresql.te | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/policy/modules/services/postgresql.te b/policy/modules/services/postgresql.te index 906a2c1..5ccf1ba 100644 --- a/policy/modules/services/postgresql.te +++ b/policy/modules/services/postgresql.te @@ -234,7 +234,7 @@ allow postgresql_t self:shm create_shm_perms; allow postgresql_t self:tcp_socket create_stream_socket_perms; allow postgresql_t self:udp_socket create_stream_socket_perms; allow postgresql_t self:unix_dgram_socket create_socket_perms; -allow postgresql_t self:unix_stream_socket create_stream_socket_perms; +allow postgresql_t self:unix_stream_socket { create_stream_socket_perms connectto }; allow postgresql_t self:netlink_selinux_socket create_socket_perms; tunable_policy(`sepgsql_transmit_client_label',` allow postgresql_t self:process { setsockcreate };