Skip to content

Commit f5db4b3

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull LSM regression fix from James Morris. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: LSM: restore certain default error codes
2 parents f045fd7 + e308fd3 commit f5db4b3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

security/security.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ int security_inode_init_security(struct inode *inode, struct inode *dir,
380380
return 0;
381381

382382
if (!initxattrs)
383-
return call_int_hook(inode_init_security, 0, inode, dir, qstr,
384-
NULL, NULL, NULL);
383+
return call_int_hook(inode_init_security, -EOPNOTSUPP, inode,
384+
dir, qstr, NULL, NULL, NULL);
385385
memset(new_xattrs, 0, sizeof(new_xattrs));
386386
lsm_xattr = new_xattrs;
387387
ret = call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, qstr,
@@ -409,8 +409,8 @@ int security_old_inode_init_security(struct inode *inode, struct inode *dir,
409409
{
410410
if (unlikely(IS_PRIVATE(inode)))
411411
return -EOPNOTSUPP;
412-
return call_int_hook(inode_init_security, 0, inode, dir, qstr,
413-
name, value, len);
412+
return call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir,
413+
qstr, name, value, len);
414414
}
415415
EXPORT_SYMBOL(security_old_inode_init_security);
416416

@@ -1281,7 +1281,8 @@ int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
12811281

12821282
int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
12831283
{
1284-
return call_int_hook(socket_getpeersec_dgram, 0, sock, skb, secid);
1284+
return call_int_hook(socket_getpeersec_dgram, -ENOPROTOOPT, sock,
1285+
skb, secid);
12851286
}
12861287
EXPORT_SYMBOL(security_socket_getpeersec_dgram);
12871288

0 commit comments

Comments
 (0)