Re: [PATCH 1/2] of: Fix crash if an earlycon driver is not found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/10/2014 05:14 PM, Rob Herring wrote:

__earlycon_of_table_sentinel.compatible is a char[128], not a pointer, so
it will never be NULL.  Checking it against NULL causes the match loop to
run past the end of the array, and eventually match a bogus entry, under
the following conditions:

  - Kernel command line specifies "earlycon" with no parameters
  - DT has a stdout-path pointing to a UART node
  - The UART driver doesn't use OF_EARLYCON_DECLARE (or maybe the console
    driver is compiled out)

Fix this by checking to see if match->compatible is a non-empty string.

Signed-off-by: Kevin Cernekee <cernekee@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # 3.16+

Thanks. I'll queue this up.

BTW, you should not add stable CC when submitting for review, but
rather add a note for the maintainer to apply to stable. Only if a
commit is in mainline already and not flagged for stable, then you
send the patch with the stable tag to get the commit added to stable.
It's a bit confusing...

It's actually OK to tag the patch for stable (not really send to stable), so that that list gets automatically notified when the comment lands in the mainline. Unless the maintainer doesn't have his own rules about stable patches (like e.g. DaveM). Do you have alike rules?

Rob

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]