On Thu, 2021-03-04 at 10:55 +0100, Philippe Gerum wrote:
> 
> > 
> > Adding the full code:
> > 
> > static inline int sem_fetch_timeout(struct timespec64 *ts,
> >                                 const void __user *u_ts)
> > {
> >     return u_ts == NULL ? -EFAULT :
> >             cobalt_copy_from_user(ts, u_ts, sizeof(*ts));
> > }
> > 
> > Copying sizeof(*ts) is to much if the application provided
> > "__old_time_t" (sizeof(time_t) =4) only. Isn't it? I would expect the
> > result (in ts) to be garbage. Due to different padding the "sec" field
> > (in ts) would now contain the nsec value from u_ts as well.
> > 
> 
> Ah, I was looking at the wrong path (32emu). Yes, this is broken for
> mere 32bit now (i.e. natively 32bit platform).
> 

I already prepared a patch. That's useful for some further discussion
as well. Coming soon, no need to interrupt dovetail porting ;-)

Reply via email to