klipper/src/atsamd
Kevin O'Connor 3f72e519ed atsamd: Fix possible buffer overflow in usbserial.c
The USB buffer size register PCKSIZE.SIZE was not being assigned
correctly.  As a result, it was possible for an incoming USB
transmission to write past the allocated buffer space, which could
corrupt memory of other storage.  In particular, in some cases gcc may
layout ram in such a way that the trailing bytes of an incoming
message might overlap the buffer for an outgoing message.  This could
cause sporadic transmit errors and unstable connections.

Fix by correctly configuring the PCKSIZE.SIZE register.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-17 10:18:39 -05:00
..
adc.c atsamd: Fixes for samc21 and compiler optimizations (#6198) 2023-06-16 16:41:08 -04:00
chipid.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
clock.c atsamd: Add support CANbus on ATSAME5x chips 2022-10-13 11:28:27 -04:00
fdcan.c atsamd: Add support for reporting canbus state 2025-02-02 18:43:34 -05:00
gpio.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
gpio.h i2c: handle errors at i2ccmds 2024-10-26 22:06:30 -04:00
hard_pwm.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
i2c.c atsamd: allow i2c rate to be 400kHz 2024-11-12 19:50:48 -05:00
internal.h atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
Kconfig Kconfig: Note which chips require software divide operations 2025-04-17 12:09:19 -04:00
main.c armcm_link: Rename CONFIG_FLASH_START to CONFIG_FLASH_APPLICATION_ADDRESS 2022-12-14 18:44:07 -05:00
Makefile atsamd: Enable HAVE_LIMITED_CODE_SIZE on small atsamd chips 2025-04-16 13:54:44 -04:00
samc21_clock.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
samd51_clock.c atsamd: Add support CANbus on ATSAME5x chips 2022-10-13 11:28:27 -04:00
samd51_watchdog.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
sercom.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
serial.c atsamd: Add Kconfig definitions for same51j19 and same54p20 chips 2022-10-13 11:27:14 -04:00
spi.c spicmds: Rework spi config commands 2019-08-06 18:56:53 -04:00
timer.c atsamd: Add support for SAMC21 2023-05-01 13:56:32 -04:00
usbserial.c atsamd: Fix possible buffer overflow in usbserial.c 2025-12-17 10:18:39 -05:00
watchdog.c atsamd: Don't clear the watchdog if a clear is still in progress 2019-02-15 22:13:28 -05:00