Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14162894pxu; Mon, 4 Jan 2021 14:46:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKYQmPGA8meVg7yZEk4XdVBtA8EfGtwOHIw08Gfb8w8HH2A+3P0YF6yd0J5NuehVyTd2ZH X-Received: by 2002:a50:d50a:: with SMTP id u10mr71927295edi.58.1609800394613; Mon, 04 Jan 2021 14:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609800394; cv=none; d=google.com; s=arc-20160816; b=CO+FQ8HoQvB6C/ditFSiPktPJDll064LPHfVvcGZaB32+q+ZTuO0gSni3n2Sjj+qVB pET9fm/Gzai9XHARiDMGEsRdBaqX5uiCkQifHlAyjiVz1JOWHyyYqk0/5lXtyrHlvFIE 524XqrEqFjm+2JXCNJMQLLzTmkty62K5ImsE2A9kyv4XHDmfc/NF5wPNYz1ASxOL53zG +S2uITuE5TouWERoGP7z/FE1OTuodfKGpzTvJKSfwcsDnTISYjvQmiAyqCxGWpiIpFg8 KxAP1lM4n5fBIwag7hnOm/LiGhWSEpbGNz02h1nehekmjl2LP5ruczDLlmvSeHaWWd7+ xckg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :mime-version:user-agent:date:message-id:subject:from:cc:to :dmarc-filter:sender:dkim-signature; bh=zZUFznR+lb3g0Oh2iFAqK9DoirsGLwYKKznxswKYgIc=; b=bBZECXwbHLq0kQtyMQ/C4FDXv3SZ1jv9xpN6baOI6i7iyNoxUQRlVGHdNpKa/+R1gW zHGa5mp4xj2sVF2uhlW4LjsBklyXlbb/TYT5bt3rYQuFqxcdN6JfLTahYNmpV6ev4Tdm OaZxV+T7m5e7gauy7dqgthhXCDUPzvxTWQyRz0Gd3PxhGzh2brg9hk0A+aaxFxc4ltHI nlu5zF04mDsOh9+jLR3URuLIaEtzmEQtqQFzBYXgdGTL1mQ/v+wbLDmqsN/m//pK8KuS y8X6XSpKGE3kAbZHlVt92G0yIa7IM0sNIIYzS+UZuxwtLBqGmayrlpPF4a3gd0TUvBm+ VxpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=k+4EdnII; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si29297654ejd.515.2021.01.04.14.46.11; Mon, 04 Jan 2021 14:46:34 -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=@mg.codeaurora.org header.s=smtp header.b=k+4EdnII; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbhADWoj (ORCPT + 99 others); Mon, 4 Jan 2021 17:44:39 -0500 Received: from so254-31.mailgun.net ([198.61.254.31]:59441 "EHLO so254-31.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbhADWoj (ORCPT ); Mon, 4 Jan 2021 17:44:39 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1609800256; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Date: Message-ID: Subject: From: Cc: To: Sender; bh=zZUFznR+lb3g0Oh2iFAqK9DoirsGLwYKKznxswKYgIc=; b=k+4EdnIINJI2YlR0Efei5eVx4JWHl0zkhm9D8xonMjVkeJnZBp6dvKw2ybRd8HREvPKmNUnc t6EnexgAW27uq3O3sBfebULQl83xRl8AkeknWJXS2yiQyt6U1iYXWUjpwH8f+NjbqLHa2GiK WdY5BX9HHCBFrKbwabdfode3aUo= X-Mailgun-Sending-Ip: 198.61.254.31 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 5ff39a233d84969114531a75 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 04 Jan 2021 22:43:47 GMT Sender: sidgup=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5BF44C433ED; Mon, 4 Jan 2021 22:43:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.10] (cpe-75-83-25-192.socal.res.rr.com [75.83.25.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4628BC433CA; Mon, 4 Jan 2021 22:43:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4628BC433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=sidgup@codeaurora.org To: mcgrof@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List Cc: "psodagud@codeaurora.org" From: Siddharth Gupta Subject: PROBLEM: Firmware loader fallback mechanism no longer works with sendfile Message-ID: <7e6f44b1-a0d2-d1d1-9c11-dcea163f8f03@codeaurora.org> Date: Mon, 4 Jan 2021 14:43:45 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Thanks, Siddharth [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