Giter Club home page Giter Club logo

Comments (3)

a-nogikh avatar a-nogikh commented on June 3, 2024

Hi,

For the next time: our mailing list [email protected] would be a better place for such questions that a github issue.

But I can't figure out why the 'kInFd' and 'kOutFd' should be 3, 4 in syz-executor.

That's how https://pkg.go.dev/os/exec works, see

	// ExtraFiles specifies additional open files to be inherited by the
	// new process. It does not include standard input, standard output, or
	// standard error. If non-nil, entry i becomes file descriptor 3+i.
	//
	// ExtraFiles is not supported on Windows.
	ExtraFiles []*[os](https://pkg.go.dev/os).[File](https://pkg.go.dev/os#File)

syzkaller/pkg/ipc/ipc.go

Lines 610 to 612 in 3ad490e

if inFile != nil && outFile != nil {
cmd.ExtraFiles = []*os.File{inFile, outFile}
}

And I also print out the value of 'fd' created in syz-fuzzer but it isn't 3 and 4.

Which fd exactly? At what point do you print it?

from syzkaller.

selfbypass avatar selfbypass commented on June 3, 2024

Hi,

But I can't figure out why the 'kInFd' and 'kOutFd' should be 3, 4 in syz-executor.

That's how https://pkg.go.dev/os/exec works, see

	// ExtraFiles specifies additional open files to be inherited by the
	// new process. It does not include standard input, standard output, or
	// standard error. If non-nil, entry i becomes file descriptor 3+i.
	//
	// ExtraFiles is not supported on Windows.
	ExtraFiles []*[os](https://pkg.go.dev/os).[File](https://pkg.go.dev/os#File)

Hi,
Thanks! The child process inherits the shared memory via cmd.ExtraFiles which file descriptors begin with 3.

syzkaller/pkg/ipc/ipc.go

Lines 610 to 612 in 3ad490e

if inFile != nil && outFile != nil {
cmd.ExtraFiles = []*os.File{inFile, outFile}
}

And I also print out the value of 'fd' created in syz-fuzzer but it isn't 3 and 4.

Which fd exactly? At what point do you print it?

I print it at the inf, inmem, err = osutil.CreateMemMappedFile(prog.ExecBufferSize).

For the next time: our mailing list [email protected] would be a better place for such questions that a github issue.

Yeah, I also think asking such questions here is a little unsuitable.

Anyway, thank you for your help!

from syzkaller.

a-nogikh avatar a-nogikh commented on June 3, 2024

I print it at the inf, inmem, err = osutil.CreateMemMappedFile(prog.ExecBufferSize).

These would be fd numbers for the syz-fuzzer process. When syz-fuzzer shares them with syz-executor, the same files would have fds 3 and 4 when accessed from the syz-executor process.

from syzkaller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.