Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp244614rdb; Fri, 6 Oct 2023 02:02:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaTXO1SoZwBBPi+h2T+uYON87F/Mxb94OUDIg1kYFFG8eekL50bPIoclt2MblqKlZeJKDW X-Received: by 2002:a05:6a20:840a:b0:163:5bfd:ae5b with SMTP id c10-20020a056a20840a00b001635bfdae5bmr9596115pzd.15.1696582977633; Fri, 06 Oct 2023 02:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696582977; cv=none; d=google.com; s=arc-20160816; b=Uu49e+lcWEw7LhCnkut/ybu4NIHQSb1FwegUkUqP/fc9AufCcCtd2MSwr7LtVEpmZW /sthqYlRTl3o2zyGdPVDLBKhWlteLVNsms+MxRitLdZE23xf4JnL5rNcSKrDL3RzdroG 3pIi41y767Q32faSU9SZGctVeRHCYCcKskXMBzsn5yU29Uf9rV0oghjb0yTv3kEWW/70 Ff9p3CdKjupPwdle9LUUReHHN1XJ8Yka3NS+FhL3h1TGrKo//2OnNN9MIqh2hDem/Szt d72PN0Lv3kK8vYPECrueU2fmYzXB/OhIYQGSRQjujNsEvbiJw0SxgnwO35H8y+tcx4lb TUXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=oZDIguXnYNfuvCTy25QRJxOzQExo+GhNuL1tdAJxFvA=; fh=sfev/DCojAJgT1c2ZAK7wuRPnsj/xAxWWh/HugwlRUw=; b=XeiX37QyNDFCZHeaM45RsI8KhnzAQEVmUXlwAY8QxO1utt79axQB8seMcfE2SMps0M yzM7JTPW4GaADxSCoYcx+0gpskL17aKSDk17O6K+JCycKmbejNljJq81ZV1Fg4QkM7bf uYcIiTEf+x4iqvMCByoVGnQJlBt+konWuwB3/c9eF+lio0oomeE7QpcMSVnhYv7pWwjP J5gfxJqbEisZvuBoiy9i2CFu/wahzI/l+5nfulf8xzxfXs8zBEKK2l1C6lWirV7tPriV AK9xkY0tc1gn0gvwXiaspbLNgkQH3PdwTKLN5nqTGRdkbN9rN6GEGZrmU9I+SbPtoovB 1yLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kChFPxns; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n8-20020a056a000d4800b00690d79bafd9si1016294pfv.168.2023.10.06.02.02.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 02:02:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kChFPxns; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 746128049212; Fri, 6 Oct 2023 02:01:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231318AbjJFJBl (ORCPT + 99 others); Fri, 6 Oct 2023 05:01:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbjJFJBk (ORCPT ); Fri, 6 Oct 2023 05:01:40 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ACF383; Fri, 6 Oct 2023 02:01:39 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 338811F45F; Fri, 6 Oct 2023 09:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696582898; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oZDIguXnYNfuvCTy25QRJxOzQExo+GhNuL1tdAJxFvA=; b=kChFPxnscyTax/udKiuFDpBaYJYhTPJwooQqM/Cv6yVz1xL/CwqE4CtdXl1xEtAEzeFdWc fbZqCX8X/p754Nq/mQHpbbIiJgsUoUV9Kch7KssOTSXdDmSMTYKcjN6fdyPtCwApnE9iei sUJ+uFAwwjJx7DnO58A3tRw8G3gGPaM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696582898; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oZDIguXnYNfuvCTy25QRJxOzQExo+GhNuL1tdAJxFvA=; b=trSMZbzQbey/vL5X3ZMqvPQ1c0mqQpwWLuwPSYWJ0DzqLHg44qo+pb4m0iBjKgrWk0N7vD MacWe9eXesnBqfAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 03BD613A2E; Fri, 6 Oct 2023 09:01:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rRVXO/HMH2VDKQAAMHmgww (envelope-from ); Fri, 06 Oct 2023 09:01:37 +0000 Date: Fri, 06 Oct 2023 11:01:37 +0200 Message-ID: <87o7hcw2dq.wl-tiwai@suse.de> From: Takashi Iwai To: "Gustavo A. R. Silva" Cc: Jaroslav Kysela , Takashi Iwai , Torsten Schenk , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] ALSA: 6fire: Fix undefined behavior bug in struct midi_runtime In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 06 Oct 2023 02:01:45 -0700 (PDT) On Fri, 29 Sep 2023 18:06:32 +0200, Gustavo A. R. Silva wrote: > > `struct urb` is a flexible structure, which means that it contains a > flexible-array member at the bottom. This could potentially lead to an > overwrite of the objects following `out_urb` in `struct midi_runtime`, > among them a function pointer. > > Fix this by placing the declaration of object `out_urb` at the end of > `struct midi_runtime`. > > Fixes: c6d43ba816d1 ("ALSA: usb/6fire - Driver for TerraTec DMX 6Fire USB") > Cc: stable@vger.kernel.org > Signed-off-by: Gustavo A. R. Silva The same question as your another 6fire patch is applied here: does it "fix" anything real? thanks, Takashi > --- > sound/usb/6fire/midi.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/usb/6fire/midi.h b/sound/usb/6fire/midi.h > index 47640c845903..df3f41913274 100644 > --- a/sound/usb/6fire/midi.h > +++ b/sound/usb/6fire/midi.h > @@ -22,12 +22,12 @@ struct midi_runtime { > spinlock_t in_lock; > spinlock_t out_lock; > struct snd_rawmidi_substream *out; > - struct urb out_urb; > u8 out_serial; /* serial number of out packet */ > u8 *out_buffer; > int buffer_offset; > > void (*in_received)(struct midi_runtime *rt, u8 *data, int length); > + struct urb out_urb; > }; > > int usb6fire_midi_init(struct sfire_chip *chip); > -- > 2.34.1 >