Received: by 10.192.165.148 with SMTP id m20csp2447106imm; Sun, 22 Apr 2018 07:15:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49jm0ApJqO6+dw/UGWq7yHiaU5eU06kg8aQN7c+jgzPEfQV95km7BuptrZrskVHqB50yZii X-Received: by 10.98.100.11 with SMTP id y11mr13494117pfb.118.1524406533590; Sun, 22 Apr 2018 07:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524406533; cv=none; d=google.com; s=arc-20160816; b=A73RCMSh5U9UljBMUoMmWk81eB9LfdM1ertYqMlUAvyuF5NTWE4umV45OocAuBtyBH /NA23vfRx8rPXZUuaWc9L8XVow0TUGA/BFxA+rRP8MEsjf7JMRLHrqjFQa/Yd3Fdx6XB hkiPisy+SHgO0cKNs74mGeQkIYFWe24nH2rIAaDGbtqm+MARXvyPAQK9RV0V84QRbal9 y8AILjxh4HBD6PqQnf5UL5xiCwERiclRFTUTHyjAGWkrzY5ovMNVOtXBYurJR3Lxr9M8 /YTiFpkOihA/34MT4VoG7Fb1u3ocuASl1/g1cbg3qw6vDKf+jugKIYQR09k/Hnfvq1Bj bO9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8lQ3tnK5Q98EM/dj/unimxNhFyv3Vsq6oZZh39Ch5G8=; b=u17wy6MsbWoQ/cIs5D69UXYLJg3AgrngrmcUUKwmem0r++xLpRn1zU2aofCeBthEHi Vv2up1Pidhjc65ujLWqkKJAxguIkW9rpnHkIHvnmbuOm5CgCHHTPHa8rdsIPu+ILrp0L ZoUFAMOj24kRofTnXUYtBz6gNbu8Anm1EO5icD6uemS39Ou4LMmoPnSig7gwLHMRumsI nsPO8RlcwQ9iLyOYO8H7EZIXtJwhDmFgD97Vxb48B2AJs/pvGvUx9zhaELKQ+DxbZH5X lu5RFvM1G4gcMGqyPcYmi/xzq38uInZBbUHDKflTQxBvUe+JpBqQ5D9KwlWUnEBZzG/A fAaA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si8267348pgn.152.2018.04.22.07.15.19; Sun, 22 Apr 2018 07:15:33 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756953AbeDVOOO (ORCPT + 99 others); Sun, 22 Apr 2018 10:14:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56126 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756922AbeDVOOJ (ORCPT ); Sun, 22 Apr 2018 10:14:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8184ECF6; Sun, 22 Apr 2018 14:14:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jann Horn , Theodore Tso , stable@kernel.org Subject: [PATCH 4.9 76/95] random: crng_reseed() should lock the crng instance that it is modifying Date: Sun, 22 Apr 2018 15:53:45 +0200 Message-Id: <20180422135213.537529455@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o commit 0bb29a849a6433b72e249eea7695477b02056e94 upstream. Reported-by: Jann Horn Fixes: 1e7f583af67b ("random: make /dev/urandom scalable for silly...") Cc: stable@kernel.org # 4.8+ Signed-off-by: Theodore Ts'o Reviewed-by: Jann Horn Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -862,7 +862,7 @@ static void crng_reseed(struct crng_stat _crng_backtrack_protect(&primary_crng, buf.block, CHACHA20_KEY_SIZE); } - spin_lock_irqsave(&primary_crng.lock, flags); + spin_lock_irqsave(&crng->lock, flags); for (i = 0; i < 8; i++) { unsigned long rv; if (!arch_get_random_seed_long(&rv) && @@ -879,7 +879,7 @@ static void crng_reseed(struct crng_stat wake_up_interruptible(&crng_init_wait); pr_notice("random: crng init done\n"); } - spin_unlock_irqrestore(&primary_crng.lock, flags); + spin_unlock_irqrestore(&crng->lock, flags); } static inline void maybe_reseed_primary_crng(void)