• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * SPDX-License-Identifier: GPL-2.0
4  *
5  * Unless required by applicable law or agreed to in writing, software
6  * distributed under the License is distributed on an "AS IS" BASIS,
7  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8  * See the License for the specific language governing permissions and
9  * limitations under the License.
10  */
11 
12 #include <trace/hooks/mm.h>
13 #include <linux/module.h>
14 #include <linux/init.h>
15 #include <linux/kernel.h>
16 
vendor_do_mprotect_pkey(void * data,unsigned long prot,int * err)17 static void vendor_do_mprotect_pkey(void *data, unsigned long prot, int *err)
18 {
19     pr_info("%s\n", __func__);
20 }
21 
mprotect_pkey_test_init_module(void)22 static int mprotect_pkey_test_init_module(void)
23 {
24     return register_trace_vendor_do_mprotect_pkey(&vendor_do_mprotect_pkey, NULL);
25 }
26 
mprotect_pkey_test_exit_module(void)27 static void mprotect_pkey_test_exit_module(void)
28 {
29     unregister_trace_vendor_do_mprotect_pkey(&vendor_do_mprotect_pkey, NULL);
30 }
31 
32 /* module entry points */
33 module_init(mprotect_pkey_test_init_module);
34 module_exit(mprotect_pkey_test_exit_module);
35 MODULE_LICENSE("GPL v2");
36