Received: by 10.192.165.148 with SMTP id m20csp449458imm; Fri, 20 Apr 2018 09:18:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/V+zlF4CsVm0AuEUyaa5skAYa0WyoC2mFeu0DMyASmkhRAyuQxhBkguloWNrG6mBRMlrO/ X-Received: by 10.99.147.20 with SMTP id b20mr9087620pge.309.1524241090272; Fri, 20 Apr 2018 09:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524241090; cv=none; d=google.com; s=arc-20160816; b=DuBCc9s0jZZ0hVDL9Na1FhMbXvZrnjKEp5BQ0FAhMK3RfPAxGN2+MREj8NeLRuXwQp OmlehDFjNTEl1+P2p6BQUJXuE0BkPDobwIaUIIIwBCuynJXopOatfeD8JJzDrUS5oNk1 JhFwtKDF08angBYJbDTv5r7f6aNt+WeUSIKgq3OW26pLoYUhtjr+oZEIwsyLnN9gwzGK ZbMmrPmEEfehwZDgvTwaU8eadqo1nO9V/UZLxLH1FkLljMf98Rxk+//XmaXPi0P2iZz5 ZYbL4nNXT1sBL6hQ5FyWp4KbOcsJwsKwYCcD5a4Zbx6DTmd5omfu7fy9y0l1bDuoCK/s hcbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:message-id:date :mime-version:dkim-signature:arc-authentication-results; bh=EpzsEq3yNDQS+f0gwv8Pt+4BoiBw9a3VmMUrSfgvJus=; b=ioB9Clp5ugecCXU6x7QeDm4mKwSizAubWVzwo2m3haLXsKAddtwfBMx0rSD0bfvXqD NzOsTZymmzve8C1EdLRb41UIdOiUXX9h+upElZqDJWNxu5n5Zk3el66HGOT3v8hpoJjk rePcdpmmPYdSWcQR7ePydkF2MH864I1Gc+vaJTATmc4ChpC9jOt4yMHZ8k/6+iQTau5B JKoeLd9QxSOEvbBTQIB0mkrH8clITkOyU02RlQGR/TCCLeJ72dUHf6u+T4iStXTkeS7H vsSCGUcxlmQr+U7L1FddyI9D9sHua6zavTKHYW7jmsBPpK/TmUI72CrVaXWxWL92c+/T uK7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MueVrMkc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u81si3671416pfg.289.2018.04.20.09.17.55; Fri, 20 Apr 2018 09:18:10 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=MueVrMkc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbeDTQQk (ORCPT + 99 others); Fri, 20 Apr 2018 12:16:40 -0400 Received: from mail-qt0-f202.google.com ([209.85.216.202]:33703 "EHLO mail-qt0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbeDTQQh (ORCPT ); Fri, 20 Apr 2018 12:16:37 -0400 Received: by mail-qt0-f202.google.com with SMTP id c21-v6so6484774qtn.0 for ; Fri, 20 Apr 2018 09:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:message-id:subject:from:to:cc; bh=EpzsEq3yNDQS+f0gwv8Pt+4BoiBw9a3VmMUrSfgvJus=; b=MueVrMkcZj7VL2NwlxDzz2lPAjYqHLPOlyx6W/OjtMADpFsJZ7ZEbB5mk3s/d4tpFs Z/MWNwS6nZ4LxRAiB7p4VIeKsN2PA7Lfsw52l8AiseMrg0qslXqGY8Fw0wTC06yt64Hy AIkZc7oYLXthVZmWeY0N+X7+XM1bM/+6MJpfQFcuU2qFymzrTLj4nJzHN029NPJ+AwjB Vk3R9kSxh2ualq1liRkWL5bLBv9LT5uQqSDfmX+bKkM45k2TvNdrwEVKTKVKW3EI3eiG 7MphlwekvIUUPLG1GlBPY3Vx7p+uJAPrlWzXED1FvV54cYIl7ki/vSR30cdjlHyJoMAc 3Liw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=EpzsEq3yNDQS+f0gwv8Pt+4BoiBw9a3VmMUrSfgvJus=; b=RZ2xNy63e439c1Ikh86hfByuKrPxAo1OaaYSH0jsC30uT5VJmlFgGDiADyumgJBSrg raySlDojGXS231hRbitu86qW3HB9b8xeC0xKvdCmJfTR34yDPECOnFlJb4UvJkh89/Bk BZo+AULb2DkKblNd9NJ+iQ5LjsGed2VO5iAV4H9BXHPn7zCW1oHTGaUmxxDSlSYfsrcu iiop+TScpvaudzvrQo1xWeQK/Dml/DPWyFDSI0QT9m5MU16hNB1B0/5KmhlblLeWSSY8 li/gBENaq4Uue6349wVxcG2o0EalHQ+xUQhptf6p4I0ASC1upezMM15pLjWHx22eWLF+ oH4w== X-Gm-Message-State: ALQs6tC85IGe0sK2mPUtPDJ6C8FiP9lWCr2xUFLJTGhskX0Ir2EB9w4r Licssn29q5vRRzOjf1Du1vFvto5CPA== MIME-Version: 1.0 X-Received: by 2002:ac8:605:: with SMTP id d5-v6mr8199107qth.36.1524240996385; Fri, 20 Apr 2018 09:16:36 -0700 (PDT) Date: Fri, 20 Apr 2018 18:16:30 +0200 Message-Id: <20180420161630.233178-1-jannh@google.com> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog Subject: [PATCH net] bpf: sockmap remove dead check From: Jann Horn To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, john.fastabend@gmail.com, jannh@google.com Cc: linux-kernel@vger.kernel.org, John Fastabend Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove dead code that bails on `attr->value_size > KMALLOC_MAX_SIZE` - the previous check already bails on `attr->value_size != 4`. Signed-off-by: Jann Horn --- kernel/bpf/sockmap.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 8dd9210d7db7..a3b21385e947 100644 --- a/kernel/bpf/sockmap.c +++ b/kernel/bpf/sockmap.c @@ -1442,9 +1442,6 @@ static struct bpf_map *sock_map_alloc(union bpf_attr *attr) attr->value_size != 4 || attr->map_flags & ~SOCK_CREATE_FLAG_MASK) return ERR_PTR(-EINVAL); - if (attr->value_size > KMALLOC_MAX_SIZE) - return ERR_PTR(-E2BIG); - err = bpf_tcp_ulp_register(); if (err && err != -EEXIST) return ERR_PTR(err); -- 2.17.0.484.g0c8726318c-goog