Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp517120ybl; Wed, 14 Aug 2019 01:32:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ8weISdi6vVslvkxKabXW8iEgGjbwZ7CdU9ZuiOvtdlFn0D82LGyhhyv/y8jJUzw8v3jA X-Received: by 2002:a17:90a:9202:: with SMTP id m2mr6066948pjo.16.1565771567932; Wed, 14 Aug 2019 01:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565771567; cv=none; d=google.com; s=arc-20160816; b=we3KyFDOp/ZMvwTNKL7zSca9buRRHoh/4Ab+2fRrO+cUuociK1hcsrGqWR+B8rgLYb 7EeymsKXqylATN1HgCx3CP4PzW+zspiNPdxu3CmqM55vFfH2Cp7tVfcSdIv3/9HzlZNI ImC66t5W7UFec42bGUSWWqFuE2ASCMfCqfZLyEYqznCnfk2ZbkpBPHqDypIcU5Wu1CqQ 4xeZZU5dfSGwvCBh45hHhBwyV7sk77nRTP8Ed1/SGt4t4SIvwF1JweI7IQsWq430JrfW MbuL0givnQVBYamvrdAMwOGqt13vutWQnCHNybJ307SXWyeVad1Ra5Yd68modbHkcBo7 1NOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nZHd0Mwvau9he5/1FmiwSLgH5Qz9c3ZEqp2z+9qu40w=; b=RWk9IOyEWfRA56wScR58Sifk7uX+/ONeAJDG/bY0JB35W+ksvhK5r/tg8cu/QCbFLz IS8gQLRhW+A3M+MioPu+04HggefPFRyMe3IHw2iLa1VIDqMn0LRHo1nfbhJxlBnQM1sJ ROimG0gYg5xl5Nmmsk2L43Fz+c0F3kUL1A7HjVk4yVekCMqG3J4vUaBP5szKFBTMdscA fHRvoylVRYcW+GKaeatx8DdcaJ+bN7mU7tIEuwIdAVtgRzf1kBSwAnKrm7/sf0/uqjd+ zhSVrydfZqxfoVwZEf4GbcWhGfzgtZhWbp9dZv8AcF8S11O2VFXlNABtGSfe82p5xxc4 twBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IebKRSQN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si2490688pjn.93.2019.08.14.01.32.29; Wed, 14 Aug 2019 01:32:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IebKRSQN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbfHNIaf (ORCPT + 99 others); Wed, 14 Aug 2019 04:30:35 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:33263 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbfHNIae (ORCPT ); Wed, 14 Aug 2019 04:30:34 -0400 Received: by mail-ot1-f68.google.com with SMTP id q20so27583988otl.0; Wed, 14 Aug 2019 01:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nZHd0Mwvau9he5/1FmiwSLgH5Qz9c3ZEqp2z+9qu40w=; b=IebKRSQNeCrFckv0XtH4F9f5wyBIk7dKKOKF31700y2SakCimIj8RonThKSr+GnDD6 wneeWv1H1j1VTrLwGu8VdCcEdkcweRtmfrMj3FNCKzbiWZd6Xw3X0IQ+PeESM7Rzmnbm Z6HLuA55H7CJ/96g5lxG27w03Tyfb9OQYMBV2QdpL6pw9iWV9TiOCvs5/8nGTCyRvxju Gz2qFQLm9fgC7DK777OGI2TIZFyh8ZFj3RN6BSY5Gm8U/6AcZY6vZBj2xHtUL9VJXuF5 RtyVkOlz2/B2jF+GCGtJmcLYsXQnwiP/PeM7YlaMnM8M33taBKQWHNGmhsEfk88EMZLe r7/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nZHd0Mwvau9he5/1FmiwSLgH5Qz9c3ZEqp2z+9qu40w=; b=FvwqcjhR1UqWdLnR+A+rYYVQEk1+PLRGM+jYhezudPqjY7pc5F+BPB2ZpM6gnrA24f jF1w1ukLABxEvVz+q/vcwKr3Fext+wwuL99qjd1KbrZVO0LmRy6dRFH0ABEUL8QHJd9q bNAxinpJ9kmUI5sGx5DbC0Gp7Q9yshp21rk2HC3xuFHZ28SVuxLIGD7Axp4mhYRUNSOq Nfg6Vvvzz07X4CHOPATE59UF6GH9ZLBm/FPiO9DhWMGZLGrg4eH2UxVIRGTWofhy1lz/ WG4lnZIX8V3V5VAV7EbjaAcN6XdUpcebU7oxQhoOegL0m6sTdRxZqmDUQKGvwwaRlIlh Yw9A== X-Gm-Message-State: APjAAAWgKi4GPEfDKfO0lMIx2I2eruO91fvOtrQ7qLiTrvDsVbUXAuy7 L9oCu9fxOPNZaiWAIkWZzPj0/2NeYPFxG1umcEY= X-Received: by 2002:a6b:f906:: with SMTP id j6mr43925234iog.26.1565771433842; Wed, 14 Aug 2019 01:30:33 -0700 (PDT) MIME-Version: 1.0 References: <20190812162105.13428-1-benjamin.tissoires@redhat.com> In-Reply-To: From: David Rheinsberg Date: Wed, 14 Aug 2019 10:30:22 +0200 Message-ID: Subject: Re: [PATCH] HID: uhid: actually use the err number from userspace To: Benjamin Tissoires Cc: Jiri Kosina , "open list:HID CORE LAYER" , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey > > 2) I think you have to filter some of the error codes. For instance, > > if you return one of the -ERESTARTSYS codes, this might cause the > > syscall to restart (if auto-restart is enabled on this context). At > > the same time, this is not *that* bad. It might even be useful for the > > userspace driver to trigger an EINTR. At least we should be aware of > > this. So maybe filters are not necessary.. Mhhh. Comments? > > I haven't thought at all of the side effects of letting the user > return a random error code. > I have the impression that anything below EHWPOISON (133) is > relatively safe. So maybe we should just make sure the error code is > below 134? > > The ERESTARTSYS has a few warnings in the include file, so I guess the > side effects might be too much for what we want to deal with. How about `err < ERESTARTSYS`? That is, we grant user-space the entire range [1-511]. This seems to be the range reserved for uapi. I think the ERESTART* codes would be fine as well, but I also don't believe there to be any actual use-case for them. Anyway, I am fine with either range. Thanks David