Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4083934rdh; Fri, 29 Sep 2023 10:31:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN8Aq/ZO3PmaJFDg7fQlVgyDlxEF4gYvgJN5yntf83GLCeAz7L0EDSHy9KU0rq01YMdFD+ X-Received: by 2002:a54:4805:0:b0:3a7:44da:d5e4 with SMTP id j5-20020a544805000000b003a744dad5e4mr4892873oij.51.1696008695718; Fri, 29 Sep 2023 10:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696008695; cv=none; d=google.com; s=arc-20160816; b=hI/S81QLk1Rzhsolivw17RN3VO1i4vK7kFnCbW/Rp+1AYIEU/cdeX3nceUw+Yy6TKA UGfZMCY2950ImdbLVeSmwrbo6ZJpDYRQ/9347Bm8A0DRdhXiX4WocBIEaSm33/8ETvjM eZk5Gsxt6FcPYBNKHTjVpRFpvC/5tdZroFuljjvxoUOzYDq3TYf9eQnAkz0M44Mn6m9n XspJdKkUxiAXKyD/s7fhtC9mqjtoobnb0s6en9ur0+xtgUjtiT7sYSziI1z9eE+/Z9zO kn4WwR6UP3LJBHa0DZ6uu1vu8XtN6hYbxtkPqIbwECLj0X7dwRqdk5jx8LVfre62nf2O URIA== 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=SgWJstEGJd48Eg1HdzFdOilLMPMqmWhwLsi9bYeQl7s=; fh=myyKjZzjprqLKGywR+mABZWHwR0F26SfX94yqsD6bUQ=; b=vMo+CxWrtRKKVi0DDqkrzeAttmtotC2PK4joUwDzijwXLfllrWUmpLn6ctzoAgmT3X WE3GReXBDOwba1xkni38W3Tq7VIbZyPnvwpa3J+bZegV+blZp8Txvl/vQO+5rzxQZK94 xxr7vtMVUxdr3iYtBY2GXeBHNnQM4PFFx2rK1/6JoOEXQIzkhjY6Xx/cc6iF1Dn+IhX1 MSQCEQnnHw+fXBqH0dmblp40pq9dd/c0HPuGmde2ESgYFknQSqEhFr42+k4xz3pjjRSp AoZhMOtMf1VtJm5s+hsjq2ZsXlcDOHIeaW+ycxwYxBMA2Q4YJFV4TtIhlDyxWIfrAWDN yffg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R11ri71z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i12-20020a633c4c000000b00578a9ea5686si10410730pgn.660.2023.09.29.10.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:31:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R11ri71z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 2D89A80C6148; Fri, 29 Sep 2023 10:28:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbjI2R1q (ORCPT + 99 others); Fri, 29 Sep 2023 13:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233450AbjI2R1f (ORCPT ); Fri, 29 Sep 2023 13:27:35 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3EA1BFD for ; Fri, 29 Sep 2023 10:26:36 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c752caeaa6so103245ad.1 for ; Fri, 29 Sep 2023 10:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696008396; x=1696613196; 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=SgWJstEGJd48Eg1HdzFdOilLMPMqmWhwLsi9bYeQl7s=; b=R11ri71zTmA5emJGU5mz5LjwNMZA1cCORaTtco5nfVll1TcZLsagRgajqn5QjUsLdL bO/I3H/6VJpyCkesYCHixGyzmUnW8GtEREaPiLSeh26totC5vRaBm74rQviNDNsuVMYD PEd8RePwhMCbAyOVm36MobRdHCt+WR3Dr2aJs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696008396; x=1696613196; 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=SgWJstEGJd48Eg1HdzFdOilLMPMqmWhwLsi9bYeQl7s=; b=ZtI757WJGhsndTH1MIcQEpciu3XjBLAEZWjjtES6fuycbjkaIMFIEilE+WtDgKiGCi 5yUbtFT1KegjGx5agK8vQTkA/+u/8y4ROyHWjcEsGUcRBGbq67atXA4BfQgP1Smie+Sf MQx0kLxHae46te5EBoDz7Vyb5MPAakhdvEVRbn/qFOr7g6/GN+1OlWzn92eAXKeetds+ CthIhASvCAC3+VPDeVfpYhnJSoohT6M+6Zz1I/UrnuuFY2Boeo3t0tTkY6V9nEKeHU4c 8tJ+TD/0RqHRI5v73v2rSgw2xYvsg7FGZvrFRoE/xzKdzQrJaxCDkXkvAXwtCYWB/Ntt FlVQ== X-Gm-Message-State: AOJu0YwbTw4vgaVx0c8EvpO03ChnCVVoRxyrcRSIu9v7u2Ij/i7UHYCV QXwiCqV89d5xZUWDfw4MWASodQ== X-Received: by 2002:a17:90a:bd8d:b0:268:e5db:6e19 with SMTP id z13-20020a17090abd8d00b00268e5db6e19mr4483958pjr.20.1696008396220; Fri, 29 Sep 2023 10:26:36 -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 oj3-20020a17090b4d8300b00276fc32c0dasm1701460pjb.4.2023.09.29.10.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:26:35 -0700 (PDT) Date: Fri, 29 Sep 2023 10:26:35 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Jaroslav Kysela , Takashi Iwai , Jussi Kivilinna , 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 comm_runtime Message-ID: <202309291024.14F6DA0@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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 10:28:42 -0700 (PDT) On Fri, Sep 29, 2023 at 05:59:22PM +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 `receiver` in `struct comm_runtime`, > among them some function pointers. > > Fix this by placing the declaration of object `receiver` at the end of > `struct comm_runtime`. > > Fixes: ddb6b5a96437 ("ALSA: 6fire: fix DMA issues with URB transfer_buffer usage") > Cc: stable@vger.kernel.org > Signed-off-by: Gustavo A. R. Silva Should these mention -Wflex-array-member-not-at-end ? Reviewed-by: Kees Cook -- Kees Cook