Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pango: 1.43.0 -> 1.44.6, fixes CVE-2019-1010238 #71571

Merged
merged 2 commits into from Oct 22, 2019

Conversation

d-goldin
Copy link
Contributor

Motivation for this change

Bumping version to incorporate a security fix.
Addresses: #70120

Upstream fix:
https://gitlab.gnome.org/GNOME/pango/commit/490f8979a260c16b1df055eab386345da18a2d54

Additional change required to build docs:
https://gitlab.gnome.org/GNOME/pango/commit/71461689b0e34d873018d46bff555475019fbf4a

The dropped patch is already incorporated into the version.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @7c6f434c

Bumping version to incorporate a security fix.

Addresses: NixOS#70120

Upstream fix:
https://gitlab.gnome.org/GNOME/pango/commit/490f8979a260c16b1df055eab386345da18a2d54

Additional change required to build docs:
https://gitlab.gnome.org/GNOME/pango/commit/71461689b0e34d873018d46bff555475019fbf4a

The dropped patch is already incorporated into the version.
@jtojnar
Copy link
Contributor

jtojnar commented Oct 21, 2019

Previous patch releases had some breakage, we need to check if they were fixed. See also #65670

@d-goldin
Copy link
Contributor Author

@jtojnar: Thanks, I will have a look.

@worldofpeace
Copy link
Contributor

I believe the issue was with pygtk #65670 (comment). So maybe you just need to give it some extra cflags to build now.

@d-goldin
Copy link
Contributor Author

d-goldin commented Oct 21, 2019

@worldofpeace: It doesn't seem like there is a 1.44.6-2 source tarball published on the regular mirrors (there is one on github and gitlab, but I'll try to stick with the pre-existing mechanism first) yet, but I will try out and see if we can backport this as a patch.

@jtojnar
Copy link
Contributor

jtojnar commented Oct 21, 2019

From IRC:

sender message
alatiera mclasen: you did a 1.44.6-2 tag but didn't upload a tarball
bochecha yeah, with a signle commit adding back PangoFontsetSimple
mclasen alatiera: I believe that is the 1.44.6 tag
and there is a 1.44.6 tarball on d.g.o
alatiera mclasen: the tarball is from first tag, we double checked it over the weekend
mclasen alright, I'll try to get some pango time this week
alatiera we could also include this one patch in the flatpak sdk till a .7 tag is around, from the issue it seems that the api is used by pygtk mostly

https://gitlab.gnome.org/GNOME/pango/compare/1.44.6...1.44.6-2

That should work for us. Could you try adding https://gitlab.gnome.org/GNOME/pango/commit/8a408d4f25ddb0e3d6020cdde0cd8f8a19ee8db2.patch to patches?

@d-goldin
Copy link
Contributor Author

d-goldin commented Oct 21, 2019

@jtojnar: Yes, this is the patch I was trying. While this solves the immediate error, it runs into another deprecated and removed API further down the line in:

pango.c:3822:32: error: ‘PangoFontClass’ {aka ‘struct _PangoFontClass’} has no member named ‘find_shaper’
     if (PANGO_FONT_CLASS(klass)->find_shaper)
                                ^~
pango.c:3823:38: error: ‘PangoFontClass’ {aka ‘struct _PangoFontClass’} has no member named ‘find_shaper’
         ret = PANGO_FONT_CLASS(klass)->find_shaper(PANGO_FONT(self->obj), lang, ch);  

On gitlab it sounded like this was supposed to fix pygtk, but I'm not sure if they actually built it and if so, if we have some discrepancy in config.

Let me push an updated version so that it can be tested via ofBorg.

@7c6f434c 7c6f434c merged commit dd5d488 into NixOS:master Oct 22, 2019
@7c6f434c
Copy link
Member

Ouch, sorry, didn't notice the first time that the updated version is still not enough. Should I revert?

@7c6f434c
Copy link
Member

Hm, pygtk doesn't build indeed, with the same problem

@7c6f434c
Copy link
Member

https://gitlab.gnome.org/GNOME/pango/commit/48c5b52c944be0083a6c35caea86d186175b1640 is where find_shaper was dropped, reason unclear

@jtojnar
Copy link
Contributor

jtojnar commented Oct 22, 2019

The reason is upstream is trying to prune deprecated APIs. Unfortunately, pygtk is still reaching at us from its grave. On #gnome-hackers channel, there was some talk about post-mortem rejuvenation for pygtk.

@d-goldin
Copy link
Contributor Author

I arrived at similar conclusions. I assune nobody feels overly enthusiastic about patching pango or being stuck witj an old version for all nixpkgs. should we consider splitting out a legacy version for pygtk and the possibly other cases until maybe sth moves upstream?

@7c6f434c: I think we probably should revert if we dont want to propagate all that pygtk breakage.

@7c6f434c
Copy link
Member

I am kind of afraid pygtk-using apps are also vulnerable to that invalid-UTF8-from-untrusted source CVE… Maybe apply the reverse of the find_shaper removal commit as a patch?

@jtojnar
Copy link
Contributor

jtojnar commented Oct 22, 2019

The reason is upstream is trying to prune deprecated APIs. Unfortunately, pygtk is still reaching at us from its grave. On #gnome-hackers channel, there was someone volunteering to perform post-mortem rejuvenation for pygtk. Until then, reverting the removal commit sounds good.

@d-goldin
Copy link
Contributor Author

Agreed on ideally not having pygtk being vulnerable. I can try to patch that part up in a few hours but Id be a but worried that this could lead a but deeper than just this particular commit. From cursory glances yesterday it looked they like have been ditching a few things.

@7c6f434c
Copy link
Member

I guess another option is to try applying the CVE patch to 1.43?

@d-goldin
Copy link
Contributor Author

I can try both avenues and test against pygtk and report back.

@d-goldin
Copy link
Contributor Author

Alright, the backport of the CVE patch seems to work well and requires less fiddling than the reverts. I will open a PR just for this particular aspect. What do you think of making an additional PR bringing back a newer pango version, moving fixed-up 1.43.0 to a versioned attribute, attaching it to pygtk only for now and seeing if we can keep most of the software on the most recent pango until the pygtk saga resolves itself?

d-goldin added a commit to d-goldin/nixpkgs that referenced this pull request Oct 22, 2019
There was a previous fix for this in
NixOS#71571

But some things, most notably pygtk, still rely on deprecated pango
APIs that are not available past 1.43, this backports the CVE
fix to this version.
@d-goldin d-goldin deleted the bump_pango branch October 22, 2019 16:46
@7c6f434c
Copy link
Member

I think a backport security fix to 1.43 in master and releases 19.09 and 19.03, with a bump with a pin for pygtk in staging sounds good.

WilliButz pushed a commit that referenced this pull request Oct 29, 2019
There was a previous fix for this in
#71571

But some things, most notably pygtk, still rely on deprecated pango
APIs that are not available past 1.43, this backports the CVE
fix to this version.

(cherry picked from commit 9524bf3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants