blob: fd0fb6035c9098b82197a28d0964f4feebf079ee [file] [log] [blame]
Paul Lawrenceeabc3522016-11-11 11:33:42 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Elliott Hughescbc80ba2018-02-13 14:26:29 -080017#pragma once
Paul Lawrenceeabc3522016-11-11 11:33:42 -080018
Paul Lawrence26f57b62017-03-27 15:38:37 -070019#include <stddef.h>
Martijn Coenend269d9b2018-11-08 16:41:42 +010020#include <stdint.h>
Paul Lawrence26f57b62017-03-27 15:38:37 -070021#include <linux/filter.h>
22
Victor Hsieh4f02dd52017-12-20 09:19:22 -080023bool set_app_seccomp_filter();
Martijn Coenenc3752be2019-01-09 16:19:57 +010024bool set_app_zygote_seccomp_filter();
Victor Hsieh4f02dd52017-12-20 09:19:22 -080025bool set_system_seccomp_filter();
Steve Muckleaa3f96c2017-07-20 13:11:54 -070026bool set_global_seccomp_filter();
Martijn Coenend269d9b2018-11-08 16:41:42 +010027
28// Installs a filter that limits setresuid/setresgid to a range of
29// [uid_gid_min..uid_gid_max] (for the real-, effective- and super-ids).
30bool install_setuidgid_seccomp_filter(uint32_t uid_gid_min, uint32_t uid_gid_max);