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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 06 Oct 2015 09:58:54 +0100
From:	Luis de Bethencourt <>
To:	Jiri Kosina <>
Subject: Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

On 05/10/15 15:24, Jiri Kosina wrote:
> On Sat, 3 Oct 2015, Luis de Bethencourt wrote:
>>> But I am not really sure where you are seeing the bug (mapping to 
>>> -EPERM) in this case? I think the only caller of hiddev_connect() 
>>> should be hid_connect(), and the only thing that guy cares about 
>>> whether individual callbacks succeed or fail, so that it sets 
>>> hdev->clamed flags accordingly.
>>> Could you please be more specific about the -EPERM mapping you are 
>>> talking about?
>> I agree with you. The only caller of hiddev_connect() only checks if the
>> callback succeded. It checks if the return < 0.
>> What I meant is that -1 means -EPERM. [0]
> I still don't understand what problem you are chasing here, sorry. EPERM 
> is defined to be 1, yes. So are many other completely unrelated #defines.
>> This patch is purely about the correctness of using -ENOMEM. The word 
>> "propagated" was not the best way to describe this problem. I could edit 
>> the commit message if you would like.
> You seem to imply that someone might be interpreting that -1 as a define 
> from errno.h. But that's not the case.
> Are you going to look at every 'return -1' occurence in the kernel and 
> convert it to something else? That can keep you busy for quite some time:
> 	$ git grep 'return -1' | wc -l
> 	9167
> The only cleanup I'd imagine at least remotely possible in this case would 
> be to convert the ->connect() callbacks return bool.

This is a very good point. I will write a second version of the patch that
converts the return to a boolean.

Thanks for the review,
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists