History

media: rc: validate that "rc_proto" is reasonable

Smatch complains that "rc_proto" comes from the user and it can result in shift wrapping in ir_raw_encode_scancode() drivers/media/rc/rc-ir-raw.c:526 ir_raw_encode_scancode() error: undefined (user controlled) shift '1 << protocol' This is true, but I reviewed the surrounding code and it appears harmless. Anyway, let's verify that "rc_proto" is valid as a kernel hardening measure.

Dan Carpenter committed 6 years ago

Commit 72e637f1 parent 73991392 files · +3 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/lirc.h+1−0
@@ -226,6 +226,7 @@ enum rc_proto { · 225 unmodified lines
226 RC_PROTO_RCMM24 = 25,226 RC_PROTO_RCMM24 = 25,
227 RC_PROTO_RCMM32 = 26,227 RC_PROTO_RCMM32 = 26,
228 RC_PROTO_XBOX_DVD = 27,228 RC_PROTO_XBOX_DVD = 27,
229 RC_PROTO_MAX = RC_PROTO_XBOX_DVD,
229};230};
230 231
231#endif232#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t