GithubHelp home page GithubHelp logo

aduggan / rmi4utils Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 10.0 225 KB

Library and utilities for working with Synaptics RMI4 devices.

License: Apache License 2.0

Makefile 1.67% C++ 97.00% C 1.33%

rmi4utils's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rmi4utils's Issues

Lack of bounds checking in FirmwareImage::ParseHierarchicalImg

There are at least two places where ParseHierarchicalImg takes an offset to a buffer and does not validate that the resulting offset is valid. This means that malicious firmware can cause rmi4utils to crash, which is potentially a security issue as the user can dictate the memory address that gets overwritten. As firmware images are unsigned, it's almost trivial for a user to supply a modified image to cause the crash.

If you'd like me to attach some sample firmware which causes a crash using either (or both) offset checks just ask. There's also now an implementation of ParseHierarchicalImg in fwupd if you'd like to copy the fixes.

respect CXXFLAGS/LDFLAGS during link

each Makefile has a slightly different linking rule. some utilize LDFLAGS, some don't. i'd make them all start like:

$(CXX) $(CXXFLAGS) $(LDFLAGS) ...

also, i'd just drop the LD indirection. you need to use the C++ driver everywhere anyways.

use CPPFLAGS instead of INCLUDES

the standard env var name for preprocessor flags is CPPFLAGS, not INCLUDES. please rename that var in the build files, and then you don't have to manually add it to CXXFLAGS and such.

respect user's env settings

in the Makefiles, rather than do things like:

CXXFLAGS = ...
CPPFLAGS = ...

it should append the value like so:

CXXFLAGS += ...
CPPFLAGS += ...

that way the settings the user has in the env will work automatically. like so:

CXXFLAGS='-O2 -pipe' CPPFLAGS=-D_FORTIFY_SOURCE=2 make

do not hardcode -static in LDFLAGS

can you make the -static flag a build time knob ? since GNU make is already required, you could do something like:

STATIC_BUILD ?= y
ifeq ($(STATIC_BUILD),y)
LDFLAGS += -static
endif

rmi4update v1.3.0+ hangs during EnterFlashProgrammingV7()

Hi,

I'm using rmi4update to update the Synaptics touchscreen firmware on a Lenovo 300e 2nd Gen AMD Chromebook. The firmware versions and touchscreen properties are included in the logs below.

Using rmi4update v1.2.14, the update succeeds: update_logs_1-2-14.txt.

Using rmi4update v1.3.0 or higher, the update hangs during EnterFlashProgrammingV7(): update_logs_1-3-0.txt.

I've bisected the breakage to commit 8ade3e9.

The updater seems to hang at this call to ReadF34QueriesV7(). This call was added as part of commit 8ade3e9, and there are now two calls to ReadF34Queries*() in EnterFlashProgrammingV7(). It's not clear whether this is intentional.

If I build v1.3.0 (or later) with that call to ReadF34QueriesV7() removed, then the update succeeds update_logs_1-3-0_call_removed.txt.

Do you have any idea why this call is causing the updater to hang?

Thanks,
Reka

use $(MAKE) instead of `make` in Makefiles

in a bunch of places, there's code like:
make -C dir target

that should be $(MAKE) instead so that the correct make is used, as well as the right flags passed down, and building in parallel is sane

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.