[{"id":1762137,"web_url":"http://patchwork.ozlabs.org/comment/1762137/","msgid":"<20170902152325.GR17058@bill-the-cat>","list_archive_url":null,"date":"2017-09-02T15:23:25","subject":"Re: [U-Boot] [PATCH 2/3] nvme: Fix potential sign extension issue\n\tin nvme_blk_rw()","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Sat, Sep 02, 2017 at 08:15:36AM -0700, Bin Meng wrote:\n\n> \"lbas\" with type \"u16\" (16 bits, unsigned) is promoted in\n> \"lbas << ns->lba_shift\" to type \"int\" (32 bits, signed), then\n> sign-extended to type \"unsigned long long\" (64 bits, unsigned).\n> If \"lbas << ns->lba_shift\" is greater than 0x7FFFFFFF, the upper\n> bits of the result will all be 1.\n> \n> Fix it by casting \"lbas\" to \"u32\".\n> \n> Reported-by: Coverity (CID: 166730)\n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n\nReviewed-by: Tom Rini <trini@konsulko.com>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"e5bgvlg3\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xl0J55DhLz9sRY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  3 Sep 2017 01:23:49 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 2AEFFC21F42; Sat,  2 Sep 2017 15:23:16 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 67038C21EE5;\n\tSat,  2 Sep 2017 15:23:13 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid F2AD7C21F0F; Sat,  2 Sep 2017 15:23:05 +0000 (UTC)","from mail-yw0-f173.google.com (mail-yw0-f173.google.com\n\t[209.85.161.173])\n\tby lists.denx.de (Postfix) with ESMTPS id 6BD86C21F1D\n\tfor <u-boot@lists.denx.de>; Sat,  2 Sep 2017 15:23:02 +0000 (UTC)","by mail-yw0-f173.google.com with SMTP id s187so11463889ywf.2\n\tfor <u-boot@lists.denx.de>; Sat, 02 Sep 2017 08:23:02 -0700 (PDT)","from bill-the-cat ([2606:a000:140b:dc:2c3d:b0b9:86a2:6bdc])\n\tby smtp.gmail.com with ESMTPSA id\n\tc11sm1007662ywb.66.2017.09.02.08.23.00\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tSat, 02 Sep 2017 08:23:00 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=x/URRbxZpVXX9WPWP8RQzgq5GRKmFBCxHGQbqyDZwZQ=;\n\tb=e5bgvlg3q8n01Lf3+TkYPxl16bD00Gt7qA568ddLG4Z+0/tk09MIDOO8lI8VuXCJuQ\n\tYbikL/gqMJySdSKA2uETBOkm/CufL4sF5kk0fwR1wKA+Q3LwyYN4+cmxIhgsg1wRu+5L\n\tZS2YMj/rGTiNV6m72qTmXGxo9vCfCU5Nf+CP0=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=x/URRbxZpVXX9WPWP8RQzgq5GRKmFBCxHGQbqyDZwZQ=;\n\tb=OYFiEk3njzyTg3WlIl6lxtw4gGVV1D6WS+58YFoHu4LvqNnAT3yv0/r6tbk+/GORRd\n\tA4kMP5XlkxUToV1dT0VL3CVMYd39vmCJdRxWzZKVCXzKYNad7NgGm71mvdO+aD6DNk47\n\tsBD1XDngKE5W90GmcGbQr7E4o6jBuB69MCkZw7GV//qbTZ/lGwcb65cb8UOumWZuFDCa\n\tgnI3y1ubAM7KY/wzji8Ap5EBexoyG05BnMIXtqq4mnYb5EI1WDMPqMIZWmoRZlDm2E4w\n\tV3sIDwUMyOc6WmJC2gc1XyXeuBmu9nwBzpVeAdKLYd3WhIm79lfq/AWWksdzX96No17w\n\tehmA==","X-Gm-Message-State":"AHPjjUjVLGm9KzU/H8bGzkhj+1RBI1yPRKQdzNPOQrg2LBM+KbGDNMcm\n\tgPnh2ix6Z1h6enEX","X-Google-Smtp-Source":"ADKCNb4klOvmuvnidUCV7HVbNawz58HWH7Y4loKm/5dVlof+rMR2O9VjsDlUz1cbDCyK51gK/AVwCw==","X-Received":"by 10.37.208.195 with SMTP id h186mr4776081ybg.345.1504365781390;\n\tSat, 02 Sep 2017 08:23:01 -0700 (PDT)","Date":"Sat, 2 Sep 2017 11:23:25 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Bin Meng <bmeng.cn@gmail.com>","Message-ID":"<20170902152325.GR17058@bill-the-cat>","References":"<1504365337-32519-1-git-send-email-bmeng.cn@gmail.com>\n\t<1504365337-32519-2-git-send-email-bmeng.cn@gmail.com>","MIME-Version":"1.0","In-Reply-To":"<1504365337-32519-2-git-send-email-bmeng.cn@gmail.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH 2/3] nvme: Fix potential sign extension issue\n\tin nvme_blk_rw()","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============1745801223226301145==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1762385,"web_url":"http://patchwork.ozlabs.org/comment/1762385/","msgid":"<20170904004223.GK17058@bill-the-cat>","list_archive_url":null,"date":"2017-09-04T00:42:23","subject":"Re: [U-Boot] [U-Boot,\n\t2/3] nvme: Fix potential sign extension issue in nvme_blk_rw()","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Sat, Sep 02, 2017 at 08:15:36AM -0700, Bin Meng wrote:\n\n> \"lbas\" with type \"u16\" (16 bits, unsigned) is promoted in\n> \"lbas << ns->lba_shift\" to type \"int\" (32 bits, signed), then\n> sign-extended to type \"unsigned long long\" (64 bits, unsigned).\n> If \"lbas << ns->lba_shift\" is greater than 0x7FFFFFFF, the upper\n> bits of the result will all be 1.\n> \n> Fix it by casting \"lbas\" to \"u32\".\n> \n> Reported-by: Coverity (CID: 166730)\n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> Reviewed-by: Tom Rini <trini@konsulko.com>\n\nApplied to u-boot/master, thanks!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"RU0oHfTP\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlrsk0zjkz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 10:52:26 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid D3CD5C21F05; Mon,  4 Sep 2017 00:49:23 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 79048C21E57;\n\tMon,  4 Sep 2017 00:49:21 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid A0CBFC21E57; Mon,  4 Sep 2017 00:42:02 +0000 (UTC)","from mail-yw0-f173.google.com (mail-yw0-f173.google.com\n\t[209.85.161.173])\n\tby lists.denx.de (Postfix) with ESMTPS id EA55EC21E41\n\tfor <u-boot@lists.denx.de>; Mon,  4 Sep 2017 00:41:57 +0000 (UTC)","by mail-yw0-f173.google.com with SMTP id t188so19134484ywb.1\n\tfor <u-boot@lists.denx.de>; Sun, 03 Sep 2017 17:41:57 -0700 (PDT)","from bill-the-cat ([2606:a000:140b:dc:91cb:39a9:fe91:e1c8])\n\tby smtp.gmail.com with ESMTPSA id\n\tc13sm2229364ywm.106.2017.09.03.17.41.56\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tSun, 03 Sep 2017 17:41:56 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=PMhxsR0fpN13jbiJHLPh7Ke4f7+27eBdbtIXSWb0mkM=;\n\tb=RU0oHfTPAY+/kVoVYXMtWVIqX+0cBnyDTTMnHhCLYfNLJo5lHkAB4Mo73tW6u2SH3K\n\tfCmLiQz9/Wsms0uGsvelXKTs8AYlLeDyBonF5UW/DyGKqgmtnXVx5eSV8qhlmnq367+K\n\tCWkKFDzOYrZF8s6uvoVtDtyQUwAmfVhyfxUyA=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=PMhxsR0fpN13jbiJHLPh7Ke4f7+27eBdbtIXSWb0mkM=;\n\tb=oSbVx2lNIIddkVkBmtcPSiPyKAKa3aMI9pCYmAs74lHNdknzrJZDsTC7lC/OX2ri7t\n\tK/ddSuPr2l57LCs0Sb/cXxFm6zmVtIfliDAe0pinBLa/baYSwLJapb0uH2tdf2Fj/ZzB\n\t+WiY0fuNSlqUDlFmD67CpF/hpB7jJVcLdB/eM6qev99NpAeaDUdW5Ri50/VStuVwDmHy\n\tDjKKpfeni8WfmKOtV2iuKGEp0CnoYVhjSUGdMGkY5QOMROfaOGPHxoSSlpA9tA4T1+0l\n\tjMW1Vpr9O/x9BbEC154J2o7HCXPSmg+uDr3dk02brvsLJPN/BstE/mydiaJYTiFYRUP2\n\tsQgQ==","X-Gm-Message-State":"AHPjjUhkB+JUhpiZYd30ISXK3+OCm0/C1+mPXxfFTy/+Z91PGlF5IkzC\n\tMxDF56WyIksZ8+YH","X-Google-Smtp-Source":"ADKCNb7zzRquzYvRDLQh+xzsjPHBFpmWgKqlpI0BBWuUytxDuIWNiZbE9MnSiFayOJ/jv2gPT+p01A==","X-Received":"by 10.129.98.194 with SMTP id w185mr7460824ywb.219.1504485716876;\n\tSun, 03 Sep 2017 17:41:56 -0700 (PDT)","Date":"Sun, 3 Sep 2017 20:42:23 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Bin Meng <bmeng.cn@gmail.com>","Message-ID":"<20170904004223.GK17058@bill-the-cat>","References":"<1504365337-32519-2-git-send-email-bmeng.cn@gmail.com>","MIME-Version":"1.0","In-Reply-To":"<1504365337-32519-2-git-send-email-bmeng.cn@gmail.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,\n\t2/3] nvme: Fix potential sign extension issue in nvme_blk_rw()","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============2467434997231706164==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]