Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
Null pointer dereference in User space and kernel space

what will happen if we dereference the null pointer in user space and kernel space?

From my understanding the behaviour is based on compiler,architecture,etc.

but in general for every user space program allocated with virtual memory and the paging is used to translate the virtual address to physical address using page tables.

so if we are dereferencing null pointer in user space,that address is invalid so the context switch will happen and in kernel based on the interrupt for this null pointer dereference 'Segmentation fault will come or page fault error will come'.

In Kernel space:

If we dereference the NULL pointer there is a possibility of crashing the system or kernel may not able to return from that call.

Is my understanding correct?or any other informations missing means please explain.

Ref:I have understood from this "What happens in OS when we dereference a NULL pointer in C?"

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The kernel maps the page at virtual address 0 into all processes with no permission bits set. When you try to access that page, you get a page fault. The kernel routine that handles it issues a SIGSEGV signal to your process. If you have no handler for SIGSEGV registered, core is dumped and you see your "Segmentation fault" message.

Kernel side, things are a bit different. After all, the kernel is supposed to be robust:

  • If the dereference happens and recovery is possible (e.g. your trackpad driver did the offence), a kernel oops is generated. The kernel continues running (for now).
  • If the dereference occurs so that no recovery is possible, the Oops leads to a kernel panic. Reboot necessary.
  • If for some reason, there is data mapped at page zero, you will corrupt memory. Which could lead to a panic down the way, go unnoticed or even be abused for a privilege escalation attack.
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda