From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3534C433FE for ; Thu, 17 Nov 2022 22:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241133AbiKQWA5 (ORCPT ); Thu, 17 Nov 2022 17:00:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241061AbiKQWAm (ORCPT ); Thu, 17 Nov 2022 17:00:42 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280E287A41 for ; Thu, 17 Nov 2022 13:59:07 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id b62so3360353pgc.0 for ; Thu, 17 Nov 2022 13:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5js234S10qtjTG5ViD8Z5NsYYM8xXfh9lDGiYeYzTNk=; b=FgMUyRzC1HQVet+tDCWA8ljDeGrHXk7NWmfvGzfwmovUinDK9knhVBWqOEaxR/WKhH wwHz/N4KP6pHF44qAgHaZHzh9z++AStihN6Ao5uRAf+yYgVBMZnVIZpD5gjuBWFIjThJ QsnQdQgUO9c1DQGCG/8tbnX/sYDH6HkHB7Fks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5js234S10qtjTG5ViD8Z5NsYYM8xXfh9lDGiYeYzTNk=; b=I6RXMwmq4gEs4srCYMCAQBcH5uzDsswY0+E1sHmvvg7WsU+CHFbviAd1vAQ0eaiget LyR7GqA12sdwdrr64X4hFA9KeYwKQi1e/biD3xRInoNxc26MDiUJvPEbAJHeA3WKDjA9 8GneuZMVpXlGajlHktKCj2KJ9q2vZlAGsWHqHjDD8r/0Vr5+GX+cgrQ3igUiOC1vSQxH vSW+yD39o0XY0AE7eqXnQSP/W/XJYH5Cy48kQmt5WxSLwSrXgSMMPCOJfxrUx7/WD10Z s8H/O7v1XNY19F5cgkCYbCSV8fUO8DtJMU4O3fSu6Dh8J6xY12HJuDMv1E0wwBHhaEKb Y7WQ== X-Gm-Message-State: ANoB5pm/dymHx1it4ep2Jb2tI/6k+TsVT4yrRFzZfBh23tG56g8yKZIK lpV/g2Ep+6DkHyRZE/a5D94yBg== X-Google-Smtp-Source: AA0mqf7QpiIvhVAGN52Mpwqa6vfs4EXQo0/q1js7mM6/xkzmq3rihpfcQy2O/U405oXjhY2LdIG4eg== X-Received: by 2002:a63:f00d:0:b0:458:f364:b00e with SMTP id k13-20020a63f00d000000b00458f364b00emr3876253pgh.577.1668722346647; Thu, 17 Nov 2022 13:59:06 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id u5-20020a17090341c500b00188fce6e8absm156864ple.280.2022.11.17.13.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 13:59:06 -0800 (PST) Date: Thu, 17 Nov 2022 13:59:05 -0800 From: Kees Cook To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Greg Kroah-Hartman , Jakub Kicinski , Russell King , Catalin Marinas , Thomas Bogendoerfer , Heiko Carstens , Herbert Xu , Christoph =?iso-8859-1?Q?B=F6hmwalder?= , Jani Nikula , Jason Gunthorpe , Sakari Ailus , "Martin K . Petersen" , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Richard Weinberger , "Darrick J . Wong" , SeongJae Park , Thomas Gleixner , Andrew Morton , Michael Ellerman , Helge Deller , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mmc@vger.kernel.org, linux-parisc@vger.kernel.org, Russell King , Ulf Hansson Subject: Re: [PATCH v3 1/3] treewide: use get_random_u32_below() instead of deprecated function Message-ID: <202211171359.412AEEE0@keescook> References: <20221114164558.1180362-1-Jason@zx2c4.com> <20221117202906.2312482-1-Jason@zx2c4.com> <20221117202906.2312482-2-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117202906.2312482-2-Jason@zx2c4.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Thu, Nov 17, 2022 at 09:29:04PM +0100, Jason A. Donenfeld wrote: > This is a simple mechanical transformation done by: > > @@ > expression E; > @@ > - prandom_u32_max > + get_random_u32_below > (E) > > Reviewed-by: Greg Kroah-Hartman > Acked-by: Darrick J. Wong # for xfs > Reviewed-by: SeongJae Park # for damon > Reviewed-by: Jason Gunthorpe # for infiniband > Reviewed-by: Russell King (Oracle) # for arm > Acked-by: Ulf Hansson # for mmc > Signed-off-by: Jason A. Donenfeld Reviewed-by: Kees Cook -- Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 189B1C433FE for ; Thu, 17 Nov 2022 22:00:15 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NCv3d34JYz3cfX for ; Fri, 18 Nov 2022 09:00:13 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FgMUyRzC; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::52a; helo=mail-pg1-x52a.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FgMUyRzC; dkim-atps=neutral Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (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 4NCv2P04sDz3dvL for ; Fri, 18 Nov 2022 08:59:08 +1100 (AEDT) Received: by mail-pg1-x52a.google.com with SMTP id r18so3264559pgr.12 for ; Thu, 17 Nov 2022 13:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5js234S10qtjTG5ViD8Z5NsYYM8xXfh9lDGiYeYzTNk=; b=FgMUyRzC1HQVet+tDCWA8ljDeGrHXk7NWmfvGzfwmovUinDK9knhVBWqOEaxR/WKhH wwHz/N4KP6pHF44qAgHaZHzh9z++AStihN6Ao5uRAf+yYgVBMZnVIZpD5gjuBWFIjThJ QsnQdQgUO9c1DQGCG/8tbnX/sYDH6HkHB7Fks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5js234S10qtjTG5ViD8Z5NsYYM8xXfh9lDGiYeYzTNk=; b=Of9Jb0iKOtz1d7YTf6/9lR7DkJF5jHi11A6kHSyiMVcvlINyL/xTZj57p7CLF2uATv TelHU2jD21KWfZr7sKap9/0uFapJJ+es+ujHlniNxPhS0ExO2Ac7HtDjvl52vIkdASCY H79HB0mKBANCu42y8V0/KnPxje77CvFX7vKJI1z4RgYDmk7yc6OVYXd62ruHY+GBH8fa P0sXJGBqMx8e9DpBkMxT/xT8xANXQ5zKe8uRQOLuY5OC1YnMLt5vQ/h1xLPjdNnIKxAK 10IHDOEM5ZBLpc3s5KdFspBNCt2t5z513gu1Gvc2gPT4mkxDnvK2FIbDzLF4W1GM1TWC 64MQ== X-Gm-Message-State: ANoB5pnMLNySaBj9Et7QW3GJ7KoYbx8kTVnzcRi0rltA0TY8ECS9XVRW 0VFRk4jUdi5kQ3nL3ud+sqU/hw== X-Google-Smtp-Source: AA0mqf7QpiIvhVAGN52Mpwqa6vfs4EXQo0/q1js7mM6/xkzmq3rihpfcQy2O/U405oXjhY2LdIG4eg== X-Received: by 2002:a63:f00d:0:b0:458:f364:b00e with SMTP id k13-20020a63f00d000000b00458f364b00emr3876253pgh.577.1668722346647; Thu, 17 Nov 2022 13:59:06 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id u5-20020a17090341c500b00188fce6e8absm156864ple.280.2022.11.17.13.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 13:59:06 -0800 (PST) Date: Thu, 17 Nov 2022 13:59:05 -0800 From: Kees Cook To: "Jason A. Donenfeld" Subject: Re: [PATCH v3 1/3] treewide: use get_random_u32_below() instead of deprecated function Message-ID: <202211171359.412AEEE0@keescook> References: <20221114164558.1180362-1-Jason@zx2c4.com> <20221117202906.2312482-1-Jason@zx2c4.com> <20221117202906.2312482-2-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117202906.2312482-2-Jason@zx2c4.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , "Darrick J . Wong" , patches@lists.linux.dev, netdev@vger.kernel.org, Andreas Dilger , Herbert Xu , Richard Weinberger , Helge Deller , Russell King , Jason Gunthorpe , Catalin Marinas , Jakub Kicinski , linux-mips@vger.kernel.org, linux-media@vger.kernel.org, Heiko Carstens , Jani Nikula , linux-block@vger.kernel.org, Russell King , SeongJae Park , loongarch@lists.linux.dev, Jaegeuk Kim , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Thomas Bogendoerfer , Theodore Ts'o , linux-parisc@vger.kernel.org, "Martin K . Petersen" , Greg Kroah-Hartman , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph =?iso-8859-1?Q?B=F6hmwalder?= , linux-crypto@vger.kernel.org, Sakari Ailus , linux-fsdevel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Nov 17, 2022 at 09:29:04PM +0100, Jason A. Donenfeld wrote: > This is a simple mechanical transformation done by: > > @@ > expression E; > @@ > - prandom_u32_max > + get_random_u32_below > (E) > > Reviewed-by: Greg Kroah-Hartman > Acked-by: Darrick J. Wong # for xfs > Reviewed-by: SeongJae Park # for damon > Reviewed-by: Jason Gunthorpe # for infiniband > Reviewed-by: Russell King (Oracle) # for arm > Acked-by: Ulf Hansson # for mmc > Signed-off-by: Jason A. Donenfeld Reviewed-by: Kees Cook -- Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D14FBC433FE for ; Thu, 17 Nov 2022 22:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2ugrNPYNgur1ipoUOh2PP5e0ZzYMq54KqugBK/Dx5Lc=; b=OmgLr5kSbbmYK8 YYN3iqehbG2y2rbTT+dDVpvS1otC2JxoplXP2Wc0882vgrTI5QEeQZm5ipnhxU+lSvdIMj0JNtD2S vXrBs8HhPJBrpimBhaYSCCZ4s53QX9WE5hmGhoLDs96yYzu3HB2eZloQcABeXE5YzWPdxNuIHJvy1 L5iARfgoJ+RsUnKr5iPD1ULT/Bbq9e6Ua+WTP0HraJ6U11UxDgQLEo14EM3IjUKS8Sj0hJAhwYXjS ve6UBUVc9f+LPkrGg04jld6g6TJy8S3vghSAbxjDD7JfnZAkkYTp/OwKbP2QeUPX/XDIgJI/joWwU 0Ho2OBJUYN8FLwYfDloA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovmud-0009qs-EQ; Thu, 17 Nov 2022 21:59:11 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovmua-0009no-2A for linux-arm-kernel@lists.infradead.org; Thu, 17 Nov 2022 21:59:09 +0000 Received: by mail-pf1-x42c.google.com with SMTP id v28so3058825pfi.12 for ; Thu, 17 Nov 2022 13:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5js234S10qtjTG5ViD8Z5NsYYM8xXfh9lDGiYeYzTNk=; b=FgMUyRzC1HQVet+tDCWA8ljDeGrHXk7NWmfvGzfwmovUinDK9knhVBWqOEaxR/WKhH wwHz/N4KP6pHF44qAgHaZHzh9z++AStihN6Ao5uRAf+yYgVBMZnVIZpD5gjuBWFIjThJ QsnQdQgUO9c1DQGCG/8tbnX/sYDH6HkHB7Fks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5js234S10qtjTG5ViD8Z5NsYYM8xXfh9lDGiYeYzTNk=; b=0HCxz45vhpGUln1iDovPorzoDIdT+pC8DQ9IaZQZAxYSNvSFoj5EruHCIVjxdaPQMp w8QWZo0MYDl1sp1hiKVPxyCZ9XDLMV52ctXVDHjjnxUwxVfO6m8ar8j4fjfEXppOKqdB QLB0s8W0ZYgl4jiqyrKtGxGGbdNwF6yNas3arTMZwvIJEcAaK+INaFtKTWJ2Ua6Oa/iH 1ekqYwe/hQJciys5oeeLoNExIEXnxY42XqlpIIFtqzb8jwunaEaU4FdaOG0Tgo4mEXz0 1XucIBhD5FBm1aZISZghT9qVPN3QoL8S6qzHFD3CVx24NVDDB2tYTaJXd8/21DE0XRrD WrmQ== X-Gm-Message-State: ANoB5pmOyVmIY1VrwKHs3kA7QYD4dgsXfyT7T1GP7Vx9mUjDSZvlK6cC K385/pkAjsWdyqt0/XotXzJ6iw== X-Google-Smtp-Source: AA0mqf7QpiIvhVAGN52Mpwqa6vfs4EXQo0/q1js7mM6/xkzmq3rihpfcQy2O/U405oXjhY2LdIG4eg== X-Received: by 2002:a63:f00d:0:b0:458:f364:b00e with SMTP id k13-20020a63f00d000000b00458f364b00emr3876253pgh.577.1668722346647; Thu, 17 Nov 2022 13:59:06 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id u5-20020a17090341c500b00188fce6e8absm156864ple.280.2022.11.17.13.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 13:59:06 -0800 (PST) Date: Thu, 17 Nov 2022 13:59:05 -0800 From: Kees Cook To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Greg Kroah-Hartman , Jakub Kicinski , Russell King , Catalin Marinas , Thomas Bogendoerfer , Heiko Carstens , Herbert Xu , Christoph =?iso-8859-1?Q?B=F6hmwalder?= , Jani Nikula , Jason Gunthorpe , Sakari Ailus , "Martin K . Petersen" , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Richard Weinberger , "Darrick J . Wong" , SeongJae Park , Thomas Gleixner , Andrew Morton , Michael Ellerman , Helge Deller , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mmc@vger.kernel.org, linux-parisc@vger.kernel.org, Russell King , Ulf Hansson Subject: Re: [PATCH v3 1/3] treewide: use get_random_u32_below() instead of deprecated function Message-ID: <202211171359.412AEEE0@keescook> References: <20221114164558.1180362-1-Jason@zx2c4.com> <20221117202906.2312482-1-Jason@zx2c4.com> <20221117202906.2312482-2-Jason@zx2c4.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221117202906.2312482-2-Jason@zx2c4.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221117_135908_124247_69653604 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 17, 2022 at 09:29:04PM +0100, Jason A. Donenfeld wrote: > This is a simple mechanical transformation done by: > > @@ > expression E; > @@ > - prandom_u32_max > + get_random_u32_below > (E) > > Reviewed-by: Greg Kroah-Hartman > Acked-by: Darrick J. Wong # for xfs > Reviewed-by: SeongJae Park # for damon > Reviewed-by: Jason Gunthorpe # for infiniband > Reviewed-by: Russell King (Oracle) # for arm > Acked-by: Ulf Hansson # for mmc > Signed-off-by: Jason A. Donenfeld Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel