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

Accessing USB device from an App make chromium to crash #101

Open
alexdupre opened this issue Nov 23, 2017 · 8 comments
Open

Accessing USB device from an App make chromium to crash #101

alexdupre opened this issue Nov 23, 2017 · 8 comments

Comments

@alexdupre
Copy link

I'm trying to use Chrome extensions that interact with USB devices, like Trezor or Ledger wallets, but chrome crashes as soon as they try to connect.

You can easily reproduce the issue by simply installing the extension at https://wallet.trezor.io (no need to have any device)

@alexdupre
Copy link
Author

For the records, I've tried to build the FreeBSD port with the DEBUG flag to try to get a stacktrace, but it fails to compile with the following error:

[12237/32200] python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="llvm-nm40" --sofile="./libgfx.so" --tocfile="./libgfx.so.TOC" --output="./libgfx.so" -- clang++40 -shared -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -m64 -Wl,--gdb-index -Wl,--export-dynamic -L/usr/local/lib -o "./libgfx.so" -Wl,-soname="libgfx.so" @"./libgfx.so.rsp" FAILED: libgfx.so libgfx.so.TOC python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="llvm-nm40" --sofile="./libgfx.so" --tocfile="./libgfx.so.TOC" --output="./libgfx.so" -- clang++40 -shared -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -m64 -Wl,--gdb-index -Wl,--export-dynamic -L/usr/local/lib -o "./libgfx.so" -Wl,-soname="libgfx.so" @"./libgfx.so.rsp" /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcPatternCreate' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcPatternAdd' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcConfigSubstitute' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcDefaultSubstitute' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcFontSort' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcPatternGetString' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcFontSetDestroy' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::GetFallbackFonts(gfx::Font const&)): undefined symbol 'FcPatternDestroy' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcPatternCreate' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcPatternAddString' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcPatternAddBool' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcConfigSubstitute' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcDefaultSubstitute' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcPatternDel' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcFontSort' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::CreateFcFontSetForLocale(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)): undefined symbol 'FcPatternDestroy' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::FillFallbackList()): undefined symbol 'FcPatternGetBool' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::FillFallbackList()): undefined symbol 'FcPatternGetString' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFontSet::FillFallbackList()): undefined symbol 'FcPatternGetCharSet' /usr/local/llvm40/bin/ld.lld: error: ../../ui/gfx/font_fallback_linux.cc:(function gfx::(anonymous namespace)::CachedFont::GetFontName(_FcPattern*)): undefined symbol 'FcPatternGetString' /usr/local/llvm40/bin/ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors) clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)

@cpu82
Copy link
Contributor

cpu82 commented Dec 28, 2017

Support for USB U2F devices was added in r455495.

@alexdupre
Copy link
Author

It doesn't crash anymore, but also it doesn't seem to recognize any plugged-in device, even after changing the /dev/uhid* and /dev/usb/* permissions.

@cpu82
Copy link
Contributor

cpu82 commented Jan 9, 2018

Do you have security/libu2f-host installed?

Please see PR196754 for further details.

@alexdupre
Copy link
Author

As far as I can see that port simply installs a set of devd rules to change the device permissions, the same thing I did. The chromium patches are expected to add support for any HID device or just for U2F ones?

@cpu82
Copy link
Contributor

cpu82 commented Jan 9, 2018

The chromium patches add support for both types of devices. It should work (not tested), but you have to add the UDEV rules.

https://github.com/trezor/trezor-common/blob/master/udev/51-trezor.rules

@alexdupre
Copy link
Author

The UDEV rules are just the Linux equivalent of the FreeBSD devd rules to change permissions.

@cpu82
Copy link
Contributor

cpu82 commented Jan 10, 2018

Yes of course, we use devd rules. Your best bet is to ask @gonzoua. In fact, he added support for USB U2F devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants