From: Jialin Zhang zhangjialin11@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4JZ0H CVE: NA
-------------------------------
Use the kABI reference checking tool as follows:
./scripts/check-kabi -k Module.symvers.baseline -s Module.symvers
A python error occurred, and the following traceback is printed:
Traceback (most recent call last): File "./scripts/check-kabi", line 144, in <module> load_symvers(symvers,symvers_file) File "./scripts/check-kabi", line 45, in load_symvers checksum,symbol,directory,type = string.split(in_line) ValueError: too many values to unpack
It is because the Module.symvers file change its line format in the following commits, and the namespace field may be empty: cb9b55d21fe0 ("modpost: add support for symbol namespaces") 5190044c2965 ("modpost: move the namespace field in Module.symvers last")
In order to solve this problem, use '\t' to split each line and add a variable to save namespace.
Fixes: 9fc7fbafe3d3 ("kabi: add kABI reference checking tool") Signed-off-by: Jialin Zhang zhangjialin11@huawei.com Reviewed-by: Wei Li liwei391@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- scripts/check-kabi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/check-kabi b/scripts/check-kabi index e3ec97cebffa..b1b55d512e61 100755 --- a/scripts/check-kabi +++ b/scripts/check-kabi @@ -42,7 +42,7 @@ def load_symvers(symvers,filename): break if in_line == "\n": continue - checksum,symbol,directory,type = string.split(in_line) + checksum,symbol,directory,type,namespace = string.split(in_line, sep='\t')
symvers[symbol] = in_line[0:-1]
@@ -57,7 +57,7 @@ def load_kabi(kabi,filename): break if in_line == "\n": continue - checksum,symbol,directory,type = string.split(in_line) + checksum,symbol,directory,type,namespace = string.split(in_line, sep='\t')
kabi[symbol] = in_line[0:-1]
@@ -70,9 +70,9 @@ def check_kabi(symvers,kabi): moved_symbols=[]
for symbol in kabi: - abi_hash,abi_sym,abi_dir,abi_type = string.split(kabi[symbol]) + abi_hash,abi_sym,abi_dir,abi_type,namespace = string.split(kabi[symbol], sep='\t') if symvers.has_key(symbol): - sym_hash,sym_sym,sym_dir,sym_type = string.split(symvers[symbol]) + sym_hash,sym_sym,sym_dir,sym_type,namespace = string.split(symvers[symbol], sep='\t') if abi_hash != sym_hash: fail=1 changed_symbols.append(symbol)