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]
Message-ID: <CANaxB-zLiUsr2OG2J65jb8sa6G4i93m2j=-3F5_p+WB-Xd8ZhA@mail.gmail.com>
Date:	Mon, 8 Jul 2013 23:23:35 +0400
From:	Andrey Wagin <avagin@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Stephen Hemminger <stephen@...workplumber.org>,
	netdev@...r.kernel.org
Subject: Re: [PATCH] ip: set the close-on-exec flag for descriptors

2013/7/8 Eric Dumazet <eric.dumazet@...il.com>:
> On Mon, 2013-07-08 at 19:51 +0400, Andrey Wagin wrote:
>> Hi Eric,
>>
>> 2013/7/8 Eric Dumazet <eric.dumazet@...il.com>:
>> >> Applied
>> >
>> > It seems it could break ip command for old kernels, as SOCK_CLOEXEC is
>> > supported from 2.6.27
>> >
>> > Not sure if its worth a patch, to do the normal socket() call followed
>> > by legacy fcntl() one.
>>
>> fcntl is not safe for multithread applications. If libnetlink isn't
>> going to be used for them, I don't have objection. The patch is
>> attached.
>>
>
> If you want multithread safety, you could attempt the SOCK_CLOEXEC, and
> fall back in case of error to legacy socket()/fcntl()
>

Yes, it's good idea. Look at the attached patch.

Thanks.

>
>

Download attachment "0001-ip-try-to-create-socket-w-o-SOCK_CLOEXEC-if-previous.patch" of type "application/octet-stream" (1389 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ