Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3993175ybv; Mon, 10 Feb 2020 10:12:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyrmas5XABnZd+CiOBVeJi1Z2Ik5XSfqEZgd37IUR5gA13QnB/qRutMSKfWytMWVtst6irf X-Received: by 2002:aca:2207:: with SMTP id b7mr198512oic.109.1581358341483; Mon, 10 Feb 2020 10:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581358341; cv=none; d=google.com; s=arc-20160816; b=TI/cH/VkuCI432HjpJxZpC3J96fRm0XO0N2SkATuLpgDg+tBBXH05RpXpD+EMNdaVR YgvlF6gwJj7yAiNliaOq1BMqwuQpVpNmI7LUNhWE/CdnaQSCqG0lhR2/APr73YUt7gpU Gtd6VERcMhvVUylxKiZ34S0tZ6R7S2IhIWuVL9/mbiFPdJxlnVFcHwPAM0ILA/H7j1aG B1RsJTKPWSlLKNXmPCrEKmQbR6VkW8hwRhzNOe8aOg/2Lctet31ceXxZd5pptoByJbIo 351vXBliStPDFg+o7pE+6C03EUUV1/Tb8/dwxSah4cTalpkpXU0OUoYu0i2r/11DKR8i 04Qg== 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=4Dz+xdTC0pyqzvmxbR9PP6Nk9yWbFPEzmCFhMkp3zl0=; b=HJPl9clFfWpK+rebSgByliTwJiIRR0nCl4Cp5tAiSJxthxL01jp0kbgYCvljh+sJ+4 lLNsuiGSOkgLw9HnRJ+ZaDAAk5s8rKVjatvDkzlj34qRoOaTvEyKhJdPes6g5qoCSFVH 81lRrQNMTRiMYs/ab2izuezEtv1b9W0r5l5CDVrrTPDW8XWUX56JWK8XCRLZn+AQBokH qyA9PtjZbv5gmN50E3VHQ7Xp2pBIlKcLbWFuHDRFlKGzxnMOirf1RvDt1egvpK1m1Wnh ZdZBPbVl4veGFzj6y1VAfmiBx8NVLVe9A3dWeHl6yLnsH0Xcd5yZvRpgtMxfrv2pYIeU ONHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=AHydNlab; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si534500otd.1.2020.02.10.10.12.08; Mon, 10 Feb 2020 10:12:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@oracle.com header.s=corp-2020-01-29 header.b=AHydNlab; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbgBJSMG (ORCPT + 99 others); Mon, 10 Feb 2020 13:12:06 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:48354 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726950AbgBJSMG (ORCPT ); Mon, 10 Feb 2020 13:12:06 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01AI8uWu036290; Mon, 10 Feb 2020 18:11:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=4Dz+xdTC0pyqzvmxbR9PP6Nk9yWbFPEzmCFhMkp3zl0=; b=AHydNlabaUzcer8clu8J6yy7inGPR/6edLvJuXrrwlaRDdveZ9lIUFBMxwXb3JzIB1HM n16JLe+p8yOVuxB8KVt6Io9HO73IlyBLbE1748rsWka+F+6uNi51RSYe7INc8/kJH1t4 aJWHqGGv5t8kBa8YtdXyap35wWYE14k8HHK7nhhQDIsjsNF66TMlvkCT4FSa30LA7qVM RuTJf52rfY8DAVqZTGxiRF9eyHFnLFSIRvwvOIX5Vfn5XOtTHbnKE6eMk5LMKOzgW22a 4wWKp7AGcfq+zVybm5e1xPoCaU4whBPW//4PRxT1AVwyAJ7eO6c1OLYETog/MFV6a595 vQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2y2p3s66dc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Feb 2020 18:11:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01AI8RSX014820; Mon, 10 Feb 2020 18:11:51 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2y26sk8q85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Feb 2020 18:11:51 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01AIBmC7009137; Mon, 10 Feb 2020 18:11:49 GMT Received: from zissou.us.oracle.com (/10.152.34.58) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 10 Feb 2020 10:11:48 -0800 From: Daniel Jordan To: Herbert Xu , Steffen Klassert Cc: Daniel Jordan , Geert Uytterhoeven , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] padata: fix uninitialized return value in padata_replace() Date: Mon, 10 Feb 2020 13:11:00 -0500 Message-Id: <20200210181100.1288437-1-daniel.m.jordan@oracle.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9527 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 malwarescore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100135 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9527 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1011 impostorscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100135 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org According to Geert's report[0], kernel/padata.c: warning: 'err' may be used uninitialized in this function [-Wuninitialized]: => 539:2 Warning is seen only with older compilers on certain archs. The runtime effect is potentially returning garbage down the stack when padata's cpumasks are modified before any pcrypt requests have run. Simplest fix is to initialize err to the success value. [0] http://lkml.kernel.org/r/20200210135506.11536-1-geert@linux-m68k.org Reported-by: Geert Uytterhoeven Fixes: bbefa1dd6a6d ("crypto: pcrypt - Avoid deadlock by using per-instance padata queues") Signed-off-by: Daniel Jordan Cc: Herbert Xu Cc: Steffen Klassert Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- kernel/padata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/padata.c b/kernel/padata.c index 72777c10bb9c..62082597d4a2 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -512,7 +512,7 @@ static int padata_replace_one(struct padata_shell *ps) static int padata_replace(struct padata_instance *pinst) { struct padata_shell *ps; - int err; + int err = 0; pinst->flags |= PADATA_RESET; -- 2.24.1