Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2506166pxb; Mon, 18 Jan 2021 21:31:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxsvuNmPdPXNtDextzmACe9rkZenXSDMm4TCPRGn41Usrs0OCVNj5v/lgmbonVJceRvVge X-Received: by 2002:a17:906:dfda:: with SMTP id jt26mr1868633ejc.240.1611034289568; Mon, 18 Jan 2021 21:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611034289; cv=none; d=google.com; s=arc-20160816; b=nPfnn7BcQk+i2CpkLasFlZen+YDcCQQl80hKVXlGWlOweUfBuahDtTwC7Y3Lt8gA28 zc6imVDzPJ8n5HMxQshAWnGuLnX7k+38D/hDWJ59zS/A6zC4ao2qUkmsHzusY0iClBFr ZHnVCvCmf4duWfIrWcMkkTJ9yvo8xHQBpb0pLrNs+KJJdwzw/0NP8TIqlqlo0Kus3SB3 sQrtbYQciDDMOoPN9FQqnx9W/AVkmF1d0VQA1+rRA9lwZWMaTuuIOILafsH08itVn7TO 9utRx6W96UH8zjwqJZy3joyWQh9+k/zg0FO4hqnIgPce8VmOTSNhymsJOD4eWg+5JCkx Il3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RtMkfJIUd3ZwToXtrFuZwzJUwaNB+RmDzcgCaA6I7MY=; b=yb58kXaMFgJS0QdHMngjXRYFhMf2KhjKU2lLJh0scn3vQ4p359IHI9JdYAdzmvppOo yDFCTKZYp76LPzaE5p47bWo6zaVsyE8e6/jlS9pB8ZqI2Da97lA2mgnEkHPXH4hPzZnr QPyXt3GTm1fyo3Vnke6Auo22IZJQC12zGdPKexJVb40T8oswxAVZoFw4mO5z2DlcZbXB HG3Rt0vnB7j8rR8tkJMCtKiIjkdGTUa6U38qRS9Gyql5GZB4Yakio2y8YsgzuKHYEkQd ok17hO/crAYdXDbOld//36hJ1gOEdNN8IxKQ6HjBtuww5oRNHr6Hb4SkfDWbnTOqFsBJ woMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=yGWFcvJi; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si7581611edd.202.2021.01.18.21.31.21; Mon, 18 Jan 2021 21:31:29 -0800 (PST) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=yGWFcvJi; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731135AbhARXeh (ORCPT + 18 others); Mon, 18 Jan 2021 18:34:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbhARXef (ORCPT ); Mon, 18 Jan 2021 18:34:35 -0500 Received: from smtp.sws.net.au (smtp.sws.net.au [IPv6:2a01:4f8:140:71f5::dada:cafe]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A85EC061573 for ; Mon, 18 Jan 2021 15:33:51 -0800 (PST) Received: from liv.coker.com.au (unknown [103.75.204.226]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: russell@coker.com.au) by smtp.sws.net.au (Postfix) with ESMTPSA id DAD78F553; Tue, 19 Jan 2021 10:33:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1611012827; bh=RtMkfJIUd3ZwToXtrFuZwzJUwaNB+RmDzcgCaA6I7MY=; l=1820; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yGWFcvJilbEEvk4larqrxXL9J+jRdCGaFYYnQcPqTkrtXXSNJ5mr9GBi/9+MaGke5 p/PlPY4tuAgBUo6aD3Fl5SeuaDnW0wxPjfA6SH2Wtu7AYHZUdP3XDWTsF6g0DcSLWv 7fSZevN6m/FlJHE8lk1aN0uC0tPevhtaDA2Sdi8k= From: Russell Coker To: Dominick Grift Cc: selinux-refpolicy@vger.kernel.org Subject: Re: [PATCH] matrixd (synapse) policy Date: Tue, 19 Jan 2021 10:33:30 +1100 Message-ID: <9533895.9IaMh57lMM@liv> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On Tuesday, 19 January 2021 2:07:06 AM AEDT Dominick Grift wrote: > > +allow matrixd_t self:fifo_file rw_file_perms; > > +allow matrixd_t self:tcp_socket create_stream_socket_perms; > > +allow matrixd_t self:netlink_route_socket rw_netlink_socket_perms; > > r_netlink_route_socket_perms probably r_netlink_socket_perms works. There isn't a r_netlink_route_socket_perms. > > +corenet_tcp_connect_http_port(matrixd_t) > > +corenet_tcp_connect_http_cache_port(matrixd_t) > > +corenet_udp_bind_generic_port(matrixd_t) > > +corenet_tcp_bind_http_port(matrixd_t) > > +corenet_udp_bind_reserved_port(matrixd_t) > > + > > +allow matrixd_t self:udp_socket create_socket_perms; > > +allow matrixd_t self:unix_dgram_socket { create getopt setopt write }; > > create_socket_perms Done. > > +# https://cffi.readthedocs.io/en/latest/using.html#callbacks > > +allow matrixd_t self:process execmem; > > + > > +can_exec(matrixd_t, { matrixd_tmp_t matrixd_var_t }) > > Are you sure that it requires "execute_no_trans" here and not just "map > execute"? Can you show the avc denials that prompted this rule to be added? I've removed that line and haven't been able to recreate whatever made me add it. I'll submit a new patch without it. > > + > > +kernel_read_system_state(matrixd_t) > > +kernel_search_fs_sysctls(matrixd_t) > > +kernel_read_vm_overcommit_sysctl(matrixd_t) > > +kernel_search_vm_sysctl(matrixd_t) > > + > > +corecmd_exec_bin(matrixd_t) > > +corecmd_shell_entry_type(matrixd_t) > > Why would the matrixd_t domain be entered via shell_exec_t? Can you show > the avc denials that prompted this rule to be added? corecmd_shell_entry_type() wasn't needed. Thanks for your review. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/