# pptp: ppp kernel module crashes (NULL pointer dereference )

## tilman

Hi

I am in the process to setup pptp. The goal is to establish a vpn between a htc desire and a linux box.

This fails however in the early stages.

Kernel version:  2.6.34-gentoo-r12 #25 SMP PREEMPT

# modprobe ppp_generic

Killed

```

Nov  6 10:47:14 ztron su[4527]: Successful su for root by tilman

Nov  6 10:47:14 ztron su[4527]: + pts/0 tilman:root

Nov  6 10:47:14 ztron su[4527]: pam_unix(su:session): session opened for user root by tilman(uid=1000)

Nov  6 10:47:33 ztron [  127.784799] PPP generic driver version 2.4.2

Nov  6 10:47:33 ztron [  127.784811] BUG: unable to handle kernel NULL pointer dereference at (null)

Nov  6 10:47:33 ztron [  127.785046] IP: [<f8eaf210>] net_generic+0x1f/0x5a [ppp_generic]

Nov  6 10:47:33 ztron [  127.785132] *pde = 00000000

Nov  6 10:47:33 ztron [  127.785132] Oops: 0000 [#1] PREEMPT SMP

Nov  6 10:47:33 ztron [  127.785132] last sysfs file: /sys/devices/platform/it87.552/name

Nov  6 10:47:33 ztron [  127.785132] Modules linked in: ppp_generic(+) slhc it87 hwmon_vid ipv6 ftdi_sio usbserial pcan usb_storage firewire_ohci k8temp psmouse hwmon firewire_core crc_itu_t i2c_piix4 pcspkr r8169 ehci_hcd ohci_hcd

Nov  6 10:47:33 ztron [  127.785132]

Nov  6 10:47:33 ztron [  127.785132] Pid: 4535, comm: modprobe Not tainted 2.6.34-gentoo-r12 #25 GA-MA78GM-UD2H/GA-MA78GM-UD2H

Nov  6 10:47:33 ztron [  127.785132] EIP: 0060:[<f8eaf210>] EFLAGS: 00010246 CPU: 1

Nov  6 10:47:33 ztron [  127.785132] EIP is at net_generic+0x1f/0x5a [ppp_generic]

Nov  6 10:47:33 ztron [  127.785132] EAX: 00000000 EBX: c1573704 ECX: f6c4afc0 EDX: 00000000

Nov  6 10:47:33 ztron [  127.785132] ESI: 00000001 EDI: f8eb284c EBP: f578bf2c ESP: f578bf24

Nov  6 10:47:33 ztron [  127.785132]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068

Nov  6 10:47:33 ztron [  127.785132] Process modprobe (pid: 4535, ti=f578a000 task=f79daf80 task.ti=f578a000)

Nov  6 10:47:33 ztron [  127.785132] Stack:

Nov  6 10:47:33 ztron [  127.785132]  00000000 f6c4afc0 f578bf38 f8eb60d2 00000000 f578bf50 c12442bd c1573704

Nov  6 10:47:33 ztron [  127.785132] <0> 00000000 f8eb284c f8eb6000 f578bf60 c12443e1 f8eb2880 f8eb284c f578bf70

Nov  6 10:47:33 ztron [  127.785132] <0> c124442e f8eb2880 00000000 f578bf84 f8eb6019 f8eb2273 f8eb2880 00000000

Nov  6 10:47:33 ztron [  127.785132] Call Trace:

Nov  6 10:47:33 ztron [  127.785132]  [<f8eb60d2>] ? ppp_init_net+0xf/0x46 [ppp_generic]

Nov  6 10:47:33 ztron [  127.785132]  [<c12442bd>] ? ops_init+0x5c/0x66

Nov  6 10:47:33 ztron [  127.785132]  [<f8eb6000>] ? ppp_init+0x0/0xc3 [ppp_generic]

Nov  6 10:47:33 ztron [  127.785132]  [<c12443e1>] ? register_pernet_operations+0x47/0x77

Nov  6 10:47:33 ztron [  127.785132]  [<c124442e>] ? register_pernet_device+0x1d/0x45

Nov  6 10:47:33 ztron [  127.785132]  [<f8eb6019>] ? ppp_init+0x19/0xc3 [ppp_generic]

Nov  6 10:47:33 ztron [  127.785132]  [<c1001139>] ? do_one_initcall+0x4c/0x131

Nov  6 10:47:33 ztron [  127.785132]  [<c1058766>] ? sys_init_module+0xa7/0x1db

Nov  6 10:47:33 ztron [  127.785132]  [<c100290c>] ? sysenter_do_call+0x12/0x22

Nov  6 10:47:33 ztron [  127.785132] Code: 97 ff ff ff 8d 65 f4 5b 5e 5f 5d c3 55 89 e5 56 89 d6 53 89 c3 b8 01 00 00 00 e8 e1 7e 42 c8 85 f6 8b 93 b0 04 00 00 74 0b 31 c0 <3b> 32 0f 97 c0 85 c0 74 04 0f 0b eb fe 8b 5c b2 08 b8 01 00 00

Nov  6 10:47:33 ztron [  127.785132] EIP: [<f8eaf210>] net_generic+0x1f/0x5a [ppp_generic] SS:ESP 0068:f578bf24

Nov  6 10:47:33 ztron [  127.785132] CR2: 0000000000000000

Nov  6 10:47:33 ztron [  127.794222] ---[ end trace 0afb9a3ea1d30d32 ]---

Nov  6 10:47:33 ztron [  127.794328] note: modprobe[4535] exited with preempt_count 1

Nov  6 10:47:33 ztron [  127.794451] BUG: scheduling while atomic: modprobe/4535/0x10000002

Nov  6 10:47:33 ztron [  127.794555] Modules linked in: ppp_generic(+) slhc it87 hwmon_vid ipv6 ftdi_sio usbserial pcan usb_storage firewire_ohci k8temp psmouse hwmon firewire_core crc_itu_t i2c_piix4 pcspkr r8169 ehci_hcd ohci_hcd

Nov  6 10:47:33 ztron [  127.794662] Pid: 4535, comm: modprobe Tainted: G      D    2.6.34-gentoo-r12 #25

Nov  6 10:47:33 ztron [  127.794664] Call Trace:

Nov  6 10:47:33 ztron [  127.794667]  [<c1025a68>] __schedule_bug+0x48/0x4d

Nov  6 10:47:33 ztron [  127.794671]  [<c12d2e41>] schedule+0x88/0x5ce

Nov  6 10:47:33 ztron [  127.794675]  [<c12d71dc>] ? __atomic_notifier_call_chain+0x36/0x54

Nov  6 10:47:33 ztron [  127.794678]  [<c12d71f0>] ? __atomic_notifier_call_chain+0x4a/0x54

Nov  6 10:47:33 ztron [  127.794681]  [<c108df17>] ? lru_add_drain+0x83/0x89

Nov  6 10:47:33 ztron [  127.794685]  [<c10a2e5f>] ? free_pages_and_swap_cache+0x44/0x57

Nov  6 10:47:33 ztron [  127.794688]  [<c10275d5>] __cond_resched+0x12/0x1e

Nov  6 10:47:33 ztron [  127.794691]  [<c12d3431>] _cond_resched+0x1e/0x29

Nov  6 10:47:33 ztron [  127.794694]  [<c10994a8>] unmap_vmas+0x569/0x5d1

Nov  6 10:47:33 ztron [  127.794698]  [<c12d4773>] ? _raw_spin_lock_irqsave+0x14/0x2e

Nov  6 10:47:33 ztron [  127.794702]  [<c109c67b>] exit_mmap+0x72/0xcc

Nov  6 10:47:33 ztron [  127.794705]  [<c102cfac>] mmput+0x25/0x9b

Nov  6 10:47:33 ztron [  127.794708]  [<c103054c>] exit_mm+0xe7/0xef

Nov  6 10:47:33 ztron [  127.794711]  [<c12d44e5>] ? _raw_spin_unlock_irq+0x2a/0x2c

Nov  6 10:47:33 ztron [  127.794714]  [<c1031ac0>] do_exit+0x1d4/0x670

Nov  6 10:47:33 ztron [  127.794716]  [<c102f954>] ? kmsg_dump+0xe4/0xf8

Nov  6 10:47:33 ztron [  127.794719]  [<c102ec7b>] ? oops_exit+0x2a/0x2f

Nov  6 10:47:33 ztron [  127.794722]  [<c12d5a0d>] oops_end+0x92/0x9a

Nov  6 10:47:33 ztron [  127.794727]  [<c101c8b7>] no_context+0x114/0x11e

Nov  6 10:47:33 ztron [  127.794730]  [<c101c9f1>] __bad_area_nosemaphore+0x130/0x138

Nov  6 10:47:33 ztron [  127.794734]  [<c1006f16>] ? native_sched_clock+0x42/0x7d

Nov  6 10:47:33 ztron [  127.794739]  [<c1048a35>] ? sched_clock_local+0x17/0x105

Nov  6 10:47:33 ztron [  127.794743]  [<c101ca06>] bad_area_nosemaphore+0xd/0x10

Nov  6 10:47:33 ztron [  127.794745]  [<c12d6f25>] do_page_fault+0x13e/0x287

Nov  6 10:47:33 ztron [  127.794748]  [<c12d6de7>] ? do_page_fault+0x0/0x287

Nov  6 10:47:33 ztron [  127.794751]  [<c12d510a>] error_code+0x66/0x6c

Nov  6 10:47:33 ztron [  127.794754]  [<c12d6de7>] ? do_page_fault+0x0/0x287

Nov  6 10:47:33 ztron [  127.794759]  [<f8eaf210>] ? net_generic+0x1f/0x5a [ppp_generic]

Nov  6 10:47:33 ztron [  127.794764]  [<f8eb60d2>] ppp_init_net+0xf/0x46 [ppp_generic]

Nov  6 10:47:33 ztron [  127.794766]  [<c12442bd>] ops_init+0x5c/0x66

Nov  6 10:47:33 ztron [  127.794771]  [<f8eb6000>] ? ppp_init+0x0/0xc3 [ppp_generic]

Nov  6 10:47:33 ztron [  127.794774]  [<c12443e1>] register_pernet_operations+0x47/0x77

Nov  6 10:47:33 ztron [  127.794777]  [<c124442e>] register_pernet_device+0x1d/0x45

Nov  6 10:47:33 ztron [  127.794782]  [<f8eb6019>] ppp_init+0x19/0xc3 [ppp_generic]

Nov  6 10:47:33 ztron [  127.794784]  [<c1001139>] do_one_initcall+0x4c/0x131

Nov  6 10:47:33 ztron [  127.794787]  [<c1058766>] sys_init_module+0xa7/0x1db

Nov  6 10:47:33 ztron [  127.794790]  [<c100290c>] sysenter_do_call+0x12/0x22

```

Any advices ?

Thanks

Tilman

----------

## roarinelk

first of all, try a more recent kernel version, and if the error persists, report it to

the linux-kernel mailinglist.

----------

## tilman

I build a linux-3.0.8 kernel. The ppp_generic no longer crashes if the client connects. The server however terminates the connection pretty quickly. Error message is "MPPE required but not available".  From what I gather from the how-to bleow, the pptpd installation and the kernel module ppp_mppe are likely not matching.

I am not sure what to do next -- can anybody help ?

Here the link that suggest that kernel module version and pptpd might not match

http://pptpclient.sourceforge.net/howto-diagnosis.phtml#pppd_options

#pppd --version

pppd version 2.4.4

#modinfo ppp_mppe

filename:       /lib/modules/3.0.8/kernel/drivers/net/ppp_mppe.ko

version:        1.0.2

alias:          ppp-compress-18

license:        Dual BSD/GPL

description:    Point-to-Point Protocol Microsoft Point-to-Point Encryption support

author:         Frank Cusack <fcusack@fcusack.com>

srcversion:     6A5CE8D947D7C37F9EBE4B7

depends:        ppp_generic

vermagic:       3.0.8 SMP mod_unload K8

/var/log/messages:

```

Nov 20 21:50:48 ztron pppd[11031]: sent [CHAP Success id=0x3d "Access granted"]

Nov 20 21:50:48 ztron pppd[11031]: MPPE required, but MS-CHAP[v2] auth not performed.

Nov 20 21:50:48 ztron pppd[11031]: [b]sent [LCP TermReq id=0x2 "MPPE required but not available"][/b]

Nov 20 21:50:48 ztron pppd[11031]: rcvd [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]

Nov 20 21:50:48 ztron pppd[11031]: Discarded non-LCP packet when LCP not open

Nov 20 21:50:48 ztron pppd[11031]: rcvd [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]

Nov 20 21:50:48 ztron pppd[11031]: Discarded non-LCP packet when LCP not open

Nov 20 21:50:48 ztron pppd[11031]: rcvd [LCP TermAck id=0x2]

Nov 20 21:50:48 ztron pppd[11031]: Connection terminated.

Nov 20 21:50:48 ztron pppd[11031]: Connect time 0.0 minutes.

Nov 20 21:50:48 ztron pppd[11031]: Sent 0 bytes, received 0 bytes.

```

Thanks

Tilman

----------

## tilman

I seemed to have it working. I am not sure what exactly did the trick.

a) I emptied /etc/ppp/options to ensure that there is not interference of options set in /etc/ppp/options.pptpd

b) I set local in remote ip in /etc/pptpd.conf. Remote and local ip need to be in the same network

The error message "MPPE required but not available" is missleading...

Regards

Tilman

----------

