Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp455288rdb; Thu, 5 Oct 2023 10:36:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP/pg3RmJkH1WzMuPW6COoTVhSCPBXi7I4SRVx5JjkSSYvZJEiqNkZ7atgyW/7ZocY/Y4X X-Received: by 2002:a05:6a20:8f03:b0:14c:c393:692 with SMTP id b3-20020a056a208f0300b0014cc3930692mr6904009pzk.7.1696527362460; Thu, 05 Oct 2023 10:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696527362; cv=none; d=google.com; s=arc-20160816; b=sMNMklLcwlImXWXpfjdfBvAKeU1oXJq2Hv0fFu+kVtXW9pgglV5ZdkcC9p5h89wsbX ZRS6c4YWdZ3cY51uAHbPwM5UmdU5NHRVSjl3NSe/4riFjSF6LDSjAsvnU1g0Noq4TR+m ZSJkZ5bW1fnDJFZvDogWNtBkYq3dhBOAAwHi91KHYV0lH+aox/DbPIeJfSvz/hVgf0uF 7VAqpMRUtj1yz390uyK/9pdZWC1BSuqYKdbgubBv3j9NCiJOVnGHMN3B+Hb4nNs6G1hV wW9SZfIBW1wzfdlgFxS1Q/rNacSuiUYVYlEBVS6RI2d+RTYIXYkJTZlJjKsdXGOu8jpr bHiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Wd8ES7UTRS4g/SWmf5zxBULHM/lF3w6VRAdiJYs6Tsc=; fh=sfev/DCojAJgT1c2ZAK7wuRPnsj/xAxWWh/HugwlRUw=; b=e6rAvbAC3diufrB5GScyrbfNNnlm1lZ5ujIIEGN3M4efbr2G4K/0BLMBdX0YuoF/H1 RBDieTyzPfQcOrifF0Wruv6OjOUnXRTT9C/XKiJhTVfqhPzh/QUm5Uklnh0CcyCQh570 i16P8qlDEzZuQj0xx/DkQPY/s5wzgl+h5dg5VRQqoLZ1o7c28ixmVLJnZGhJSd+8wd24 rECfHxPfnsQvqcLua/CXNwrnvhcjrVPtliFvpg2gO330IGoHFSLBOGYXyAzaGtX2mCfm SQvlc8I5cNya8ZxZwVeBqT2RTzLuzLMEL2y6E91zXD+Z5t/QPMmVc5Bklx15VEDREZYu piTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mnHvYWfu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bx31-20020a056a02051f00b0058938dc0fcasi2135038pgb.257.2023.10.05.10.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 10:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mnHvYWfu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9694083470F4; Fri, 29 Sep 2023 10:30:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233874AbjI2R3b (ORCPT + 99 others); Fri, 29 Sep 2023 13:29:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233838AbjI2R3T (ORCPT ); Fri, 29 Sep 2023 13:29:19 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 718FF1731 for ; Fri, 29 Sep 2023 10:27:05 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-69101022969so12941422b3a.3 for ; Fri, 29 Sep 2023 10:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696008423; x=1696613223; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Wd8ES7UTRS4g/SWmf5zxBULHM/lF3w6VRAdiJYs6Tsc=; b=mnHvYWfuhj77AztlOw7+dRx7IJbxeR3VGI2/80fKFfqyIuErtzTvg6lO0MAlXuiBsw yKFc2yy90rV0OblD8RTfbnp0lfvArnMItWLhf7KY52rJtpeCM/vQRFiet7o1008fYBpE 0RBM4zp/sJBiB9Wej0a9tfE705dIW3lWhFDeg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696008423; x=1696613223; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Wd8ES7UTRS4g/SWmf5zxBULHM/lF3w6VRAdiJYs6Tsc=; b=iYo5xdc/l5RX577lw/qgXJSlRqW4LmMSw9twbQj5eZqgu1Jh+vVH5Pwy+8yvtsoUBj L1y5p+XP/dXibrG+afHDlpph8/dSP1DqVpzhpqjO8dBYfqpFxgPmprT727z8T4ml9MoC uC7P4PAtEe9pg5UAy9f1yajwxZmqJTHw7k6iE+Q2Rk8BIwrNjYcE88ohkfAd/tBIWO0z 2g3P1GVDgjFOFXHI/H51yMKp76kXZBmzOdGMB11xKE2ZuTfOAB0ltI8yfi1+MDbD9/PD xcupv2UAA1E8ix7HXVR0V2c6jjOSPdEM+/aKYcljNEevcKtUQcJzVzJnmwItW7huIFFn cXhQ== X-Gm-Message-State: AOJu0Yz6aoqnwub/LTM81kDGMZB1Xzta2JNB8GIudCML85BPyNLBJ+R+ 9Nxm/DtHfIlCb0u6nXbx+/8GhthMKeHXwek4tUE= X-Received: by 2002:a05:6a20:d42f:b0:14e:315b:d9c with SMTP id il47-20020a056a20d42f00b0014e315b0d9cmr4362465pzb.22.1696008423179; Fri, 29 Sep 2023 10:27:03 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id i6-20020aa787c6000000b0068a0b5df6b2sm15242690pfo.196.2023.09.29.10.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:27:02 -0700 (PDT) Date: Fri, 29 Sep 2023 10:27:02 -0700 From: Kees Cook 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 Message-ID: <202309291026.06071AC@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Fri, 29 Sep 2023 10:30:26 -0700 (PDT) On Fri, Sep 29, 2023 at 06:06:32PM +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 Another good find. :) Reviewed-by: Kees Cook -- Kees Cook