tomoyo.c (43fc460907dc56a3450654efc6ba1dfbcd4594eb) tomoyo.c (bbd3662a834813730912a58efb44dd6df6d952e6)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * security/tomoyo/tomoyo.c
4 *
5 * Copyright (C) 2005-2011 NTT DATA CORPORATION
6 */
7
8#include <linux/lsm_hooks.h>

--- 495 unchanged lines hidden (view full) ---

504 * Returns 0 on success, negative value otherwise.
505 */
506static int tomoyo_socket_sendmsg(struct socket *sock, struct msghdr *msg,
507 int size)
508{
509 return tomoyo_socket_sendmsg_permission(sock, msg, size);
510}
511
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * security/tomoyo/tomoyo.c
4 *
5 * Copyright (C) 2005-2011 NTT DATA CORPORATION
6 */
7
8#include <linux/lsm_hooks.h>

--- 495 unchanged lines hidden (view full) ---

504 * Returns 0 on success, negative value otherwise.
505 */
506static int tomoyo_socket_sendmsg(struct socket *sock, struct msghdr *msg,
507 int size)
508{
509 return tomoyo_socket_sendmsg_permission(sock, msg, size);
510}
511
512struct lsm_blob_sizes tomoyo_blob_sizes __lsm_ro_after_init = {
513 .lbs_cred = sizeof(struct tomoyo_domain_info *),
514};
515
512/*
513 * tomoyo_security_ops is a "struct security_operations" which is used for
514 * registering TOMOYO.
515 */
516static struct security_hook_list tomoyo_hooks[] __lsm_ro_after_init = {
517 LSM_HOOK_INIT(cred_alloc_blank, tomoyo_cred_alloc_blank),
518 LSM_HOOK_INIT(cred_prepare, tomoyo_cred_prepare),
519 LSM_HOOK_INIT(cred_transfer, tomoyo_cred_transfer),

--- 37 unchanged lines hidden (view full) ---

557static int __init tomoyo_init(void)
558{
559 struct cred *cred = (struct cred *) current_cred();
560 struct tomoyo_domain_info **blob;
561
562 /* register ourselves with the security framework */
563 security_add_hooks(tomoyo_hooks, ARRAY_SIZE(tomoyo_hooks), "tomoyo");
564 printk(KERN_INFO "TOMOYO Linux initialized\n");
516/*
517 * tomoyo_security_ops is a "struct security_operations" which is used for
518 * registering TOMOYO.
519 */
520static struct security_hook_list tomoyo_hooks[] __lsm_ro_after_init = {
521 LSM_HOOK_INIT(cred_alloc_blank, tomoyo_cred_alloc_blank),
522 LSM_HOOK_INIT(cred_prepare, tomoyo_cred_prepare),
523 LSM_HOOK_INIT(cred_transfer, tomoyo_cred_transfer),

--- 37 unchanged lines hidden (view full) ---

561static int __init tomoyo_init(void)
562{
563 struct cred *cred = (struct cred *) current_cred();
564 struct tomoyo_domain_info **blob;
565
566 /* register ourselves with the security framework */
567 security_add_hooks(tomoyo_hooks, ARRAY_SIZE(tomoyo_hooks), "tomoyo");
568 printk(KERN_INFO "TOMOYO Linux initialized\n");
569 lsm_early_cred(cred);
565 blob = tomoyo_cred(cred);
566 *blob = &tomoyo_kernel_domain;
567 tomoyo_mm_init();
568
569 return 0;
570}
571
572DEFINE_LSM(tomoyo) = {
573 .name = "tomoyo",
574 .enabled = &tomoyo_enabled,
575 .flags = LSM_FLAG_LEGACY_MAJOR | LSM_FLAG_EXCLUSIVE,
570 blob = tomoyo_cred(cred);
571 *blob = &tomoyo_kernel_domain;
572 tomoyo_mm_init();
573
574 return 0;
575}
576
577DEFINE_LSM(tomoyo) = {
578 .name = "tomoyo",
579 .enabled = &tomoyo_enabled,
580 .flags = LSM_FLAG_LEGACY_MAJOR | LSM_FLAG_EXCLUSIVE,
581 .blobs = &tomoyo_blob_sizes,
576 .init = tomoyo_init,
577};
582 .init = tomoyo_init,
583};