lkml.org 
[lkml]   [2020]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] dev_ioctl: split out SIOC?IFMAP ioctls
On Fri, Sep 25, 2020 at 02:28:29PM +0200, Arnd Bergmann wrote:
> > > +++ b/include/uapi/linux/if.h
> > > @@ -247,7 +247,13 @@ struct ifreq {
> > > short ifru_flags;
> > > int ifru_ivalue;
> > > int ifru_mtu;
> > > +#ifndef __KERNEL__
> > > + /*
> > > + * ifru_map is rarely used but causes the incompatibility
> > > + * between native and compat mode.
> > > + */
> > > struct ifmap ifru_map;
> > > +#endif
> >
> > Do we need a way to verify that this never changes the struct size?
>
> Not sure which way you would want to check. The point of the patch
> is that it does change the struct size inside of the kernel but not
> in user space.
>
> Do you mean we should check that the (larger) user space size
> remains what it is for future changes, or that the (smaller)
> kernel size remains the same on all kernels, or maybe both?

I had something like:

BUILD_BUG_ON(sizeof(struct ifmap) >
sizeof(struct ifreq) - IFNAMSIZ);

plus a suitable comment in mind.

\
 
 \ /
  Last update: 2020-09-29 19:53    [W:0.100 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site