Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1510463ybl; Thu, 30 Jan 2020 00:57:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxCZh96pC+ixfN2ubMRGIcRm5zloIuKNY7klWwm9tADn58lfX8zHBSNvIBiLJIoNHzwZ6o3 X-Received: by 2002:a9d:4c8e:: with SMTP id m14mr2578386otf.245.1580374648936; Thu, 30 Jan 2020 00:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580374648; cv=none; d=google.com; s=arc-20160816; b=BjXn0dvKhYlcAyK4NLHvBffaBplFcKtSVxfb6hvPu5OgKHQKdI7GDittON4y/ewMc0 xlDZWcbe+Ba8PtJoGT15CA3J5sIe+zWvMBRsd7Cej/RMbzg9VPsicVaSimBWsOeFh/pt XdRe6ETELk0rCd4Gp0RiFKg2eq+J2ccaysmO14wxVbfjFpFRXtAuXXm7rw3lBlaNZ7LB hfgTHUZdN7gS8bahJh1GwGluXHDXSkHxopK81ok3sYQ2W00oydF1K9Fwy/xpvVtVZS1p ANJqJW3UQJaBmIFJUzdygNSt1E1sm98iLoh/u0ooVGZ1oXjdNYS7kjkKr/BdSOZuq+ri /fCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ltqih8r/YXGD2kJxXajbixBSaqU0NAsgMPa1WlgZDaQ=; b=DjDAFXvlYldB2O4aauRvtuTtyvojfVzCZYScYdovndyqKD/NiL2tkewtJR7JryA+9R RBlvwacCbP1tATeXwT3Q1Pw6OsAMR6g0W5Vqx9hYv2pAdKGv0TPHYCgmCWPW5XAoDQ7T fQpbJs3i3XXe/TuotofwMte7PIm6Xr/T+antDrNKXoKOufALx+SK4bAt5k9ktoRBXrBd GMiQiu0zeBiFPmiqxHcQ30VHHqKvWd23/XTXH0YvOA21qXEZyJfJCu7J3305LxGSS/Gp U6CIelNqxlgqGuxfPuZ8hYRyRA5xIpFdX4tRObcYnBl/GNu1KqIrTD71jpdhRCCqjZMc jjNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=i5u7lKKk; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d83si2295353oib.166.2020.01.30.00.57.02; Thu, 30 Jan 2020 00:57:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-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=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=i5u7lKKk; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726909AbgA3Iz3 (ORCPT + 99 others); Thu, 30 Jan 2020 03:55:29 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35816 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726895AbgA3Iz3 (ORCPT ); Thu, 30 Jan 2020 03:55:29 -0500 Received: by mail-wr1-f68.google.com with SMTP id g17so3052061wro.2 for ; Thu, 30 Jan 2020 00:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Ltqih8r/YXGD2kJxXajbixBSaqU0NAsgMPa1WlgZDaQ=; b=i5u7lKKk7hA7OeFIOvJ/dBUA3pnmEymApSJEkQ9UeoXpJ7UaxW79bcxlpmorJ9dLNV wHKbtNMp71WOkQwSrauTqjr9WQZR6KLjuLx3OpDH3GMjbrWpexDIyiq9b/Fs4Uu8SD6+ a/KmnJZCtpvWOz4ac2Z2Y3DXSNu4qgYlhM5IhqbhWgn+/IYFaU1YVuex/yJc1NYevv9l AwYbf9HVuB4tt5MDVXGrAmkBe/UCi+kiBYjBNxiEsHLA9rhoS1RvV3HyZWGYS91VCTEk 3ZFWdEERjmV4IDM5474AIIC3ZZsEslwvPxaMPuYiFxnsF4sFwyNtRI1WL4pOqOyF1D0X GM5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Ltqih8r/YXGD2kJxXajbixBSaqU0NAsgMPa1WlgZDaQ=; b=DW7CDGQg9q4ZZo129I/4IWLa3iZ8OFfCSunA2fbWR7cKTZOVZiEUVkAzISqdbxJuU7 CgHFQGleOW0SvW9gdr+Ye67Q/tSBehUVfAtyDiiNBy3OhPsKUN6W4gAi6Q3eTZW+Fqoc JXHgSazNfSE1EzWoRFOrjMhl6LrpWjE9WhoZLKf8ZjOIpp3aAb8CVjgEItQc9QOJJuyT LnoPQOejaaoEDFEN8DdWFDQmog+4b3D1p0oekWxq6fk5Cw+f+J80vQrib+Qr+2p/3uAV wTsdSj0JQKdMEs+keH5+9G2ZM7Vl/pLvO1+SUIUT8YbQflECj3ErDlz7fLW1Xnz4cUUY rgPA== X-Gm-Message-State: APjAAAVHQJkUjoC74HU0WPbXTiY1ooPz5tnFigvh0AYuKmtCFEc65lxJ q+W6nYqFeIVK//CWBqpDY2xlg5yNwjs= X-Received: by 2002:a05:6000:1187:: with SMTP id g7mr4151219wrx.109.1580374527486; Thu, 30 Jan 2020 00:55:27 -0800 (PST) Received: from rgajda2364 ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id q130sm5550413wme.19.2020.01.30.00.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 00:55:26 -0800 (PST) Date: Thu, 30 Jan 2020 09:55:25 +0100 From: Rafal Gajda To: "Gix, Brian" Cc: "linux-bluetooth@vger.kernel.org" , "Stotland, Inga" Subject: Re: [PATCH BlueZ v4 5/5] mesh: Add NVM storage of Replay Protection Message-ID: <20200130085525.hmlrfexnwm5dehbb@rgajda2364> References: <20200129023258.10004-1-brian.gix@intel.com> <20200129023258.10004-6-brian.gix@intel.com> <20200129121744.zv3jnf6uejjpetud@rgajda2364> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Wed, Jan 29, 2020 at 03:06:10PM +0000, Gix, Brian wrote: > Hi Rafał, > > On Wed, 2020-01-29 at 13:17 +0100, Rafal Gajda wrote: > > Hi Brian, > > > > I have a question about the way RPL is stored. > > > > On Tue, Jan 28, 2020 at 06:32:58PM -0800, Brian Gix wrote: > > > Mesh specification requires that Replay Protection be preserved > > > across node restarts. This adds that storage in > > > /rpl// > > > > Wouldn't it be more convinient to keep both iv_index and sequence in a file like this: > > /rpl/ > > ? > > > > You could store them in bytes instead of hex string > > and it would eliminate the need for cleaning entries from old IV_index. > > > We considered this and decided against it for ease of processing, as this method requires fewer file > operations. Cleaning old entries is something that will happen regardless of how the RPL tree looks in the > file system, as we delete entries that are older than (net->iv_index - 1) since we don't receive messages on > that iv_index, there is no possiblility of a Replay attack. And deleting a file system tree is pretty simple. > A SRC address does not get to keep it's spot in the RPL indefinitely... only over the current or prior > iv_index. > > Our other considerations included maintaining the integrity of the RPL across power-loss or abort reboots. > > However, we do recognize that some platforms may different NVM storage available that can be optimized in > different ways, so we tried to keep the NVM RPL apis as simple as possible to allow others to optimize the > storage as they see fit. For instance, if someone was to port this to an embedded system without a standard > linux file system. Ok, I understand. Thank you for the explanation. Rafał Gajda Silvair