Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1529696rwn; Thu, 8 Sep 2022 22:59:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7hTc8takM9mwJV8kakU0XnE0Ir+ZjFohrOSUBBLYzzdLu01tiqspTKwsRkMFpgH3X1ignp X-Received: by 2002:a05:6512:2344:b0:497:a136:c5ea with SMTP id p4-20020a056512234400b00497a136c5eamr3667799lfu.563.1662703192933; Thu, 08 Sep 2022 22:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662703192; cv=none; d=google.com; s=arc-20160816; b=e3rf8fQt/yj1wag4LvVWxsxxMvlI28iy+3UcYDuU+9Rz3t2lxyhW9HEWD76ZSpUAVw oz5ljr7p7W8Gectm3PSc+SeTvrf7bD5suHLchgAYY13lLw0ajQTSROIfQrMaIoTKIUiB 1BV2qztT/7/ld5KqAKEibLvEos2PX4rjaOj1pnkxyCINDgVPLUHCgB9WQ9ve/qVfBTiy Wb5aXsAgukqCap0hzmyxXHbgbUbGLuIWcZqpzLWM4bh62ghWifId8F0CfiChwL/uxYyY pNXRquW4OlDi1USQAKVuGUUNQMVmNuKSwGGX0PZrDCjmQ97ydINIrTtNFtDmU7N0XviD MA3Q== 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=LtU2vvX+dhUA/iJIDKqXnAduyUpcQdDrtWBLOZ6MBWY=; b=FDjoCnDzjclDv+kN4zcAsuhi0MKryBfBzncuh48sXXB4LSvPBH1GgCtlWMT6c3+0gf fT8G4jDoEncFzcpI7f1lHPUshzm/5VNxpkVf39bhwhiYd7A/3x+UoP2YDUDdct253O2p zTsOfogRru2pR+cqEYaEOAl4f9mVNyKLheJ2xl4fqyqKR3hBNFBhlHA++zhZhiBCRrGH gTBC+cjpcVfJ9cgqdtnawtatrHXx7qiDcxgyZhdaUQbhLBIXXa/TZQ3tGK03hEqdXfzv jWpSQXSkoUwsv0Ss+BCtmRbWsEUecnmXnPejKCT8HIAI3ADgX+LkExAC9kqHVNs/3jk7 BBlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0a77IeEQ; 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 a6-20020a05651c010600b002655a1412b7si469433ljb.55.2022.09.08.22.59.24; Thu, 08 Sep 2022 22:59:52 -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=@linuxfoundation.org header.s=korg header.b=0a77IeEQ; 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 S229967AbiIIFsA (ORCPT + 99 others); Fri, 9 Sep 2022 01:48:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbiIIFr6 (ORCPT ); Fri, 9 Sep 2022 01:47:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FDA7F12D for ; Thu, 8 Sep 2022 22:47:57 -0700 (PDT) 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 0E4ADB8206F for ; Fri, 9 Sep 2022 05:47:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 700B8C433D6; Fri, 9 Sep 2022 05:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662702474; bh=0vVGtD3bKh45RiCjRwMej10XDq4aP2ygUfgxljQEXXA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0a77IeEQp1gjZsZC7UYBds9koxGkx+nhssvrM7AKhM6rYp27+K3SbfaFeiM3CfbPh a7JeqkjVE1ULnxgCfirYeR527dCBL4wt3R8+ANWluA8wl7x4iwx3781AZHHZ0uH4SN P0d7pInr3BFo0Nq3lGH8QX4sNkvZBQsVpphYVHfE= Date: Fri, 9 Sep 2022 07:47:52 +0200 From: Greg KH To: Nam Cao Cc: forest@alittletooquiet.net, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH] staging: vt6655: fix potential memory conruption bug Message-ID: References: <20220909053038.33188-1-namcaov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909053038.33188-1-namcaov@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,T_SCC_BODY_TEXT_LINE 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 Fri, Sep 09, 2022 at 07:30:39AM +0200, Nam Cao wrote: > A line of code is attempting to set the entire struct vnt_rdes0 to > zero by treating it as unsigned int. However, this only works if > sizeof(unsigned int) is equal to sizeof(struct vnt_rdes0) (4 bytes), > which is not guaranteed. This may cause memory conruption if > sizeof(unsigned int) is 8 bytes for example. Fix the problem by using > memset instead. sizeof(unsigned int) is not going to be 8 bytes, so there's no memory issue here. But your fix is good, so can you please just rewrite this to be "make it more obvious what is happening" type of patch? thanks, greg k-h