[Skiboot] [PATCH 05/15] libc/string: Add memcpy_ci

Stewart Smith stewart at linux.vnet.ibm.com
Wed Sep 14 19:17:49 AEST 2016


Balbir Singh <bsingharora at gmail.com> writes:
>> +	unsigned long int destp = (long int) destpp;
>> +	unsigned long int srcp = (long int) srcpp;
>> +
>> +	/* copy just a few bytes to make dst aligned */
>> +	i = len % block;
>
>
> I would do some basic sanity tests around len, like
>
> is len > RAM size?

We could re-use opal_addr_valid() in a bunch of libc actually.. perhaps
just leading to an assert()?

Odds are if you're passing an invalid pointer into memcpy() the best
thing to do is set fire to everything rather than limp and continue?

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list