On Wed, Jan 21, 2026 at 01:37:10PM +0000, Jonathan Cameron wrote:
> On Wed, 21 Jan 2026 12:25:18 +0100
> Mauro Carvalho Chehab <[email protected]> wrote:
> 
> > Add a command to inject random errors for fuzzy logic testing.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> Seems reasonable, but maybe some more text in the description on
> what types of fuzzy records it generates?  I.e. what is constrained
> or at least starts as being standard values vs what is entirely random

I'll improve at the next version. By default, it just randomly picks
a valid GUID from the lis, and selects a default size that would be
a valid choice.

There is a parameter to force it to use an specific type:

    $ ghes_inject.py fuzzy -h

    Inject fuzzy test CPER packets

    options:
      -h, --help            show this help message and exit

    Fuzz testing error inject:
      -T, --type TYPE       Type of the error: 
proc-generic,proc-x86,proc-itanium,proc-arm,platform-mem,platform-mem2,pcie,pci-bus,pci-dev,firmware-error,dma-generic,dma-vt,dma-iommu,ccix-per,cxl-prot-err,cxl-evt-media,cxl-evt-dram,cxl-evt-mem-module,cxl-evt-mem-sparing,cxl-evt-phy-sw,cxl-evt-virt-sw,cxl-evt-mdl-port,cxl-evt-dyna-cap,fru-mem-poison
      --min-size MIN_SIZE   Minimal size of the CPER
      --max-size MAX_SIZE   Maximal size of the CPER
      -z, --zero            Zero all bytes of the CPER payload (default: False)
      -t, --timeout TIMEOUT
                            Specify timeout for CPER send retries (default: 
30.0 seconds)
      -d, --delay DELAY     Specify a delay between multiple CPER (default: 0)
      -c, --count COUNT     Specify the number of CPER records to be sent 
(default: 1)

and parameters to allow it to mangle with the payload size.

When -T is not used, it randomly pics a valid GUID. When it is
used, all injected packages will have the same type.

Right now, the fuzzy-testing is mangling just with the CPER
payload, so GUIDs are valid. see:


  $ ghes_inject.py -d fuzzy
  Injecting cxl-evt-dyna-cap with 64 bytes
  GUID: ca95afa7-f183-4018-8c2f-95268e101a2a
  Generic Error Status Block (20 bytes):
      00000000  01 00 00 00 00 00 00 00 00 00 00 00 88 00 00 00   
................
      00000010  00 00 00 00                                       ....

  Generic Error Data Entry (72 bytes):
      00000000  a7 af 95 ca 83 f1 18 40 8c 2f 95 26 8e 10 1a 2a   
.......@./.&...*
      00000010  00 00 00 00 00 03 00 00 40 00 00 00 00 00 00 00   
........@.......
      00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
................
      00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
................
      00000040  00 00 00 00 00 00 00 00                           ........

  Payload (64 bytes):
      00000000  32 ba ed 9c 1f ea ac cd 8c 8f 44 7b ab 4b c1 8f   
2.........D{.K..
      00000010  68 32 8a c1 07 dd 0f 93 54 de 09 a8 42 79 80 1f   
h2......T...By..
      00000020  f4 e8 0c 85 02 2d 0b 7d f5 64 32 8e 3b d6 f1 6b   
.....-.}.d2.;..k
      00000030  73 39 97 00 54 30 aa e6 39 f0 5d 95 1c b1 cd 0f   
s9..T0..9.].....

The first two tables (GESB and GEDE) aren't randomized, and the GUID is always
a valid one. Jus the payload contains either random numbers (default) or are 
always zero:

  $ ghes_inject.py -d fuzzy -z
  Injecting cxl-evt-media with 32 bytes
  GUID: fbcd0a77-c260-417f-85a9-088b1621eba6
  Generic Error Status Block (20 bytes):
      00000000  01 00 00 00 00 00 00 00 00 00 00 00 68 00 00 00   
............h...
      00000010  00 00 00 00                                       ....

  Generic Error Data Entry (72 bytes):
      00000000  77 0a cd fb 60 c2 7f 41 85 a9 08 8b 16 21 eb a6   
w...`..A.....!..
      00000010  00 00 00 00 00 03 00 00 20 00 00 00 00 00 00 00   ........ 
.......
      00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
................
      00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
................
      00000040  00 00 00 00 00 00 00 00                           ........

  Payload (32 bytes):
      00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
................
      00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
................

-- 
Thanks,
Mauro

Reply via email to