Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3030742pxb; Tue, 12 Jan 2021 04:48:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuy0xBFCQ8xFVAqtM9DW9kzo4CN85pKfCLT6DKpmPzczf3IvDvvlhW6gCWlrtpWxYEPJWx X-Received: by 2002:a17:907:1009:: with SMTP id ox9mr3152026ejb.37.1610455687144; Tue, 12 Jan 2021 04:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610455687; cv=none; d=google.com; s=arc-20160816; b=J3gMShHORS35r4kQH7qwvGRZ2VVdehME6r/nYb9Sdq9Zqrb5eBJmqhhzlkyZ8VQ+zX 7yEiRcUMWIjoqdS9U/pe4d9/igjNGRh1pttJBBVQfv8wZ2lUPpcB/FdEbseaT0oU4dLc HvgBIJjxfeokCB1oxX2fUk/MoWFXwB9NKky8M0R7T4giOtZh/jPUNiRfzJao9+8sWKQk YP0Q+DUDN8fJqQbCKg44RmUTNTdhpg8CvLWqPtxlyfhnTMxoTNQihFIztB79Tjo4Cv+b jE0m6ZSLn9ohH6G2Kmqffa8F9qtYBq5ge0oGcZqWb0LbEvDafqHKXudSuTq4dg5n12fc nS0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=V6wHYaEGjN0+PCErJ3gaFfgOYX7d+Op2i2G9mI3vayw=; b=VO8yWsZGxiYXyxAsbfvXOB5TQokbmzFqvdgzov4BIxBmNgX4PjQSx3EL78w+k1Q2Nz AiOm5gVkOMR8lffmz+VVzuIvPqDBJXT1478wmCklaeQigds2bhixTymjjACC7zJaA6vC Nhof1Ft+lPNT7T7T2kTvR5aVC2hufvDVTVPwpyfKbvGLMC41jGz2/QpZOS+F5j4pUpCS aDamOYiXnwCT18dUtT28oOiDt0bWg0Qx8+ruNUJJ8qPqywYe7Z5MHk1saPY4+FWbDlNE d9Po0lsvetvtcVLTxmvU3o9sUFta7gjRU8Nk+ninjux+IjRaiggWDHYI3H6KW/A0XrmR qB1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=riUt8foV; 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 h12si1102146eje.122.2021.01.12.04.48.02; Tue, 12 Jan 2021 04:48:07 -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=riUt8foV; 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 S2404697AbhALKQz (ORCPT + 18 others); Tue, 12 Jan 2021 05:16:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404693AbhALKQz (ORCPT ); Tue, 12 Jan 2021 05:16:55 -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 4F8B3C061575 for ; Tue, 12 Jan 2021 02:16:15 -0800 (PST) Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 66E1C16DD9 for ; Tue, 12 Jan 2021 21:16:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1610446573; bh=V6wHYaEGjN0+PCErJ3gaFfgOYX7d+Op2i2G9mI3vayw=; l=3164; h=Date:From:To:Subject:From; b=riUt8foVhBnOtjQ/ru1qn1Kwp+JtY5WpNtIsoRNew3En20MERKMILWRE0UNpkpaKa WLA8wXLP62weSYIZKpJSsucYFui3pPaOaDph+WZjZi2m2/6IFUyKBNCsyKD84iQL9c ei9w6SFY1SVB3LdJtnQ/KhAFyPNNroXEH7rJsrgE= Received: by xev.coker.com.au (Postfix, from userid 1001) id 6E85112ECF88; Tue, 12 Jan 2021 21:16:09 +1100 (AEDT) Date: Tue, 12 Jan 2021 21:16:09 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] chrome/chromium stranger things Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org This is some of the other things needed by Chrome/Chromium. Some is obvious (like IPP). The file creation thing under /proc is something Chrome does, I still don't know why. I'll submit a patch without that if you like, but I think the rest should be acceptable without debate. Signed-off-by: Russell Coker Index: refpolicy-2.20201205/policy/modules/apps/chromium.te =================================================================== --- refpolicy-2.20201205.orig/policy/modules/apps/chromium.te +++ refpolicy-2.20201205/policy/modules/apps/chromium.te @@ -90,7 +97,9 @@ xdg_cache_content(chromium_xdg_cache_t) # # execmem for load in plugins -allow chromium_t self:process { execmem getsched getcap setcap setrlimit setsched sigkill signal }; +allow chromium_t self:process { execmem getsched getcap setcap setrlimit setsched sigkill signal signull }; +allow chromium_t self:dir { write add_name }; +allow chromium_t self:file create; allow chromium_t self:fifo_file rw_fifo_file_perms; allow chromium_t self:sem create_sem_perms; allow chromium_t self:netlink_kobject_uevent_socket client_stream_socket_perms; @@ -145,7 +154,12 @@ dyntrans_pattern(chromium_t, chromium_re domtrans_pattern(chromium_t, chromium_sandbox_exec_t, chromium_sandbox_t) domtrans_pattern(chromium_t, chromium_naclhelper_exec_t, chromium_naclhelper_t) +# for self:file create +kernel_associate_proc(chromium_t) + +kernel_get_sysvipc_info(chromium_t) kernel_list_proc(chromium_t) +kernel_read_crypto_sysctls(chromium_t) kernel_read_fs_sysctls(chromium_t) kernel_read_kernel_sysctls(chromium_t) kernel_read_net_sysctls(chromium_t) @@ -157,6 +171,7 @@ corecmd_exec_shell(chromium_t) corenet_tcp_connect_all_unreserved_ports(chromium_t) corenet_tcp_connect_ftp_port(chromium_t) corenet_tcp_connect_http_port(chromium_t) +corenet_tcp_connect_ipp_port(chromium_t) corenet_udp_bind_generic_node(chromium_t) corenet_udp_bind_all_unreserved_ports(chromium_t) @@ -328,6 +348,9 @@ userdom_use_user_terminals(chromium_rend xdg_read_config_files(chromium_renderer_t) +# should we have a tunable for this? +xdg_read_pictures(chromium_t) + xserver_user_x_domain_template(chromium_renderer, chromium_renderer_t, chromium_tmpfs_t) tunable_policy(`chromium_read_system_info',` Index: refpolicy-2.20201205/policy/modules/kernel/kernel.if =================================================================== --- refpolicy-2.20201205.orig/policy/modules/kernel/kernel.if +++ refpolicy-2.20201205/policy/modules/kernel/kernel.if @@ -2442,6 +2442,24 @@ interface(`kernel_rw_all_sysctls',` ######################################## ## +## Associate a file to proc_t (/proc) +## +## +## +## Domain allowed access. +## +## +## +# +interface(`kernel_associate_proc',` + gen_require(` + type proc_t; + ') + allow $1 proc_t:filesystem associate; +') + +######################################## +## ## Send a kill signal to unlabeled processes. ## ##