From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754031AbbFEFq6 (ORCPT ); Fri, 5 Jun 2015 01:46:58 -0400 Received: from smtprelay0090.hostedemail.com ([216.40.44.90]:53400 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753191AbbFEFqy (ORCPT ); Fri, 5 Jun 2015 01:46:54 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2693:2731:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6261:6691:7903:8660:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12517:12519:12740:13069:13148:13230:13311:13357:13618:13972:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: smile56_1ef236e6b4732 X-Filterd-Recvd-Size: 2272 Message-ID: <1433483211.2658.22.camel@perches.com> Subject: Re: [PATCH v2] staging: fbtft: fix out of bound access From: Joe Perches To: Sudip Mukherjee Cc: Thomas Petazzoni , Noralf =?ISO-8859-1?Q?Tr=F8nnes?= , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Thu, 04 Jun 2015 22:46:51 -0700 In-Reply-To: <20150605045257.GA4012@sudip-PC> References: <1433424892-23333-1-git-send-email-sudipm.mukherjee@gmail.com> <1433450911.2658.6.camel@perches.com> <20150605045257.GA4012@sudip-PC> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-06-05 at 10:22 +0530, Sudip Mukherjee wrote: > On Thu, Jun 04, 2015 at 01:48:31PM -0700, Joe Perches wrote: [] > ccing you just slipped out of my mind. No worries. > > > 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. I looked at it a bit more and there's a macro that calls write_register so there are actually many more call sites. It's a bit non trivial to change the macro as all the called (*write_register) functions would need changing and these functions use va_list. Maybe if you _really_ feel like it, but it's a bit of work.