Re: [issue1863] Implement 'hammer volume-list' subcommand

看板DFBSD_bugs作者時間15年前 (2010/10/09 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串9/17 (看更多)
On 10/08/2010 06:26 PM, Stathis Kamperis (via DragonFly issue tracker) wrote: > > Stathis Kamperis <ekamperi@gmail.com> added the comment: > > Fixed, sorry. > > I changed strlcpy() to copyout() and also added some rudimentary validation on > the count of volumes to write. > > I honestly don't know how to make kernel defend against a lying user-land. The kernel holds all the cards, just check absolutely everything userland tells you against your own data structures :) Patch looks ok, except that you don't want to unconditionally copy MAXPATHLEN bytes to userland. The issue here isn't performance, but information disclosure. Your code will copy to userspace whatever happens to be allocated adjacent to the volume name in RAM. Perhaps an implementation of copyoutstr() is in order? HTH, Aggelos
文章代碼(AID): #1ChwdtiO (DFBSD_bugs)
討論串 (同標題文章)
完整討論串 (本文為第 9 之 17 篇):
文章代碼(AID): #1ChwdtiO (DFBSD_bugs)