Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp102956rdb; Thu, 1 Feb 2024 03:31:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IE50lYL4TG3sXZPMLZsptW5jW0o2PriocAdoRtzqcQyEO+140E0OM65KXoehk+H3EGKcHg0 X-Received: by 2002:aa7:d903:0:b0:55f:c4b8:2419 with SMTP id a3-20020aa7d903000000b0055fc4b82419mr739065edr.27.1706787085454; Thu, 01 Feb 2024 03:31:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706787085; cv=pass; d=google.com; s=arc-20160816; b=vIuyXPTtFc6TvDCQRwSx90t0uaeQUCGetCuJ9Ry9lsji3ZQ+xGN7O4183sBtiS59Hx Tq7dB2eMvY6hAddIJpzq3KfVxoaFkw381ibV1kZ4myoj86fkA+s4BF81WtJ+iskZ8/hV KkIKbrjSg6agv+wCw/79g5p6E/AyzexLYZ3SVNrWP07KEjkHeJUffEIWPFIQ1Y8uoEb1 LMkkWe+KzgJ5yMHTM9QavKyHWpvq7N+TokBpemFEriuxFGKzioPQwRxqNGfOVh2cZ/Jt G5YLJp6NXXK88j3+azlKzfMJiIAUM+B43DiyPnqbYaWidVsIMbjZkjsGSXCZH6n9sAZk gpCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=SXDAqwloLtMdP5hSFI7p7/KPaX//87AjfSP5ZVecoKI=; fh=xTo0P1LbllSJcUlme2/KFlJuMdRrnTO5YII9/4WIoRQ=; b=JKGgZoK04JougA0q8F+nrI1dV0Oo4oLGOwhlHcHKWLC7V2v/TPbIBS3OlsTC96itVo AK2seA4OFGYckgg81e7j/WBU4ixRwGsJQ26Lm+OP1B898iLjxxD7WJ3bDhtvDKw2WWpu zXv/gDBniH9t/LTI0mTUebSXvpN5ZH1cjuXbITK+yldY4riTV1jE9zCng9XbGM4Pr9Cg 6QD48UPIfa1j3iMbPgUB1d7UFPMjhOnrhywt3faA/2mQiRKnbrHDNaTtUUXA+HVBY515 ciDgNPlPS7/3+MkhzLafCJaaRDmn2+Rfmwsh9xpdZFGuh5rgdP1jotuA/HPRZqR3RtZD r1kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g19CADUd; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47825-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCV5ZP2sdfkLRAqEU/XsHExDGaRIVbKdHYCgmXXM57WMk0k0PMj3c/hLvlEl+DU9Dze9Zeuvq1OkxT15F7+Q86N+pUg6ghaYVjcsDTqEQQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ev11-20020a056402540b00b0055ca5ce7475si6792189edb.106.2024.02.01.03.31.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 03:31:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g19CADUd; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47825-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4F4961F22D42 for ; Thu, 1 Feb 2024 09:04:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0705E15AAD8; Thu, 1 Feb 2024 09:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="g19CADUd" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91A30159571; Thu, 1 Feb 2024 09:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706778270; cv=none; b=VeKCMafNKb38g2QPJNBRdZkY4pj8zKmgSn7LZ02zfzrUFUYaASF3mzywa1j5u5BjXjaFxliSZLWPph/ZS839QvCUKeSx7e2fqFHuUBbzZyVwh6aolNcxdpbvdknXIYU6ET8/PKhEd38AQA+Hus4oDAxU8DJ+7T3NZcTUbKTGJNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706778270; c=relaxed/simple; bh=WEHuLNNIYqe3ayWos7yXk/oWPTdphOv3MXqYZro4v7A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QZjXtHRDum2wMrZNxwY1SL33q12vzAYBDiWAdtEHP9Qm8FqNo9fCJQSkky6w9uM7qGx3GhaaJGQLxPOV9fDWtMBxzddZJbsC3zr72eJWHXHttCtroBKpMR0PisbcxE6Wy27yFA9VH/abs1pdd2twIyX7x8W23smqFbHrsEj7y+g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=g19CADUd; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706778269; x=1738314269; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=WEHuLNNIYqe3ayWos7yXk/oWPTdphOv3MXqYZro4v7A=; b=g19CADUdW82uaxad2aW6jy+n1Ed6wEMGPXkh0Ai09aKdXbPd0UrKNAeR eWQ1KLlCh5nZ8zlOCStNlGQplJXElN2d1v5jlh1I5FRAmqCC1e4ab4IIp Glm1uHQeEXcATC9es8HpTbZhdiUOG9mizQNZRljFy1opWy+zathnUhnsy ovn+2VGdmi3tdKdExD9U6iW+caPlhFNqfqy1OB6kh4MHC+Zoetie3zq4r d9oEjOrlwGz0eE/D3zOw2ipnTEiijGz3z9uiJ2fA4f+BXO46V0TIKLest 9FAt+KgmSr6LP0VPav+6wwLV4jGTN/NYCEvVHh6ugmjUU6LOVJwFUwu7S Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="60331" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="60331" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 01:04:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="4366156" Received: from aslawinx-mobl.ger.corp.intel.com (HELO [10.94.0.53]) ([10.94.0.53]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 01:04:25 -0800 Message-ID: Date: Thu, 1 Feb 2024 10:04:23 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sound: soc: wcd934x: fix an incorrect use of kstrndup() Content-Language: en-US To: Mark Brown , srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, tiwai@suse.com, Fullway Wang Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, fullwaywang@tencent.com References: <170662942110.37296.1277489815994094565.b4-ty@kernel.org> From: =?UTF-8?Q?Amadeusz_S=C5=82awi=C5=84ski?= In-Reply-To: <170662942110.37296.1277489815994094565.b4-ty@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/30/2024 4:43 PM, Mark Brown wrote: > On Thu, 18 Jan 2024 15:52:49 +0800, Fullway Wang wrote: >> In wcd934x_codec_enable_dec(), kstrndup() is used to alloc memory. >> However, kmemdup_nul() should be used instead with the size known. >> >> This is similar to CVE-2019-12454 which was fixed in commit >> a549881. >> >> >> [...] > > Applied to > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next > > Thanks! > Hi, Mark, my other comment was meant to stop this patch from being applied ;), perhaps I could have been more clear? kmemdup_nul() in this case will copy bytes behind the end of widget name when copying. Widgets to which it applies are named: "ADX MUX0", "ADC MUX1" and so on, until "ADC MUX 8", which is 10 bytes including '\0', and kmemdup_nul() will copy 15 using memcpy().