FIX: AddrSpace dup handles must NOT be POSITIONED
AddrSpace handles from dup(b'empty') and dup(b'exclusive') use the write syscall for mmap commands, not seekable I/O. The kwriteoff handler returns the mapped address (not bytes written), which sys_write would incorrectly add to the file offset when POSITIONED is set. This corrupted the offset, causing the next write to fail with EINVAL (offset_word skip exhausted the buffer). Only mmap-min-addr needs POSITIONED for actual read/write.
This commit is contained in:
+2
-1
@@ -1247,7 +1247,8 @@ impl KernelScheme for ProcScheme {
|
||||
_ => return Err(Error::new(EINVAL)),
|
||||
};
|
||||
|
||||
handle(Handle { context, kind }, true)
|
||||
let positioned = !matches!(kind, ContextHandle::AddrSpace { .. });
|
||||
handle(Handle { context, kind }, positioned)
|
||||
}
|
||||
_ => return Err(Error::new(EINVAL)),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user