lkml.org 
[lkml]   [2018]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/6] mm/gup_benchmark: Time put_page
On Wed, 10 Oct 2018 16:28:43 -0600 Keith Busch <keith.busch@intel.com> wrote:

> > > struct gup_benchmark {
> > > - __u64 delta_usec;
> > > + __u64 get_delta_usec;
> > > + __u64 put_delta_usec;
> > > __u64 addr;
> > > __u64 size;
> > > __u32 nr_pages_per_call;
> >
> > If we move put_delta_usec to the end of this struct, the ABI remains
> > back-compatible?
>
> If the kernel writes to a new value appended to the end of the struct,
> and the application allocated the older sized struct, wouldn't that
> corrupt the user memory?

Looks like it. How about we do this while we're breaking it?

--- a/mm/gup_benchmark.c~mm-gup_benchmark-time-put_page-fix
+++ a/mm/gup_benchmark.c
@@ -14,6 +14,7 @@ struct gup_benchmark {
__u64 size;
__u32 nr_pages_per_call;
__u32 flags;
+ __u64 expansion[10]; /* For future use */
};

static int __gup_benchmark_ioctl(unsigned int cmd,
\
 
 \ /
  Last update: 2018-10-11 00:42    [W:0.045 / U:16.780 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site