Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp492650rwb; Thu, 1 Dec 2022 05:00:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7YGzb3F1slv36f9bnNcnpteBo5ZdriSp3q4a0Xadiy2q+aZFq4UyP0avIw25+bCgNa0lnY X-Received: by 2002:a17:902:c104:b0:189:a931:c8a1 with SMTP id 4-20020a170902c10400b00189a931c8a1mr8733033pli.112.1669899651509; Thu, 01 Dec 2022 05:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669899651; cv=none; d=google.com; s=arc-20160816; b=UfGM2XlVx5q1xzKcNuZHAZONIUz9KQiOtaZy4DFwwDTFRGLie5/dRqnHhBFzfDI3EM 7oW23bYqzGB9yKvE506WlEFCmyD2RCbHqT6rZDAsBZesyIb/r3fK5qgcWZ3mB3/VobGM A7mHnYNKdfu87zTGa2/Qu1akinj0yavGm+x49yjWoIinyd4Rkx7ZBOCxU2tAZHzAhLt1 OLlQNZZY8vJBsGrhR0Xs6oy1abpSLY2HW51J2XsoBh1J1VCBcDH8YY3loMvvR5JlGiea xE6cs9PsFdt5A7lC/7mMe6lm+WHi8v54ZDQxagzwBUq0B0kz1EEV3bAuhypCVysCqCkM dziQ== 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=TtfaR/nlgwLp62pFyL1N0qKblfp9A04f8y5D5uxzC7U=; b=CXMkCvRDG4Xv4vHR3Htq5v3dUkI7Ih+CBoWwnoXcXENaEn2Q7cXvTMihs+tuAn+Ejx 253HGhMYRdlfhVu23mquufyEgiKORA5fEf26NlyPUv5TZPO1jh+wWDirqtAph5B2CbH5 LMfWdV/sIg7TM52BftX/SxkDf84QurTJddIhfSjI7jrbuJ/4Tpd3J6nSEWP2ybP8/3ri t6FzjpVI1dsaD6RD4zrg8I0At7Q6jVubnBMbeO8RIkXgvVpC4u/j4uC1u3LT4/eQ1D7k eGbx66NUbDXUTA6KpXxMofJhOKFB67wnjT9h5PBwEuATdMKoIvwIWnbE1oItYPBXk633 PvAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ob6TzdLJ; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020a170902da9100b0018997e90c80si4946790plx.275.2022.12.01.05.00.38; Thu, 01 Dec 2022 05:00:51 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=ob6TzdLJ; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231367AbiLAM3H (ORCPT + 82 others); Thu, 1 Dec 2022 07:29:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiLAM3D (ORCPT ); Thu, 1 Dec 2022 07:29:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3A09AC190; Thu, 1 Dec 2022 04:29:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7FBDB81F10; Thu, 1 Dec 2022 12:28:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB251C433D6; Thu, 1 Dec 2022 12:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669897738; bh=Gr2FvS1mhvh5ynkST3Bf0Qv+fAkMpmLHnaLhGS+sctA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ob6TzdLJsyOxJ8KCRZRWs0Arw/uGBAtwVzlLVhaL4vt5tQbNfCD58bMsMwwcM0TKo iY+VVXToz47Mzgr27C0dSZzChOoz8HXqpMIouvVeWWBrrK9HxDGxJxRO+8xa6n18ww osDcX9gXz+5BaobFzO7/EaXvhLVZPoJJtBow0R9E= Date: Thu, 1 Dec 2022 13:28:53 +0100 From: Greg Kroah-Hartman To: Szymon Heidrich Cc: laurent.pinchart@ideasonboard.com, Felipe Balbi , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Prevent buffer overflow in UVC Gadget setup handler Message-ID: References: <20221201122141.8739-1-szymon.heidrich@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221201122141.8739-1-szymon.heidrich@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Thu, Dec 01, 2022 at 01:21:41PM +0100, Szymon Heidrich wrote: > Setup function uvc_function_setup permits control transfer > requests with up to 64 bytes of payload (UVC_MAX_REQUEST_SIZE), > data stage handler for OUT transfer uses memcpy to copy req->actual > bytes to uvc_event->data.data array of size 60. This may result > in an overflow of 4 bytes. > > Signed-off-by: Szymon Heidrich > --- > drivers/usb/gadget/function/f_uvc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) What commit id does this fix? Is it needed for stable kernels? thanks, greg k-h