From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751353AbdCPH47 (ORCPT ); Thu, 16 Mar 2017 03:56:59 -0400 Received: from smtp.lesbg.com ([178.62.242.175]:57298 "EHLO smtp.lesbg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbdCPH46 (ORCPT ); Thu, 16 Mar 2017 03:56:58 -0400 Message-ID: <1489650479.2097.9.camel@lesbg.com> Subject: Re: [PATCH v4 1/2] usbip: Fix-format-overflow From: Jonathan Dieter To: linux-kernel@vger.kernel.org Cc: Valentina Manea , Shuah Khan , Peter Senna Tschudin , Greg Kroah-Hartman , Krzysztof Opasiak , "open list:USB OVER IP DRIVER" Date: Thu, 16 Mar 2017 09:47:59 +0200 In-Reply-To: <20170227083108.16391-1-jdieter@lesbg.com> References: <20170222181803.16373-1-jdieter@lesbg.com> <20170227083108.16391-1-jdieter@lesbg.com> Organization: Lebanon Evangelical School for Boys and Girls Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.5 (3.22.5-1.fc25) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-02-27 at 10:31 +0200, Jonathan Dieter wrote: > The usbip userspace tools call sprintf()/snprintf() and don't check for > the return value which can lead the paths to overflow, truncating the > final file in the path. > > More urgently, GCC 7 now warns that these aren't checked with > -Wformat-overflow, and with -Werror enabled in configure.ac, that makes > these tools unbuildable. > > This patch fixes these problems by replacing sprintf() with snprintf() in > one place and adding checks for the return value of snprintf(). > > > Reviewed-by: Peter Senna Tschudin > > Signed-off-by: Jonathan Dieter > --- > Changes since v3 >  * Cast sizeof to long unsigned when printing errors to fix building for 32-bit >    architectures Just wanted to check if there's anything else I need to do to make this ready? Thanks, Jonathan