/*
* Copyright (c) 2012 The Chromium OS Authors.
+ * Copyright (c) 2012-2017 The strace developers.
* Written by Mike Frysinger <vapier@gentoo.org>.
*
* Redistribution and use in source and binary forms, with or without
tprints(", lo_encrypt_type=");
printxval(loop_crypt_type_options, info.lo_encrypt_type,
"LO_CRYPT_???");
- tprintf(", lo_encrypt_key_size=%d", info.lo_encrypt_key_size);
+ /*
+ * It is converted to unsigned before use in kernel, see
+ * loop_info64_from_old in drivers/block/loop.c
+ */
+ tprintf(", lo_encrypt_key_size=%" PRIu32,
+ (uint32_t) info.lo_encrypt_key_size);
}
tprints(", lo_flags=");
if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) {
tprints(", lo_encrypt_key=");
print_quoted_string((void *) info.lo_encrypt_key,
- LO_KEY_SIZE, 0);
+ MIN((uint32_t) info.lo_encrypt_key_size,
+ LO_KEY_SIZE), 0);
}
if (!abbrev(tcp))
LO_NAME_SIZE, QUOTE_0_TERMINATED);
tprints(", lo_encrypt_key=");
print_quoted_string((void *) info64.lo_encrypt_key,
- LO_KEY_SIZE, 0);
+ MIN(info64.lo_encrypt_key_size,
+ LO_KEY_SIZE), 0);
}
if (!abbrev(tcp))
struct tcb *tcp, const unsigned int code,
const kernel_ulong_t arg)
{
- if (!verbose(tcp))
- return RVAL_DECODED;
-
switch (code) {
case LOOP_GET_STATUS:
if (entering(tcp))