From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbbFEExN (ORCPT ); Fri, 5 Jun 2015 00:53:13 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33997 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbbFEExK (ORCPT ); Fri, 5 Jun 2015 00:53:10 -0400 Date: Fri, 5 Jun 2015 10:22:57 +0530 From: Sudip Mukherjee To: Joe Perches Cc: Thomas Petazzoni , Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: fbtft: fix out of bound access Message-ID: <20150605045257.GA4012@sudip-PC> References: <1433424892-23333-1-git-send-email-sudipm.mukherjee@gmail.com> <1433450911.2658.6.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433450911.2658.6.camel@perches.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2015 at 01:48:31PM -0700, Joe Perches wrote: > On Thu, 2015-06-04 at 19:04 +0530, Sudip Mukherjee wrote: > > str was 16 bytes but was mentioned as 128 in snprintf. > > again msg is 128 bytes but not sufficient to hold the complete debug > > message of register values. > > Now removed the use of str, msg and print the register values from the > > loop. > [] > > v2: removed the use of msg and str. > > It's nice to cc the people that give you suggestions when > you send a new version of a patch. oops, i thought but apparently i forgot while sending. actuially I was going through one of your advise you gave long ago (https://lkml.org/lkml/2014/10/11/85) , and I was trying to find out the effects of that on the way i have done the v2 and I changed it again to arrive at the posted patch. While doing all these, ccing you just slipped out of my mind. sorry again. > > > diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c > [] > > @@ -1067,8 +1067,6 @@ static int fbtft_init_display_dt(struct fbtft_par *par) > > const __be32 *p; > > u32 val; > > int buf[64], i, j; > [] > > par->fbtftops.write_register(par, i, > > buf[0], buf[1], buf[2], buf[3], > > It seems there are only 2 callers of (*write_register)() > and the arguments are always an in-order array int[64] > > Maybe it'd be nicer to change the prototypes of the > write_register functions to take a const int * > instead of pushing 64 ints on the stack. yes, I will send it as a separate patch as that is another change. regards sudip >