Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2748424imm; Wed, 3 Oct 2018 08:35:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV60wbpcb/W4RDwllwOFnRxZxeyuKTmZMbpxnABOoyziOsBjM41z3OVQXXr0YfBEQ00aLJjTX X-Received: by 2002:a17:902:7615:: with SMTP id k21-v6mr2168036pll.313.1538580926666; Wed, 03 Oct 2018 08:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538580926; cv=none; d=google.com; s=arc-20160816; b=sQMBtBYRkmvgQ/ujGeMZVRA3boZK0CEF7fXmLxfQwznZB3Izz2RaFLdnc7vrD6O/3I ISMqDVBft1OPebU0gf3gPUhLb5mOVnhYb9X6AqYc80u7EZf2c6cx7/bbFSYQhppwtHpp aA6s5m4cB7sah8JGIqTv0ZbZAdVEuIItH/pMTuQM+FFVCNn8jtRTHPxTjdqIuMDDFEJd ld0miDvwM5Ts/sfio46acOeO8p4L7AxCoG8GoY2my59+ejadydSTnizwi5A0cqpkSjFX npVNECJkhwB1kPm0EKsgxH7dY80DrBv7OQMdd0wPJHU9v4mpkgm+iWuOTmeiZEFSn6cM BNZQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=kVPjsqg7h7ECUpnPz4+gQaOCquxaFji9J+6klIEax60=; b=hwoJ+3iqQl7bEyxd/zLqi6a1ZT3YRf9aHuAYRVr4CCfnPOrt83X5UrOmDN7Fa06s+Q jUhR2pbGZzrqnfaK5VXAgLLw1iHgPh5M8NWcZseaB5wxcU1D2iZIwDMRhycYW9dDyfeR 4ygRHlmhDt6txPmpkKEQi9dL9r+7nTcyFuNVmX7LzErLj8BdHYPXiZHxLAlRNPufYkBm Wgm7Xm57B/s9sKiKfO3F+nqwYaWcuDNjmJaq5NvEFwPU98AvZqDRCpfdmaR3yfw8G6Ct FmlD/83eUb6to/ok5Hi4kZxzfrRtReOvNMTcx1iYX9pEfSuGdgKnS/rdfInXSU2hsZAC A4cg== 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 d186-v6si1894745pfg.23.2018.10.03.08.35.10; Wed, 03 Oct 2018 08:35:26 -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 S1726971AbeJCWXw (ORCPT + 99 others); Wed, 3 Oct 2018 18:23:52 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33993 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbeJCWXw (ORCPT ); Wed, 3 Oct 2018 18:23:52 -0400 Received: by mail-pg1-f194.google.com with SMTP id g12-v6so1756629pgs.1 for ; Wed, 03 Oct 2018 08:34:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=kVPjsqg7h7ECUpnPz4+gQaOCquxaFji9J+6klIEax60=; b=GSIK+/qWIlUIkZYeldUMecLWiKXPjRtbLBXsF/+XpEolkfRJrlmxkGn4D2OaQTtjfz lIuLKIZuDLsDUuBgkg6tBGYsJ3OorSzc4/gs+jQwBqWCO7EO3iqDKRk7ro0uxJs7MG0G 7aYS/DxymLhRLJT49DY7PlE75TSXFbJLz5OupIUunM0H+lzaqgeqN+S6IFfBtvXUjVhu xyZwx8pXMSEGJlukidSGBojSqiZxTF50PpvkafTEP9A2tK+oiCiBNu9Ur5KkdyqH6prK ImDcYKg0DQa8xaFWz1n692lg1NSVIk+Qdwum79yO4+9/fy1FFYUGr1gPaNVt59cdhVGQ WuoQ== X-Gm-Message-State: ABuFfojs6qi0ygbUYERfygLCVV8ZFt3RhXwm3aPmX93EVGzr6rg0fAfg OTnXcmIe/76tUD7Eap4aOWE= X-Received: by 2002:a63:e943:: with SMTP id q3-v6mr1864103pgj.42.1538580898756; Wed, 03 Oct 2018 08:34:58 -0700 (PDT) Received: from ?IPv6:2620:15c:2cd:203:5cdc:422c:7b28:ebb5? ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id n79-v6sm6990654pfk.19.2018.10.03.08.34.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 08:34:57 -0700 (PDT) Message-ID: <1538580896.205649.12.camel@acm.org> Subject: Re: [PATCH 6/6] lib/scatterlist: Fix overflow check in sgl_alloc_order From: Bart Van Assche To: Tvrtko Ursulin , linux-kernel@vger.kernel.org Cc: tvrtko.ursulin@linux.intel.com, Tvrtko Ursulin , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Jens Axboe Date: Wed, 03 Oct 2018 08:34:56 -0700 In-Reply-To: <20180926141625.17727-7-tvrtko.ursulin@linux.intel.com> References: <20180926141625.17727-1-tvrtko.ursulin@linux.intel.com> <20180926141625.17727-7-tvrtko.ursulin@linux.intel.com> Content-Type: text/plain; charset="UTF-7" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-09-26 at 15:16 +-0100, Tvrtko Ursulin wrote: +AD4 From: Tvrtko Ursulin +ADw-tvrtko.ursulin+AEA-intel.com+AD4 +AD4 +AD4 It is necessary to ensure types on both sides of the comparison are of the +AD4 same width. Otherwise the check overflows sooner than expect due left hand +AD4 side being an unsigned long length, and the right hand side unsigned int +AD4 number of elements multiplied by element size. Reviewed-by: Bart Van Assche +ADw-bvanassche+AEA-acm.org+AD4