Home Home > GIT Browse > SLE15-SP1-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-10-17 07:17:18 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-10-17 07:17:18 +0200
commit0b851e1e63bca2eb946f34c403ddfb3937af41f2 (patch)
tree295372b10677a0c98a4d760c2ec3ed7551a56811
parent317643b0d60e84645daac83c8c2fb8d07d2ad3de (diff)
parent075a4cbc5f2fc0bf2be271d3dfaf7291855af9da (diff)
Merge branch 'users/bpetkov/SLE15/for-next' into SLE15
Pull an NFC raw socket fix from Borislav Petkov suse-commit: d621dd2cbbca1f21c70272f6e1c1e8ade1c01a73
-rw-r--r--net/nfc/llcp_sock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
index fb7afcaa3004..33ad7e25a89d 100644
--- a/net/nfc/llcp_sock.c
+++ b/net/nfc/llcp_sock.c
@@ -1012,10 +1012,13 @@ static int llcp_sock_create(struct net *net, struct socket *sock,
sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
- if (sock->type == SOCK_RAW)
+ if (sock->type == SOCK_RAW) {
+ if (!capable(CAP_NET_RAW))
+ return -EPERM;
sock->ops = &llcp_rawsock_ops;
- else
+ } else {
sock->ops = &llcp_sock_ops;
+ }
sk = nfc_llcp_sock_alloc(sock, sock->type, GFP_ATOMIC, kern);
if (sk == NULL)