lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Sep 2022 13:39:30 -0700
From:   Nicolin Chen <nicolinc@...dia.com>
To:     "Tian, Kevin" <kevin.tian@...el.com>
CC:     "yong.wu@...iatek.com" <yong.wu@...iatek.com>,
        "joro@...tes.org" <joro@...tes.org>,
        "will@...nel.org" <will@...nel.org>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "jean-philippe@...aro.org" <jean-philippe@...aro.org>,
        "jgg@...dia.com" <jgg@...dia.com>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH v3 6/6] iommu: Propagate ret for a potential soft failure
 EINVAL

On Tue, Sep 20, 2022 at 06:50:22AM +0000, Tian, Kevin wrote:
> External email: Use caution opening links or attachments
> 
> 
> > From: Nicolin Chen <nicolinc@...dia.com>
> > Sent: Thursday, September 15, 2022 3:59 PM
> >
> > Following the new rules in include/linux/iommu.h kdocs, EINVAL now can be
> > used to indicate that domain and device are incompatible by a caller that
> > treats it as a soft failure and tries attaching to another domain.
> >
> > Either mtk_iommu or virtio driver has a place that returns a hard failure
> > instead of the return value from the function call, where an incompatible
> > errno EINVAL could potentially occur.
> 
> in both cases there is no EINVAL returned from the calling stack
> 
> IMHO error propagation is the right way even w/o talking about EINVAL
> otherwise we may miss ENOMEM etc.

OK. I changed to:

The mtk_iommu and virtio drivers have places in the ->attach_dev callback
functions that return hardcode errnos instead of the returned values, but
callers of these ->attach_dv callback functions may care. Propagate them
directly without the extra conversions.

> > Propagate the real return value to not miss a potential soft failure.
> >
> > Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> 
> Apart from that comment,
> 
> Reviewed-by: Kevin Tian <kevin.tian@...el.com>

Added this too. Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ