Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  extable.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
#include <linux/err.h>
#include <linux/mm.h>
#include <asm/current.h>
#include <asm/traps.h>
#include <asm/vdso.h>

struct vdso_exception_table_entry {
 int insn, fixup;
};

bool fixup_vdso_exception(struct pt_regs *regs, int trapnr,
     unsigned long error_code, unsigned long fault_addr)
{
 const struct vdso_image *image = current->mm->context.vdso_image;
 const struct vdso_exception_table_entry *extable;
 unsigned int nr_entries, i;
 unsigned long base;

 /*
 * Do not attempt to fixup #DB or #BP.  It's impossible to identify
 * whether or not a #DB/#BP originated from within an SGX enclave and
 * SGX enclaves are currently the only use case for vDSO fixup.
 */

 if (trapnr == X86_TRAP_DB || trapnr == X86_TRAP_BP)
  return false;

 if (!current->mm->context.vdso)
  return false;

 base =  (unsigned long)current->mm->context.vdso + image->extable_base;
 nr_entries = image->extable_len / (sizeof(*extable));
 extable = image->extable;

 for (i = 0; i < nr_entries; i++) {
  if (regs->ip == base + extable[i].insn) {
   regs->ip = base + extable[i].fixup;
   regs->di = trapnr;
   regs->si = error_code;
   regs->dx = fault_addr;
   return true;
  }
 }

 return false;
}

Messung V0.5
C=96 H=78 G=87

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge