Received: by 10.192.165.148 with SMTP id m20csp782288imm; Wed, 9 May 2018 23:59:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpfnf9HeZsJIPzmNRMkMsXsqgS1ZpfPN3StoJCf3npO81qD0REbbxquS7Xy9Frne2AqV6L6 X-Received: by 2002:a62:404f:: with SMTP id n76-v6mr206888pfa.185.1525935597388; Wed, 09 May 2018 23:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525935597; cv=none; d=google.com; s=arc-20160816; b=lM7ok2PlFniktzYtlOg1MxjibyqCpV8ATq7Lo7kW3mSTYhX138jK/KJ6fjbECeZ9sk reDmozBOTjlv7goSCsSn6MyGu8CAX1zkXIdmbqGriUFPhqZEPNlWSWepA7E9QLGkAs5g 4vPOZ6myV2esPS9RtCt/bV3Xe41A5f2frKJTh4C5r/WNYfFwP2HUiEZNjIQ1sD8kSsda 457yaeGBEhkcgcfbF7CdhdiaF3cguIkQXbkMF8rwsfKJ91qCI26IzwE1GUZS4osBI3N9 CGy9cz/ISt5IIVNIjfILsaOlMeqITOrR1Txq50pSs/IXODUWkpOLWO5ergQsaukdR0cx zkWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=dV7J7pPNy72lPEyyE9WMlvngXzqomhIB0806Eb1MwGM=; b=cm3j37dzMJwKkeDuWGfuopeSy+Vq1a1NeETKjsvUFxuoRdh5jya7AY454OpdnmKjMo MP0e0pDkHuXU2zmN3QIsgO6N/fGoicYKujS4H/1EKUROnL1utU3ku8hRVNkwNsNwaZZS oNRWlm6k0wBxSdCAHg/qofg00zq6MNYUVhtBhRCECykgaBMTjsIJzLrKAdwrxRKZoOIS RUETx9/8tRMeB7D2ZlqafCtkk644pk7ylDci0cAvU23G0IMBJy10xrElHCQCLrKSRzPJ QGkU3PJW2NPZklebpDlbXEQS42dtnAkM45bV/yMYzn4RWWwcTVfpuli8eARSXC78XU7F /70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eVkQtaS8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o189-v6si134368pfo.20.2018.05.09.23.59.43; Wed, 09 May 2018 23:59:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eVkQtaS8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756712AbeEJG7c (ORCPT + 99 others); Thu, 10 May 2018 02:59:32 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36879 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753693AbeEJG7b (ORCPT ); Thu, 10 May 2018 02:59:31 -0400 Received: by mail-pf0-f195.google.com with SMTP id e9-v6so611042pfi.4 for ; Wed, 09 May 2018 23:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dV7J7pPNy72lPEyyE9WMlvngXzqomhIB0806Eb1MwGM=; b=eVkQtaS80PhQDEgXTYiN730hosdxfYg5CUpqzR0Iu0eSNDHT35Ny+9GkjMhg6xH7+l B7zOy0LhoIBYO96qIvEXjLt6pdSzSSwycuRTUDyWm/nyxCaenRcZJd50B2InUOQ8QrxE yyas2+YR470URVgfGGhTmQuw+Y6MxRZ8DR6Tx4TRcM+j7PbTGLy/TD1aGLhZCInLVcLx Xl48LM+ZBPsYISlaVWnAHV0tHYFgsOfzyiFb6UxEwskQXf5oJd2wRDCpX+JadDMMNiRu IssJMoHhBR01SIp8YGNkTYgG+fN4YWnYSt5+DhzGSaM0f2EFJ6a3U4AyPesga5ugekDt IOuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dV7J7pPNy72lPEyyE9WMlvngXzqomhIB0806Eb1MwGM=; b=f+z+C7WEfMXoCaXHwPULeH1rLXrn5Fr3gTtv7U8RuPdBo69TcCohiK08Q4PXZhjSEM 2QR+6Bm0wvsl/UqUSXIe66djDcIHeIHTEn8Cmgifdc3VR5Dk84wEZxCgHiZ+r4pNBD8B ld07otNZ8GEsqtD6bpqMNBaVFUMCYNHCY97MY4EmvrcMDpiv2sWKVxk0UDev6SquB8zb d54n7W8tnhkni50+o8yuV7ScUs3WTxgTzhK2aWDRj+JbW8MRBVxYqA7fwIuXLIBQmsAv Zyp4V5rXai6RkwSV1w501AyzBAAGycw8PZWBQ/+2JGTPb9gqGfSszeicagcICnn6GM22 YTAw== X-Gm-Message-State: ALKqPwfwmxbPa78Uc6TaJFho1SJG3SRvPVoJs8H4OnHIb902v946YKTd mjooXBaNJ2g/cjNflogdtqEFt8RbJEyuJZapNG5f9Q== X-Received: by 2002:a62:1fc8:: with SMTP id l69-v6mr219170pfj.49.1525935570333; Wed, 09 May 2018 23:59:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.149.24 with HTTP; Wed, 9 May 2018 23:59:09 -0700 (PDT) In-Reply-To: References: <001a1144928eca24f605625fd8f9@google.com> From: Dmitry Vyukov Date: Thu, 10 May 2018 08:59:09 +0200 Message-ID: Subject: Re: WARNING in ion_buffer_destroy To: Laura Abbott Cc: syzbot , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , "open list:ANDROID DRIVERS" , Greg Kroah-Hartman , LKML , Martijn Coenen , Sumit Semwal , syzkaller-bugs , Todd Kjos Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 10, 2018 at 7:14 PM, Laura Abbott wrote: > On 01/09/2018 02:58 PM, syzbot wrote: >> >> Hello, >> >> syzkaller hit the following crash on >> 06d41862286aa7bc634a1dd9e6e7e96f925ef30a >> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master >> compiler: gcc (GCC) 7.1.1 20170620 >> .config is attached >> Raw console output is attached. >> C reproducer is attached >> syzkaller reproducer is attached. See https://goo.gl/kgGztJ >> for information about syzkaller reproducers >> >> >> IMPORTANT: if you fix the bug, please add the following tag to the commit: >> Reported-by: syzbot+cd8bcd40cb049efa2770@syzkaller.appspotmail.com >> It will help syzbot understand when the bug is fixed. See footer for >> details. >> If you forward the report, please keep this part and the footer. >> >> audit: type=1400 audit(1515538424.230:7): avc: denied { map } for >> pid=3499 comm="syzkaller239906" path="/root/syzkaller239906633" dev="sda1" >> ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 >> tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 >> WARNING: CPU: 0 PID: 1467 at drivers/staging/android/ion/ion.c:122 >> ion_buffer_destroy+0xd4/0x190 drivers/staging/android/ion/ion.c:122 >> Kernel panic - not syncing: panic_on_warn set ... >> >> CPU: 0 PID: 1467 Comm: ion_system_heap Not tainted >> 4.15.0-rc7-next-20180109+ #92 >> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS >> Google 01/01/2011 >> Call Trace: >> __dump_stack lib/dump_stack.c:17 [inline] >> dump_stack+0x194/0x257 lib/dump_stack.c:53 >> panic+0x1e4/0x41c kernel/panic.c:183 >> __warn+0x1dc/0x200 kernel/panic.c:547 >> report_bug+0x211/0x2d0 lib/bug.c:184 >> fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178 >> fixup_bug arch/x86/kernel/traps.c:247 [inline] >> do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296 >> do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315 >> invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:1079 >> RIP: 0010:ion_buffer_destroy+0xd4/0x190 >> drivers/staging/android/ion/ion.c:122 >> RSP: 0018:ffff8801d3a9fd28 EFLAGS: 00010293 >> RAX: ffff8801d39ee700 RBX: ffff8801c00e57c0 RCX: ffffffff8415d2a4 >> RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8801d5ada5b8 >> RBP: ffff8801d3a9fd50 R08: 0000000000000000 R09: 1ffff1003a753f8a >> R10: ffff8801d3a9fc18 R11: 0000000000000000 R12: ffffffff86e4c980 >> R13: ffff8801d5ada580 R14: ffff8801c00e57e0 R15: 0000000000000001 >> ion_heap_deferred_free+0x290/0x650 >> drivers/staging/android/ion/ion_heap.c:236 >> kthread+0x33c/0x400 kernel/kthread.c:238 >> ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:524 >> Dumping ftrace buffer: >> (ftrace buffer empty) >> Kernel Offset: disabled >> Rebooting in 86400 seconds.. > > > This is catching that a buffer was freed with an existing kernel > map still present. The problem is this can easily be triggered from > userspace by calling DMA_BUF_SYNC_START without calling > DMA_BUF_SYNC_END. It's clearly not appropriate for userspace to > be able to trigger a warning so I'll see about switching this to > a pr_warn_once. Hi Laura, Any updates on this?