From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 2 of 3] linux-2.6.18: xen/pv-on-hvm kexec: prevent crash in xenwatch_thread() when stale watch events arrive Date: Thu, 6 Oct 2011 11:23:44 +0200 Message-ID: <20111006092343.GA3731@aepfle.de> References: <94943cf143035aa7adbe.1317823855@probook.site> <4E8D88CE0200007800059A1A@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <4E8D88CE0200007800059A1A@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Thu, Oct 06, Jan Beulich wrote: > While I committed the other two patches in this series, this one seems > to have the potential for regressions (the comment and the checking for > -EEXIST can be assumed to have been there for a reason - whether > they became stale by now is not obvious), so I'd like to double check > that you verified that there's no code path where > register_xenbus_watch() could be called twice for the same watch. Would there be any benefit from allowing such a second watch where path and token match? In the end only one watcher will receive the event. With this change such code bug will be found. > The other possibly problematic case is that of watches user mode > can register through writing the xenbus device: Here the patch > definitely changes behavior observable by user mode (a > re-registration does not cancel an existing watch without this > change). I did not know watches can be registered by domU userspace, and I therfore did not consider this case. Looking through xenbus_dev_write I think the patch does not change behaviour because the requested watch-path may be the same, but the generated token passed to xenstored will change each time a watch is requested because the watch struct is allocated with kmalloc. Olaf