/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2021-2022 Klara Systems4*5* This software was developed by Mitchell Horne <[email protected]>6* under sponsorship from Juniper Networks and Klara Systems.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions10* are met:11*12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17*18* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR19* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES20* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.21* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,22* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT23* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,24* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY25* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT26* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF27* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.28*/29#include "opt_mac.h"3031#include <sys/param.h>32#include <sys/kernel.h>33#include <sys/module.h>3435#include <ddb/ddb.h>3637#include <security/mac/mac_framework.h>38#include <security/mac/mac_internal.h>39#include <security/mac/mac_policy.h>4041int42mac_kdb_grant_backend(struct kdb_dbbe *be)43{44int error = 0;4546MAC_POLICY_GRANT_NOSLEEP(kdb_check_backend, be);47return (error);48}4950int51mac_kdb_check_backend(struct kdb_dbbe *be)52{53int error = 0;5455MAC_POLICY_CHECK_NOSLEEP(kdb_check_backend, be);56return (error);57}5859int60mac_ddb_command_register(struct db_command_table *table, struct db_command *cmd)61{62int error = 0;6364MAC_POLICY_CHECK_NOSLEEP(ddb_command_register, table, cmd);65return (error);66}6768int69mac_ddb_command_exec(struct db_command *cmd, db_expr_t addr,70bool have_addr, db_expr_t count, char *modif)71{72int error = 0;7374MAC_POLICY_CHECK_NOSLEEP(ddb_command_exec, cmd, addr, have_addr,75count, modif);76return (error);77}787980