Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756040AbaLHR4n (ORCPT ); Mon, 8 Dec 2014 12:56:43 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:56293 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbaLHR4k convert rfc822-to-8bit (ORCPT ); Mon, 8 Dec 2014 12:56:40 -0500 Subject: Re: [PATCH v2 2/3] fpga manager: framework core Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: text/plain; charset=utf-8 From: Pantelis Antoniou In-Reply-To: <20141208175050.92EDAC40D73@trevor.secretlab.ca> Date: Mon, 8 Dec 2014 19:56:33 +0200 Cc: Pavel Machek , atull , Greg Kroah-Hartman , Jason Gunthorpe , "H. Peter Anvin" , Michal Simek , Michal Simek , Randy Dunlap , linux-kernel , "devicetree@vger.kernel.org" , Rob Herring , Ira Snyder , "linux-doc@vger.kernel.org" , Mark Brown , philip@balister.org, rubini , Steffen Trumtrar , Jason , kyle.teske@ni.com, Nicolas Pitre , Felipe Balbi , Mauro Carvalho Chehab , David Brown , Rob Landley , David Miller , cesarb@cesarb.net, "sameo@linux.intel.com" , Andrew Morton , Linus Walleij , Alan Tull , dinguyen@opensource.altera.com, Yves Vandervennet Content-Transfer-Encoding: 8BIT Message-Id: <6B035765-3AFB-4A28-8A16-51D2E2737932@konsulko.com> References: <1414007405-32186-1-git-send-email-atull@opensource.altera.com> <1414007405-32186-3-git-send-email-atull@opensource.altera.com> <20141024105200.GA20775@amd> <20141206135533.GA19672@amd> <20141208175050.92EDAC40D73@trevor.secretlab.ca> To: Grant Likely X-Mailer: Apple Mail (2.1993) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Grant, > On Dec 8, 2014, at 19:50 , Grant Likely wrote: > > On Sat, 6 Dec 2014 14:55:33 +0100 > , Pavel Machek > wrote: >> Hi! >> >>>> I am accustomed to doing 'echo -n' for most of sysfs anyway. Once in a >>>> while I am a bonehead and forget the '-n' and spend a few minutes >>>> wondering why this thing that worked last week suddenly rejects all >>>> commands. I'm just trying to make my user interface a bit user-friendly. >>>> >>>> I will take out the '\n' stripping and update the documentation. I didn't >>>> realize this would be controversial. >>> >>> Don't. You're doing the right thing by scrubbing your input. Requiring >>> 'echo -n' is just stupid when it is so easy to make work easily. >> >> 'foo\nbar\n' is unusual but valid filename in linux. It is bad idea to >> echo filenames into files in the first place... and arbitrarily >> disallowing certain filenames is not helping. > > Meh. Just because it is a valid linux filename doesn't mean this > interface is forced to accept it. There should be tighter rules about > how the filename can be constructed. Allowing any arbitrary path for any > arbitrary valid linux filename makes for a large attack surface. > > I would like to know, what is the purpose of the interface? Why is it > important to provide the firmware filename in this manor? Are there > going to be a lot of different FPGA bitstreams that may need to be > loaded? How does userspace choose between them, and is there a better > way to do the selection without passing the firmware filename through > the kernel? Is this merely intended to get udev to behave in a certain > way? If so, then maybe there is a better way to go about it. > > We could for example use a UDEV 'PROGRAM=' rule to execute a userspace > app and have that program figure out which firmware file to provide to > the kernel. > Please, lets not depend at all on udev. Firmware can be embedded in the kernel image, which is pretty important to work before userland if you have to have the rootfs on a device that’s instantiated via an FPGA bitstream. > g. Regards — Pantelis -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/