~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/xfree86/int10/pci.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.12 2002/04/04 14:05:51 eich Exp $ */
 
2
 
 
3
/*
 
4
 *                   XFree86 int10 module
 
5
 *   execute BIOS int 10h calls in x86 real mode environment
 
6
 *                 Copyright 1999 Egbert Eich
 
7
 */
 
8
#include "xf86Pci.h"
 
9
#include "xf86.h"
 
10
#include "xf86_ansic.h"
 
11
#define _INT10_PRIVATE
 
12
#include "xf86int10.h"
 
13
 
 
14
int
 
15
mapPciRom(int pciEntity, unsigned char * address)
 
16
{
 
17
    PCITAG tag;
 
18
    unsigned char *mem, *ptr;
 
19
    int length;
 
20
    
 
21
    pciVideoPtr pvp = xf86GetPciInfoForEntity(pciEntity);
 
22
 
 
23
    if (pvp == NULL) {
 
24
#ifdef DEBUG
 
25
        ErrorF("mapPciRom: no PCI info\n");
 
26
#endif
 
27
        return 0;
 
28
    }
 
29
 
 
30
    tag = pciTag(pvp->bus,pvp->device,pvp->func);
 
31
    length = 1 << pvp->biosSize;
 
32
 
 
33
    /* Read in entire PCI ROM */
 
34
    mem = ptr = xnfcalloc(length, 1);
 
35
    length = xf86ReadPciBIOS(0, tag, -1, ptr, length);
 
36
    if (length > 0)
 
37
        memcpy(address, ptr, length);
 
38
    /* unmap/close/disable PCI bios mem */
 
39
    xfree(mem);
 
40
 
 
41
#ifdef DEBUG
 
42
    if (!length)
 
43
        ErrorF("mapPciRom: no BIOS found\n");
 
44
#ifdef PRINT_PCI
 
45
    else
 
46
        dprint(address,0x20);
 
47
#endif
 
48
#endif
 
49
 
 
50
    return length;
 
51
}