Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp252334ybi; Wed, 29 May 2019 20:41:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJKrQihWu3NlqNjAE8XyB2ejuMyBEh1kRl7krh24iSfmxQvgYXIDm4wgAAS5T64VYDiQ22 X-Received: by 2002:a63:ee0a:: with SMTP id e10mr1739652pgi.28.1559187697989; Wed, 29 May 2019 20:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559187697; cv=none; d=google.com; s=arc-20160816; b=VeeZNgHNTwTTjFc44ZkCeXzvoYP7vgwY81o6Y/4wCgf6A10/feL8lk6x2SlwL08hw9 ukf+CEkPzXRZgKgD9yAdiIYIy3WKJBZ/ufWhA6iboLk+EO5Bb2hg46Krly0hnyGY62gZ I762QoibVUheGm5aLpTT4JNwGdvlx2W0fjMr8HlcBJKzIDTw14S42FctC0nHPih7yqDj NKxLTT7GZEQhZtvmxKRTywTH+IegInCrOIXrUwsfABB+KE8l6nZq119P18xrCWKfg3XS mwI48h2Kc7mPlsvi4LF446nrhVEDVhAXe+HeehPFAOIbtrljweZDBVlwSHoJWTqVuBTp ph/w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ClwytLeUF4WVfMeLlTzQ2mXGyTdVgc/4ZTlonxjTGjQ=; b=Ale/9KjkQ4cF0yNx/NVSUtMjY8HUPE2wv5VKClb+OnOMI13oTBYKVh04KM5dGPOs+X vCgIdlBFdifyc0rFTsm8DUh3Gpcbv5d/YDdfq/kHh+5WA/CUWJB0zifMYIJhAg7mvcUC cR+4vPsk+PLRoSZgER9V0WtIkwX8Z74R80CzCkdJgVqouIXUXMhur4O35JR9OeVwdS1i hQkKKdCr/hAxNV3K2TwK67mjpsBiSRbQRY/2E3caNUXiLxZwkLRouzGvKkVR4yEVWYkU A36mGBaQhOTkJeEg09r93blJ1MmyxEebT2ZTCVCaXSQr/kPiJW0Jczra6DEvXw84X86o pIlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TaF8jgj1; 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 y24si1746732plp.332.2019.05.29.20.41.21; Wed, 29 May 2019 20:41:37 -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; dkim=pass header.i=@kernel.org header.s=default header.b=TaF8jgj1; 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 S1732663AbfE3DV6 (ORCPT + 99 others); Wed, 29 May 2019 23:21:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:42962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730714AbfE3DQd (ORCPT ); Wed, 29 May 2019 23:16:33 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48E8F24598; Thu, 30 May 2019 03:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186192; bh=UT5ptIzvBWmArzRHvLDDWZswCaWyxEW9/R4B4KcsSDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TaF8jgj1LlarWsCHjcOI2ftyLnhSgvGaFZBB0E6RPikBovHD6TBIBCe/0WNnCXt7X RVXV9hBQDso8N0cO50zcLoAOFZVZwRKzYbuwX/y3hyoaQa0NBNpVm1+uoCj9rzrM5X fUymU2yTWcwQfUZ49bgx6FZmldXaAj14re2DdviQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bo YU , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 063/276] powerpc/boot: Fix missing check of lseek() return value Date: Wed, 29 May 2019 20:03:41 -0700 Message-Id: <20190530030529.803504311@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 5d085ec04a000fefb5182d3b03ee46ca96d8389b ] This is detected by Coverity scan: CID: 1440481 Signed-off-by: Bo YU Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/boot/addnote.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c index 9d9f6f334d3cc..3da3e2b1b51bc 100644 --- a/arch/powerpc/boot/addnote.c +++ b/arch/powerpc/boot/addnote.c @@ -223,7 +223,11 @@ main(int ac, char **av) PUT_16(E_PHNUM, np + 2); /* write back */ - lseek(fd, (long) 0, SEEK_SET); + i = lseek(fd, (long) 0, SEEK_SET); + if (i < 0) { + perror("lseek"); + exit(1); + } i = write(fd, buf, n); if (i < 0) { perror("write"); -- 2.20.1