All of lore.kernel.org
 help / color / mirror / Atom feed
* [cxenstored] Potential bug in special watch event firing
@ 2022-04-26 17:02 Raphael Ning
  2022-04-27  7:30 ` Juergen Gross
  0 siblings, 1 reply; 3+ messages in thread
From: Raphael Ning @ 2022-04-26 17:02 UTC (permalink / raw)
  To: Xen-devel; +Cc: Juergen Gross, Julien Grall

While reading C xenstored code, I noticed that it may send special events like @releaseDomain to (privileged) clients that only watch the root node (/). That's probably not the intended behaviour.

For example, when firing @releaseDomain, fire_watches() is called with exact == false:

https://github.com/xen-project/xen/blob/2419a159fb943c24a6f2439604b9fdb1478fcd08/tools/xenstore/xenstored_domain.c#L234

As a result, it will check whether @releaseDomain is a child of the path being watched:

https://github.com/xen-project/xen/blob/2419a159fb943c24a6f2439604b9fdb1478fcd08/tools/xenstore/xenstored_watch.c#L195

And when the parent path is /, is_child() unconditionally returns true:

https://github.com/xen-project/xen/blob/2419a159fb943c24a6f2439604b9fdb1478fcd08/tools/xenstore/xenstored_watch.c#L66

The xenstore documentation is not clear about whether @<wspecial> should be considered children of /. But I find it counterintuitive that clients may be notified about a special event without explicitly subscribing to it. Is it a bug?


Thanks,

Raphael



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cxenstored] Potential bug in special watch event firing
  2022-04-26 17:02 [cxenstored] Potential bug in special watch event firing Raphael Ning
@ 2022-04-27  7:30 ` Juergen Gross
  2022-04-27  9:41   ` Raphael Ning
  0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2022-04-27  7:30 UTC (permalink / raw)
  To: Raphael Ning, Xen-devel; +Cc: Julien Grall


[-- Attachment #1.1.1: Type: text/plain, Size: 1182 bytes --]

Hi Raphael,

On 26.04.22 19:02, Raphael Ning wrote:
> While reading C xenstored code, I noticed that it may send special events like @releaseDomain to (privileged) clients that only watch the root node (/). That's probably not the intended behaviour.
> 
> For example, when firing @releaseDomain, fire_watches() is called with exact == false:
> 
> https://github.com/xen-project/xen/blob/2419a159fb943c24a6f2439604b9fdb1478fcd08/tools/xenstore/xenstored_domain.c#L234
> 
> As a result, it will check whether @releaseDomain is a child of the path being watched:
> 
> https://github.com/xen-project/xen/blob/2419a159fb943c24a6f2439604b9fdb1478fcd08/tools/xenstore/xenstored_watch.c#L195
> 
> And when the parent path is /, is_child() unconditionally returns true:
> 
> https://github.com/xen-project/xen/blob/2419a159fb943c24a6f2439604b9fdb1478fcd08/tools/xenstore/xenstored_watch.c#L66
> 
> The xenstore documentation is not clear about whether @<wspecial> should be considered children of /. But I find it counterintuitive that clients may be notified about a special event without explicitly subscribing to it. Is it a bug?

I agree this is a bug.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cxenstored] Potential bug in special watch event firing
  2022-04-27  7:30 ` Juergen Gross
@ 2022-04-27  9:41   ` Raphael Ning
  0 siblings, 0 replies; 3+ messages in thread
From: Raphael Ning @ 2022-04-27  9:41 UTC (permalink / raw)
  To: Juergen Gross, Xen-devel; +Cc: Julien Grall

Hi Juergen,

On 27/04/2022 08:30, Juergen Gross wrote:
> [...]
>> The xenstore documentation is not clear about whether @<wspecial> should be considered children of /. But I find it counterintuitive that clients may be notified about a special event without explicitly subscribing to it. Is it a bug?
>
> I agree this is a bug.


Thanks for confirming that. I can send a patch to fix it, but it probably won't happen until later next week. If anyone else can get it done sooner, please feel free to do so.

Raphael



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-27  9:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 17:02 [cxenstored] Potential bug in special watch event firing Raphael Ning
2022-04-27  7:30 ` Juergen Gross
2022-04-27  9:41   ` Raphael Ning

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.