diff options
Diffstat (limited to 'pym/kernelcheck/lib/kernellib.py')
-rw-r--r-- | pym/kernelcheck/lib/kernellib.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/pym/kernelcheck/lib/kernellib.py b/pym/kernelcheck/lib/kernellib.py index 384026f..c95252e 100644 --- a/pym/kernelcheck/lib/kernellib.py +++ b/pym/kernelcheck/lib/kernellib.py @@ -176,6 +176,7 @@ class Genpatch: class Kernel: 'Kernel class' + arch = str() revision = str() source = str() version = str() @@ -425,7 +426,7 @@ def find_cve(cve, directory): return None -def eval_cve_files(directory, kernel, arch, spin=None): +def eval_cve_files(directory, kernel, spin=None): 'Returns a vulnerabilty evaluation' files = parse_cve_files(directory) @@ -438,14 +439,14 @@ def eval_cve_files(directory, kernel, arch, spin=None): evaluation = Evaluation() for item in files: - if spin: #TODO migh be useful in future release (e.g. framework) + if spin: spin.update() evaluation.read += 1 if item.arch not in ARCHES: BUG_ON('[Error] Wrong architecture %s' % item.arch, item.bugid) - if item.arch != arch and item.arch != 'all': + if item.arch != kernel.arch and item.arch != 'all': evaluation.unaffected.append(item) else: evaluation.arch += 1 @@ -524,8 +525,12 @@ def compare_evaluation(kernel, compare): comparison = Comparison() - if kernel.read != compare.read or kernel.arch != compare.arch: - BUG_ON('Kernels do not match: %s' % kernel.read, compare.read) + if kernel.read != compare.read: + BUG_ON('Kernels do not match (read) : %s' % kernel.read, compare.read) + return + + if kernel.arch != compare.arch: + BUG_ON('Kernels do not match (arch) : %s' % kernel.arch, compare.arch) return for item in kernel.affected: @@ -645,7 +650,7 @@ def all_version(source): return versions -def eval_kernel_updates(kernel, kernel_eval, arch, spin=None): #TODO +def eval_kernel_updates(kernel, kernel_eval, spin): "" index = 0 @@ -655,8 +660,9 @@ def eval_kernel_updates(kernel, kernel_eval, arch, spin=None): #TODO if compare.version > kernel.version or \ (compare.version == kernel.version and \ compare.revision > kernel.revision): + compare.arch = kernel.arch compare.genpatch = get_genpatch(PORTDIR, compare) - compare_eval = eval_cve_files(DIR['out'], compare, arch, None) + compare_eval = eval_cve_files(DIR['out'], compare, spin) comparison = compare_evaluation(kernel_eval, compare_eval) for item in comparison.fixed: |