Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753548AbdLSTmO (ORCPT ); Tue, 19 Dec 2017 14:42:14 -0500 Received: from mga01.intel.com ([192.55.52.88]:17651 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbdLSTg7 (ORCPT ); Tue, 19 Dec 2017 14:36:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,428,1508828400"; d="scan'208";a="4018623" From: Dongwon Kim To: linux-kernel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, xen-devel@lists.xenproject.org, mateuszx.potrola@intel.com, dongwon.kim@intel.com Subject: [RFC PATCH 42/60] hyper_dmabuf: always generate a new random keys Date: Tue, 19 Dec 2017 11:29:58 -0800 Message-Id: <1513711816-2618-42-git-send-email-dongwon.kim@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513711816-2618-1-git-send-email-dongwon.kim@intel.com> References: <1513711816-2618-1-git-send-email-dongwon.kim@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 954 Lines: 30 From: Mateusz Polrola Need to update random keys when reusing hyper_dmabuf_id in the list to increase security Signed-off-by: Dongwon Kim --- drivers/xen/hyper_dmabuf/hyper_dmabuf_id.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/xen/hyper_dmabuf/hyper_dmabuf_id.c b/drivers/xen/hyper_dmabuf/hyper_dmabuf_id.c index f59dee3..cccdc19 100644 --- a/drivers/xen/hyper_dmabuf/hyper_dmabuf_id.c +++ b/drivers/xen/hyper_dmabuf/hyper_dmabuf_id.c @@ -120,10 +120,11 @@ hyper_dmabuf_id_t hyper_dmabuf_get_hid(void) */ if (hid.id == -1 && count < HYPER_DMABUF_ID_MAX) { hid.id = HYPER_DMABUF_ID_CREATE(hyper_dmabuf_private.domid, count++); - /* random data embedded in the id for security */ - get_random_bytes(&hid.rng_key[0], 12); } + /* random data embedded in the id for security */ + get_random_bytes(&hid.rng_key[0], 12); + return hid; } -- 2.7.4