From patchwork Thu Nov 28 06:24:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1201923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NnvX1tvDz9s7T for ; Thu, 28 Nov 2019 17:35:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MjmrR+pS"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47NnvW5D7nzDr0f for ; Thu, 28 Nov 2019 17:35:35 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::443; helo=mail-pf1-x443.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MjmrR+pS"; dkim-atps=neutral Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47NnjS3YFwzDqZ2 for ; Thu, 28 Nov 2019 17:26:52 +1100 (AEDT) Received: by mail-pf1-x443.google.com with SMTP id x28so12618964pfo.6 for ; Wed, 27 Nov 2019 22:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0jfOwWndtRM4WkUUBqx/4oIughBUbwLkxds7UWNOfKc=; b=MjmrR+pSsCT21UeOOLo5fLGlZTY466+iJyKYGZWevrm6pB78B6BOF5SwL+ryHWiovP DGA4iz0oyPkr+zXcEjdzrjgeD/+PMTQPPGoYKXCaRWMd7bvBZJwnk3mAGBbM3Gmf18Gd HJIx4OJ//N5BqpcVFP+qmvZpcMTJHuJIFMkOFlP4Qvw0/dd0RQlqFCB2q73VC6l13gXl 4R94xcO9sqT5IQ48uD4ZB/klP31EhxYwU1c0xWSM06viZz9CAAnFNpkoDdKvpbgo/yzY O7Vx6WRNpdUjjEpX228b8NJrtkN0fzjx3kFY69tmXtQgHIyTRLk6lPi7056uPianSjU8 Z8sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0jfOwWndtRM4WkUUBqx/4oIughBUbwLkxds7UWNOfKc=; b=aq+fiWCyVJNozWJ7Pfu65DxBr353vO329Q41U5JBtjCvGOBCbwdEYhJL4aoVadFSJo viBhQDZHpJUPnMb0+z1WtNxOJyzR2nlejOxX707WnANCc1lBlKU5kbe4ZD0mzyzP1vW2 hKK75tHeFCm+h2bS2SAwI677LiNE+i+UaIxntP7Fweziuh2HtoU5fSOmUejNXdxio1jD bqNG2Y1t6Ef0yjQjmpFApPex9qqLLwseY+AAbFp8Ukk0RDg+DHzUGnXJ73G3hgHna29U M3A/aKN1365TrI+6hDZZMWgZ++dofoXpfi8cKyYySqh2+GG1GA9SwyxN9Xv02xbw/ERk Vnpw== X-Gm-Message-State: APjAAAXcWvY4fi4Bc5xqsDEcIp6jowsKSFJdXI7ace5isqtQsknNrftO we2sqIeiSNzAFLlmU6iWN/QMvhKwHtA= X-Google-Smtp-Source: APXvYqwoo0WHyVl9ZHj5ddduoU0hRc4qcFvKAZ4bNQJiRG0PAGDrFdBx05qbGW1R3hvWJhN+Fq65Tw== X-Received: by 2002:a65:5608:: with SMTP id l8mr9362953pgs.135.1574922410579; Wed, 27 Nov 2019 22:26:50 -0800 (PST) Received: from bobo.local0.net ([203.194.47.34]) by smtp.gmail.com with ESMTPSA id e5sm8463196pjv.29.2019.11.27.22.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 22:26:50 -0800 (PST) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Thu, 28 Nov 2019 16:24:42 +1000 Message-Id: <20191128062442.20690-29-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128062442.20690-1-npiggin@gmail.com> References: <20191128062442.20690-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v8 28/28] i2c: fix wild dereference X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The contents of the buffer is not initialized in the case of a read, and not even necessarily at least 8 bytes long. It seems like the address is what's wanted. Signed-off-by: Nicholas Piggin --- core/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/i2c.c b/core/i2c.c index 6bae83b42..89231e5f9 100644 --- a/core/i2c.c +++ b/core/i2c.c @@ -173,10 +173,10 @@ int64_t i2c_request_sync(struct i2c_request *req) req->req_state = i2c_req_new; } - prlog(PR_DEBUG, "I2C: %s req op=%x offset=%x buf=%016llx buflen=%d " + prlog(PR_DEBUG, "I2C: %s req op=%x offset=%x buf=%p buflen=%d " "delay=%lu/%lld rc=%lld\n", (rc) ? "!!!!" : "----", req->op, req->offset, - *(uint64_t*) req->rw_buf, req->rw_len, tb_to_msecs(waited), req->timeout, rc); + req->rw_buf, req->rw_len, tb_to_msecs(waited), req->timeout, rc); return rc; }