Allow NULL data in mount(2)
PiperOrigin-RevId: 213315267 Change-Id: I7562bcd81fb22e90aa9c7dd9eeb94803fcb8c5af
This commit is contained in:
parent
25add7b22b
commit
d639c3d61b
|
@ -46,13 +46,16 @@ func Mount(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Syscall
|
|||
return 0, nil, err
|
||||
}
|
||||
|
||||
// In Linux, a full page is always copied in regardless of null
|
||||
// character placement, and the address is passed to each file system.
|
||||
// Most file systems always treat this data as a string, though, and so
|
||||
// do all of the ones we implement.
|
||||
data, err := t.CopyInString(dataAddr, usermem.PageSize)
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
data := ""
|
||||
if dataAddr != 0 {
|
||||
// In Linux, a full page is always copied in regardless of null
|
||||
// character placement, and the address is passed to each file system.
|
||||
// Most file systems always treat this data as a string, though, and so
|
||||
// do all of the ones we implement.
|
||||
data, err = t.CopyInString(dataAddr, usermem.PageSize)
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore magic value that was required before Linux 2.4.
|
||||
|
|
Loading…
Reference in New Issue