From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6BC0A0547 for ; Thu, 1 Apr 2021 09:46:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5549141083; Thu, 1 Apr 2021 09:46:58 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 859C74013F; Thu, 1 Apr 2021 09:46:55 +0200 (CEST) IronPort-SDR: Kkm2p3TSim1KGmdPpmszPl+mosgejpdzC3Y8obEzXBnUaKpeJri/bkv5+yrsj//mDx55oE47a+ mwAmYnlH4baA== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="192200710" X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="192200710" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 00:46:50 -0700 IronPort-SDR: o1iwcNcmG8XYgBbi8uFVpOLRmUeg51UCrt4dGsR/Brh92x2fApgcTDbJtpGd4b5DvaTQF4up4C fYEEWbaoZcXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="517236890" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga001.fm.intel.com with ESMTP; 01 Apr 2021 00:46:50 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 1 Apr 2021 00:46:50 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Thu, 1 Apr 2021 00:46:50 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Thu, 1 Apr 2021 00:46:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MEXfMUdsqfLLkxtiXDMFmyIKqXAIZZ6THIl7+kMtaLXvQWW7L9m/wGEw9v5rp0z0clWx4ggIz6GNO52idmxIS83HO7zH/++kNSvCFcqz6zGBYtFNDLlj9bIbVHqNUYO6JqoZfNjyqJaCzzyNdptOMIQ3uMavmmAUq1nQKjL9zY9rE3XFKpWURXiwwH4uRqMMthwsz1dcdyUnSr9y13bzq29+flQ75qeto3RSlmfwQD1NYPrGNOTrWFKmqdjht7FBuFgulaZEX8NLL83tL1ne+8XYQHuwGgWxRUr7n0OH3ny9lG4HozTcJrQ7wXHMUucxkeVjBRABdJRxk3QEiQrXuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TcLeyHfy0cSkpINjeX7VFj1QpoHIWLa+K8o1l32mSMI=; b=fqfF3jFMmKreaX3BTX9MA3fU+mHOWZFBnLDo3fgpFXV6o6uSKPBtx4nskfYv1HTYlxEbc73pedrwrS26riviuPAruOZnlhhBs7j2T63MizwbuHS5B7idLbDERG0byn7ua29fOTLIj3Oyjsns76yxt1izVHYIYicWilVzH2y4iMEvA5GHNdei4vk6SO7FwiAQb0sKa2AvIsAH29c5joRzpSTKRo+eRKAww5gVOXSv6MlujHmcQqJHSJc7ZR+w+OiPYM4wkXUZFY7Pvaw45W0YrxlrhAWiOjBZnPCuZqQFIDZYy+TCbXagW3OrQS8QAMd58tJdfsXO55XRaTp/zpSRLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TcLeyHfy0cSkpINjeX7VFj1QpoHIWLa+K8o1l32mSMI=; b=d7QjwdZQxgGFV5tUAQNo06xEzcz6rC0j1D4Wf+6A4JgysWuVnKVCYD2lfitvD29TMsCcQ4gKqT3THKBd4vP+Nf0o3jIlN7K3UylWy3V/qmZTleT9uHTmDZmiGeiGJGM8Nhvn0YL2ilDIwkzkXYW6a4x2Q03YHiwZhSNfnR94U1c= Received: from DM6PR11MB3131.namprd11.prod.outlook.com (2603:10b6:5:6d::32) by DM6PR11MB3468.namprd11.prod.outlook.com (2603:10b6:5:5c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Thu, 1 Apr 2021 07:46:47 +0000 Received: from DM6PR11MB3131.namprd11.prod.outlook.com ([fe80::181b:59f1:8b7e:b9db]) by DM6PR11MB3131.namprd11.prod.outlook.com ([fe80::181b:59f1:8b7e:b9db%6]) with mapi id 15.20.3999.028; Thu, 1 Apr 2021 07:46:47 +0000 From: "Zhang, Tianfei" To: "Huang, Wei" , "dev@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" CC: "stable@dpdk.org" Thread-Topic: [PATCH v1 2/4] raw/ifpga/base: check return value of lseek Thread-Index: AQHXGwaPp5oqwiwPm0Cy40EjwOZCTKqfYDdg Date: Thu, 1 Apr 2021 07:46:47 +0000 Message-ID: References: <1615969296-17021-1-git-send-email-wei.huang@intel.com> <1615969296-17021-3-git-send-email-wei.huang@intel.com> In-Reply-To: <1615969296-17021-3-git-send-email-wei.huang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6a4a87e0-a783-47c1-26c7-08d8f4e24d94 x-ms-traffictypediagnostic: DM6PR11MB3468: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:345; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zmVa7MlXhQqr4prcVGB1x21zKDiPBQIbYzmOIS54/zY48K5fX+tlt8o8HQ9vy7ofyPLbmDHHX5uyZ7ewlt6SpHUH07O8ss6SqIC9w8xHghna+f574wdcfnfl+yY+US82xghtOJAb8XwuuDnPqKnAwz1WhObkJgHUiT7jc8/6XCgNoQpSvpZeQphmw3uZ0k5Zu3txVic9HEmPnJNSJ2R9rCtxpCF7RCE2X7uTOZNfEArpi6AZ/IArGPymombKhBzJPJx5dCe2XINzR1ocMZH0eumfhhvYPpFYvyMJex2CArdevZ5HVEtwbr9C7xNw4dp5760dBVIoNvbdhEmJhUKIKCqSEKeC5Z9oJFsw9+/tmZo2FZj1dZmEfH55EcSTNzgJkbJygA6edRS8HtQSbUbp6XE4LNX8+6HUlz2YlTp9iirEnQNmx0E3sVVLTd9IsQ7t26j5FHWG9jVejg1c+dXuHfpmHa8Wt0gwii3SGff6DC0Wvq241e1xFcwQ0A3yXNeoAKZV/Gp/Nc6DPtZdGzCDRMcwOi2goU0sW8GAQicSZiD8P/ib4kIPXRs5+TrFaJI/ZXj4VwhVNJI/oTLAZtAzSMGHYjLmi2rRBL3yM9bIANyM3nbBxbKH5IHuIoyVWUR5Xt6L4MDCCVu/RgVztydseIaHG71uaTZJo6KGJw4Lk+w= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3131.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(136003)(366004)(346002)(39860400002)(66446008)(33656002)(7696005)(66946007)(66476007)(2906002)(53546011)(38100700001)(26005)(316002)(55016002)(9686003)(186003)(76116006)(71200400001)(110136005)(86362001)(5660300002)(4326008)(450100002)(8676002)(6636002)(52536014)(64756008)(83380400001)(8936002)(6506007)(478600001)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?iso-2022-jp?B?bU5QbHRuQmdpZy9JZEJnMnEzV0tnSkxmU1RZcVVQaDVveHNWSkpoYkow?= =?iso-2022-jp?B?eDJKTndFS1l1N2M2S3V5blFBSHV1MURSQ0EwRDlDOEtWWDQraUZxNjhp?= =?iso-2022-jp?B?UlBicG9JYndud3BDVDEyQlRhdlBFelpwbFJra3VUVTltblI3S2NTc05M?= =?iso-2022-jp?B?NFpSWEpJaEpLT3c1UDdwNTJTaGk5SmNvWFg2ZFJ5NWh5ZnpRUldNbGlT?= =?iso-2022-jp?B?RVQyMDJFUUY0Y0NIS3N5ZDdTN2UvSG8yb3UzRkl5TlpmcklSbUlFdTA1?= =?iso-2022-jp?B?eFAxMDhUL05FQkdKWEpnQU5XdWJtd3Bma0RZcHAyUkh2dWh0djJHSkYv?= =?iso-2022-jp?B?aFMwZHcwSVg5QUJoemozckZvTFB2WWZ6THBKSjJwbjNQMVBUODFyQnpC?= =?iso-2022-jp?B?OEE1ZFR0bzY4d2pjcm1FMGM5MmgyZmpYRHRHK2ZkcmNPRnA4NGdsSXBJ?= =?iso-2022-jp?B?d1I5b3ZEVUFLQW1GRDVkNHdReHg5cFdFODA5MHJSSGxJYnRsSWdVS2FT?= =?iso-2022-jp?B?Umo1eXF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cGpoOWZq?= =?iso-2022-jp?B?SDM2Si9SR3IyVk1NRHhyODR4bjFXQ3hiZFhJeEwxZUtLbUR6SnFwOFVZ?= =?iso-2022-jp?B?ZERFdG81ZGI2YWdEckVlVUFTNnBldlpreENzMTU2OVRSNzMzc0lpa2pB?= =?iso-2022-jp?B?Q2V0YUovTlE5Rkp3OTNPVWVWc3RQQ05Qa0x1akM4by9PNXc5c2taRTl1?= =?iso-2022-jp?B?YllTRkdDTjhlOHZ2dldSN0NOZU53QXdTOGc3Q05MdEZ6UWtuVERBLzNB?= =?iso-2022-jp?B?VEZhT01TOUI5WUlPSzFHZDhsZFdjWUgvYUx0SStHTjUwcGRyTC9aby9y?= =?iso-2022-jp?B?TmlicFoxbzFTMFVKdXpzUTdOeU9SaHNsc3ZNZmFUa0Q0eC9xL3EvS1ow?= =?iso-2022-jp?B?WGlOTGtBb0ZZMDFQajc0dEJNcUhONUE1MWNuQStTekRPOTI0YmlGVzRN?= =?iso-2022-jp?B?RVpXam5kVjRvTlRwTmhEVVQ1aHYzSVNKb2JKYnhKdU5pTUwvOE9mOCt3?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3131.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a4a87e0-a783-47c1-26c7-08d8f4e24d94 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2021 07:46:47.3286 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kcD5jG9tDFSCXH2tgx5MT6YXlMXAcC3WDvCCeAh4eqVYoT0/5ynzaVgqC2xS3vMaZlUqqbmLEtG9NFyc6nBrhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3468 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH v1 2/4] raw/ifpga/base: check return value of lseek X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Huang, Wei > Sent: 2021=1B$BG/=1B(B3=1B$B7n=1B(B17=1B$BF|=1B(B 16:22 > To: dev@dpdk.org; Xu, Rosen ; Zhang, Qi Z > > Cc: stable@dpdk.org; Zhang, Tianfei ; Huang, Wei > > Subject: [PATCH v1 2/4] raw/ifpga/base: check return value of lseek >=20 > In write_flash_image(), calling function "lseek" without checking return = value > has risk. Negative return value should be handled as an error condition. >=20 > Coverity issue: 367478 > Fixes: 7a4f3993f269 ("raw/ifpga: add FPGA RSU APIs") >=20 > Signed-off-by: Wei Huang > --- > drivers/raw/ifpga/base/ifpga_fme_rsu.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/raw/ifpga/base/ifpga_fme_rsu.c > b/drivers/raw/ifpga/base/ifpga_fme_rsu.c > index d32f1eccb1..a4cb2f54ba 100644 > --- a/drivers/raw/ifpga/base/ifpga_fme_rsu.c > +++ b/drivers/raw/ifpga/base/ifpga_fme_rsu.c > @@ -130,7 +130,12 @@ static int write_flash_image(struct ifpga_sec_mgr > *smgr, const char *image, > do { > to_transfer =3D (length > IFPGA_RSU_DATA_BLK_SIZE) ? > IFPGA_RSU_DATA_BLK_SIZE : length; > - lseek(fd, offset, SEEK_SET); > + if (lseek(fd, offset, SEEK_SET) < 0) { > + dev_err(smgr, "Failed to seek in \'%s\' [e:%s]\n", > + image, strerror(errno)); > + ret =3D -EIO; > + goto end; > + } > read_size =3D read(fd, buf, to_transfer); > if (read_size < 0) { > dev_err(smgr, "Failed to read from \'%s\' [e:%s]\n", > -- Acked-by: Tianfei zhang