Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3894657pxb; Tue, 19 Apr 2022 12:00:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEr8XvPDAh/3tXNVip4yvHmpio3nCodhD9pYbFqkwDvAesrFf1gqhWp418sbqbdar2SR5v X-Received: by 2002:a17:906:2bd7:b0:6cd:f89d:c828 with SMTP id n23-20020a1709062bd700b006cdf89dc828mr14823937ejg.232.1650394825742; Tue, 19 Apr 2022 12:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650394825; cv=none; d=google.com; s=arc-20160816; b=Jj/Ca3URD5/opLrp79Inz1Dqu8/wbtYdb70erMzb7fUOGXfNm1iBuRKEAZkj+MvgVX VKj5m3NVMYmI01DNpesF7J9tLS9RdKQQ2R+Ye4R9x3WDZ4W0LjztXg61AfgZVGH5WMfT NOZto7U+aGKYBAchRz7IQbh4wnl63oV3ztN7g1UlD+Pu+GpNfC8hT8dIvQBrwrFWM1GQ QY4/xsuiLZxZoNB90NH+h4+UJEM2TxmjIFLe+Gt6GBdlYxwZcsITjOrvdWFxcnbt5yZX FtJ4lY2nRO0LA4LTTKZf1fR1mqjgEmx8nQIX+q0hR8MWh+I5EPaXo+uz5Bddw0byBlPK 9dlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wCsQtD2NQ+gbeoKp9EzAjHzyK6SBXrAkZNvU9pPrYqA=; b=g6Kh7j4z+2/OnbnPANM665JBqSk71J6UA686O7vH7ZrcT/rd11ubDTcFXPzVKqpK02 x9d1RbxK8GXbpKzR57xMLkVdXcb0/yQltIwbngPhwrYT5Rc9Hjleb/9B9oYX5zzEV8YH 5P1X7nhqs5LVf3qZ+uOkxaHiUy5P94HpJtVuYK9ZYtIRfafSgpq1cFOcm/3Df9HMk0P8 6b2csHfq91vo19yvzPHorExXJ9hiG47xH1cbuNp6Bs0SVGB0Wl3Rwuw6btYIlHVFryOS 6trf8LG8yWoScDTyJ8u2+n5pnIm3oDdNYRbKeb7Mwv8Hm5xZMcsVDtKYsjtQIiEgQwQH vyxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=M9TlNCxx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec22-20020a170906b6d600b006e8722478e0si91226ejb.164.2022.04.19.12.00.01; Tue, 19 Apr 2022 12:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=M9TlNCxx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344223AbiDSCCN (ORCPT + 99 others); Mon, 18 Apr 2022 22:02:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234716AbiDSCCL (ORCPT ); Mon, 18 Apr 2022 22:02:11 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6BC22F382 for ; Mon, 18 Apr 2022 18:59:29 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id s70so5747971qke.8 for ; Mon, 18 Apr 2022 18:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wCsQtD2NQ+gbeoKp9EzAjHzyK6SBXrAkZNvU9pPrYqA=; b=M9TlNCxxcBX0yUHiIVEapcv8P3OPBDK5VOwlHdUva2h3+sMA0gk7fJtp7stFVeb8CY HYTNcluvwI0Sgg42bXELRbBOCihfzVIb5lpF8DVz/ljn7GPxht0cJSqtxrlfSHIDr+qK mVpxQfqMgMwWpGRBRWzBwHLOCb+qKSrk9it8C0Ai0PGUwlJc1EdrAgnZlhHRz1q8fv9+ rqzkmxsv26cA7Ha1t4s5ukPeM4hDhXlnW8U8m8pb1KYOJXjj5BnpxsyCXMS86WHXhVPx /5lKSn9NdL4M1vNq+YiAoWFCPvEb1mR2rcroAF0mpO+YkQioXAtJ6yXAge0kiLzkYxyI CYRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wCsQtD2NQ+gbeoKp9EzAjHzyK6SBXrAkZNvU9pPrYqA=; b=l/rt4UkZ+kAbS6fwee9cNl1RDuZB65V+M60DHdzEMoLCr9M6WYStzcZWMHcXOXfmus AW5PKac8TyZg+SZ/8zsqRiY+CAw0sDiQffLk0jIMcSkn1TTS+KFgOkWqDVPQubK1FzJ4 9Xu7axpuN0CO2apReENZpSHARj/SUYQ5F5y9I20fHMiObCU6UtmVuubVAsVUPK3e24BT EhD6aIe4y1yKBNWx5er9/8dCnVhe+HDdnkJxYvUWr7h0KuXUuUuVdriedQPziCqmoIUb 0t8FkPws35vqOjogEIuEhj+YIz+RRVoVshHDA5aD2oYr/NX85NF2P3rsqfLzmN0/f9Cl 7KLA== X-Gm-Message-State: AOAM5325nA+F1cqA9Cl8QDVBH8hS5BWlDme8nXcAXSetADJmd66s8hKL rlITbqQpYQGngRCtjwiMAg2K7obXOIQUJtkSmPT7Vg== X-Received: by 2002:a37:9603:0:b0:67d:da02:19e8 with SMTP id y3-20020a379603000000b0067dda0219e8mr8458309qkd.242.1650333568819; Mon, 18 Apr 2022 18:59:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Curtis Malainey Date: Mon, 18 Apr 2022 18:59:17 -0700 Message-ID: Subject: Re: [Sound-open-firmware] out-of-bounds access in sound/soc/sof/topology.c To: Sergey Senozhatsky Cc: Liam Girdwood , Pierre-Louis Bossart , Ranjani Sridharan , Kai Vehmanen , ALSA development , Linux Kernel Mailing List , Takashi Iwai , Tomasz Figa , Mark Brown , Ricardo Ribalda , Jaroslav Kysela , Sound Open Firmware Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 > Now control data allocations looks as follows > > scontrol->size = struct_size(scontrol->control_data, chanv, > le32_to_cpu(mc->num_channels)); > scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); > > Which is sizeof(sof_ipc_ctrl_data) + mc->num_channels * sizeof(sof_ipc_ctrl_value_chan) > > For some reason it uses sizeof(sof_ipc_ctrl_value_chan), which is not > the largest member of the union. > For the record, this could be hitting as far back as 5.4 as I have been trying to debug an invalid IPC write in JSL.