Linux-Security-Module Archive on lore.kernel.org
 help / color / Atom feed
* Re: general protection fault in smack_socket_sendmsg
       [not found] <20190831053311.15704-1-hdanton@sina.com>
@ 2019-09-03 23:17 ` Casey Schaufler
  2019-09-04 10:16   ` Tetsuo Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Casey Schaufler @ 2019-09-03 23:17 UTC (permalink / raw)
  To: Hillf Danton, syzbot
  Cc: jmorris, linux-kernel, linux-security-module, serge,
	syzkaller-bugs, casey

On 8/30/2019 10:33 PM, Hillf Danton wrote:
> On Fri, 30 Aug 2019 12:40:07 -0700
>> Hello,
>>
>> syzbot found the following crash on:
>>
>> HEAD commit:    6525771f Merge tag 'arc-5.3-rc7' of git://git.kernel.org/p..
>> git tree:       upstream
>> console output: https://syzkaller.appspot.com/x/log.txt?x=11486cea600000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=58485246ad14eafe
>> dashboard link: https://syzkaller.appspot.com/bug?extid=5fd781d646d4fcbdfeb0
>> compiler:       clang version 9.0.0 (/home/glider/llvm/clang  
>> 80fee25776c2fb61e74c1ecb1a523375c2500b69)
>>
>> Unfortunately, I don't have any reproducer for this crash yet.
>>
>> IMPORTANT: if you fix the bug, please add the following tag to the commit:
>> Reported-by: syzbot+5fd781d646d4fcbdfeb0@syzkaller.appspotmail.com
>>
>> kasan: CONFIG_KASAN_INLINE enabled
>> kasan: GPF could be caused by NULL-ptr deref or user memory access
>> general protection fault: 0000 [#1] PREEMPT SMP KASAN
>> CPU: 0 PID: 11983 Comm: kworker/0:0 Not tainted 5.3.0-rc6+ #94
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
>> Google 01/01/2011
>> Workqueue: krxrpcd rxrpc_peer_keepalive_worker
>> RIP: 0010:smack_socket_sendmsg+0x5b/0x480 security/smack/smack_lsm.c:3677
>> Code: e8 6a 07 71 fe 4c 89 e8 48 c1 e8 03 42 80 3c 38 00 74 08 4c 89 ef e8  
>> b4 ff a9 fe 4d 8b 65 00 48 83 c3 18 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00  
>> 74 08 48 89 df e8 96 ff a9 fe 4c 8b 33 49 8d 9e 08
>> RSP: 0018:ffff8881daa1f9c8 EFLAGS: 00010206
>> RAX: 0000000000000003 RBX: 0000000000000018 RCX: ffff888048882500
>> RDX: 0000000000000000 RSI: ffff8881daa1fb18 RDI: 0000000000000000
>> RBP: ffff8881daa1fa80 R08: ffffffff8350cc90 R09: ffff8881daa1fb86
>> R10: ffffed103b543f72 R11: 0000000000000000 R12: ffff88803704c594
>> R13: ffff8881daa1fb18 R14: dffffc0000000000 R15: dffffc0000000000
>> FS:  0000000000000000(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000
>> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> CR2: 00007f7d4f2b5028 CR3: 000000005e835000 CR4: 00000000001426f0
>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
>> Call Trace:
>>   security_socket_sendmsg+0x6c/0xd0 security/security.c:1973
>>   sock_sendmsg net/socket.c:654 [inline]
>>   kernel_sendmsg+0x77/0x140 net/socket.c:677
>>   rxrpc_send_keepalive+0x254/0x3c0 net/rxrpc/output.c:655
>>   rxrpc_peer_keepalive_dispatch net/rxrpc/peer_event.c:369 [inline]
>>   rxrpc_peer_keepalive_worker+0x76e/0xb40 net/rxrpc/peer_event.c:430
>>   process_one_work+0x7ef/0x10e0 kernel/workqueue.c:2269
>>   worker_thread+0xc01/0x1630 kernel/workqueue.c:2415
>>   kthread+0x332/0x350 kernel/kthread.c:255
>>   ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
>> Modules linked in:
>> ---[ end trace 61235a384085b26a ]---

If you want to add a description and signed-off-by I will take this.

>  
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -3674,7 +3674,7 @@ static int smack_socket_sendmsg(struct s
>  	struct sockaddr_in6 *sap = (struct sockaddr_in6 *) msg->msg_name;
>  #endif
>  #ifdef SMACK_IPV6_SECMARK_LABELING
> -	struct socket_smack *ssp = sock->sk->sk_security;
> +	struct socket_smack *ssp;
>  	struct smack_known *rsp;
>  #endif
>  	int rc = 0;
> @@ -3684,6 +3684,15 @@ static int smack_socket_sendmsg(struct s
>  	 */
>  	if (sip == NULL)
>  		return 0;
> +	/*
> +	 * Fine if sock reaped
> +	 */
> +	if (!READ_ONCE(sock->sk))
> +		return 0;
> +
> +#ifdef SMACK_IPV6_SECMARK_LABELING
> +	ssp = sock->sk->sk_security;
> +#endif
>  
>  	switch (sock->sk->sk_family) {
>  	case AF_INET:
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: general protection fault in smack_socket_sendmsg
  2019-09-03 23:17 ` general protection fault in smack_socket_sendmsg Casey Schaufler
@ 2019-09-04 10:16   ` Tetsuo Handa
  2019-09-04 21:07     ` Casey Schaufler
  0 siblings, 1 reply; 4+ messages in thread
From: Tetsuo Handa @ 2019-09-04 10:16 UTC (permalink / raw)
  To: Casey Schaufler, Hillf Danton, syzbot
  Cc: jmorris, linux-kernel, linux-security-module, serge, syzkaller-bugs

On 2019/09/04 8:17, Casey Schaufler wrote:
> On 8/30/2019 10:33 PM, Hillf Danton wrote:
>>> dashboard link: https://syzkaller.appspot.com/bug?extid=5fd781d646d4fcbdfeb0
> If you want to add a description and signed-off-by I will take this.

Excuse me, but this bug was already closed as dup of "KASAN: use-after-free Read in rxrpc_send_keepalive".


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: general protection fault in smack_socket_sendmsg
  2019-09-04 10:16   ` Tetsuo Handa
@ 2019-09-04 21:07     ` Casey Schaufler
  0 siblings, 0 replies; 4+ messages in thread
From: Casey Schaufler @ 2019-09-04 21:07 UTC (permalink / raw)
  To: Tetsuo Handa, Hillf Danton, syzbot
  Cc: jmorris, linux-kernel, linux-security-module, serge, syzkaller-bugs

On 9/4/2019 3:16 AM, Tetsuo Handa wrote:
> On 2019/09/04 8:17, Casey Schaufler wrote:
>> On 8/30/2019 10:33 PM, Hillf Danton wrote:
>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=5fd781d646d4fcbdfeb0
>> If you want to add a description and signed-off-by I will take this.
> Excuse me, but this bug was already closed as dup of "KASAN: use-after-free Read in rxrpc_send_keepalive".

I will hold off then. Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* general protection fault in smack_socket_sendmsg
@ 2019-08-30 19:40 syzbot
  0 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2019-08-30 19:40 UTC (permalink / raw)
  To: casey, jmorris, linux-kernel, linux-security-module, serge,
	syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    6525771f Merge tag 'arc-5.3-rc7' of git://git.kernel.org/p..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11486cea600000
kernel config:  https://syzkaller.appspot.com/x/.config?x=58485246ad14eafe
dashboard link: https://syzkaller.appspot.com/bug?extid=5fd781d646d4fcbdfeb0
compiler:       clang version 9.0.0 (/home/glider/llvm/clang  
80fee25776c2fb61e74c1ecb1a523375c2500b69)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+5fd781d646d4fcbdfeb0@syzkaller.appspotmail.com

kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 11983 Comm: kworker/0:0 Not tainted 5.3.0-rc6+ #94
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Workqueue: krxrpcd rxrpc_peer_keepalive_worker
RIP: 0010:smack_socket_sendmsg+0x5b/0x480 security/smack/smack_lsm.c:3677
Code: e8 6a 07 71 fe 4c 89 e8 48 c1 e8 03 42 80 3c 38 00 74 08 4c 89 ef e8  
b4 ff a9 fe 4d 8b 65 00 48 83 c3 18 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00  
74 08 48 89 df e8 96 ff a9 fe 4c 8b 33 49 8d 9e 08
RSP: 0018:ffff8881daa1f9c8 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: ffff888048882500
RDX: 0000000000000000 RSI: ffff8881daa1fb18 RDI: 0000000000000000
RBP: ffff8881daa1fa80 R08: ffffffff8350cc90 R09: ffff8881daa1fb86
R10: ffffed103b543f72 R11: 0000000000000000 R12: ffff88803704c594
R13: ffff8881daa1fb18 R14: dffffc0000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7d4f2b5028 CR3: 000000005e835000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  security_socket_sendmsg+0x6c/0xd0 security/security.c:1973
  sock_sendmsg net/socket.c:654 [inline]
  kernel_sendmsg+0x77/0x140 net/socket.c:677
  rxrpc_send_keepalive+0x254/0x3c0 net/rxrpc/output.c:655
  rxrpc_peer_keepalive_dispatch net/rxrpc/peer_event.c:369 [inline]
  rxrpc_peer_keepalive_worker+0x76e/0xb40 net/rxrpc/peer_event.c:430
  process_one_work+0x7ef/0x10e0 kernel/workqueue.c:2269
  worker_thread+0xc01/0x1630 kernel/workqueue.c:2415
  kthread+0x332/0x350 kernel/kthread.c:255
  ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
Modules linked in:
---[ end trace 61235a384085b26a ]---
RIP: 0010:smack_socket_sendmsg+0x5b/0x480 security/smack/smack_lsm.c:3677
Code: e8 6a 07 71 fe 4c 89 e8 48 c1 e8 03 42 80 3c 38 00 74 08 4c 89 ef e8  
b4 ff a9 fe 4d 8b 65 00 48 83 c3 18 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00  
74 08 48 89 df e8 96 ff a9 fe 4c 8b 33 49 8d 9e 08
RSP: 0018:ffff8881daa1f9c8 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: ffff888048882500
RDX: 0000000000000000 RSI: ffff8881daa1fb18 RDI: 0000000000000000
RBP: ffff8881daa1fa80 R08: ffffffff8350cc90 R09: ffff8881daa1fb86
R10: ffffed103b543f72 R11: 0000000000000000 R12: ffff88803704c594
R13: ffff8881daa1fb18 R14: dffffc0000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000960004 CR3: 0000000022fd0000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190831053311.15704-1-hdanton@sina.com>
2019-09-03 23:17 ` general protection fault in smack_socket_sendmsg Casey Schaufler
2019-09-04 10:16   ` Tetsuo Handa
2019-09-04 21:07     ` Casey Schaufler
2019-08-30 19:40 syzbot

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org linux-security-module@archiver.kernel.org
	public-inbox-index linux-security-module


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/ public-inbox