Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2947055imm; Sun, 13 May 2018 00:37:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoBZb1gnQng5Fa47hBRSovWYZQ5NDQXC+nieidq6le59fYhqys0E82SprFWMXX0Zcr4abiD X-Received: by 2002:a17:902:1023:: with SMTP id b32-v6mr5099718pla.145.1526197054672; Sun, 13 May 2018 00:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526197054; cv=none; d=google.com; s=arc-20160816; b=hcgB0snxKtwMNzfWWZOsGH+C8S+S/3HP0wcMGRt5hFgShWwUbggAyUgNNO03BEVJk3 rZKRunkZ66eg/H/ZSnjTW4Q1jFI7xc+7jJUoHIgnSTr9TN8bqinK1ySmmZFiOLV0glnP BrhX73aHh9wZ/Lhj9uArkb2N+Yztfo2XBExtjafaWmQT6ekoTNP8mq7Q0cXDaFmKJW71 BCGjbKuiEVSRROl2oM7cAMhfwEaSOja6dDoZhwN5R2j4UGkaoR8SfRDq6DsTSv+64llA P3jpD86iPZpBMYyA78mYsApLbD1PM9teHArCry59/KceG8l3irgs5lDjjMgVZfcQrjhf tNXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=kXzKZk5gq51jJg2j9VzLM1bDDmV1aemTyAMW26/MqsY=; b=quVycS9SZ/T1h5KzmDcFS6KtkG+alEcxzZ/6JrrapY9XPKifKAfy+/F//x2SNUPQOm llsolHso40qUBpi6gET4BM+Db1Yo+TEeU3PdcY71LXIzC1DdY6jTpoljK9H8GmelDNtd aQ/pzeiXxaDZ38BwTrbEIunuiopx/Rn9IidCs+Z4I2bLAtAYqOepWMyWhAi9/ADFcvhU iz53JqIY9zQAfJndLKNaBC3ixM1dgDndFYXq5IyHYc9mXmASdouYt5Sy45mkhW6FyMET E9uMW0dhw9oe8BnrhrzMBy3Jd1Hu241rs5eQgUp+xfAU1BwMgLmqdAsREpynFbvaXHCq SJuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a66-v6si7445222pfb.81.2018.05.13.00.37.20; Sun, 13 May 2018 00:37:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbeEMHhE (ORCPT + 99 others); Sun, 13 May 2018 03:37:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:42001 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbeEMHhE (ORCPT ); Sun, 13 May 2018 03:37:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8C3ACAB3F; Sun, 13 May 2018 07:37:02 +0000 (UTC) Date: Sun, 13 May 2018 09:37:02 +0200 Message-ID: From: Takashi Iwai To: Eric Biggers 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 In-Reply-To: <20180513073636.GB27296@sol.localdomain> References: <001a1147e1988b160a05620552eb@google.com> <20180110080800.GE931@zzz.localdomain> <20180513073636.GB27296@sol.localdomain> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 13 May 2018 09:36:36 +0200, Eric Biggers wrote: > > 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. Good to hear. Yes, this should have been covered by the change. Thanks for checking! Takashi