Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-26 Thread Ian Abbott
On 25/05/17 19:35, Kees Cook wrote: On Thu, May 25, 2017 at 5:03 AM, Ian Abbott wrote: If the first parameter of container_of() is a pointer to a non-const-qualified array type (and the third parameter names a non-const-qualified array member), the local variable __mptr will

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-26 Thread Ian Abbott
On 25/05/17 19:35, Kees Cook wrote: On Thu, May 25, 2017 at 5:03 AM, Ian Abbott wrote: If the first parameter of container_of() is a pointer to a non-const-qualified array type (and the third parameter names a non-const-qualified array member), the local variable __mptr will be defined with a

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Kees Cook
On Thu, May 25, 2017 at 5:03 AM, Ian Abbott wrote: > If the first parameter of container_of() is a pointer to a > non-const-qualified array type (and the third parameter names a > non-const-qualified array member), the local variable __mptr will be > defined with a

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Kees Cook
On Thu, May 25, 2017 at 5:03 AM, Ian Abbott wrote: > If the first parameter of container_of() is a pointer to a > non-const-qualified array type (and the third parameter names a > non-const-qualified array member), the local variable __mptr will be > defined with a const-qualified array type. In

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Michal Nazarewicz
On Thu, May 25 2017, Ian Abbott wrote: > If the first parameter of container_of() is a pointer to a > non-const-qualified array type (and the third parameter names a > non-const-qualified array member), the local variable __mptr will be > defined with a const-qualified array type. In ISO C, these

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Michal Nazarewicz
On Thu, May 25 2017, Ian Abbott wrote: > If the first parameter of container_of() is a pointer to a > non-const-qualified array type (and the third parameter names a > non-const-qualified array member), the local variable __mptr will be > defined with a const-qualified array type. In ISO C, these

[PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Ian Abbott
If the first parameter of container_of() is a pointer to a non-const-qualified array type (and the third parameter names a non-const-qualified array member), the local variable __mptr will be defined with a const-qualified array type. In ISO C, these types are incompatible. They work as expected

[PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Ian Abbott
If the first parameter of container_of() is a pointer to a non-const-qualified array type (and the third parameter names a non-const-qualified array member), the local variable __mptr will be defined with a const-qualified array type. In ISO C, these types are incompatible. They work as expected