Patch from Daniel Kamil Kozar via BZ#333817.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14107
333428 ldr.w pc [rD, #imm] instruction leads to assertion
333666 Recognize MPX instructions and bnd prefix.
333788 Valgrind does not support the CDROM_DISC_STATUS ioctl (has patch)
+333817 Valgrind reports the memory areas written to by the SG_IO
+ ioctl as untouched
334049 lzcnt fails silently (x86_32)
334705 sendmsg and recvmsg should guard against bogus msghdr fields.
334727 Build fails with -Werror=format-security
PRE_MEM_READ( "ioctl(SG_SET_COMMAND_Q)", ARG3, sizeof(int) );
break;
case VKI_SG_IO:
- PRE_MEM_WRITE( "ioctl(SG_IO)", ARG3, sizeof(vki_sg_io_hdr_t) );
+ PRE_MEM_READ( "ioctl(SG_IO)", ARG3, sizeof(vki_sg_io_hdr_t) );
+ {
+ vki_sg_io_hdr_t *sgio = (vki_sg_io_hdr_t*)ARG3;
+ PRE_MEM_READ( "ioctl(SG_IO)", (Addr)sgio->cmdp, sgio->cmd_len );
+ if ( sgio->dxfer_direction == VKI_SG_DXFER_TO_DEV ||
+ sgio->dxfer_direction == VKI_SG_DXFER_TO_FROM_DEV ) {
+ PRE_MEM_READ( "ioctl(SG_IO)", (Addr)sgio->dxferp, sgio->dxfer_len );
+ }
+ }
break;
case VKI_SG_GET_SCSI_ID:
PRE_MEM_WRITE( "ioctl(SG_GET_SCSI_ID)", ARG3, sizeof(vki_sg_scsi_id_t) );
case VKI_SG_SET_COMMAND_Q:
break;
case VKI_SG_IO:
- POST_MEM_WRITE(ARG3, sizeof(vki_sg_io_hdr_t));
+ {
+ vki_sg_io_hdr_t *sgio = (vki_sg_io_hdr_t*)ARG3;
+ if ( sgio->sbp ) {
+ POST_MEM_WRITE( (Addr)sgio->sbp, sgio->sb_len_wr );
+ }
+ if ( sgio->dxfer_direction == VKI_SG_DXFER_FROM_DEV ||
+ sgio->dxfer_direction == VKI_SG_DXFER_TO_FROM_DEV ) {
+ int transferred = sgio->dxfer_len - sgio->resid;
+ POST_MEM_WRITE( (Addr)sgio->dxferp, transferred );
+ }
+ }
break;
case VKI_SG_GET_SCSI_ID:
POST_MEM_WRITE(ARG3, sizeof(vki_sg_scsi_id_t));
333434 In some weird corner case Valgrind cannot execute
executable files symlinked by /proc/self/fd (related to 331311?)
333051 handling hugepages (is largely broken)
-333817 Valgrind reports the memory areas written to by the SG_IO
- ioctl as untouched
334585 recvmmsg unhandled (+patch) (arm)
=== Debuginfo reader ===================================================
unsigned int info; /* [o] auxiliary information */
} vki_sg_io_hdr_t; /* 64 bytes long (on i386) */
+#define VKI_SG_DXFER_NONE -1 /* e.g. a SCSI Test Unit Ready command */
+#define VKI_SG_DXFER_TO_DEV -2 /* e.g. a SCSI WRITE command */
+#define VKI_SG_DXFER_FROM_DEV -3 /* e.g. a SCSI READ command */
+#define VKI_SG_DXFER_TO_FROM_DEV -4 /* treated like SG_DXFER_FROM_DEV with the
+ additional property than during indirect
+ IO the user buffer is copied into the
+ kernel buffers before the transfer */
+
typedef struct vki_sg_scsi_id { /* used by SG_GET_SCSI_ID ioctl() */
int host_no; /* as in "scsi<n>" where 'n' is one of 0, 1, 2 etc */
int channel;