其他分享
首页 > 其他分享> > MIT_JOS_Lab5

MIT_JOS_Lab5

作者:互联网

ClientClientdevfile_readdevfile_readServerServerserve_readserve_read/lib/file.c/lib/file.c/fs/serv.c/fs/serv.ccall fsipc()call fsipc()fsipcfsipctypetypefsipcbuffsipcbufpermissionpermission4G4GUSTACKTOPUSTACKTOPDISKMAP+DISKSIZEDISKMAP+DISKSIZEDISKMAPDISKMAPUTEXTUTEXTfsreqfsreqNormal User StackNormal User Stack1024
struct Fd*
1024...
3GB IDE Disk Space3GB IDE Disk Spaceunion Fsipc *fsrequnion Fsipc *fsreq





Program Data & Heap
Program Data & Heap...
....................0xeebef0000xeebef0000xeebed0000xeebed0000xd00000000xd00000001024 x PGSIZE1024 x PGSIZE0x100000000x100000000x0ffff0000x0ffff0000x008000000x00800000opentab[MAXOPEN]opentab[MAXOPEN]
construct fsipcbufconstruct fsipcbufunion Fsipc fsipcbuf union Fsipc fsipcbuf struct Fsreq_read
struct Fsreq_read
struct Fsret_read
struct Fsret_read
char ret_buf[PGSIZE];
char ret_buf[PGSIZE];
opentab[MAXOPEN]opentab[MAXOPEN]struct OpenFile *ostruct OpenFile *ouint32_t o_fileid;uint32_t o_fileid;struct File *o_file;struct File *o_file;int o_mode;int o_mode;struct Fd *o_fd;struct Fd *o_fd;int req_fileid;int req_fileid;size_t req_n;size_t req_n;look uplook upo->o_fileo->o_fileret->ret_bufret->ret_bufreq->req_nreq->req_no->o_fd->fd_offset)o->o_fd->...move result
into bufferflow
move result...
ipc_send(whom, r, pg, perm);ipc_send(whom, r, pg, perm);ipc_recv(NULL, dstva, NULL)ipc_recv(NULL, dstva, NULL)ipc_find_env(ENV_TYPE_FS)
ipc_find_env(ENV_TYPE_FS)
ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U)ipc_send(fsenv, type, &fsipcbuf...memmove(buf, fsipcbuf.readRet.ret_buf, r);memmove(buf, fsipcbuf.readRet.ret_buf, r);

标签:ipc,JOS,struct,++,svg,req,ret,Lab5,MIT
来源: https://www.cnblogs.com/wevolf/p/13329243.html