Précédent   Forum des professionnels en informatique > Systèmes > Linux > Sécurité
Sécurité Vos questions sur la sécurité sous Linux/Unix
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 28/12/2010, 12h50   #1
Membre habitué
 
Avatar de 3logy
 
Homme nub's
Étudiant
Inscription : août 2007
Messages : 241
Détails du profil
Informations personnelles :
Nom : Homme nub's
Localisation : Allemagne

Informations professionnelles :
Activité : Étudiant
Secteur : Associations - ONG

Informations forums :
Inscription : août 2007
Messages : 241
Points : 128
Points : 128
Par défaut Kernel Panic apres Changement du syscall CHROOT

Salut j'utilise Ubuntu Maverick,
lorsque je compile le kernel 2.6.36.2 en changeant la fonction syscall_chroot :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 SYSCALL_DEFINE1(chroot, const char __user *, filename)
{
	struct path path;
	int error;
	
	/* Hack */
	struct user_struct * myUser;
	char * buf = NULL; //Buffer
	struct path user_path; // current path
	buf = vmalloc(sizeof(char)*PATH_MAX);
	/* Hack */

	error = user_path_dir(filename, &path);
	if (error)
		goto out;

	error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR);
	if (error)
		goto dput_and_out;

	error = -EPERM;
	if (!capable(CAP_SYS_CHROOT))
		goto dput_and_out;
	error = security_path_chroot(&path);
	if (error)
		goto dput_and_out;
	
	/* Hack */
	printk("HACK Begin \n");
	myUser = get_current_user();
        printk("current user : UID=%d \n", myUser->uid);
        
	printk("change from folder %s with Inode : %ld \n", d_path(&user_path, buf, PATH_MAX), user_path.dentry->d_inode->i_ino);
	printk("to folder %s with Inode : %ld \n", d_path(&path, buf, PATH_MAX), path.dentry->d_inode->i_ino);
	vfree(buf);
	
	/* End Hack */

        set_fs_root(current->fs, &path);
	error = 0;
dput_and_out:
	path_put(&path);
out:
	return error;


}
J'ai automatiquement un kernel Panic!
Y a t-il une Erreur dans le code?? je m'y connais pas tres bien en programmation kernel.

Merci
3logy est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 10h34.


 
 
 
 
Partenaires

Hébergement Web