From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35819C433FE for ; Sun, 16 Oct 2022 11:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k0oeOK/lgvQFftglNNiHWUN1+05P9stuQvv6Ec8zPEs=; b=s29IH2uHBCJalU MFf6wZb3rm9Tr0BXDia80pEUn7EsJxTBXp3HuQlGE76i8pPFdTad2wTwQONzmQvnOZCc0DTEPAUJV Ag6gWByDaP8K42L82b7IOqEgpAy86oO0c8fuR5Bb/P1fdsMJrcM2oYAlBiA2WONT5PzwjG5Ys1Cfk 73Ev3VC0p11zGKk2hNuopyDigedkYjngUvcqjmkvitdXSSXji7S7WVoYSH4qUDd3nz0U8FNzIhbtS d0cIJCPsPvnznb95ra+QI6M1aXTNusgHzpJAqaanjqGmXUTfH2mkjIDoKRD3OYPPhBYx/nt73fgqo Ht6aIWnYcbWvZQv6eCZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ok1b2-0019FD-PO; Sun, 16 Oct 2022 11:14:20 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ok1az-0019EB-3T for linux-arm-kernel@lists.infradead.org; Sun, 16 Oct 2022 11:14:18 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 97054B80C82; Sun, 16 Oct 2022 11:14:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98E45C433D6; Sun, 16 Oct 2022 11:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665918854; bh=hIeR0HjC/MFtqIOCqjFNizhJMZwtz0fSkbUOXk7wnmg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NkmdpPVSMBptLWUOcjeMi0SObz1Amo9AEWB0YE7rrZKz5TaDhnmpHZaM8IXX6KDDf cPe8wNxZry6rdepcnEX4Ocpur/ecNRXrRa/hfcVJe2T5jKXde/XD2cWngNbsoPd6Vl uuabzsgFAcd+bfT+dCveGJlCHIYzU0S8vouZtVI++LA32ItCVUFZkltGbaGfM5SRAc GAksFqGvuCCdm2VC7cxqHVaCsz/VkwbFKaklsO2/8vdsZo3P7K3SutAnfNwv4YyLjC UMDglvVIEK+QjWFmZGGW3Cb/WJBFFZenRwjoGh1GBvwj1xyX4DdUKOWUK3RXY1dt80 q2N3oPTMXtd2g== Date: Sun, 16 Oct 2022 12:14:41 +0100 From: Jonathan Cameron To: Subject: Re: [PATCH v3 04/10] iio: at91-sama5d2_adc: Fix unsafe buffer attributes Message-ID: <20221016121441.5e792a52@jic23-huawei> In-Reply-To: <2d150d6d-17bb-3e18-3174-e769f4cc8417@microchip.com> References: <2d150d6d-17bb-3e18-3174-e769f4cc8417@microchip.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221016_041417_316918_3246D867 X-CRM114-Status: GOOD ( 18.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, lars@metafoo.de, mazziesaccount@gmail.com, linux-iio@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, Eugen.Hristev@microchip.com, alexandru.ardelean@analog.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 6 Oct 2022 08:34:17 +0000 wrote: > On 03.10.2022 11:11, Matti Vaittinen wrote: > > The iio_triggered_buffer_setup_ext() was changed by > > commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") > > to silently expect that all attributes given in buffer_attrs array are > > device-attributes. This expectation was not forced by the API - and some > > drivers did register attributes created by IIO_CONST_ATTR(). > > > > The added attribute "wrapping" does not copy the pointer to stored > > string constant and when the sysfs file is read the kernel will access > > to invalid location. > > > > Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order > > to prevent the invalid memory access. > > > > Signed-off-by: Matti Vaittinen > > Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") > > Tested-by: Claudiu Beznea > > on SAMA5D2 > Applied to the fixes-togreg branch of iio.git and marked for stable. For the reset of the series I'll need to wait for these first 4 patches to make their way to upstream of the togreg branch then queue the rest up on top of that. Jonathan > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel