Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3058312rwi; Sun, 16 Oct 2022 04:39:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4oioY/M0IqCGE+Jx5F9AHhc/S7WfyV/MlU12Ca5ubrTMvGbg9JTgASryoybcCUR6Falt8i X-Received: by 2002:a17:907:3ea7:b0:78d:cb74:3d1f with SMTP id hs39-20020a1709073ea700b0078dcb743d1fmr4948678ejc.483.1665920353913; Sun, 16 Oct 2022 04:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665920353; cv=none; d=google.com; s=arc-20160816; b=ozG10fDpeOvh+YPZakPmcqH1H7/a4ElxUiqVhir4KuLBcV5X4qIBBwWk0l31A2p0Zg o8H1u15T545d7rZN09EhfhaVOf7UVJcv+MS9GdjryztuYt3U3Zr/lDf7NwQYxQSwfNXy HkBzP0R7qpz5pedw7TgC+Ls+4+etptBFSy+GfBA28b25Zn8uTTZZdmvXkVE4vgPhFoUg Mf4PKqOWzUbyv4GI/T+rUCIlCfRbkk+0ApE/KgRTV4Ff9ToA/xX8k1ZzH2GYOe5Q5qrQ IvFvJyrd5U3okuXcFixMMGvUbaLmc7ZrGpARpfghE/opdMb86TaUXirZiLzUupJS8YRV RkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=jAfLiH+MbZYTTamqUTvEoLnO4YgSOwbrIU05SvM1nqE=; b=XhJ1w/TrZ6+BxdUq+q9Q791bJjRp0hdvkv/Jy181x43Fzya70d/nOHZbQB/XAhridN BNXrCK4oRRKvUMUVCu/lQAU3luLHF7OgjURmY9Vqow6rMwv4jLG2EWuevT6uvGPkW5JI hME/b0md+WxIWIbuMY2Mxc7ltLfIWTLIXHomYUB4u1mZWNIuJHbfTfeRwVdJT2SGcVYb 0DapDocMwjYei0hgF0yClwl/YcH6y4g+u31tJLCTS5XMD4re9lLf+XuAat/OCAU/5Jqy VFZRFg3xrrRNQ/dDwvj5Gb5oko31ymvpw0S2equI/gT2XmDIc6qFvi9oMO0YixpDCoJq PB4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NkmdpPVS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb6-20020a170907960600b0078d25914115si8142732ejc.570.2022.10.16.04.38.39; Sun, 16 Oct 2022 04:39:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NkmdpPVS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbiJPLOU (ORCPT + 99 others); Sun, 16 Oct 2022 07:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiJPLOR (ORCPT ); Sun, 16 Oct 2022 07:14:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 426263DF00; Sun, 16 Oct 2022 04:14:16 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id E79EA60A54; Sun, 16 Oct 2022 11:14:14 +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: Cc: , , , , , , , , , 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >