* TAKE 956783 - xfs_dm_getall_dmattr() doesn't check if the user buffer is at valid address
@ 2006-11-21 6:21 Vlad Apostolov
2006-11-27 5:58 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Vlad Apostolov @ 2006-11-21 6:21 UTC (permalink / raw)
To: sgi.bugs.xfs; +Cc: linux-xfs
No EFAULT error when dm_getall_dmattr() called with an invalid user
buffer address.
Date: Tue Nov 21 17:14:34 AEDT 2006
Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/linux-xfs-dmapi
Inspected by: donaldd
Author: vapo
The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb
Modid: xfs-linux-melb:xfs-kern:27510a
fs/xfs/dmapi/xfs_dm.c - 1.28 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.28&r2=text&tr2=1.27&f=h
- pv 956783, rv donaldd - Check user buffer address in
dm_getall_dmattr() for EFAULT error
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: TAKE 956783 - xfs_dm_getall_dmattr() doesn't check if the user buffer is at valid address
2006-11-21 6:21 TAKE 956783 - xfs_dm_getall_dmattr() doesn't check if the user buffer is at valid address Vlad Apostolov
@ 2006-11-27 5:58 ` Christoph Hellwig
2006-11-28 0:00 ` Vlad Apostolov
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2006-11-27 5:58 UTC (permalink / raw)
To: Vlad Apostolov; +Cc: sgi.bugs.xfs, linux-xfs
On Tue, Nov 21, 2006 at 05:21:12PM +1100, Vlad Apostolov wrote:
> No EFAULT error when dm_getall_dmattr() called with an invalid user
> buffer address.
This fix is broken. access_ok is not enough to verify the buffer,
it just does very few static check (basically the address space limit)
You need to use copy_{from,to}_user to access user pointers. I had
an untested patch to fix this at my good old SGI time, but Dean wanted
to review and test it a lot more. I'll try to dig up that patch if you care.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: TAKE 956783 - xfs_dm_getall_dmattr() doesn't check if the user buffer is at valid address
2006-11-27 5:58 ` Christoph Hellwig
@ 2006-11-28 0:00 ` Vlad Apostolov
2006-11-29 15:11 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Vlad Apostolov @ 2006-11-28 0:00 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: sgi.bugs.xfs, linux-xfs
Christoph Hellwig wrote:
> On Tue, Nov 21, 2006 at 05:21:12PM +1100, Vlad Apostolov wrote:
>
>> No EFAULT error when dm_getall_dmattr() called with an invalid user
>> buffer address.
>>
>
> This fix is broken. access_ok is not enough to verify the buffer,
> it just does very few static check (basically the address space limit)
>
> You need to use copy_{from,to}_user to access user pointers. I had
> an untested patch to fix this at my good old SGI time, but Dean wanted
> to review and test it a lot more. I'll try to dig up that patch if you care.
>
The fix is actually fine as it gives an early indication (even not complete)
that the user pointer is bad. There is another problem you are pointing at and
it is the userspace pointer dereference later on without using copy_to_user().
If you have any patch fixing this problem it would be great.
Thanks and regards,
Vlad
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: TAKE 956783 - xfs_dm_getall_dmattr() doesn't check if the user buffer is at valid address
2006-11-28 0:00 ` Vlad Apostolov
@ 2006-11-29 15:11 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2006-11-29 15:11 UTC (permalink / raw)
To: Vlad Apostolov; +Cc: Christoph Hellwig, sgi.bugs.xfs, linux-xfs
On Tue, Nov 28, 2006 at 11:00:26AM +1100, Vlad Apostolov wrote:
> The fix is actually fine as it gives an early indication (even not complete)
> that the user pointer is bad. There is another problem you are pointing at
> and it is the userspace pointer dereference later on without using
> copy_to_user(). If you have any patch fixing this problem it would be great.
Unfortunately I haven't found my patch, I'm sorry. I have on the other
hand found various old trivial XFS patches of mine that I'll submit.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-11-29 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21 6:21 TAKE 956783 - xfs_dm_getall_dmattr() doesn't check if the user buffer is at valid address Vlad Apostolov
2006-11-27 5:58 ` Christoph Hellwig
2006-11-28 0:00 ` Vlad Apostolov
2006-11-29 15:11 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox