Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754703Ab2BVRqc (ORCPT ); Wed, 22 Feb 2012 12:46:32 -0500 Received: from terminus.zytor.com ([198.137.202.10]:51622 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753266Ab2BVRqa (ORCPT ); Wed, 22 Feb 2012 12:46:30 -0500 Message-ID: <4F4529D4.6070008@zytor.com> Date: Wed, 22 Feb 2012 09:45:56 -0800 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 MIME-Version: 1.0 To: Linus Torvalds CC: Ian Kent , David Miller , linux-kernel@vger.kernel.org, autofs@vger.kernel.org, Thomas Meyer , Al Viro Subject: Re: compat: autofs v5 packet size ambiguity - update References: <20120221.221609.218135609185671883.davem@davemloft.net> <1329889428.2193.45.camel@perseus.themaw.net> <4F4484F0.9070501@zytor.com> In-Reply-To: X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 962 Lines: 25 On 02/22/2012 08:10 AM, Linus Torvalds wrote: > > But yeah, writing fixed-size data and then having a reader that reads > fixed-size data is just not a very good approach. It's doubly bad when > the "fixed size" isn't an explicit size that is documented in the > protocol, but depends on data structures. > Incidentally, a valid user space workaround for this problem would be to just read all the data off the pipe but consider the packet length to be NAME_MAX rather than NAME_MAX+1; then simply discard all-zero ints received on input since a packet always starts with the autofs version number. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. -- 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/