Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE77AC433FE for ; Tue, 8 Feb 2022 11:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359450AbiBHLbg (ORCPT ); Tue, 8 Feb 2022 06:31:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357036AbiBHLVM (ORCPT ); Tue, 8 Feb 2022 06:21:12 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877DFC03FEC9 for ; Tue, 8 Feb 2022 03:21:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 14BC161576 for ; Tue, 8 Feb 2022 11:21:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B90B4C004E1; Tue, 8 Feb 2022 11:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644319270; bh=0EBDyWCdj2J0467X/93+UBDpjoKXI2Z2G0PsdgKfF5U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hF9/r39S/Vv5A15WV1f14ZNe09dmsnhn/SP9QD2K4NageqcTX94/evV5nSBmE+y6D Qm7Jl4jzzep391FYvmFZHp4IvxXVZ1kQT86sTsYim8WB3GyTP+DR1GMPhWN6gtisHC t+RXN/+PDq+t0G93HnkW5FPp/3uSsGgm+WjeS3Es= Date: Tue, 8 Feb 2022 12:21:07 +0100 From: Greg Kroah-Hartman To: Sergey Shtylyov Cc: linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: core: use sysfs_emit() instead of sprintf() Message-ID: References: <4248804f-d9eb-5e00-563f-28815cd42b65@omp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4248804f-d9eb-5e00-563f-28815cd42b65@omp.ru> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Tue, Feb 08, 2022 at 02:02:20PM +0300, Sergey Shtylyov wrote: > sprintf() (still used in the USB core for the sysfs output) is vulnerable > to the buffer overflow. Really? Where? If we have potential overflows, let's fix them as bug fixes and properly backport the fixes where needed. If these really are just using the "old-style" functions instead, then that's something totally different and you should not say "vulnerable" if it really is not at all. > Use the new-fangled sysfs_emit() instead. > > Found by Linux Verification Center (linuxtesting.org) with the SVACE static > analysis tool. You mean coccinelle, right? It's been checking for this for a while. Also properly wrap your changelog at 72 columns please. thanks, greg k-h