Re: [PATCH 03/24] net: add a new sockptr_t type

2020-07-22 Thread Christoph Hellwig
On Mon, Jul 20, 2020 at 10:55:43AM -0700, Eric Biggers wrote: > On Mon, Jul 20, 2020 at 07:43:22PM +0200, Christoph Hellwig wrote: > > On Mon, Jul 20, 2020 at 09:37:48AM -0700, Eric Biggers wrote: > > > How does this not introduce a massive security hole when > > >

RE: [PATCH 03/24] net: add a new sockptr_t type

2020-07-21 Thread David Laight
From: Christoph Hellwig > Sent: 20 July 2020 13:47 > > Add a uptr_t type that can hold a pointer to either a user or kernel > memory region, and simply helpers to copy to and from it. For > architectures like x86 that have non-overlapping user and kernel > address space it just is a union and

RE: [PATCH 03/24] net: add a new sockptr_t type

2020-07-21 Thread David Laight
From: Eric Biggers > Sent: 20 July 2020 17:38 ... > How does this not introduce a massive security hole when > CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE? > > AFAICS, userspace can pass in a pointer >= TASK_SIZE, > and this code makes it be treated as a kernel pointer. One thought I've had is

Re: [PATCH 03/24] net: add a new sockptr_t type

2020-07-20 Thread Eric Biggers
On Mon, Jul 20, 2020 at 07:43:22PM +0200, Christoph Hellwig wrote: > On Mon, Jul 20, 2020 at 09:37:48AM -0700, Eric Biggers wrote: > > How does this not introduce a massive security hole when > > CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE? > > > > AFAICS, userspace can pass in a pointer >=

Re: [PATCH 03/24] net: add a new sockptr_t type

2020-07-20 Thread Christoph Hellwig
On Mon, Jul 20, 2020 at 09:37:48AM -0700, Eric Biggers wrote: > How does this not introduce a massive security hole when > CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE? > > AFAICS, userspace can pass in a pointer >= TASK_SIZE, > and this code makes it be treated as a kernel pointer. Yeah, we'll

Re: [PATCH 03/24] net: add a new sockptr_t type

2020-07-20 Thread Eric Biggers
On Mon, Jul 20, 2020 at 02:47:16PM +0200, Christoph Hellwig wrote: > Add a uptr_t type that can hold a pointer to either a user or kernel > memory region, and simply helpers to copy to and from it. For > architectures like x86 that have non-overlapping user and kernel > address space it just is a

[PATCH 03/24] net: add a new sockptr_t type

2020-07-20 Thread Christoph Hellwig
Add a uptr_t type that can hold a pointer to either a user or kernel memory region, and simply helpers to copy to and from it. For architectures like x86 that have non-overlapping user and kernel address space it just is a union and uses a TASK_SIZE check to select the proper copy routine. For