From: Ian Jackson Subject: [PATCH 1/2] xenstore: sanity check incoming message body lengths [and 2 more messages] Date: Thu, 19 Dec 2013 15:42:29 +0000 Message-ID: <21171.5093.267948.137874@mariner.uk.xensource.com> References: <1385770805-1929-1-git-send-email-mattd@bugfuzz.com> <1385770805-1929-2-git-send-email-mattd@bugfuzz.com> <21148.28652.13717.846395@mariner.uk.xensource.com> <529B210A.9080005@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1385770805-1929-2-git-send-email-mattd@bugfuzz.com>, <529B210A.9080005@citrix.com>, List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Matthew Daley Cc: Stefano Stabellini , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Matthew Daley writes ("[PATCH 1/2] xenstore: sanity check incoming message body lengths"): > This is for the client-side receiving messages from xenstored, so there > is no security impact, unlike XSA-72. Andrew Cooper writes ("Re: [Xen-devel] [PATCH 1/2] xenstore: sanity check incoming message body lengths"): > Reviewed-by: Andrew Cooper Matthew Daley writes ("Re: [PATCH 1/2] xenstore: sanity check incoming message body lengths"): > On Tue, Dec 3, 2013 at 12:33 AM, Ian Jackson wrote: > > If this situation should arise, your proposal would discard the > > headers of the bogus message and read the start of what would be the > > over-long payload as the next header. ... > > It would be best to either kill the connection dead, or perhaps to > > skip the overlong data. > > The only callers of read_message I can see are read_reply, > read_watch_internal and read_thread. read_reply's only caller is > xs_talkv, which closes the connection on the failure being passed > down. read_watch_internal doesn't, and neither do its callers. > read_thread does close the connection. > > So, with that said, where should the handling of the failure go? Would > it be good to consolidate the handling in one spot, ie. directly in > read_message? Since read_message is the root function for all these > other functions, and since read_thread already does handle the failure > and the other functions use that if implicitly if threaded background > reading is enabled, it seems like a good idea to do so. Yes. Arguably, based on what you've said, this patch should be applied as-is, on the grounds of it being an improvement. Ian C, do you have an opinion ? Ian.