[PATCH] fixing icecat's multimedia

  • Done
  • quality assurance status badge
Details
2 participants
  • Julien Lepiller
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Julien Lepiller
Severity
normal
J
J
Julien Lepiller wrote on 14 Jan 2020 01:58
(address . guix-patches@gnu.org)
20200114015819.713f4e4f@tachikoma.lepiller.eu
From IRC yesterday, I found that icecat was still missing something to
properly read multimedia streams, like mp3/mp4. In the current version,
it now tries to open ffmpeg's library dynamically, by looking in the
store, instead of standard locations (/usr/lib etc). But this is not
enough: even if icecat can properly find the library, it cannot load it
because it uses a sandboxing feature that only allows it to read and
write files from/to specific locations. /gnu/store is not part of them.

Since icecat has access to /lib and /usr/lib, I think we can also give
it read access (not write) to /gnu/store. This patch attempts to do
just that, but I couldn't build icecat because of a lack of space. It
sets the default security.sandbox.content.read_path_whitelist to
/gnu/store/, the leading / meaning "and everything under it,
recursively").

Wdyt?
From adf7fdeffaa806edcd8abdac0746c06dad52c495 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 14 Jan 2020 01:48:42 +0100
Subject: [PATCH] gnu: icecat: Give access to the store to the sandbox.

* gnu/packages/gnuzilla.scm (icecat): Add punch-hole-in-sandbox phase.
---
gnu/packages/gnuzilla.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (21 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 62b4390eab..14f446ee0a 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -971,6 +971,14 @@ from forcing GEXP-PROMISE."
(("libavcodec\\.so")
(string-append (assoc-ref inputs "ffmpeg") "/lib/libavcodec.so")))
#t))
+ (add-after 'fix-ffmpeg-runtime-linker 'punch-hole-in-sandbox
+ (lambda _
+ (substitute* "browser/app/profile/icecat.js"
+ (("\"security.sandbox.content.read_path_whitelist\", \"\"")
+ (string-append
+ "\"security.sandbox.content.read_path_whitelist\", \""
+ (%store-directory) "/\"")))
+ #t))
(replace 'bootstrap
(lambda _
(invoke "sh" "-c" "autoconf old-configure.in > old-configure")
--
2.24.0
T
T
Tobias Geerinckx-Rice wrote on 14 Jan 2020 02:29
87eew2hllb.fsf@nckx
Julien,

Thanks! For anything with ‘security’ *and* ‘sandbox’ in the name
we should definitely involve IceCat upstream.

Julien Lepiller ???
Toggle quote (6 lines)
> (substitute* "browser/app/profile/icecat.js"
> (("\"security.sandbox.content.read_path_whitelist\", \"\"")
> (string-append
> "\"security.sandbox.content.read_path_whitelist\", \""
> (%store-directory) "/\"")))

When I asked bandali on IRC a few weeks(?) ago about this exact
patch, they didn't sound convinced. But we were both quite unsure
:-) Have things changed? Have you talked to Mark?

Toggle quote (4 lines)
> Since icecat has access to /lib and /usr/lib, I think we can
> also give
> it read access (not write) to /gnu/store.

That sounds reasonable, if you're certain that it's read-only.

Toggle quote (2 lines)
> Wdyt?

LGTM from the Guix side.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl4dGXAACgkQ2Imw8BjF
STxD1w//TwjqW3vUr91rsliI9WaWfCvxoGvlXXH5eR9w6JY6JN0bXOzG+kD6TNbC
6wgpL1X/ZmyMJ/E1luF/cUCrT17lCvo0qEYj1XvQ8S4rPEmTg8KnbwaBP0GbidCR
5YBvrWfM+NuM3ax5DVk589fBrhzeKtPyo4YEuHysnTdk+0sxJ7CyBY+yRvMiZ3Qv
W7pVhQ3AVxAQoI2kEjOmYp3aUMuL6D/QNufZTXpcdIYVJeeluIKs5nGE7ffysxOt
nMrwqyR8B4/PXNiq6gOOcayELr68ek7ReNIKoDSIkPoNrotytJ/UQ21WeJ9hPL4a
9h5b2zYAcV+CaERsQBL3cyvOObcLqpDIJSqGZcBmsnlQdbr81p1vpIyVGXAkPyRT
jStGffRZoHYxncdEdGc7MhB5Z0yLThZKDBU5eNxSAwp+/wlJdkosNdCUzRUHEfoU
31bo48Z6yxiF2HQ+Ufzjue1v0Msm00uUY+48suBlefxQq/65V1w+B4zxsUlPFb0R
zHacozpVMNDvaiR8sPOCUcYwtbINSVZ+pTI520A2aiMa4ZMRl/jjDKNJ4LfwhbLW
nEdXteEtjn5IUcIiMj1Sj1ksE/bcmX4SrVCr1xzBHxhC1+f5Lfcbw+brL/udz3fH
kpIuVb+N2WwaI/aIYoUeGoVd/6OykyAo9bio3ScPx9VSmvWCSO0=
=Uob7
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 14 Jan 2020 02:36
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 39127@debbugs.gnu.org)
20200114023605.70d61b0b@tachikoma.lepiller.eu
Le Tue, 14 Jan 2020 02:29:20 +0100,
Tobias Geerinckx-Rice <me@tobias.gr> a écrit :

Toggle quote (16 lines)
> Julien,
>
> Thanks! For anything with ‘security’ *and* ‘sandbox’ in the name
> we should definitely involve IceCat upstream.
>
> Julien Lepiller ???
> > (substitute* "browser/app/profile/icecat.js"
> > (("\"security.sandbox.content.read_path_whitelist\", \"\"")
> > (string-append
> > "\"security.sandbox.content.read_path_whitelist\", \""
> > (%store-directory) "/\"")))
>
> When I asked bandali on IRC a few weeks(?) ago about this exact
> patch, they didn't sound convinced. But we were both quite unsure
> :-) Have things changed? Have you talked to Mark?

I haven't talked to Mark, but here's how you can check:

set security.sandbox.content.read_path_whitelist in about:config to an
empty string (the default) and restart icecat. It cannot play the video
from https://harmonist.tuxfamily.org/.It doesn't work. Set it to
/gnu/store/ (with a trailing /) and restart the browser. Now the video
works. This patch attempts to make the working scenario the default :)

Toggle quote (14 lines)
>
> > Since icecat has access to /lib and /usr/lib, I think we can
> > also give
> > it read access (not write) to /gnu/store.
>
> That sounds reasonable, if you're certain that it's read-only.
>
> > Wdyt?
>
> LGTM from the Guix side.
>
> Kind regards,
>
> T G-R
T
T
Tobias Geerinckx-Rice wrote on 14 Jan 2020 02:42
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 39127@debbugs.gnu.org)
87d0bmhkyt.fsf@nckx
Julien,

Julien Lepiller ???
Toggle quote (2 lines)
> I haven't talked to Mark, but here's how you can check:

[…]

I meant about any potential security issues or alternative
solutions (e.g. restricting access to less than the entire store).

I was already aware of the problem and this work-around, and can
confirm that it works.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl4dHJoACgkQ2Imw8BjF
STxhdxAAqg07l/9bwEpu1aRJ2KXhouPuMu13rg0Zmc7Gbk63Hkt38sUfoUhuzM+O
IR3GOQOO+KQg+Dw/fKNLjMdxXpNb3Ur7G9z9tMSfn86j6278tBXFLJJXjaHKBE0J
1mF5ndHUBrzxOSPeaKtGk79dvGcU/OCmN9Z+ew++rgNCktm9p5jQ8qyBvDwH2Zea
b488vQB8vAFqCL2eIaBRNTRvg9Tc0awSD/2pIE4KagRNj12kg7x3Dmr12CCmfF/x
r9+58fSrXL3UkswNwg679hhkzaFr+1qWsZsfgdWz8VUg8+eMihaat8BKTd/Vebjb
0TgUJWSzSNJcGNOGunXmzMBZdy1Rld0NLruliHlvzaIJhgbzdzRmyl2ACOJJPq0v
nikT3C8iJs4ZMmeq71CGDw+RnzEzruvqGfwaHF0NjJ25sKpdjKtqNJf10ptDalps
Lnvkv7E9uIcFym9+MxZxpxf9SXAtnFNz/OxSRvyTJBjKoerxMg/4ktCfqS46Qs2G
Ew/t5NseWGtbTO7v6vStcKpb1l/w2RqfsOHK4kVHRRi5oES7nGRSlbDqH/gF/+Hx
/qqzFe93NU4xyyIBw+HkMLLfEm7VPVoOnkvrjomGEhzmfrV3ks75SA4kHnvHQoiV
6hPFHgOTJXKji5pbXsoncP2ZRTBr0oGEc0ZGBUOZuHFUIYHoMtY=
=QUfI
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 16 Jan 2020 10:04
(address . 39127-done@debbugs.gnu.org)
878sm7ai2a.fsf@nckx
Fixed by mhw[0] in commit
429c8284d232c3f9fbe3dc87a3da323f3a864c03, so closing this one.

Thanks!

T G-R

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl4gJw0ACgkQ2Imw8BjF
STz7lA/8CDIAGxxQfuUlKndP3E6dsSY/g/vqV/pEVAC6yw3hy/eP1A0pMX2OhXlp
Qi4OonL7cysdHvv4VbiA0SF6lAAKBk+vMPqJlE+V2JVu5Ipa82WTDLn7P446Ndj/
qTC4Ft4C2OgkzZBsw1QVvi7VoOEHs/c7WmyJKfDAyX7ZcalxlxJ7uUBFQz7eID8E
h5qiOPOhJ1Hx3tzogM44i4R1/jQiKQm5zzX/fCypitFPXDidoeRK7+XCod1xb1Ie
T6tlS703lnF6tCWOQCOoImIq9OWYE7VhuVOHfTf2vkwbUYMAnbmtQPtve8Zd9RNp
wFzZqQDj+KSIZj6vpIrlxYsP+58HSBTVaXU/qSnuANlO6nPx5HqBzSEbi1RE/mlJ
/doRcyy/zkQAVSdjxbO6dURXxNDUefp4iJf5SKMVNjTkb18/j+Q1F/N/T5p2vAcV
mDPW9fLn2hpiWoEGAp3RJx8sqVKEzApQ/DDkbQ72wiAVuzoMwwi06QZmssdlCOmZ
yDm/RUaoGpeSZFF+joiFzzukaOAHtAJdXbl2Tg0XEQsx/wsyQoMj0qSTXF0a/iwh
qZFls0XV6fO9kPGf42qTIURs3RL6ny6eO8H1hJX/0TsBdQGRa1KdC8ZNwo29mP05
7H3wv9v748b59cXjXNn/0xMjha/9BIvxeAPMzx4yTrkRghG7EDM=
=f41F
-----END PGP SIGNATURE-----

Closed
?