With string type property entries we need to use sizeof(const char *) instead of the number of characters as the length of the entry. If the string was shorter then sizeof(const char *), attempts to read it would have failed with -EOVERFLOW. The problem has been hidden because all build-in string properties have had a string longer then 8 characters until now.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -258,7 +258,7 @@ struct property_entry { · 257 unmodified lines | ||
| 258 | 258 | #define PROPERTY_ENTRY_STRING(_name_, _val_) \ |
| 259 | 259 | (struct property_entry) { \ |
| 260 | 260 | .name = _name_, \ |
| 261 | − .length = sizeof(_val_), \ | |
| 261 | + .length = sizeof(const char *), \ | |
| 262 | 262 | .type = DEV_PROP_STRING, \ |
| 263 | 263 | { .value = { .str = _val_ } }, \ |
| 264 | 264 | } |