From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:46316 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752186AbeCUPK4 (ORCPT ); Wed, 21 Mar 2018 11:10:56 -0400 Date: Wed, 21 Mar 2018 08:10:11 -0700 From: Dave Watson To: Boris Pismenny CC: "David S. Miller" , Tom Herbert , Alexei Starovoitov , , , , Atul Gupta , Vakul Garg , Hannes Frederic Sowa , Steffen Klassert , John Fastabend , Daniel Borkmann Subject: Re: [PATCH net-next 5/6] tls: RX path for ktls Message-ID: <20180321151011.GB92320@davejwatson-mba.local> References: <20180320175434.GA23938@davejwatson-mba.local> <95b3174b-c860-3c87-2c8e-0917ccb72f1d@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <95b3174b-c860-3c87-2c8e-0917ccb72f1d@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: On 03/21/18 07:20 AM, Boris Pismenny wrote: > > > On 3/20/2018 7:54 PM, Dave Watson wrote: > > + ctx->control = header[0]; > > + > > + data_len = ((header[4] & 0xFF) | (header[3] << 8)); > > + > > + cipher_overhead = tls_ctx->rx.tag_size + tls_ctx->rx.iv_size; > > + > > + if (data_len > TLS_MAX_PAYLOAD_SIZE + cipher_overhead) { > > + ret = -EMSGSIZE; > > + goto read_failure; > > + } > > + if (data_len < cipher_overhead) { > > + ret = -EMSGSIZE; > > I think this should be considered EBADMSG, because this error is cipher > dependent. At least, that's what happens within OpenSSL. Also, EMSGSIZE is > usually used only for too long messages. Ah, indeed. Thanks, will send v2.