From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F27EC433E0 for ; Mon, 10 Aug 2020 17:53:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F48020866 for ; Mon, 10 Aug 2020 17:53:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727962AbgHJRxK (ORCPT ); Mon, 10 Aug 2020 13:53:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:47436 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbgHJRxK (ORCPT ); Mon, 10 Aug 2020 13:53:10 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 85B64AC8B; Mon, 10 Aug 2020 17:53:28 +0000 (UTC) Date: Mon, 10 Aug 2020 19:53:07 +0200 Message-ID: From: Takashi Iwai To: Pavel Machek Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+1a54a94bd32716796edd@syzkaller.appspotmail.com, syzbot+9d2abfef257f3e2d4713@syzkaller.appspotmail.com, Hillf Danton Subject: Re: [PATCH 4.19 06/48] ALSA: seq: oss: Serialize ioctls In-Reply-To: <20200810163717.GA24408@amd> References: <20200810151804.199494191@linuxfoundation.org> <20200810151804.528955642@linuxfoundation.org> <20200810163717.GA24408@amd> 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 Mon, 10 Aug 2020 18:37:17 +0200, Pavel Machek wrote: > > Hi! > > > commit 80982c7e834e5d4e325b6ce33757012ecafdf0bb upstream. > > > > Some ioctls via OSS sequencer API may race and lead to UAF when the > > port create and delete are performed concurrently, as spotted by a > > couple of syzkaller cases. This patch is an attempt to address it by > > serializing the ioctls with the existing register_mutex. > > > > Basically OSS sequencer API is an obsoleted interface and was designed > > without much consideration of the concurrency. There are very few > > applications with it, and the concurrent performance isn't asked, > > hence this "big hammer" approach should be good enough. > > That really is a "big hammer". And I believe it is too big. > > In particular, do we need to drop the lock while sleeping in > SNDCTL_SEQ_SYNC: => snd_seq_oss_writeq_sync ? Well, do you see any issue with this for really used applications? If yes, I'd happily take a look and give finer locking. thanks, Takashi