From patchwork Wed Jul 10 01:24:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 11037687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D63E714C0 for ; Wed, 10 Jul 2019 01:34:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8933288FD for ; Wed, 10 Jul 2019 01:34:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8F892890B; Wed, 10 Jul 2019 01:34:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2044F288FD for ; Wed, 10 Jul 2019 01:34:43 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EEB8540B4; Wed, 10 Jul 2019 01:34:41 +0000 (UTC) X-Original-To: cip-dev@lists.cip-project.org Delivered-To: cip-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 23F7C3645 for ; Wed, 10 Jul 2019 01:25:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mo-csw.securemx.jp (mo-csw1116.securemx.jp [210.130.202.158]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 24D1B88E for ; Wed, 10 Jul 2019 01:25:06 +0000 (UTC) Received: by mo-csw.securemx.jp (mx-mo-csw1116) id x6A1Owwc014450; Wed, 10 Jul 2019 10:24:58 +0900 X-Iguazu-Qid: 2wGr1P8H2t2RsAg2RY X-Iguazu-QSIG: v=2; s=0; t=1562721898; q=2wGr1P8H2t2RsAg2RY; m=Z8Sdo52SdMSBsPoC6B2QkTdGWFb34RP8j//SsArs7bw= Received: from imx2.toshiba.co.jp (imx2.toshiba.co.jp [106.186.93.51]) by relay.securemx.jp (mx-mr1111) id x6A1Ou9T020288; Wed, 10 Jul 2019 10:24:57 +0900 Received: from enc01.localdomain ([106.186.93.100]) by imx2.toshiba.co.jp with ESMTP id x6A1OuT0019827; Wed, 10 Jul 2019 10:24:56 +0900 (JST) Received: from hop001.toshiba.co.jp ([133.199.164.63]) by enc01.localdomain with ESMTP id x6A1OuGq025485; Wed, 10 Jul 2019 10:24:56 +0900 From: Daniel Sangorrin To: ben.hutchings@codethink.co.uk Date: Wed, 10 Jul 2019 10:24:50 +0900 X-TSB-HOP: ON Message-Id: <20190710012450.16524-7-daniel.sangorrin@toshiba.co.jp> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190710012450.16524-1-daniel.sangorrin@toshiba.co.jp> References: <20190710012450.16524-1-daniel.sangorrin@toshiba.co.jp> Cc: cip-dev@lists.cip-project.org Subject: [cip-dev] [cip-kernel-sec][RESEND 6/6] report_affected: add show-description option X-BeenThere: cip-dev@lists.cip-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cip-dev-bounces@lists.cip-project.org Errors-To: cip-dev-bounces@lists.cip-project.org X-Virus-Scanned: ClamAV using ClamSMTP Rather than looking up each issue file, I would like to have an overview of what each CVE ID means. Example: $ ./scripts/report_affected.py --show-description linux-4.4.y-cip Signed-off-by: Daniel Sangorrin --- scripts/report_affected.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/report_affected.py b/scripts/report_affected.py index a97986c..b7a2678 100755 --- a/scripts/report_affected.py +++ b/scripts/report_affected.py @@ -18,8 +18,8 @@ import kernel_sec.issue import kernel_sec.version -def main(git_repo, remotes, - only_fixed_upstream, include_ignored, *branch_names): +def main(git_repo, remotes, only_fixed_upstream, + include_ignored, show_description, *branch_names): live_branches = kernel_sec.branch.get_live_branches() if branch_names: branches = [] @@ -130,7 +130,13 @@ def main(git_repo, remotes, sorted_cve_ids = sorted( branch_issues.get(branch['full_name'], []), key=kernel_sec.issue.get_id_sort_key) - print('%s:' % branch['full_name'], *sorted_cve_ids) + if show_description: + print('%s:' % branch['full_name']) + for cve_id in sorted_cve_ids: + print(cve_id, '=>', + kernel_sec.issue.load(cve_id).get('description', 'None')) + else: + print('%s:' % branch['full_name'], *sorted_cve_ids) if __name__ == '__main__': @@ -159,6 +165,9 @@ if __name__ == '__main__': parser.add_argument('--include-ignored', action='store_true', help='include issues that have been marked as ignored') + parser.add_argument('--show-description', + action='store_true', + help='show the issue description') parser.add_argument('branches', nargs='*', help=('specific branch[:tag] or stable tag to ' @@ -171,5 +180,5 @@ if __name__ == '__main__': mainline=args.mainline_remote_name, stable=args.stable_remote_name) kernel_sec.branch.check_git_repo(args.git_repo, remotes) - main(args.git_repo, remotes, - args.only_fixed_upstream, args.include_ignored, *args.branches) + main(args.git_repo, remotes, args.only_fixed_upstream, + args.include_ignored, args.show_description, *args.branches)