Bug 215869 - [macOS] Stop logging sandbox violations of com.apple.CoreDisplay.Notification
Summary: [macOS] Stop logging sandbox violations of com.apple.CoreDisplay.Notification
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-26 15:13 PDT by Per Arne Vollan
Modified: 2020-08-27 09:53 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.42 KB, patch)
2020-08-26 15:16 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (1.48 KB, patch)
2020-08-26 16:29 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2020-08-26 15:13:56 PDT
On macOS, stop logging mach-lookup sandbox violations of com.apple.CoreDisplay.Notification for performance reasons.
Comment 1 Per Arne Vollan 2020-08-26 15:16:55 PDT
Created attachment 407342 [details]
Patch
Comment 2 Per Arne Vollan 2020-08-26 15:17:37 PDT
<rdar://problem/67831223>
Comment 3 Per Arne Vollan 2020-08-26 16:29:10 PDT
Created attachment 407353 [details]
Patch
Comment 4 Darin Adler 2020-08-26 16:33:37 PDT
Comment on attachment 407353 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407353&action=review

> Source/WebKit/ChangeLog:8
> +        On macOS, stop logging mach-lookup sandbox violations of com.apple.CoreDisplay.Notification for performance reasons.

This makes it sound like it’s something already denied, and this patch simply changes it to no-log.

> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:771
> +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
> +(deny mach-lookup (with no-log)
> +    (global-name "com.apple.CoreDisplay.Notification))
> +#endif

But this is a new deny rule, not changing an existing one to no-log mode.

What am I missing?
Comment 5 Per Arne Vollan 2020-08-26 16:57:19 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 407353 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=407353&action=review
> 
> > Source/WebKit/ChangeLog:8
> > +        On macOS, stop logging mach-lookup sandbox violations of com.apple.CoreDisplay.Notification for performance reasons.
> 
> This makes it sound like it’s something already denied, and this patch
> simply changes it to no-log.
> 

Yes, that is correct.

> > Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:771
> > +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
> > +(deny mach-lookup (with no-log)
> > +    (global-name "com.apple.CoreDisplay.Notification))
> > +#endif
> 
> But this is a new deny rule, not changing an existing one to no-log mode.
> 
> What am I missing?

Yes, you are right. There is no previous rule for this service, so the default behavior is in effect, where the service is being denied, but with logging enabled.

This change is only changing the logging behavior.

Thanks for reviewing!
Comment 6 Darin Adler 2020-08-26 17:05:22 PDT
Comment on attachment 407353 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407353&action=review

>>> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:771
>>> +#endif
>> 
>> But this is a new deny rule, not changing an existing one to no-log mode.
>> 
>> What am I missing?
> 
> Yes, you are right. There is no previous rule for this service, so the default behavior is in effect, where the service is being denied, but with logging enabled.
> 
> This change is only changing the logging behavior.
> 
> Thanks for reviewing!

Oh, didn’t realize that "deny" was default for everything. I guess that should have been obvious.
Comment 7 Per Arne Vollan 2020-08-26 17:07:58 PDT
(In reply to Darin Adler from comment #6)
> Comment on attachment 407353 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=407353&action=review
> 
> >>> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:771
> >>> +#endif
> >> 
> >> But this is a new deny rule, not changing an existing one to no-log mode.
> >> 
> >> What am I missing?
> > 
> > Yes, you are right. There is no previous rule for this service, so the default behavior is in effect, where the service is being denied, but with logging enabled.
> > 
> > This change is only changing the logging behavior.
> > 
> > Thanks for reviewing!
> 
> Oh, didn’t realize that "deny" was default for everything. I guess that
> should have been obvious.

Actually, in some cases, "allow" is the default, but not in this case :)

Thanks for reviewing!
Comment 8 EWS 2020-08-26 18:58:37 PDT
Committed r266216: <https://trac.webkit.org/changeset/266216>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407353 [details].
Comment 9 Chris Dumez 2020-08-27 09:53:00 PDT
Comment on attachment 407353 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407353&action=review

> Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:770
> +    (global-name "com.apple.CoreDisplay.Notification))

Missing double quote here :(

https://trac.webkit.org/changeset/266238/webkit