lkml.org 
[lkml]   [1997]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectvalidation of mode argument in open?
While reviewing the handling of mkdir calls I noticed that the
open_namei() routine doesn't do any verification of the mode argument
before calling the fs create() operation. Unless I've missed it, the
calling path from the syscall down to open_namei() doesn't test the mode
either. In contrast, mknod() does validate the argument, and mkdir masks
away all but the permissions (though I think it should OR in S_IFDIR).

It was my understanding that the fs create() operation was intended only
for plain files, and that directory and device node creation (if
supported) should always go to the mkdir and mknod ops. If this is the
case, there should be a test somewhere in the open() code to make sure
the mode is valid (i.e. S_IFREG plus permissions).

Regards,
Bill

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.015 / U:2.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site