From owner-svn-src-head@freebsd.org Wed Nov 18 22:20:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57B23A329E7; Wed, 18 Nov 2015 22:20:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26D671F26; Wed, 18 Nov 2015 22:20:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAIMK4dZ084155; Wed, 18 Nov 2015 22:20:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAIMK4vM084154; Wed, 18 Nov 2015 22:20:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511182220.tAIMK4vM084154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 18 Nov 2015 22:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291029 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2015 22:20:05 -0000 Author: cem Date: Wed Nov 18 22:20:04 2015 New Revision: 291029 URL: https://svnweb.freebsd.org/changeset/base/291029 Log: NTB: Fix 32-bit BAR size validation Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 18 22:19:55 2015 (r291028) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Nov 18 22:20:04 2015 (r291029) @@ -2575,9 +2575,9 @@ ntb_mw_set_trans(struct ntb_softc *ntb, } else { /* Configure 32-bit (split) BAR MW */ - if ((addr & ~UINT32_MAX) != 0) + if ((addr & UINT32_MAX) != addr) return (EINVAL); - if (((addr + size) & ~UINT32_MAX) != 0) + if (((addr + size) & UINT32_MAX) != (addr + size)) return (EINVAL); base = ntb_reg_read(4, base_reg);