Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14367150pxu; Mon, 4 Jan 2021 22:41:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3vUOBYHAf+99X4ACk8srbJUQmaFc2vXGNEdpavryIpRunonXEeFNCXA8SV+oeaRW4jrRe X-Received: by 2002:a17:906:8587:: with SMTP id v7mr67620299ejx.381.1609828891532; Mon, 04 Jan 2021 22:41:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609828891; cv=none; d=google.com; s=arc-20160816; b=E1lamY0QV02paRoJaEfM6FtfpVz2epwWgQ8FRQ2ZWx+irSdSqYa8Zt3rwgYHERp7Ay XTv8dtoFz6qL0LesWMIq8nLk9oWUCzIBesc2Wdql44pyxKPhshk2B3znUvJy1uPMVlv9 NqEZFHIMeGE5ajfIgF6LTD0RT94bEKTgqpYzpvhu7Y1EOY5DEC/DDv81q3Khh9kmpkyQ Y/6UpxxvggGjJCNHiEDuC/SJvICzJgnrxFVWbERS5rsVvPakuiEi20K2D1BTmqTMlUI8 LQrgiIC/VJwqjQRwgXhXNlyTNCWcENDeP7Pc8624h0yucs38GqSWo1++PDyezL1znZV6 dYzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8Btzre3ahdvAhcPBbmYbZS6kG1lNTXOYW1iRS/B3yUw=; b=XjzTau4pIK++IuSSQXST0B5NpWRwQE/KjijbaXdU3SC2l3ffYKmKJEj12oRNQ4m56/ bMiUdJdRsktdR9JJwkxR6Da3ouy2Ib/nxtyd0R0ZzkCRH40f5BosBc4uUs40jGP852vs u+G2+ayTBVbF0QHarHgkVrT2S6m9uX7inhYTTTVcd2nGWQ2M2RP/1yLFDvfiWydca1El Luxp+Pe8+A4bveL43qVmWVaiFjj6CisSlgcPzXTt5p5RX4YHKiNGHnfX20rYifgvyrUi dy02ciz29BEahQ1R79Uvu++/kN5C0Tv4sym8yJm8ih4P8uBMPWDhCg0YFNAsj57pMH/4 6wHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oGL+AKY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si31960038edq.247.2021.01.04.22.41.08; Mon, 04 Jan 2021 22:41:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oGL+AKY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726329AbhAEGhn (ORCPT + 99 others); Tue, 5 Jan 2021 01:37:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:57156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbhAEGhn (ORCPT ); Tue, 5 Jan 2021 01:37:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC6BD22286; Tue, 5 Jan 2021 06:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609828622; bh=oZOFcC23CV20+DCygF8foWIBHoqErFJTMYyklPRWOCk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oGL+AKY/X85vM+06sLdW3kxiRkJn1D/91jJ0TY+FBrRFixllk6NS/sjOJcZnI3/G9 E2s8luVagf8slq81cf6YnJGvvcbaJtVGAO8xMhgBwS2moiH51GUIJLRGk8DCvfCwih q+IHUzb8G87w1v0BESEogXL3v0pUOM9DfFW8VzB4= Date: Tue, 5 Jan 2021 07:36:58 +0100 From: Greg KH To: Siddharth Gupta Cc: mcgrof@kernel.org, rafael@kernel.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List , "psodagud@codeaurora.org" Subject: Re: PROBLEM: Firmware loader fallback mechanism no longer works with sendfile Message-ID: References: <7e6f44b1-a0d2-d1d1-9c11-dcea163f8f03@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e6f44b1-a0d2-d1d1-9c11-dcea163f8f03@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 02:43:45PM -0800, Siddharth Gupta wrote: > Hi all, > > With the introduction of the filesystem change "fs: don't allow splice > read/write without explicit ops"[1] the fallback mechanism of the firmware > loader[2] no longer works when using sendfile[3] from the userspace. What userspace program are you using to load firmware? Are you not using the in-kernel firmware loader for some reason? > Since the binary attributes don't support splice_{read,write} functions the > calls to splice_{read,write} used the default kernel_{read,write} functions. > With the above change this results in an -EINVAL return from > do_splice_from[4]. > > This essentially means that sendfile will not work for any binary attribute > in the sysfs. Have you tried fixing this with a patch much like what we did for the proc files that needed this? If not, can you? > [1]: https://github.com/torvalds/linux/commit/36e2c7421f02a22f71c9283e55fdb672a9eb58e7#diff-70c49af2ed5805fc1406ed6e6532d6a029ada1abd90cca6442711b9cecd4d523 > [2]: https://github.com/torvalds/linux/blob/master/drivers/base/firmware_loader/main.c#L831 > [3]: https://github.com/torvalds/linux/blob/master/fs/read_write.c#L1257 > [4]: https://github.com/torvalds/linux/blob/master/fs/splice.c#L753 kernel development is on git.kernel.org, not github :) thanks, greg k-h