Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2946412imm; Sun, 13 May 2018 00:36:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpz7zODOtHlJpoLLInL9SgHZoxJvaTnHlb49FpCsBQcGbIoJkP5n6nqeKZMj88Uqi4wnJ34 X-Received: by 2002:a62:18d6:: with SMTP id 205-v6mr5717548pfy.242.1526196998031; Sun, 13 May 2018 00:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526196997; cv=none; d=google.com; s=arc-20160816; b=GePUDJSZmsLXrNK9VBniPlRWK1P3KFhJeCQ4o1ryQoTN2He6CHwZCSavZCRuuRwrA9 c+4T0TULioru/mMCSPMJF0/ICJhqGbDvniu/t/lQSQg/nN7YT/6AJkc48u5HUsGPKQ6k orKU9XEyqI6Q7GKsG4meE9AKsqorx/IJP6aUkaHIGm1Iqyw1EQKwIICviL4/XSYv3xIq MchNmoz6pe/JalDRXe7TE0VE+anpzhmq+JjOYjabZWC5KIcqKeMhCwBenBN2KduHG5/6 vS2b1gAsng2IqqqdARiwQWYVK53jCAcYXiFg4+GZZr8qNDuyqbdlkr55w/nCVLQCB4WG 0YvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=qt701e3y3DrrKSTaac1NH9OYAVu9ATHzjlL+8modJyc=; b=coIcOk2GcDVfs02WggvuZyJoSmQGqYo96W6ugT9Kss+qK4pqo2wThqTS11BhCrSU76 oB3JcOSDO5d3kF7Pfc5UHor56TDFQoxSJbM7vYP5g44Nn6QdARHpZrywqtc0c28kxHW5 1RzAg/3D3aL7PUqHcLBF4iBqSkTsfVkKHRmGf9zrDHOYuXCorvMdix8uGHXmSVlrpK7h 3Hv7GLZgIx5u9F75MHBW+gMBKDj9IinfGeruyEGylukeuK+BcGW2ERhG4No/gnatdhnD 8S6Df4le7q0rKYMzkjHtuVXEoansQvXczPKPYr2rJjcoXimN35b2rSaDmjjkRwxeM0B3 Ef3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qX+Xe80k; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si6825803plc.403.2018.05.13.00.36.23; Sun, 13 May 2018 00:36:37 -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=@gmail.com header.s=20161025 header.b=qX+Xe80k; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424AbeEMHed (ORCPT + 99 others); Sun, 13 May 2018 03:34:33 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:42351 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbeEMHeb (ORCPT ); Sun, 13 May 2018 03:34:31 -0400 Received: by mail-pf0-f196.google.com with SMTP id p14-v6so4569829pfh.9 for ; Sun, 13 May 2018 00:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qt701e3y3DrrKSTaac1NH9OYAVu9ATHzjlL+8modJyc=; b=qX+Xe80kerJdbq8vRi/68gO5GVGi2xHCIv602GamjPK1zHYpHnbPTLfHH5SlbKn9xF UiOLkUqw2ofaWtVti7cNKIrCgB6Ho467UhC/SHLf/ePzYFJs+wW5bn46w3dTOjyeki65 dcjnWUqrCvNKxvMCwbzI/i2liKqngKjq7IPKShKNlTPtfealAIb6VYvmySjxeEW//0dP bDXueeE9eZx7PP/kRospXc3+gYOJVFScKr2g3vklDwh80BwfYijrgG7Y/jsQN/p7laB1 SpEoSJ7DwP7Ekbe7naC87kKj5iUZWPkQ3/q2+y4UESgWYZBcd7Gg9sapbtoKgCpzzgE5 MqOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qt701e3y3DrrKSTaac1NH9OYAVu9ATHzjlL+8modJyc=; b=c2s4wDlwJA2egiLcOZFcptzAlSBNdPuKRIUdWc50Dwqi8Eakbwf0O5XJohDOjftpIO dbG/McR9KO1CjVBIwb36/k2hYLvbksmJOD2qOF+IW6wkcXs04bPudYUGXqbDpOtdrgg8 QJEzTKCErKo0R2awQB51oJCUnPCqncqkWY0jrqGskrunx1pdo56HQJYyWPqDTANYYi9Y ww2U4JXbahsh17LMqmiKCKx2f+HOFWjvIukN3kkGekeeeADv/s/KbU66AcJYwsFMZZXy tftfKcSZDFNKCFhI3WjehzQLsOB9f94mqDsatpF7blqr3SReO+4KHd3xsrn2dXfYFKF9 oLIg== X-Gm-Message-State: ALKqPwdTkhLIANT8QmhiNnqTJ+xnsek/X1su7QZAlAs5WgQRQEgDi5v2 04aYKpPm9831fD1QJxhuUNU= X-Received: by 2002:aa7:8551:: with SMTP id y17-v6mr5636523pfn.163.1526196870766; Sun, 13 May 2018 00:34:30 -0700 (PDT) Received: from sol.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id a7-v6sm11413822pgc.68.2018.05.13.00.34.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 May 2018 00:34:29 -0700 (PDT) Date: Sun, 13 May 2018 00:36:36 -0700 From: Eric Biggers To: Takashi Iwai Cc: syzbot , alsa-devel@alsa-project.org, syzkaller-bugs@googlegroups.com, perex@perex.cz, linux-kernel@vger.kernel.org Subject: Re: KASAN: null-ptr-deref Write in linear_transfer Message-ID: <20180513073636.GB27296@sol.localdomain> References: <001a1147e1988b160a05620552eb@google.com> <20180110080800.GE931@zzz.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) 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 10:58:43AM +0100, Takashi Iwai wrote: > On Wed, 10 Jan 2018 09:08:00 +0100, > Eric Biggers wrote: > > > > On Fri, Jan 05, 2018 at 02:58:02AM -0800, syzbot wrote: > > > Hello, > > > > > > syzkaller hit the following crash on > > > 30a7acd573899fd8b8ac39236eff6468b195ac7d > > > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.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+a8f5641f452c7e6abf03@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. > > > > > > ================================================================== > > > BUG: KASAN: null-ptr-deref in memcpy include/linux/string.h:344 [inline] > > > BUG: KASAN: null-ptr-deref in do_convert sound/core/oss/linear.c:52 [inline] > > > BUG: KASAN: null-ptr-deref in convert sound/core/oss/linear.c:81 [inline] > > > BUG: KASAN: null-ptr-deref in linear_transfer+0x634/0x900 > > > sound/core/oss/linear.c:110 > > > Write of size 2 at addr (null) by task syzkaller360172/7860 > > > > > > CPU: 0 PID: 7860 Comm: syzkaller360172 Not tainted 4.15.0-rc6+ #155 > > > 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 > > > kasan_report_error mm/kasan/report.c:349 [inline] > > > kasan_report+0x13b/0x340 mm/kasan/report.c:409 > > > check_memory_region_inline mm/kasan/kasan.c:260 [inline] > > > check_memory_region+0x137/0x190 mm/kasan/kasan.c:267 > > > memcpy+0x37/0x50 mm/kasan/kasan.c:303 > > > memcpy include/linux/string.h:344 [inline] > > > do_convert sound/core/oss/linear.c:52 [inline] > > > convert sound/core/oss/linear.c:81 [inline] > > > linear_transfer+0x634/0x900 sound/core/oss/linear.c:110 > > > snd_pcm_plug_write_transfer+0x22d/0x420 sound/core/oss/pcm_plugin.c:611 > > > snd_pcm_oss_write2+0x260/0x420 sound/core/oss/pcm_oss.c:1311 > > > snd_pcm_oss_sync1+0x1cc/0x550 sound/core/oss/pcm_oss.c:1530 > > > snd_pcm_oss_sync+0x5b6/0x830 sound/core/oss/pcm_oss.c:1604 > > > snd_pcm_oss_release+0x20b/0x280 sound/core/oss/pcm_oss.c:2431 > > > __fput+0x327/0x7e0 fs/file_table.c:210 > > > ____fput+0x15/0x20 fs/file_table.c:244 > > > task_work_run+0x199/0x270 kernel/task_work.c:113 > > > exit_task_work include/linux/task_work.h:22 [inline] > > > do_exit+0x9bb/0x1ad0 kernel/exit.c:865 > > > do_group_exit+0x149/0x400 kernel/exit.c:968 > > > get_signal+0x73f/0x16c0 kernel/signal.c:2335 > > > do_signal+0x90/0x1eb0 arch/x86/kernel/signal.c:809 > > > exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158 > > > prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] > > > syscall_return_slowpath arch/x86/entry/common.c:264 [inline] > > > do_syscall_32_irqs_on arch/x86/entry/common.c:333 [inline] > > > do_fast_syscall_32+0xbfd/0xf9d arch/x86/entry/common.c:389 > > > entry_SYSENTER_compat+0x54/0x63 arch/x86/entry/entry_64_compat.S:129 > > > > Still reproducible even after all the fixes currently in sound/for-linus. > > Interesting, I can't reproduce it on my VM any longer... > No longer occurring, last occurrence was Mar 29 on commit a2601d78b77aa. Seems to have been fixed by commit 02a5d6925cd3: #syz fix: ALSA: pcm: Avoid potential races between OSS ioctls and read/write The reproducer was opening /dev/dsp1, then concurrently writing to it and calling the SNDCTL_DSP_SPEED ioctl. - Eric