Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbdGDS07 (ORCPT ); Tue, 4 Jul 2017 14:26:59 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40008 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbdGDS04 (ORCPT ); Tue, 4 Jul 2017 14:26:56 -0400 From: Lawrence Brakmo To: Daniel Borkmann , Colin King , Alexei Starovoitov , "David S . Miller" , "netdev@vger.kernel.org" CC: "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH][bpf-next] bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case Thread-Topic: [PATCH][bpf-next] bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case Thread-Index: AQHS9Nk1CHIGkqFmKU6VCtA/JRiz4qJDyiqA//+86oA= Date: Tue, 4 Jul 2017 18:26:34 +0000 Message-ID: <385C64DB-4BF4-4AC1-B7F0-76AB30969682@fb.com> References: <20170704152112.18623-1-colin.king@canonical.com> <595BB3AF.3000304@iogearbox.net> In-Reply-To: <595BB3AF.3000304@iogearbox.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/f.23.0.170610 authentication-results: iogearbox.net; dkim=none (message not signed) header.d=none;iogearbox.net; dmarc=none action=none header.from=fb.com; x-originating-ip: [2620:10d:c090:180::1:c878] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR15MB1671;20:EEjGNopFMm5C0MdvYoPp4gl6Aai0QugCbBwSk4sCQLRa9mxeUyxP0x/nYh+z3GiBSURih968rAAbnwStoTOBW9kIGPPn9uMS9My1LJSH7dFa1XqD8MMECpHnfmh4LOZxpRr0cU+/8TZ2J/Z+PwLRXcT2M1NRTuSIH3kZN18NA/0= x-ms-office365-filtering-correlation-id: 14f12a03-7ad7-4831-68ad-08d4c30a338b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR15MB1671; x-ms-traffictypediagnostic: CY4PR15MB1671: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(133145235818549)(236129657087228)(9452136761055)(67672495146484)(198206253151910); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR15MB1671;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR15MB1671; x-forefront-prvs: 0358535363 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39410400002)(39860400002)(39400400002)(39850400002)(39840400002)(39450400003)(24454002)(377454003)(6116002)(6512007)(102836003)(6506006)(478600001)(83716003)(2906002)(54906002)(25786009)(229853002)(38730400002)(2501003)(4001350100001)(53936002)(6486002)(83506001)(4326008)(77096006)(53546010)(99286003)(6246003)(14454004)(82746002)(33656002)(50986999)(7736002)(76176999)(305945005)(54356999)(2950100002)(189998001)(2900100001)(6436002)(81166006)(5660300001)(3280700002)(36756003)(86362001)(8676002)(3660700001)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1671;H:CY4PR15MB1671.namprd15.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <5FAD45A869CEA3448391CC6ED6BC3521@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2017 18:26:34.6071 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1671 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-04_11:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v64IRAej019633 Content-Length: 1390 Lines: 42 On 7/4/17, 8:26 AM, "netdev-owner@vger.kernel.org on behalf of Daniel Borkmann" wrote: [ +Lawrence ] On 07/04/2017 05:21 PM, Colin King wrote: > From: Colin Ian King > > There appears to be a missing break in the TCP_BPF_SNDCWND_CLAMP case. > Currently the non-error path where val is greater than zero falls through > to the default case that sets the error return to -EINVAL. Add in > the missing break. > > Detected by CoverityScan, CID#1449376 ("Missing break in switch") > > Fixes: 13bf96411ad2 ("bpf: Adds support for setting sndcwnd clamp") > Signed-off-by: Colin Ian King Acked-by: Daniel Borkmann daniel@iogearbox.net Acked-by: Lawrence Brakmo > --- > net/core/filter.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/core/filter.c b/net/core/filter.c > index 94169572d002..c7f737058d89 100644 > --- a/net/core/filter.c > +++ b/net/core/filter.c > @@ -2867,6 +2867,7 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, > tp->snd_cwnd_clamp = val; > tp->snd_ssthresh = val; > } > + break; > default: > ret = -EINVAL; > } >