Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp585707ybl; Fri, 13 Dec 2019 01:08:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyeiAokBiWUcaL00PNKn93Of6umIaufYl2H1SpHBbUch/pzSP5SLVOFb0SISValndqXNg3q X-Received: by 2002:a9d:58c9:: with SMTP id s9mr12844052oth.121.1576228136613; Fri, 13 Dec 2019 01:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576228136; cv=none; d=google.com; s=arc-20160816; b=EQVWosNwAu95MWi8keT7+0eInTQW80r2iJ9wCX/CfFkOLr4AO2Uk4lRNX5exn0sJDP 04NrlpMFMuXNFS8bgFUoXK0bcVPQV1VrTsHUB3qrzyEiqZ8UXi+JjyigTSpdMkuxj16A eViwU6/66IOAgGhVW4jAHMRnoyfbp3ZvHTSXIku/MdmGDqyZzNzJmvEN9qe2sfIB0mep 2m2AU4qwKDOdSizDAhhI4j7DI8GxWFw8lvt5EHxUZ8xdCM7Ks0bPGb5xXA3vajqIau+C qexam9JHnJ23wr3p6D7La3EucRzfiWcz59Q1DG1Pwn7QAKmnWYXfACyeg1+JW6b8gLZz yJZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=zgE7H652OqyN4nqOaV860HJ7ZzQUNg5TLy0QsJ2RWEM=; b=cl/2OQiLSDh8fic471JY+jsGqcUOEZfgsyD2yVv/aX9VvHyPe3fNpb2ufkvPm+4HYb e4c7P4PTS5Qk95DzXNE5FS06NxbMxNUetMdkfCNU26984QKmMxhhR44rq7YZEMowDuPV 4lS7gq1ZbrqzVvVliocIuawsHtHVj+0l4xYqvg92DojTjiNfODMhVOc8WWexefmvF+AC PlPHhcTJN+PqVLdnmRqQsiSl4kGZvpwjdVPpAYiSS6OUdeB3yAeivoejhRGdzj2nefkO uqyq1QkQAkkdTO71YbnuUrcd2WYcA8JYwaKjq1hFrrpk0+1BdGJlrGmH4Qg3sXWp7fmz uQLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J1oVLkla; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si4931981oir.132.2019.12.13.01.08.45; Fri, 13 Dec 2019 01:08:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J1oVLkla; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbfLMJHC (ORCPT + 99 others); Fri, 13 Dec 2019 04:07:02 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36496 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfLMJHC (ORCPT ); Fri, 13 Dec 2019 04:07:02 -0500 Received: by mail-wr1-f65.google.com with SMTP id z3so5797933wru.3; Fri, 13 Dec 2019 01:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=zgE7H652OqyN4nqOaV860HJ7ZzQUNg5TLy0QsJ2RWEM=; b=J1oVLkla8WreiTlDRa8LXhCUU3+ujH95oXC6BB78EC0TlSd6fLuE2GRl+0xU9wkgF/ pyiyXOPC1BtTsJaHcINVAVDo++Wm383E4Q9i5piBTTXn49Pj2ALqb7sMcSUNkIbfT+yS K41HTu/Fh6XO7jD1+BHEfutnY8DvE7/4h4QCqP/EGosQaxJRTuErqsXGNXZaIUKlgS/M ttQvUX5dQv/Dn31A6dLorPNkKNvVw5Xm93i3BrnH0CEukc26UZp3qzPUX9Hafr0dM8Qn zwGBiZvLc/9JryUUTIAfiKJy58fNZtfm5fGzi2nfQ8YT7b2vnHRrELju7cV9nRB0jdkh dpCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zgE7H652OqyN4nqOaV860HJ7ZzQUNg5TLy0QsJ2RWEM=; b=jZIOmZtAsEKd7kimOxV0IrEYPz/QqRV1JYPzJNLd7iHHnP2DFHN3zZyAArxDGnlZ50 EdUuMVoBfyqLA2sX/7jKf/PEfVbjtbgdLO8eWzJW8P0H8yWRDkAHUbMevnSReTmGtVQa hszGdgyairpDkCY+r7eQvtsOuZsz5APwAdPZ1DRtNNPJNfNBRDnPsHfu8YvIMJDZW3FZ 9Ze8bQK0anUjYogz4GRKsFa7KVDIaqYTjIAOasL7PpfXn5oD032hEDlp/jZjbESa2c55 YuiOGJ2FUM93UKz1BgAUzTerrsvCUrRG0J01Q9jm+q9SPVA2iVrIHTJO8riFPv6rdwHA y58Q== X-Gm-Message-State: APjAAAU4nNoysGG4j54NdB9MLCNxPAlLmk5DJsSi8VvP5QDh68ZkZdL7 XJbEhYsZvi7bSCdvncVvAtQ= X-Received: by 2002:adf:ebc6:: with SMTP id v6mr11423586wrn.75.1576228019639; Fri, 13 Dec 2019 01:06:59 -0800 (PST) Received: from linux-691t.suse.de ([124.11.22.254]) by smtp.gmail.com with ESMTPSA id y6sm9079094wrl.17.2019.12.13.01.06.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2019 01:06:58 -0800 (PST) From: "Lee, Chun-Yi" X-Google-Original-From: "Lee, Chun-Yi" To: Ard Biesheuvel , James Morris , "Serge E . Hallyn" , David Howells , Josh Boyer , Nayna Jain , Mimi Zohar Cc: linux-efi@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" Subject: [PATCH 0/2 v2] efi: cosmetic patches for the error messages when Date: Fri, 13 Dec 2019 17:06:44 +0800 Message-Id: <20191213090646.12329-1-jlee@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When loading certificates list from EFI variables, the error messages and efi status codes always be emitted to dmesg. It looks ugly: [ 2.335031] Couldn't get size: 0x800000000000000e [ 2.335032] Couldn't get UEFI MokListRT [ 2.339985] Couldn't get size: 0x800000000000000e [ 2.339987] Couldn't get UEFI dbx list This cosmetic patch set moved the above messages to the error handling code path. And, it adds a function to convert EFI status code to a string for improving the readability of debug log. The function can also be used in other EFI logs. v2: The convert function be moved to efi.c Lee, Chun-Yi (2): efi: add a function to convert the status code to a string efi: show error messages only when loading certificates is failed drivers/firmware/efi/efi.c | 32 +++++++++++++++++++++ include/linux/efi.h | 1 + security/integrity/platform_certs/load_uefi.c | 41 ++++++++++++++------------- 3 files changed, 55 insertions(+), 19 deletions(-) -- 2.16.4