From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61E23C433E0 for ; Tue, 12 Jan 2021 10:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 169A122EBD for ; Tue, 12 Jan 2021 10:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404697AbhALKQz (ORCPT ); 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. ## ##