From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757745AbcH2PRE (ORCPT ); Mon, 29 Aug 2016 11:17:04 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:41525 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757454AbcH2PRB (ORCPT ); Mon, 29 Aug 2016 11:17:01 -0400 Subject: Re: [PATCH] iio: ad5755: fix off-by-one on devnr limit check To: Lars-Peter Clausen , Colin King , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , linux-iio@vger.kernel.org References: <1469486401-17839-1-git-send-email-colin.king@canonical.com> <1efdfc25-b13d-c383-2346-75b414b32081@kernel.org> <3ed48869-735a-002b-d89e-b1a694d19b6e@metafoo.de> Cc: linux-kernel@vger.kernel.org From: Jonathan Cameron Message-ID: Date: Mon, 29 Aug 2016 16:16:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <3ed48869-735a-002b-d89e-b1a694d19b6e@metafoo.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/08/16 21:07, Lars-Peter Clausen wrote: > On 08/21/2016 09:30 PM, Jonathan Cameron wrote: >> On 25/07/16 23:40, Colin King wrote: >>> From: Colin Ian King >>> >>> The comparison for devnr limits is off-by-one, the current check >>> allows 0 to AD5755_NUM_CHANNELS and the limit should be in fact >>> 0 to AD5755_NUM_CHANNELS - 1. This can lead to an out of bounds >>> write to pdata->dac[devnr]. Fix this by replacing > with >= on the >>> comparison. >>> >>> Signed-off-by: Colin Ian King >> Lars? >> >> Looks correct to me. >> >> I'd also like a fixes tag for this if possible. Guessing it >> might well be the original driver introduction but best to be >> sure ;) > > It's new in 4.8-rc1. It was introduced by the devictree support patch. > > Fixes: c947459979c6 ("iio: ad5755: add support for dt bindings") Thanks Lars, Applied to the togreg branch of iio.git - initially pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >