Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp193076lfo; Tue, 17 May 2022 21:57:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7fQkUWr8JMXoNVLGd8zGgqbQtiqvXSBtdO1M5qgxMgMGMzn08eQOls2bDOdb87DGtHWRh X-Received: by 2002:a17:90b:4b51:b0:1dc:9172:f344 with SMTP id mi17-20020a17090b4b5100b001dc9172f344mr28993029pjb.130.1652849838852; Tue, 17 May 2022 21:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652849838; cv=none; d=google.com; s=arc-20160816; b=N3jJKYLryp09qgg2Y52KjWog46FdBgiMHTP+IghjFQCMqz6Miq7am7AebWg5Z/wCJC jZESG3mLonElmEBJ3/csJ/WGbDLPbPm13j73m67/6IcnRvi4hAcNjHhZF1kRrSYouwlE c5JOENA7Wn/lxg/9nV7xOVnxifGcgPJrU4LP0yXaTZcKVlmfME1FqZU+rqZZRMosGozl dGWLYKzc8BzoNoIIzGMBGJ90QXkvSn2ynEDbNIX3A/UOlu5omkaCPWf+jOry1j2d9U5B GzU4z+ZaboDzjqbKBb8XtL6yPPSyQmDAElEav5/VKfziCfE3XoHgWB5C5JqZjjI9o6rR DBgQ== 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=Dpx3Jffm0X55rIjetpdC5J9yK1F0OTTvsieDpFGV6bc=; b=wpUmT+VKJfmjJ2Kl8LeqEvJsoYAESOhuwt0KOb8ylIs7vaqyViqS7eKiUA8kZkKCWW 1VzsOH0KJWbxI1Q7uyBgBruPccOjjv5BLAAX+zYVGNJAOvRCzqvwVarRCFLxxUjKzBzr /Y7vlYO0OsXJmcFz88L+f0Hz3eiZEBAQrITXSltdMTXfz/ItNbV+ql6sHBrpgS1VVQfR NFNDOsK5zWdTUoQE9pXMtqVMJ1nZxcsatyn5TC8nfImON1hEkVqHn6TFKIXhtpbCvGq7 N8Del+PWRJfIgC8oYjJx5gMQP+dtiBjAbg5lY09hureLGwDiMaprp9sFViULKKG7/13s EZqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZWFnKVyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c11-20020a170903234b00b0015a39e94e61si673091plh.420.2022.05.17.21.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:57:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZWFnKVyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5251D14AA78; Tue, 17 May 2022 21:06:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbiERD4Z (ORCPT + 99 others); Tue, 17 May 2022 23:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiERD4T (ORCPT ); Tue, 17 May 2022 23:56:19 -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 3C3D92F0; Tue, 17 May 2022 20:56:17 -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 5580AB81E68; Wed, 18 May 2022 03:56:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D5C9C385AA; Wed, 18 May 2022 03:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652846160; bh=HdoByi/zUhr+JLFYPlfgIYQGec1a21OZIoDG/tTTYtA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZWFnKVyh8Be2jF5K2H8hThsO6wQ3G8KT5xsDUz70vKDlEGUYG/MDgECp90jx5GDu6 RSnnwXt4hzh8+7PVRNzMq+q/2qtS4Z+B90P2pjNscQGb1c4JKPnAcwtQyGhQcqZFjQ BAkqT5/RSP2FgU5bVlNluFlnJrxWZKMbtnueJUeIFXG2Ad3UmiuSBxKMkhaTmOnVmc +V1CxDTUsCYPwiYdw3Idg5ui/AZZv+jS7r/nmuX5lEsdHlABBSgKstUD5x3p65bgio U67kgY2tzjrFHFxDrY6B6J9biUpfUAfquzsp7pqsjWAXnZEFY22LOuBFAC0g0krkhF ehMFhkcwQtK0Q== Date: Wed, 18 May 2022 11:55:56 +0800 From: Tzung-Bi Shih To: Yuanjun Gong Cc: Benson Leung , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/1] platform/chrome: check *dest of memcpy Message-ID: References: <20220517095521.6897-1-ruc_gongyuanjun@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220517095521.6897-1-ruc_gongyuanjun@163.com> X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Tue, May 17, 2022 at 05:55:21PM +0800, Yuanjun Gong wrote: > From: Gong Yuanjun > > In regulator/cros-ec-regulator.c, cros_ec_cmd is sometimes called > with *indata set to NULL. > > static int cros_ec_regulator_enable(struct regulator_dev *dev){ > ... > cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, > sizeof(cmd), NULL, 0) > ...} > > Don't do memcpy if indata is NULL. The fix makes less sense to me. Did you find somewhere that `indata` is NULL but `insize` is not 0?