From patchwork Mon Oct 21 11:48:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11202049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 293FC1390 for ; Mon, 21 Oct 2019 11:51:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3AA620659 for ; Mon, 21 Oct 2019 11:51:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nuDilwro" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3AA620659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:38986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMWDH-0007Iq-JR for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Oct 2019 07:51:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52716) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMWBW-0005UE-ID for qemu-devel@nongnu.org; Mon, 21 Oct 2019 07:49:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMWBR-00039U-PB for qemu-devel@nongnu.org; Mon, 21 Oct 2019 07:49:13 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:37096) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMWBP-000381-EN for qemu-devel@nongnu.org; Mon, 21 Oct 2019 07:49:09 -0400 Received: by mail-wr1-x444.google.com with SMTP id e11so4889576wrv.4 for ; Mon, 21 Oct 2019 04:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vNMFynTjAmTxUUIwIswr/6MOiNNDJT5kgZOoy66ko1A=; b=nuDilwroNJijyV1WSInoXJb25iNFWyRxRGMtDGhqvLqjpMAkuCjMQDHLGOTfW8BTKG XSeXLYlV3YZpHJk1vtwtQzyWEscD3yV3OWaYMAw2zfNlKwXyrpveb5ehmaYi6r4D8fWS +6wSdTZpwE/erOseZecq86W68SxW7l1ezu7CSzuwN4Ha96g7U0Ji+nRvAiSianxG7vOW q4IENIO+3Ps2mH9UdYDrNTimZ0EgGy3IBzWy8zFAgenL8Wmjm3VD13HRbT4nfCDkj9kq w48tLEbg0pAQPmPJ3063+n2jhRNS0DE9DHkffbVAtqTCwN+1jZbeoQfErFYyLWCESEGl oOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vNMFynTjAmTxUUIwIswr/6MOiNNDJT5kgZOoy66ko1A=; b=JpcZRExNU3uMWK6l0wIuj2NYtiddvy7fJgaerMKVrMvzRY8eu2jYLE0JR3Glkn4wmP lJuoUHNCBFxeoto6wfFJmEXaqG/iXxE2t1UB66/vd2V3gsPnXLBnCRiDZ8gEziPok3FA 1DuM9wAawLntPE+kKKlkdqQfNfgfLfuW30Zozf01u71Ofau0kB4hRPyFG1GWUPA6R0Un AynCEXp77+f6EuUld7CIbCclNkMyk23rScPnSQvWNlnUcTBaukgZcQrqMiKuHMxTWjXx 3FGGNMVjfgGdZFUOob2lrRfNzlpvRL+OjzR5WLeMQeJfbLf26vV1scl4LMCqKAb6AUeX Bzlg== X-Gm-Message-State: APjAAAUaoKJUKoVTZ7lLrS3d9t0p+jHVq/ZTviIQas7lUD7IHMZBB9D9 RXJm2xON4oYPbeg+fGfYapudXVLX X-Google-Smtp-Source: APXvYqwVJ0air9VZ4mVA/BMhrx7laBNxaLO2+49JsWC8jmbYilD1ZO6xWaEVrDSnfM+m7di9g8w/Tw== X-Received: by 2002:a05:6000:149:: with SMTP id r9mr14753575wrx.90.1571658541947; Mon, 21 Oct 2019 04:49:01 -0700 (PDT) Received: from localhost.localdomain (129.red-83-57-174.dynamicip.rima-tde.net. [83.57.174.129]) by smtp.gmail.com with ESMTPSA id x5sm17156137wrt.75.2019.10.21.04.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 04:49:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 1/9] linux-user/strace: Display invalid pointer in print_timeval() Date: Mon, 21 Oct 2019 13:48:49 +0200 Message-Id: <20191021114857.20538-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191021114857.20538-1-f4bug@amsat.org> References: <20191021114857.20538-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Suggested-by: Laurent Vivier Reviewed-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- linux-user/strace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index c80e93b5db..f326c357a2 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1243,8 +1243,10 @@ print_timeval(abi_ulong tv_addr, int last) struct target_timeval *tv; tv = lock_user(VERIFY_READ, tv_addr, sizeof(*tv), 1); - if (!tv) + if (!tv) { + print_pointer(tv_addr, last); return; + } gemu_log("{" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "}%s", tswapal(tv->tv_sec), tswapal(tv->tv_usec), get_comma(last)); unlock_user(tv, tv_addr, 0);