Re: [PATCH] amd64-agp: fix arbitrary kernel memory writes

2019-05-29 Thread Yang Xiao
I am not so sure about taking off the cast, just to be in line with patch in 194b3da873fd. The comment can be deleted. On Wed, May 29, 2019 at 4:35 PM Greg KH wrote: > > On Wed, May 29, 2019 at 12:52:01PM +0800, Young Xiao wrote: > > pg_start is copied from userspace on AGPIOC_BIND and

Re: [PATCH] amd64-agp: fix arbitrary kernel memory writes

2019-05-29 Thread Greg KH
On Wed, May 29, 2019 at 12:52:01PM +0800, Young Xiao wrote: > pg_start is copied from userspace on AGPIOC_BIND and AGPIOC_UNBIND ioctl > cmds of agp_ioctl() and passed to agpioc_bind_wrap(). As said in the > comment, (pg_start + mem->page_count) may wrap in case of AGPIOC_BIND, > and it is not

[PATCH] amd64-agp: fix arbitrary kernel memory writes

2019-05-28 Thread Young Xiao
pg_start is copied from userspace on AGPIOC_BIND and AGPIOC_UNBIND ioctl cmds of agp_ioctl() and passed to agpioc_bind_wrap(). As said in the comment, (pg_start + mem->page_count) may wrap in case of AGPIOC_BIND, and it is not checked at all in case of AGPIOC_UNBIND. As a result, user with