[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY1PR0301MB0748FD38A1FD925F273EB33A877D0@CY1PR0301MB0748.namprd03.prod.outlook.com>
Date: Mon, 1 Dec 2014 22:28:36 +0000
From: Stuart Yoder <stuart.yoder@...escale.com>
To: Alexander Graf <agraf@...e.de>,
Jose Rivera <German.Rivera@...escale.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"arnd@...db.de" <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Kim Phillips <Kim.Phillips@...escale.com>,
Scott Wood <scottwood@...escale.com>,
"bhamciu1@...escale.com" <bhamciu1@...escale.com>,
"R89243@...escale.com" <R89243@...escale.com>,
Geoff Thorpe <Geoff.Thorpe@...escale.com>,
"bhupesh.sharma@...escale.com" <bhupesh.sharma@...escale.com>,
"nir.erez@...escale.com" <nir.erez@...escale.com>,
Richard Schmitt <richard.schmitt@...escale.com>
Subject: RE: [PATCH 1/3 v4] drivers/bus: Added Freescale Management Complex
APIs
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@...e.de]
> Sent: Thursday, November 27, 2014 8:30 AM
> To: Rivera Jose-B46482; gregkh@...uxfoundation.org; arnd@...db.de; linux-kernel@...r.kernel.org
> Cc: Yoder Stuart-B08248; Phillips Kim-R1AAHA; Wood Scott-B07421; Hamciuc Bogdan-BHAMCIU1; Marginean
> Alexandru-R89243; Thorpe Geoff-R01361; Sharma Bhupesh-B45370; Erez Nir-RM30794; Schmitt Richard-B43082
> Subject: Re: [PATCH 1/3 v4] drivers/bus: Added Freescale Management Complex APIs
>
>
>
> On 13.11.14 18:54, J. German Rivera wrote:
> > APIs to access the Management Complex (MC) hardware
> > module of Freescale LS2 SoCs. This patch includes
> > APIs to check the MC firmware version and to manipulate
> > DPRC objects in the MC.
> >
> > Signed-off-by: J. German Rivera <German.Rivera@...escale.com>
> > Signed-off-by: Stuart Yoder <stuart.yoder@...escale.com>
>
> [...]
>
> > +/*
> > + * Object descriptor, returned from dprc_get_obj()
> > + */
> > +struct dprc_obj_desc {
> > + /* Type of object: NULL terminated string */
> > + char type[16];
>
> I don't see where it actually gets NULL terminated - all 16 bytes come
> directly from the device.
>
> While it's probably ok to trust it, I think we'd still be safer off if
> we just make this a char[17] array to always have our NULL terminating
> string. That way we're guaranteed we'll never run over our memory
> boundaries.
The device is supposed to guarantee that the string is null
terminated...so there will never be valid chars in the 16th
character. So, what about just forcing type[15] = '\0'?
I think that would be better than making it a char[17].
Stuart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists