lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Sep 2009 12:30:14 -0700
From:	Brian McGrew <brian@...ionpro.com>
To:	Luciano Rocha <luciano@...otux.com>
CC:	<linux-kernel@...r.kernel.org>
Subject: Re: (un)mount ramfs from C code

> You mean without using system(3), right? System call is how your program
> interacts with the outside world.
> 
> The relevant system calls are:
>   - mount(2): mount("none", "/mnt", "ramfs", 0, NULL);
>   - umount(2): umount("/mnt");
> 

Thanks for the help!  I'm getting there.  Considering the following:

If (mount("ramfs", rd_path, "ramfs", MS_NOEXEC | MS_NOSUID, "size=2000m") <
0) {
    strerror(errno);
} else {
    std::cout << "mounted";
}

Works great!  Thank you.  However, even though the filesystem is mounted and
/bin/mountpoint confirms it's a mountpoint, I do not see the mountpoint
listed in /etc/mtab.

Also, according to what I've read about ramfs, the size is supposed to be
limited to size=, however, I can cat /dev/zero until the box it out of
memory (and swap).

I think I'm just missing something and google's not helping a whole lot
since ramfs isn't the most popular subject today.

Thanks,

-b

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ