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=-0.8 required=3.0 tests=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 418ACC4321A for ; Fri, 28 Jun 2019 09:22:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17AAE208E3 for ; Fri, 28 Jun 2019 09:22:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbfF1JWv (ORCPT ); Fri, 28 Jun 2019 05:22:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:54866 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726385AbfF1JWv (ORCPT ); Fri, 28 Jun 2019 05:22:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5A584B01F; Fri, 28 Jun 2019 09:22:50 +0000 (UTC) Date: Fri, 28 Jun 2019 11:22:50 +0200 Message-ID: From: Takashi Iwai To: "Colin Ian King" Cc: , "Jaroslav Kysela" , "linux-kernel@vger.kernel.org" Subject: Re: static analysis bug report: ALSA: swapped client and port arguments in calls to snd_seq_oss_fill_addr In-Reply-To: <28c3fc44-0d4c-25e2-c9f4-d240c6d239f0@canonical.com> References: <28c3fc44-0d4c-25e2-c9f4-d240c6d239f0@canonical.com> 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 Thu, 27 Jun 2019 16:01:40 +0200, Colin Ian King wrote: > > Hi there, > > Static analysis with Coverity has picked up two potential issues with > the call to function snd_seq_oss_fill_addr. The prototype of > snd_seq_oss_fill_addr is as follows: > > static inline void > snd_seq_oss_fill_addr(struct seq_oss_devinfo *dp, struct snd_seq_event > *ev,int dest_client, int dest_port) > > > However, in sound/core/seq/oss/seq_oss_ioctl.c in function > snd_seq_oss_oob_user it is being called as follows: > > snd_seq_oss_fill_addr(dp, &tmpev, dp->addr.port, dp->addr.client); > > and also in sound/core/seq/oss/seq_oss_rw.c in function is it also being > called as follows: > > snd_seq_oss_fill_addr(dp, &event, dp->addr.port, dp->addr.client); > > ..as one can see, in both cases the port and client arguments are > swapped compared to the function prototype. I doubt this is intentional > but you never know. Are these bugs? That's a clear bug, the order should be (client, port), so it's bugs in the caller side. They are rare use case, so probably no one really hits or is annoyed -- the latter is a note-off just to be sure, and the former is a special ioctl probably that has been never used :) In anyway, would you send me a fix patch? Thanks! Takashi > > Colin >