From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH] PM / OPP: Use snprintf() instead of sprintf() Date: Tue, 5 Jan 2016 11:52:47 -0800 Message-ID: <20160105195247.GD22188@codeaurora.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:44651 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbcAETwt (ORCPT ); Tue, 5 Jan 2016 14:52:49 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Viresh Kumar Cc: Rafael Wysocki , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Geert Uytterhoeven , Greg Kroah-Hartman , Len Brown , open list , Nishanth Menon , Pavel Machek , Viresh Kumar On 01/05, Viresh Kumar wrote: > sprintf() can access memory outside of the range of the character array, > and is risky in some situations. The driver specified prop_name string > can be longer than NAME_MAX here (only an attacker will do that though) > and so blindly copying it into the character array of size NAME_MAX > isn't safe. Instead we must use snprintf() here. > > Reported-by: Geert Uytterhoeven > Signed-off-by: Viresh Kumar > --- Acked-by: Stephen Boyd -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project