Skip to content

Commit

Permalink
fix uevent action-string regression
Browse files Browse the repository at this point in the history
Mark Lord wrote:
>
> On boot, syslog is flooded with "uevent: unsupported action-string;" messages.
..
> Mar 28 14:43:29 shrimp kernel: tty ptyqd: uevent: unsupported
> action-string; this will be ignored in a future kernel version
> Mar 28 14:43:29 shrimp kernel: tty ptyqe: uevent: unsupported
> action-string; this will be ignored in a future kernel version
> Mar 28 14:43:29 shrimp kernel: tty ptyqf: uevent: unsupported
> action-string; this will be ignored in a future kernel version
> Mar 28 14:43:29 shrimp kernel: tty ptyr0: uevent: unsupported
> action-string; this will be ignored in a future kernel version
..

These messages are a regression compared with 2.6.24, which did not
flood the syslog with them.

The actual underlying problem was introduced in 2.6.23, when somebody
made the string parsing no longer accept nul-terminated strings as a
valid input to store_uevent().

Eg.  "add\0" was valid prior to 2.6.23, where the code regressed to
require "add" without the '\0'.

This patch fixes the 2.6.23 / 2.6.24 regressions, by having the code
once again tolerate the trailing '\0', if present.

According to GregKH, this mainly affects older Ubuntu systems, such as
the one I have here that requires this fix.

Signed-off-by: Mark Lord <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Mark Lord authored and torvalds committed Mar 30, 2008
1 parent eb08b6b commit a9edadb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kobject_uevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int kobject_action_type(const char *buf, size_t count,
enum kobject_action action;
int ret = -EINVAL;

if (count && buf[count-1] == '\n')
if (count && (buf[count-1] == '\n' || buf[count-1] == '\0'))
count--;

if (!count)
Expand Down

0 comments on commit a9edadb

Please sign in to comment.