Patch "Revert "scripts/faddr2line: Check only two symbols when calculating symbol size"" has been added to the 6.11-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    Revert "scripts/faddr2line: Check only two symbols when calculating symbol size"

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-scripts-faddr2line-check-only-two-symbols-whe.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d0c6c081d693523d62647a63de94b11992b491df
Author: Carlos Llamas <cmllamas@xxxxxxxxxx>
Date:   Mon Aug 12 23:01:20 2024 +0000

    Revert "scripts/faddr2line: Check only two symbols when calculating symbol size"
    
    [ Upstream commit 56ac7bd2c58a4e93d19f0ccb181035d075b315d3 ]
    
    This reverts commit c02904f05ff805d6c0631634d5751ebd338f75ec.
    
    Such commit assumed that only two symbols are relevant for the symbol
    size calculation. However, this can lead to an incorrect symbol size
    calculation when there are mapping symbols emitted by readelf.
    
    For instance, when feeding 'update_irq_load_avg+0x1c/0x1c4', faddr2line
    might need to process the following readelf lines:
    
     784284: ffffffc0081cca30   428 FUNC    GLOBAL DEFAULT     2 update_irq_load_avg
      87319: ffffffc0081ccb0c     0 NOTYPE  LOCAL  DEFAULT     2 $x.62522
      87321: ffffffc0081ccbdc     0 NOTYPE  LOCAL  DEFAULT     2 $x.62524
      87323: ffffffc0081ccbe0     0 NOTYPE  LOCAL  DEFAULT     2 $x.62526
      87325: ffffffc0081ccbe4     0 NOTYPE  LOCAL  DEFAULT     2 $x.62528
      87327: ffffffc0081ccbe8     0 NOTYPE  LOCAL  DEFAULT     2 $x.62530
      87329: ffffffc0081ccbec     0 NOTYPE  LOCAL  DEFAULT     2 $x.62532
      87331: ffffffc0081ccbf0     0 NOTYPE  LOCAL  DEFAULT     2 $x.62534
      87332: ffffffc0081ccbf4     0 NOTYPE  LOCAL  DEFAULT     2 $x.62535
     783403: ffffffc0081ccbf4   424 FUNC    GLOBAL DEFAULT     2 sched_pelt_multiplier
    
    The symbol size of 'update_irq_load_avg' should be calculated with the
    address of 'sched_pelt_multiplier', after skipping the mapping symbols
    seen in between. However, the offending commit cuts the list short and
    faddr2line incorrectly assumes 'update_irq_load_avg' is the last symbol
    in the section, resulting in:
    
      $ scripts/faddr2line vmlinux update_irq_load_avg+0x1c/0x1c4
      skipping update_irq_load_avg address at 0xffffffc0081cca4c due to size mismatch (0x1c4 != 0x3ff9a59988)
      no match for update_irq_load_avg+0x1c/0x1c4
    
    After reverting the commit the issue is resolved:
    
      $ scripts/faddr2line vmlinux update_irq_load_avg+0x1c/0x1c4
      update_irq_load_avg+0x1c/0x1c4:
      cpu_of at kernel/sched/sched.h:1109
      (inlined by) update_irq_load_avg at kernel/sched/pelt.c:481
    
    Fixes: c02904f05ff8 ("scripts/faddr2line: Check only two symbols when calculating symbol size")
    Signed-off-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
    Acked-by: Will Deacon <will@xxxxxxxxxx>
    Acked-by: Brian Johannesmeyer <bjohannesmeyer@xxxxxxxxx>
    Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/scripts/faddr2line b/scripts/faddr2line
index fe0cc45f03be1..1fa6beef9f978 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -252,7 +252,7 @@ __faddr2line() {
 				found=2
 				break
 			fi
-		done < <(echo "${ELF_SYMS}" | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2 | ${GREP} -A1 --no-group-separator " ${sym_name}$")
+		done < <(echo "${ELF_SYMS}" | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2)
 
 		if [[ $found = 0 ]]; then
 			warn "can't find symbol: sym_name: $sym_name sym_sec: $sym_sec sym_addr: $sym_addr sym_elf_size: $sym_elf_size"




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux