From patchwork Fri Jul 20 01:47:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 142405 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2392237ljj; Thu, 19 Jul 2018 18:48:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSQm+TCFGYIizuIDlfSmgSyrUtvzdGLFv3mQ2cNA3NqyWU5SNAiakUYYl7eHoWPyGXHHET X-Received: by 2002:a62:c218:: with SMTP id l24-v6mr86316pfg.185.1532051294650; Thu, 19 Jul 2018 18:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532051294; cv=none; d=google.com; s=arc-20160816; b=OzlMQcJG5J6AAmN0LywDjRQj5PFB0XIlXM3vhTvIrlyBOMpuSb7OtFBBUF8YiNaUKr pRx4crkFKIsxrPoRSxx37MHwTi2euClzODne1mgqswwd5W1jE/Zp9sktI+ry7/MpGTGK oHnxC+Ac04uj9UYVwyzz2h8Dm6u9aX2jukTLwDq4CuEpDX9DCY9IL6JJs932i+4kCXvB TreyMpBB2hPAVsNSl+dG1Zw4c5RfotS8E73JbFBRMNnP/A37wXZh5UxMeauu2x6MJPKc yPEKnUncj9NaRD+IZQ0SrFIp/n/IJSELh40XQRxUyFUt0S3Tu0400GuURDXbH3u3lb2E AQmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=TK1WDbeXxDnAkoiR4N4slQI5HJBht91mInwgn17IrQ0=; b=rQqF2SEHPm15dSB3EEqi9vbCf3sHuUvQD+nteTQBBvjEFhF3aEkf8cHr7Xtji+JN8g wNQVhpTaZ8YcrAA3mR4mahbxLRloVNYAu+//8Z3CtyvYs+BToE+FXhB53CwLuRlzOSpv oEmuknlYxY1QCJcMcRZJz858mSIJjeWlcHjjmH8KZRSbt/HpwzZhH/l82x/YAjAZTDkL s5FuLSrBmZYfjqyRPzbHLWME/4VqkNPKbIPfb8RvbyQbi8U7V20MU07CVHP/Ij311s7e EFrlZ1XWVhLNES3uM4Me5rk8ijIbgTfmwAC8oa4LdxW5l3sOwFG6vN9/Yu9H9LHuqFgR DUPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VZ8Nnv6B; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v37-v6si610005plg.486.2018.07.19.18.48.14; Thu, 19 Jul 2018 18:48:14 -0700 (PDT) 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=@linaro.org header.s=google header.b=VZ8Nnv6B; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731557AbeGTCeC (ORCPT + 31 others); Thu, 19 Jul 2018 22:34:02 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40285 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731446AbeGTCeA (ORCPT ); Thu, 19 Jul 2018 22:34:00 -0400 Received: by mail-pg1-f196.google.com with SMTP id x5-v6so5358422pgp.7 for ; Thu, 19 Jul 2018 18:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TK1WDbeXxDnAkoiR4N4slQI5HJBht91mInwgn17IrQ0=; b=VZ8Nnv6BZ94a23iQ0zH0JXowN4YBd3UQvKDC+65woEeUzIrnGOPiTVJUHqB+41bviu 0mccSQjfmELIkbnUsVSI5vUR9jlVuMOGhNTSO2/OMIOMpsgbWRiCn85TAoppIqRLmpo3 x6nbwOfmyPAxN34pAhVCll1MlqqlRknOc9LQk= 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:in-reply-to :references; bh=TK1WDbeXxDnAkoiR4N4slQI5HJBht91mInwgn17IrQ0=; b=BynnKoyi+9Q+X4VDt2xufqy87TrU5LEGAn4Q9766fs8glUA8dfQj1ff4o9xWNBxote I2REEzqVTcr8XxYHDBWsKkSGcqg5Z5Fd/8eySrkDERww6fuQlv+Oc2+mWq4IVRs2kOUy wG0QiqveKofrqSleu4FAzX1RdgP25rCFkA3LvprddVMsL2k7bgrO1EqnQK47xNoSEm7z cDiTeg5PMh9S3EXb8TwpZ+TJCljBBhMZzlM4tmToL2SWQmG4NYBZ3F7h7ntrVDbVCLm1 WMztWNBD9nWsaBSWZey4pM+mkNwz+7z+Bv6sJpW5OJXR6KX3V5asZzMnUf/MynQ9VZsD pNIQ== X-Gm-Message-State: AOUpUlEizoUoPA3FTdmJzGHLQH5Oqf9wPpOK8Srerz2rltSnycI9e2zr GHKVusrhmpXnVHsQXktV4VsEdA== X-Received: by 2002:a63:b349:: with SMTP id x9-v6mr73318pgt.337.1532051290075; Thu, 19 Jul 2018 18:48:10 -0700 (PDT) Received: from localhost.localdomain (fs76eedbeb.tkyc508.ap.nuro.jp. [118.238.219.235]) by smtp.gmail.com with ESMTPSA id 203-v6sm475868pgb.14.2018.07.19.18.48.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 18:48:09 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Andy Shevchenko , Hans de Goede , Lukas Wunner Subject: [PATCH 9/9] efivars: Call guid_parse() against guid_t type of variable Date: Fri, 20 Jul 2018 10:47:26 +0900 Message-Id: <20180720014726.24031-10-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180720014726.24031-1-ard.biesheuvel@linaro.org> References: <20180720014726.24031-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko uuid_le_to_bin() is deprecated API and take into consideration that variable, to where we store parsed data, is type of guid_t we switch to guid_parse() for sake of consistency. While here, add error checking to it. Signed-off-by: Andy Shevchenko Signed-off-by: Ard Biesheuvel --- fs/efivarfs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index 71fccccf317e..8c6ab6c95727 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c @@ -86,7 +86,9 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, /* length of the variable name itself: remove GUID and separator */ namelen = dentry->d_name.len - EFI_VARIABLE_GUID_LEN - 1; - uuid_le_to_bin(dentry->d_name.name + namelen + 1, &var->var.VendorGuid); + err = guid_parse(dentry->d_name.name + namelen + 1, &var->var.VendorGuid); + if (err) + goto out; if (efivar_variable_is_removable(var->var.VendorGuid, dentry->d_name.name, namelen))