Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1933084ybv; Sat, 8 Feb 2020 09:13:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzqAg07q4wriDrNPMoGOtYPUQtu6g6WDOnEKwNaSdbN1BX3uqc425OM7QqSbav3eh10FecY X-Received: by 2002:a9d:7d87:: with SMTP id j7mr3903543otn.159.1581181984194; Sat, 08 Feb 2020 09:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581181984; cv=none; d=google.com; s=arc-20160816; b=pUo3FIb5AZh4exegPtNb4N88C5xYDSChHubdakMcaLTDfFN/JRf8USYVvA3z+XeOI3 MTyCdj48f0Y2mEB49idf9F+B/78lAuZYF2r6VLbHRl8q4owjbXtxI/yqUlVIdgcUfrWQ 5pCGQg0hXfX6OkZJgWkfS4crZ4J0U/XmtMvsq3MjCBvtdpcB9crsraZzi1nhNDFJUQSX LOLtFmopLNyhP3Z7WU5e/0XKLOhyoTuN4pw1LeOmULLBZEOtuI7x/e5zc5R71BcRRbt/ q/9bz5DG9u+KubcZdT3q3oYWBDVd/muU7rM1Jl7Jpz7jaM7Aic035TFkq922dppoJvX9 36Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YD1lho2uBiFfgje3vY86cE2s7Be2NhAx8ao7Z4azKF8=; b=Dz3LFv5yCq/ROVOvpTiLPKgdmT99llqJ8nJ+z4QJgbKshp6z/Lrgfgt83V+m8yn/0V VQIFWw4h5Nc64e+Pf82q7ULZpGR5BSnvuFd8pNEnBA0R9uMdkmlokiRUenUSLbnt5kEv HV8aBkQ7u8kAjv3m7vBlVUASVBenNhsNSRNnypIxwn2enkF9irkItmXOy6CEKfzs951+ SVinaZJSkqRdKtxy1tm89c0TV2Z3GLa3FoQYuM1fN/i9YgQsk2rAapGxKHAq26QaG20n CYJnPNU/5zBvk3NLbSbHlpbhVAU/Hdy0+WJaEyeHUrRRXPfBPdAIRReDkPUh1JeqEkYj aTsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I61HMxdl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b191si5914905oii.266.2020.02.08.09.12.40; Sat, 08 Feb 2020 09:13:04 -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=@google.com header.s=20161025 header.b=I61HMxdl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbgBHRMf (ORCPT + 99 others); Sat, 8 Feb 2020 12:12:35 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39671 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbgBHRMf (ORCPT ); Sat, 8 Feb 2020 12:12:35 -0500 Received: by mail-pg1-f193.google.com with SMTP id j15so1508023pgm.6 for ; Sat, 08 Feb 2020 09:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YD1lho2uBiFfgje3vY86cE2s7Be2NhAx8ao7Z4azKF8=; b=I61HMxdlwT05pwtKmeeU8+SUq4o970AFpSI9vYmhWG7LNFzWwqMvdBvdUQJXerJ/75 718WtHd61dh3svU3LDow31w9U0Q3GpxBRn+Vp2al4NiNWcVBJgYsz59+irONFUX/gVus 0bdnafXobtYBKgT800FQVwpC/KI+SuxuAnwFTApwZl9+Lfm4M4EKbZagJgN+poZvAj+v i1bCAtVcfEa2Bkb0VUzkV+Q06vQLZqZhVWhkOZWtgduSqRhenzTHqxtKfZEScyQKsrlu T7t6QmXR8mJKossLEOSUmxpe37cP6OhZy2BcvHjIS+XUvilGxEswnc9gbKbVbAqoIr/i u+8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YD1lho2uBiFfgje3vY86cE2s7Be2NhAx8ao7Z4azKF8=; b=QJbmS3OGyjgvD2jOlt/wZ3yme47HKPYnh6gq+UUeumNYWsFJxJmIdpzfMZ2nYnWcSH 5kj+PA+98dSqKnL/3HpsXh110Laqz/hfRwOeRYMR4fqkApVuAuUgyUp6MeSrj/cBgGFP /lsFpyTJe0NKa0knY6a+Fw8rpWG72WhrOxXs2rWoo4Q4n0chOM+RbfW5l6+n8Niv79UJ gqiSMHJwW8zQ4Evvh7CbxKliXi2pNfPC2sjPU9/IFcU3MN0zIFDZpqOg/bQ7xtbMfWBw SQ4kNIctSyg7J1Tlm5TuJ//0WNU6YQZWh2ZALGb6nxroQLz08NLp/QRVBAV/XQTUnquW hfSw== X-Gm-Message-State: APjAAAW4TXfJiDbtNWOj3lNI93QRX2BRTI8P3Gi22A1EBTx74I6H1MDY Yf53pOAkBPuVRyEp+88ncu5WM7EdAxjtnv0f7LbaGQ== X-Received: by 2002:aa7:8618:: with SMTP id p24mr5122092pfn.3.1581181954133; Sat, 08 Feb 2020 09:12:34 -0800 (PST) MIME-Version: 1.0 References: <20200208141052.48476-1-natechancellor@gmail.com> In-Reply-To: <20200208141052.48476-1-natechancellor@gmail.com> From: Nick Desaulniers Date: Sat, 8 Feb 2020 17:12:21 +0000 Message-ID: Subject: Re: [PATCH] s390/kaslr: Fix casts in get_random To: Nathan Chancellor Cc: Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390 , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 8, 2020 at 3:11 PM Nathan Chancellor wrote: > > 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 Thanks for the patch! Reviewed-by: Nick Desaulniers > --- > 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 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200208141052.48476-1-natechancellor%40gmail.com. -- Thanks, ~Nick Desaulniers