Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754916AbbERTBZ (ORCPT ); Mon, 18 May 2015 15:01:25 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:32963 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754308AbbERTBW (ORCPT ); Mon, 18 May 2015 15:01:22 -0400 Message-ID: <1431975679.621.40.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [PATCH net-next] tcp: Return error instead of partial read for saved syn headers From: Eric Dumazet To: Rick Jones Cc: Eric B Munson , David Miller , Eric Dumazet , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 18 May 2015 12:01:19 -0700 In-Reply-To: <555A3264.3060205@hp.com> References: <1431974158-28288-1-git-send-email-emunson@akamai.com> <555A3264.3060205@hp.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 927 Lines: 23 On Mon, 2015-05-18 at 11:41 -0700, Rick Jones wrote: > On 05/18/2015 11:35 AM, Eric B Munson wrote: > > Currently the getsockopt() requesting the cached contents of the syn > > packet headers will fail silently if the caller uses a buffer that is > > too small to contain the requested data. Rather than fail silently and > > discard the headers, getsockopt() should return an error and report the > > required size to hold the data. > > Is there any chapter and verse on whether a "failed" getsockopt() may > alter the items passed to it? This should be fine. getsockopt() has two copyout to perform, the second one can fail. We can not 'undo' the first one in a safe way. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/