From: lovecreatesbeauty on
On Nov 25, 5:01 pm, "lovecreatesbea...(a)gmai1.c0m"
<lovecreatesbea...(a)gmail.com> wrote:

[..]


[ 1.541280] Kernel panic - not syncing: No init found. Try passing
init= option to kernel.

It seems caused by my code.

I add init=3 in menu.lst as:

kernel/boot/vmlinuz-2.6.26 root=/dev/sda1 ro quiet init=3

Still it has the problem.
From: Bill Marcum on
["Followup-To:" header set to comp.os.linux.development.system.]
On 2009-11-25, lovecreatesbeauty(a)gmai1.c0m <lovecreatesbeauty(a)gmail.com> wrote:
> On Nov 25, 5:01 pm, "lovecreatesbea...(a)gmai1.c0m"
><lovecreatesbea...(a)gmail.com> wrote:
>
> [..]
>
>
> [ 1.541280] Kernel panic - not syncing: No init found. Try passing
> init= option to kernel.
>
> It seems caused by my code.
>
> I add init=3 in menu.lst as:
>
> kernel/boot/vmlinuz-2.6.26 root=/dev/sda1 ro quiet init=3
>
> Still it has the problem.

The file /sbin/init is missing, or you have the wrong partition chosen
for root=. Try booting from a live CD of the same distro and copy that
file.
From: Rainer Weikusat on
"lovecreatesbeauty(a)gmai1.c0m" <lovecreatesbeauty(a)gmail.com> writes:
> On Nov 13, 6:49 pm, Rainer Weikusat <rweiku...(a)mssgmbh.com> wrote:
>>
>> The most glaring problem with this is that this will (probably, I
>> haven't tested it) allow access to any process whose corresponding
>> binary is named apache2. Try
>>
>> cd /bin
>> ln ed apache2
>> ./apache2 /var/www/index.html
>>
>> as root for a demonstration (assuming /bin/ed exists, of course).
>>
>> You really should be using the existing facilities for extended access
>> control, such as capabilities or one of the MAC-frameworks instead of
>> trying to 'roll your own' in a that crude fashion.- Hide quoted text -
>>
>
> Thank you.
>
> I didn't get the full pathname of filename in the previous code. It
> doesn't handle this situation:
>
> # cd /var
> # vi www/index.html
>
> Did you also mean this point?

No. But this really doesn't matter since the approach you insist on
using cannot ever work.

[...]

> My new code:

[...]

> +/* strrvs is by jian hua li, http://www.grex.org/~jhl/miscc.txt */
> +static unsigned char *strrvs(unsigned char *p)
> +{
> + unsigned char *p1, *p2, ch;
> +
> + for (p1 = p; *(p1 + 1); p1++) ;
> + for (p2 = p; p2 < p1; p2++, p1--)
> + ch = *p2, *p2 = *p1, *p1 = ch;
> + return p;
> +}
> +
> long do_sys_open(int dfd, const char __user *filename, int flags, int
> mode)
> {
> char *tmp = getname(filename);
> int fd = PTR_ERR(tmp);
> + char *s1 = "/var/www";
> + char *s2 = "apache2";
> + unsigned char fullname[2048] = {'\0'}; /* temporary length */
> + struct dentry *dentry = current->fs->pwd.dentry;
> +
> + if (filename[0] != '/'){
> + strncat(fullname, strrvs(filename), sizeof fullname - 1);

Leaving the issue with the trashed dentries aside, I assume that a
file named tini/nibs/ simply doesn't exist on your system. But don't
worry to much about that --- since the system won't boot anymore,
files have successfully been secured against accesses of any user
without a screwdriver ...

This must be satire, right?
From: lovecreatesbeautifulgirls on
On 11/25/09 18:31, "lovecreatesbeauty(a)gmai1.c0m" <lovecreatesbeauty(a)gmail.com> wrote:

> On Nov 25, 5:01 pm, "lovecreatesbea...(a)gmai1.c0m"
> <lovecreatesbea...(a)gmail.com> wrote:
>
> [..]
>
>
> [ 1.541280] Kernel panic - not syncing: No init found. Try passing
> init= option to kernel.
>
> It seems caused by my code.
>
> I add init=3 in menu.lst as:
>
> kernel/boot/vmlinuz-2.6.26 root=/dev/sda1 ro quiet init=3
>
> Still it has the problem.

Stupid, there is never such usage of 'init', either "init 3",
or "init=/bin/what_ever_shell".


From: lovecreatesbeautifulgirls on
On 11/25/09 17:01, "lovecreatesbeauty(a)gmai1.c0m" <lovecreatesbeauty(a)gmail.com> wrote:
> On Nov 13, 6:49 pm, Rainer Weikusat <rweiku...(a)mssgmbh.com> wrote:
>>
>> The most glaring problem with this is that this will (probably, I
>> haven't tested it) allow access to any process whose corresponding
>> binary is named apache2. Try
>>
>> cd /bin
>> ln ed apache2
>> ./apache2 /var/www/index.html
>>
>> as root for a demonstration (assuming /bin/ed exists, of course).
>>
>> You really should be using the existing facilities for extended access
>> control, such as capabilities or one of the MAC-frameworks instead of
>> trying to 'roll your own' in a that crude fashion.- Hide quoted text -
>>
>
> Thank you.
>
> I didn't get the full pathname of filename in the previous code. It
> doesn't handle this situation:
>
> # cd /var
> # vi www/index.html
>
> Did you also mean this point? My new code:


After checking some previous emails in this thread, I think you
should try SELinux or AppArmor, definitely you're going to a wrong
direction.

>
> (I rebuilt the source and reinstalled the kernel successfully on
> debian hosted on VMWare. After I increased memory from 1536M to 2048M
> in VMWare and reboot, I got: Kernel panic: no init found. Try passing
> init= option to kernel. Dunno why.)

Obviously it's nothing to do with your physical memory size.

<snip stupid code>

You are definitely implementing a policy in kernel, and it's too stupid.
Stop.