Lines Matching refs:r

362 static int tomoyo_audit_net_log(struct tomoyo_request_info *r,  in tomoyo_audit_net_log()  argument
366 return tomoyo_supervisor(r, "network %s %s %s %s\n", family, in tomoyo_audit_net_log()
378 static int tomoyo_audit_inet_log(struct tomoyo_request_info *r) in tomoyo_audit_inet_log() argument
382 const __be32 *address = r->param.inet_network.address; in tomoyo_audit_inet_log()
384 if (r->param.inet_network.is_ipv6) in tomoyo_audit_inet_log()
391 r->param.inet_network.port); in tomoyo_audit_inet_log()
392 return tomoyo_audit_net_log(r, "inet", r->param.inet_network.protocol, in tomoyo_audit_inet_log()
393 r->param.inet_network.operation, buf); in tomoyo_audit_inet_log()
403 static int tomoyo_audit_unix_log(struct tomoyo_request_info *r) in tomoyo_audit_unix_log() argument
405 return tomoyo_audit_net_log(r, "unix", r->param.unix_network.protocol, in tomoyo_audit_unix_log()
406 r->param.unix_network.operation, in tomoyo_audit_unix_log()
407 r->param.unix_network.address->name); in tomoyo_audit_unix_log()
418 static bool tomoyo_check_inet_acl(struct tomoyo_request_info *r, in tomoyo_check_inet_acl() argument
423 const u8 size = r->param.inet_network.is_ipv6 ? 16 : 4; in tomoyo_check_inet_acl()
425 if (!(acl->perm & (1 << r->param.inet_network.operation)) || in tomoyo_check_inet_acl()
426 !tomoyo_compare_number_union(r->param.inet_network.port, in tomoyo_check_inet_acl()
431 (r->param.inet_network.is_ipv6, in tomoyo_check_inet_acl()
432 r->param.inet_network.address, acl->address.group); in tomoyo_check_inet_acl()
433 return acl->address.is_ipv6 == r->param.inet_network.is_ipv6 && in tomoyo_check_inet_acl()
435 r->param.inet_network.address, size) <= 0 && in tomoyo_check_inet_acl()
436 memcmp(r->param.inet_network.address, in tomoyo_check_inet_acl()
448 static bool tomoyo_check_unix_acl(struct tomoyo_request_info *r, in tomoyo_check_unix_acl() argument
454 return (acl->perm & (1 << r->param.unix_network.operation)) && in tomoyo_check_unix_acl()
455 tomoyo_compare_name_union(r->param.unix_network.address, in tomoyo_check_unix_acl()
469 struct tomoyo_request_info r; in tomoyo_inet_entry() local
473 if (type && tomoyo_init_request_info(&r, NULL, type) in tomoyo_inet_entry()
475 r.param_type = TOMOYO_TYPE_INET_ACL; in tomoyo_inet_entry()
476 r.param.inet_network.protocol = address->protocol; in tomoyo_inet_entry()
477 r.param.inet_network.operation = address->operation; in tomoyo_inet_entry()
478 r.param.inet_network.is_ipv6 = address->inet.is_ipv6; in tomoyo_inet_entry()
479 r.param.inet_network.address = address->inet.address; in tomoyo_inet_entry()
480 r.param.inet_network.port = ntohs(address->inet.port); in tomoyo_inet_entry()
482 tomoyo_check_acl(&r, tomoyo_check_inet_acl); in tomoyo_inet_entry()
483 error = tomoyo_audit_inet_log(&r); in tomoyo_inet_entry()
544 struct tomoyo_request_info r; in tomoyo_unix_entry() local
548 if (type && tomoyo_init_request_info(&r, NULL, type) in tomoyo_unix_entry()
565 r.param_type = TOMOYO_TYPE_UNIX_ACL; in tomoyo_unix_entry()
566 r.param.unix_network.protocol = address->protocol; in tomoyo_unix_entry()
567 r.param.unix_network.operation = address->operation; in tomoyo_unix_entry()
568 r.param.unix_network.address = &addr; in tomoyo_unix_entry()
570 tomoyo_check_acl(&r, tomoyo_check_unix_acl); in tomoyo_unix_entry()
571 error = tomoyo_audit_unix_log(&r); in tomoyo_unix_entry()