Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Oct 2015 02:12:55 -0700
From:      NGie Cooper <yaneurabeya@gmail.com>
To:        Garrett Cooper <ngie@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r289450 - head/lib/libcam
Message-ID:  <70C8FD63-73D9-4DE0-9FA4-DE928225F479@gmail.com>
In-Reply-To: <201510170907.t9H97sgF066102@repo.freebsd.org>
References:  <201510170907.t9H97sgF066102@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Oct 17, 2015, at 02:07, Garrett Cooper <ngie@FreeBSD.org> wrote:
>=20
> Author: ngie
> Date: Sat Oct 17 09:07:53 2015
> New Revision: 289450
> URL: https://svnweb.freebsd.org/changeset/base/289450
>=20
> Log:
>  Set dev->fd to -1 when calling cam_close_spec_device with a valid =
dev->fd
>  descriptor to avoid trashing valid file descriptors that access =
dev->fd at a
>  later point in time

That wasn=E2=80=99t a good description =E2=80=94 sorry :(.

The cam_close_spec_device API doesn=E2=80=99t free `struct cam_device =
*dev` by design, so something could reuse the structure, or call close =
on dev->fd (out of band), which could trash valid file descriptor(s) by =
accident.

Thanks!
-NGie=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?70C8FD63-73D9-4DE0-9FA4-DE928225F479>