From patchwork Wed Aug 1 21:25:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10553041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69E1613BF for ; Wed, 1 Aug 2018 21:25:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 530A12A4BD for ; Wed, 1 Aug 2018 21:25:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46EEF2B607; Wed, 1 Aug 2018 21:25:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB2812B5FF for ; Wed, 1 Aug 2018 21:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732367AbeHAXNd (ORCPT ); Wed, 1 Aug 2018 19:13:33 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:42129 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732373AbeHAXNd (ORCPT ); Wed, 1 Aug 2018 19:13:33 -0400 Received: by mail-pl0-f65.google.com with SMTP id z7-v6so15152plo.9 for ; Wed, 01 Aug 2018 14:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=jxNBccwBJhOjNSehNOYa6peZNnukJ0uEhyMfONEe2KU=; b=e2jRX/ORCzfYWWo8zwRFnr31EHJkGKgauIMX/rYrDSUnsgapk8Ts2IdB1VgczVUlcx ckbyZnKJAMETkb1/ChuKehOk6Hc7rh+rKeMLrQ1PgTcWhMcpC5eIEX8HBQURhMgCJWR9 RuSkhO6a1PUj2DofXXEmN+q+m66yH5oKjVxYk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jxNBccwBJhOjNSehNOYa6peZNnukJ0uEhyMfONEe2KU=; b=Q7J8PFCtf7oPTBAM5r95Y+dnzjSGLOwahYcHc9DYROhKspBhiXO/gcpVLskBGMouN3 vnBa5BhmkVODyCS17oKADvv8hYGQYDgX5ypAZwT4QGoupkKXEYHWjIg3KSsEfga04z89 BIBZeXcUFdQJmzKMIg5Yz+U6ZBoGSOINDKjIxHHbWMlK7dt2Ls4LyrmhObzAn5sPqoRq oEsBLueAxM2Tp7mcjOkYTigfnQwIeCa/wViBJ5si5OmRT6uSqg/XOzPsu5B1kBZcFM+X GFssqnBegBU/sL0NUOVufEIt2SGl45CkZSXCr4cYFafG3I/vr20Gb/bQC3L9m2jEm8DR rKkg== X-Gm-Message-State: AOUpUlFqQpwsM+aK7PpnT1C4QJk7gc1qnEBkVjEWTmqVUBekafF8YaY5 8ylqJxcsh6eT3hXKCqPAaoOGfw== X-Google-Smtp-Source: AAOMgpfWVHbmyfnDG9pH0pOtb1VPUbXvWW8MnMZz8paghwL1DU1edkrPLlaT5alehIcYSEkxQVI3xg== X-Received: by 2002:a17:902:b08d:: with SMTP id p13-v6mr64370plr.0.1533158748927; Wed, 01 Aug 2018 14:25:48 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id f67-v6sm40264pfe.75.2018.08.01.14.25.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 14:25:46 -0700 (PDT) From: Kees Cook To: Jason Gunthorpe Cc: Kees Cook , Rasmus Villemoes , Leon Romanovsky , Bart Van Assche , Doug Ledford , Dan Carpenter , Randy Dunlap , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH rdma-next v4 0/3] overflow.h: Add left-shift helper Date: Wed, 1 Aug 2018 14:25:38 -0700 Message-Id: <20180801212541.22889-1-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the left-shift overflow helper, selftests, and first usage. -Kees v4: - actually fix docs typo - rename to check_shl_overflow() v3: - add even more test cases (type mismatches, more signed overflows). - fix documentation typo on argument name. v2: - swap out selftests with framework from Rasmus, add lots more tests. - drop double-assignment in helper. Jason Gunthorpe (1): overflow.h: Add arithmetic shift helper Kees Cook (1): test_overflow: Add shift overflow tests Leon Romanovsky (1): RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq drivers/infiniband/hw/mlx5/qp.c | 4 +- include/linux/overflow.h | 31 +++++ lib/test_overflow.c | 198 +++++++++++++++++++++++++++++++- 3 files changed, 231 insertions(+), 2 deletions(-)