Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1796526ybv; Sat, 8 Feb 2020 06:12:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwsXMraTimL6KDu+A3nnq/x5pSjKDfaBxhYvYGgDLmeVcAQWjTsUlvjRDiwBjOcGdOd/9GU X-Received: by 2002:a9d:65cf:: with SMTP id z15mr3712365oth.238.1581171143670; Sat, 08 Feb 2020 06:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581171143; cv=none; d=google.com; s=arc-20160816; b=xZaGGuLOMgjNfvFcgz2UeZP7TKHiGqnTGjvloK9TAESY1hplC9uIse8tW+fb++915p aDe4Tsua9tGpiYt/+jep76by6YV+/oRLjJgyvcWvSYrpnDE+YasmEMgAoJY+cK22oB/A 3M3CEEXC72RhfeU7RtBi+NqwrKEAYnCEslFfU/xmTg9XuNWyApBuYQCJnEMoTIQkAzO9 n+VU1kXQSUjBYip5TiRdp7G6Om1K+DkPWp1rExkI+zZxc2xfh+bCSJBUozMCxpa/xWTH 21++lC+0V7UdJZhTtuyqGcYB/6FGRHmpXZStdFc7GnYYuNExhVf/NB7fW1HEvPr30joc OSaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cWwOu9a6Z1tLizrwqoz4gJCJrtA9tbQqyQC9xeUEbAk=; b=cDbjt0d1LfeXTlPcWrB3KK6lwm121CNHM92TnYdmX0oZjYx55Q+7/r/DDYS5GistC7 uUahJGHqULYorMJF8uTlfrGjt8+i8XcM/Xdey9mnBvyHVyq1CXJXNaC2v6lJ4PI/x/+B No8wVefqc5LhNpdR0P3EyDsHdbMLQsQNvbTaEhgBaDldHLY9bMrmYDBxt2HboMnz0YiD f6aOgmaHMM0H6d1/RdF+V4JKWlDM/GYfW6QDTjTubpDqAooJESFtNfYe6vW6ttkc8fHA vmrjFqdMZrZPK0L30qTYj4CcZCRKzK6nYa9tbyDZSibHjmyacDs1o8W+V7qTaE0erDqu Zf2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IhgngSOU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si1552382otr.202.2020.02.08.06.12.12; Sat, 08 Feb 2020 06:12:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IhgngSOU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbgBHOLJ (ORCPT + 99 others); Sat, 8 Feb 2020 09:11:09 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42848 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbgBHOLJ (ORCPT ); Sat, 8 Feb 2020 09:11:09 -0500 Received: by mail-ot1-f65.google.com with SMTP id 66so2053864otd.9; Sat, 08 Feb 2020 06:11:08 -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:mime-version :content-transfer-encoding; bh=cWwOu9a6Z1tLizrwqoz4gJCJrtA9tbQqyQC9xeUEbAk=; b=IhgngSOUWZuvS1yoCpBIkBgYZSyuHDMJxKhnvk+9BKkLidnOBtpGJ2UYyjuXV49rtx Y7QKwAzxZQHMYk1aOqyHV93VNWOd/cuOuh1zsHex5pBJnBP7Qz3qh1cwExoQfwGJwOnl AY4Fjocfx7JqExG7KllMr+Q8w4PzGI+fzGTheyLHi91hFNrEHKqpxhBOkFCX58ghhrZ7 O5+Cv+qa2eqDfsZs+1NFITd/XiyY0eRNSfF96tSCDpSIuXjjS7qf3On2Ci20nGG0jKL3 KwdYlEh54/XhY6ALIDTam4B9xD0+dQu9Tw8OaV5nqf+myj/cO2H5yG/4kbrrVzCH0rVn wAbg== 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:mime-version :content-transfer-encoding; bh=cWwOu9a6Z1tLizrwqoz4gJCJrtA9tbQqyQC9xeUEbAk=; b=ebzIAw0F53vj7ygxlsEqd+2OM0ERdotPgGS8ddPILdVTkxvdzg7NTW9JTBBT+79pNI vQe90hVFZuenynlRgbhS4V7lumzRnlGyoTIAh6xKIHCEiadP/KalwgReuSVO+BCMwEa/ ICHrUnlSCQLOa37/0ySyTlHKNZWMKo4antb0KTSjk1JQM9TzwJ7HQItW6EjmW1QXYEUP mDo0D1QQUTkCs9xJwCPJlBXuP2ZZ0iy0lx1dGrm5wDaP9JePIMRtUl4iI5M82ZwLs8bP g4rG04d8FGZe+NDi2Ftn5zneZgGnheO0dNcL92B7/PwE1ZKn5f6yW6H19eq4HAQ54GXW jU4Q== X-Gm-Message-State: APjAAAU+gRnJnHv5PT0Zq2LJsXuATXPMp0N1vQ8p+aBrai675j1jun0h u1C5YAW35y3KQHDK+fQ4KSM= X-Received: by 2002:a9d:6212:: with SMTP id g18mr3705409otj.187.1581171068359; Sat, 08 Feb 2020 06:11:08 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c36sm2294461otb.55.2020.02.08.06.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2020 06:11:08 -0800 (PST) From: Nathan Chancellor To: Heiko Carstens , Vasily Gorbik , Christian Borntraeger Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] s390/kaslr: Fix casts in get_random Date: Sat, 8 Feb 2020 07:10:52 -0700 Message-Id: <20200208141052.48476-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: ../arch/s390/boot/kaslr.c:78:25: warning: passing 'char *' to parameter of type 'const u8 *' (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign] (char *) entropy, (char *) entropy, ^~~~~~~~~~~~~~~~ ../arch/s390/include/asm/cpacf.h:280:28: note: passing argument to parameter 'src' here u8 *dest, const u8 *src, long src_len) ^ 2 warnings generated. Fix the cast to match what else is done in this function. Fixes: b2d24b97b2a9 ("s390/kernel: add support for kernel address space layout randomization (KASLR)") Link: https://github.com/ClangBuiltLinux/linux/issues/862 Signed-off-by: Nathan Chancellor --- arch/s390/boot/kaslr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/boot/kaslr.c b/arch/s390/boot/kaslr.c index 5d12352545c5..5591243d673e 100644 --- a/arch/s390/boot/kaslr.c +++ b/arch/s390/boot/kaslr.c @@ -75,7 +75,7 @@ static unsigned long get_random(unsigned long limit) *(unsigned long *) prng.parm_block ^= seed; for (i = 0; i < 16; i++) { cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block, - (char *) entropy, (char *) entropy, + (u8 *) entropy, (u8 *) entropy, sizeof(entropy)); memcpy(prng.parm_block, entropy, sizeof(entropy)); } -- 2.25.0