]> git.baikalelectronics.ru Git - kernel.git/commit
of: unittest: re-implement overlay tracking
authorFrank Rowand <frank.rowand@sony.com>
Sat, 1 Jan 2022 03:33:29 +0000 (21:33 -0600)
committerRob Herring <robh@kernel.org>
Wed, 5 Jan 2022 01:23:06 +0000 (19:23 -0600)
commit4222c91c4b38b15ab499851ff3aa46cb168b22a2
treecb5cf36da54730a91787d679b7cf3c9686d8ebb6
parent7b217304fa73348611bc8007f9d560d923f501f8
of: unittest: re-implement overlay tracking

Some overlays are tracked when they are applied.  The tracked overlays
are later removed after the overlay tests are completed.  The old
implementation makes assumptions about the expected values for
overlay changeset id created by the overlay apply which result
in fragile code.  The new code removes the assumptions.

A symptom that exposes a problem with the tracking code is a
warning "UBSAN: shift-out-of-bounds in drivers/of/unittest.c:1933:36",
Kernel Version: 5.15-rc7, PPC-64, Talos II.  This results from variable
"id" value of -1 in the final line of of_unittest_untrack_overlay().

Reported-by: erhard_f@mailbox.org
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220101033329.1277779-3-frowand.list@gmail.com
drivers/of/unittest.c