Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbbDGNz6 (ORCPT ); Tue, 7 Apr 2015 09:55:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52902 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752825AbbDGNzz (ORCPT ); Tue, 7 Apr 2015 09:55:55 -0400 Date: Tue, 7 Apr 2015 14:55:52 +0100 From: Alasdair G Kergon To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Alasdair Kergon , Mike Snitzer , Neil Brown , "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [dm-devel] [PATCH 3/3] dm-crypt: Adds support for wiping key when doing suspend/hibernation Message-ID: <20150407135552.GA32694@agk-dp.fab.redhat.com> Mail-Followup-To: Pali =?iso-8859-1?Q?Roh=E1r?= , Alasdair Kergon , Mike Snitzer , Neil Brown , "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <1428254419-7334-1-git-send-email-pali.rohar@gmail.com> <1428254419-7334-4-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1428254419-7334-4-git-send-email-pali.rohar@gmail.com> Organization: Red Hat UK Ltd. Registered in England and Wales, number 03798903. Registered Office: 64 Baker Street, 4th floor, London, W1U 7DF. User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1079 Lines: 26 On Sun, Apr 05, 2015 at 07:20:19PM +0200, Pali Roh?r wrote: > This patch adds dm message commands and option strings to optionally wipe key > from dm-crypt device before entering suspend or hibernate state. Try to avoid 0/1 - use descriptive options instead. E.g. key wipe_on_hibernation / key retain_on_hibernation (message) wipe_key_on_hiberation ('dmsetup table' - don't forget the reporting interface!) Have you tested against every state the driver might be in at the time of suspend/hibernation? > +static void crypt_suspend_and_wipe_key(struct crypt_config *cc) > +{ > + dm_suspend_md(dm_table_get_md(cc->ti->table)); I'm not particularly keen on this - silently ignoring expected error states like -EINVAL rather than checking first and not calling the function at all when it's known not to be needed. Alasdair -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/