fwupd/plugins/dfu
Richard Hughes 5308ea4fae Never use memcpy() in a possibly unsafe way
There are several subtle bugs in various places in fwupd caused by not treating
user-provided offsets into buffers as unsafe. As fwupd runs as root we have to
assume that all user firmware is evil, and also that devices cannot be trusted.

Make a helper to put all the logic into one place and convert all users.
2019-08-12 09:22:09 -05:00
..
contrib Do not use /usr/bin/env in the shebang line 2018-07-12 07:08:53 -05:00
fuzzing trivial: Add the generated SREC examples for easy fuzzing 2018-05-01 09:53:10 +01:00
tests Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-cipher-xtea.c Never use memcpy() in a possibly unsafe way 2019-08-12 09:22:09 -05:00
dfu-cipher-xtea.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-common.c Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-common.h Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-device-private.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-device.c Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-device.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-element.c Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-element.h Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-firmware.c Export the version-format to clients 2019-04-30 09:25:41 +01:00
dfu-firmware.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-format-dfu.c Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
dfu-format-dfu.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-format-dfuse.c Never use memcpy() in a possibly unsafe way 2019-08-12 09:22:09 -05:00
dfu-format-dfuse.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-format-ihex.c Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-format-ihex.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-format-metadata.c Never use memcpy() in a possibly unsafe way 2019-08-12 09:22:09 -05:00
dfu-format-metadata.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-format-raw.c Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
dfu-format-raw.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-format-srec.c Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-format-srec.h Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-image.c Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
dfu-image.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-patch.c Never use memcpy() in a possibly unsafe way 2019-08-12 09:22:09 -05:00
dfu-patch.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-sector-private.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-sector.c Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
dfu-sector.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-self-test.c Use FuFirmware as a container for firmware images 2019-08-08 13:10:57 +01:00
dfu-target-avr.c dfu: Add some trivial, but useful, debugging for AVR DFU devices 2019-04-29 08:27:51 -05:00
dfu-target-avr.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-target-private.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-target-stm.c Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
dfu-target-stm.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
dfu-target.c Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
dfu-target.h Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
dfu-tool.c Export the version-format to clients 2019-04-30 09:25:41 +01:00
dfu-tool.h2m use help2man for dfu-tool too 2018-02-09 17:26:18 +00:00
dfu.quirk dfu: Require a specific USB class and subclass for DFU mode 2018-12-03 13:57:52 +00:00
fu-plugin-dfu.c Show a console warning if loading an out-of-tree plugin 2019-01-19 07:26:20 +00:00
fuzzing.md Add support for parsing Motorola S-record files 2018-05-01 09:16:19 +01:00
meson.build trivial: Fix potential compile failures for high -j values 2019-02-01 16:52:16 +00:00
README.md trivial: Add the missing protocol IDs to the plugin READMEs 2019-01-29 22:28:09 +00:00

DFU Support

Introduction

Device Firmware Update is a standard that allows USB devices to be easily and safely updated by any operating system.

Firmware Format

The daemon will decompress the cabinet archive and extract a firmware blob in DFU or DfuSe file format.

This plugin supports the following protocol IDs:

  • org.usb.dfu
  • com.st.dfuse

GUID Generation

These devices use the standard USB DeviceInstanceId values, e.g.

  • USB\VID_273F&PID_1003&REV_0001
  • USB\VID_273F&PID_1003
  • USB\VID_273F

Quirk use

This plugin uses the following plugin-specific quirks:

Quirk Description Minimum fwupd version
DfuFlags Optional quirks for a DFU device which doesn't follow the DFU 1.0 or 1.1 specification 1.0.1
DfuForceVersion Forces a specific DFU version for the hardware device. This is required if the device does not set, or sets incorrectly, items in the DFU functional descriptor. 1.0.1
DfuJabraDetach Assigns the two magic bytes sent to the Jabra hardware when the device is in runtime mode to make it switch into DFU mode. 1.0.1