Skip to content

Commit 3011a34

Browse files
eparisxjamesmorris
authored andcommitted
security: remove dead hook key_session_to_parent
Unused hook. Remove. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
1 parent 6307f8f commit 3011a34

4 files changed

Lines changed: 0 additions & 42 deletions

File tree

‎include/linux/security.h‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,13 +1067,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
10671067
* Return the length of the string (including terminating NUL) or -ve if
10681068
* an error.
10691069
* May also return 0 (and a NULL buffer pointer) if there is no label.
1070-
* @key_session_to_parent:
1071-
* Forcibly assign the session keyring from a process to its parent
1072-
* process.
1073-
* @cred: Pointer to process's credentials
1074-
* @parent_cred: Pointer to parent process's credentials
1075-
* @keyring: Proposed new session keyring
1076-
* Return 0 if permission is granted, -ve error otherwise.
10771070
*
10781071
* Security hooks affecting all System V IPC operations.
10791072
*
@@ -1642,9 +1635,6 @@ struct security_operations {
16421635
const struct cred *cred,
16431636
key_perm_t perm);
16441637
int (*key_getsecurity)(struct key *key, char **_buffer);
1645-
int (*key_session_to_parent)(const struct cred *cred,
1646-
const struct cred *parent_cred,
1647-
struct key *key);
16481638
#endif /* CONFIG_KEYS */
16491639

16501640
#ifdef CONFIG_AUDIT
@@ -2918,9 +2908,6 @@ void security_key_free(struct key *key);
29182908
int security_key_permission(key_ref_t key_ref,
29192909
const struct cred *cred, key_perm_t perm);
29202910
int security_key_getsecurity(struct key *key, char **_buffer);
2921-
int security_key_session_to_parent(const struct cred *cred,
2922-
const struct cred *parent_cred,
2923-
struct key *key);
29242911

29252912
#else
29262913

@@ -2948,13 +2935,6 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer)
29482935
return 0;
29492936
}
29502937

2951-
static inline int security_key_session_to_parent(const struct cred *cred,
2952-
const struct cred *parent_cred,
2953-
struct key *key)
2954-
{
2955-
return 0;
2956-
}
2957-
29582938
#endif
29592939
#endif /* CONFIG_KEYS */
29602940

‎security/capability.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -826,13 +826,6 @@ static int cap_key_getsecurity(struct key *key, char **_buffer)
826826
return 0;
827827
}
828828

829-
static int cap_key_session_to_parent(const struct cred *cred,
830-
const struct cred *parent_cred,
831-
struct key *key)
832-
{
833-
return 0;
834-
}
835-
836829
#endif /* CONFIG_KEYS */
837830

838831
#ifdef CONFIG_AUDIT
@@ -1053,7 +1046,6 @@ void security_fixup_ops(struct security_operations *ops)
10531046
set_to_cap_if_null(ops, key_free);
10541047
set_to_cap_if_null(ops, key_permission);
10551048
set_to_cap_if_null(ops, key_getsecurity);
1056-
set_to_cap_if_null(ops, key_session_to_parent);
10571049
#endif /* CONFIG_KEYS */
10581050
#ifdef CONFIG_AUDIT
10591051
set_to_cap_if_null(ops, audit_rule_init);

‎security/keys/keyctl.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,13 +1295,6 @@ long keyctl_session_to_parent(void)
12951295
mycred->tgcred->session_keyring->uid != mycred->euid)
12961296
goto not_permitted;
12971297

1298-
/* the LSM must permit the replacement of the parent's keyring with the
1299-
* keyring from this process */
1300-
ret = security_key_session_to_parent(mycred, pcred,
1301-
key_ref_to_ptr(keyring_r));
1302-
if (ret < 0)
1303-
goto not_permitted;
1304-
13051298
/* if there's an already pending keyring replacement, then we replace
13061299
* that */
13071300
oldcred = parent->replacement_session_keyring;

‎security/security.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,13 +1262,6 @@ int security_key_getsecurity(struct key *key, char **_buffer)
12621262
return security_ops->key_getsecurity(key, _buffer);
12631263
}
12641264

1265-
int security_key_session_to_parent(const struct cred *cred,
1266-
const struct cred *parent_cred,
1267-
struct key *key)
1268-
{
1269-
return security_ops->key_session_to_parent(cred, parent_cred, key);
1270-
}
1271-
12721265
#endif /* CONFIG_KEYS */
12731266

12741267
#ifdef CONFIG_AUDIT

0 commit comments

Comments
 (0)