Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp280251pxa; Wed, 26 Aug 2020 10:21:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAXPKxWLJKsGLJ5Ax0ab3s0ZX5CVxXXKCe7d6BqDn5rEZ9kWr+MHhKAg3E8CpwxDqV+NkT X-Received: by 2002:a05:6402:312b:: with SMTP id dd11mr6125988edb.276.1598462518317; Wed, 26 Aug 2020 10:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598462518; cv=none; d=google.com; s=arc-20160816; b=fy8fSlZAySpX1RnyQNkKdpyO1c1r2luA4B3d++sijvl745U7OWM17WNl7RSp31JwXh uGj+xCYoDVDGnSon4V3k3tYQY7LW4RrwVttIzuB6AkDWDg1pVVmfKzvgK8CFgcTUYyUA 73IiV44FkKPkn0omyCJZxru7fLF6ve4FC7B/AmUaQuTy0yA1BEudnOO9ZQnOckNw4adD 0prrR/eh2fhHRnudm/va4AibbFth/w2j118Bylg+3v+egx8/qXv8R4JtqQYbU6/R0Zod pkYK5Ia0i2Zt69nCATu4v6L6NdpQ2/J/cTKo1I8v5qrY3d0YKOZHcJEBbm7Z26hXg5mF D1Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=wSED4ESvd7iAdE/O7jBMYhtVsvuSpxlXjFlIkcHc+zM=; b=MsTMtwAC73Vmex1MR8uo6wGSJ0otDvw/EuCvoq/K0BTC5YS2R/EnHByykj0bLTbAZ4 d5vcNh9fc8dwbbTqSOjwr1vogj8r8I8+F7AF2qaFwi2ef0bAbA5J0HCoFW2hwVFn4Hsx k1shnAVdWKKPvXRY15VJlXjyZhO1UICCVl4m88oA3eCkUNZhNPx4KR/BlVpRmzvQewgR yFFvUHDpZoGNu+a73SD39D/gF0u1CPRnAgRAFPdmWhMcKNVq/1HVXCuZb33cy0E4jsrw ROZfH0ZjS9Xuwb3McOad71W9LzfUl/qsi3hGALSyWoBGtWn989fG1ovmTtCYdFu1/nfN nJYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c3gUSVlD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd4si2047372ejb.107.2020.08.26.10.21.35; Wed, 26 Aug 2020 10:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c3gUSVlD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727022AbgHZRUr (ORCPT + 99 others); Wed, 26 Aug 2020 13:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbgHZRUo (ORCPT ); Wed, 26 Aug 2020 13:20:44 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 736B1C061574; Wed, 26 Aug 2020 10:20:44 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id t23so2025818qto.3; Wed, 26 Aug 2020 10:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wSED4ESvd7iAdE/O7jBMYhtVsvuSpxlXjFlIkcHc+zM=; b=c3gUSVlDW5AcjSvdZVhlSt1dPojJYuyaw6hvXfSRDxI/PzBa7l/l20B7Vxg4LCukI4 0pURKybdgjCf5+OwBPA1uaHRRZSTF2zAgVrU+j4WIg94xvku1pGhJKSon32WxUWgP+0R lJjWoVqlLsbR81J9dmyK5QJz8pyy+dj9L+vK2WHkozMYDyio8+L/C1WazoAqzSZt8vXK gcp/bMLOvoCPQ+OcfNLnSDc1m9K9BIv+YLV6YuGGFmA9psovlKlgBps9HCQ98B/a5SCI 9yRizlesPEY5i2P8RijrCtGhnYuuyPBCrPQP3uQBA0Tz/1HBwl8gPs8UrBOKazwSypJZ 0F7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wSED4ESvd7iAdE/O7jBMYhtVsvuSpxlXjFlIkcHc+zM=; b=tEGNd5q7KusKVVjgEJpVXtbBhmJMfeALj4CVk5lrBkdxMT4o9407P90bXStebAcDfJ hbpP4fIypZsQjD+c8EUAd++GhxX7ndwniJdhzOA2AwDGw/PEUHjer9jXx/avLNK6GoiS DA2E0PCPgnVsZ6WeW+NqqtsNFb4TuEyYSOHv52b7sugi4W2MVe6wmV9JKRmi3EULdvxB n1n/PJklISF0L5WDIZJDKaeB5BmA0ONS3+ou/oNEgtgRfEcYJAb3f4QE9CcV7If9CFBO bGg3qkT6cIM5d4JLMgvZDU2adK7jxuAX5CL3hYE3bkoDAMTmeg1ssBHGyBLui3gPe1XL +VpA== X-Gm-Message-State: AOAM530KAyBAKb6nUKgLsu3ZMgMLVMvdGNzUfa92dOSRD6YGBsPuGIVi w7qJ1a37mz+WYtp2RaMe26c= X-Received: by 2002:aed:2821:: with SMTP id r30mr14914331qtd.3.1598462442746; Wed, 26 Aug 2020 10:20:42 -0700 (PDT) Received: from [192.168.1.181] (pool-173-75-208-99.phlapa.fios.verizon.net. [173.75.208.99]) by smtp.gmail.com with ESMTPSA id d8sm2432241qtn.70.2020.08.26.10.20.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Aug 2020 10:20:42 -0700 (PDT) Subject: Re: [GIT PULL] USB fixes for 5.9-rc3 To: Marek Szyprowski , Andy Shevchenko , Greg KH Cc: Linus Torvalds , Andrew Morton , Linux Kernel Mailing List , USB , Ilja Van Sprundel , Kees Cook , Felipe Balbi , Bartlomiej Zolnierkiewicz References: <20200826134315.GA3882506@kroah.com> <1425ab4f-ef7e-97d9-238f-0328ab51eb35@samsung.com> <20200826153347.GB4187816@kroah.com> From: Brooke Basile Message-ID: Date: Wed, 26 Aug 2020 13:20:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/26/20 12:17 PM, Marek Szyprowski wrote: > Hi Andy, > > On 26.08.2020 17:53, Andy Shevchenko wrote: >> On Wed, Aug 26, 2020 at 6:36 PM Greg KH wrote: >>> On Wed, Aug 26, 2020 at 05:02:38PM +0200, Marek Szyprowski wrote: >>>> On 26.08.2020 15:43, Greg KH wrote: >>>> >>>>> Brooke Basile (2): >>>>> USB: gadget: u_f: add overflow checks to VLA macros >>>> Sorry, but the above patch breaks USB Ethernet Gadget operation. It also >>>> didn't get the proper testing in linux-next (next-20200826 is the first >>>> one with this patch). >>>> >>>> This is how it explodes on Samsung Exynos (ARM 32bit) based board with >>>> g_ether module loaded: >>> Odd, for a "normal" descriptor, the logic should have remained the same >>> as without this patch. >>> Brooke, any ideas? >> I have an idea. >> >> Does below fix this? > > Yep, that's it. I've also moved offset assignment in the first part > after size_t size = array_size(n, sizeof(type)); > > Feel free to add: > > Reported-by: Marek Szyprowski > > Tested-by: Marek Szyprowski > > Thanks! > > Best regards > Ah, I see. My apologies, I don't know how I was able to miss something like this when building/testing... Thank you for testing and reporting the issue. Best, Brooke Basile