<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/devpts_fs.h, branch v4.5.6</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.5.6</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.5.6'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-02-07T07:45:46Z</updated>
<entry>
<title>pty: make sure super_block is still valid in final /dev/tty close</title>
<updated>2016-02-07T07:45:46Z</updated>
<author>
<name>Herton R. Krzesinski</name>
<email>herton@redhat.com</email>
</author>
<published>2016-01-14T19:56:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1f55c718c290616889c04946864a13ef30f64929'/>
<id>urn:sha1:1f55c718c290616889c04946864a13ef30f64929</id>
<content type='text'>
Considering current pty code and multiple devpts instances, it's possible
to umount a devpts file system while a program still has /dev/tty opened
pointing to a previosuly closed pty pair in that instance. In the case all
ptmx and pts/N files are closed, umount can be done. If the program closes
/dev/tty after umount is done, devpts_kill_index will use now an invalid
super_block, which was already destroyed in the umount operation after
running -&gt;kill_sb. This is another "use after free" type of issue, but now
related to the allocated super_block instance.

To avoid the problem (warning at ida_remove and potential crashes) for
this specific case, I added two functions in devpts which grabs additional
references to the super_block, which pty code now uses so it makes sure
the super block structure is still valid until pty shutdown is done.
I also moved the additional inode references to the same functions, which
also covered similar case with inode being freed before /dev/tty final
close/shutdown.

Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Cc: stable@vger.kernel.org # 2.6.29+
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: devpts, do not set driver_data</title>
<updated>2012-10-22T23:50:13Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-10-18T20:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f11afb61247016162aa92225a337c1575556c9d9'/>
<id>urn:sha1:f11afb61247016162aa92225a337c1575556c9d9</id>
<content type='text'>
The goal is to stop setting and using tty-&gt;driver_data in devpts code.
It should be used solely by the driver's code, pty in this case.

Now driver_data are managed only in the pty driver. devpts_pty_new is
switched to accept what we used to dig out of tty_struct, i.e. device
node number and index.

This also removes a note about driver_data being set outside of the
driver.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: devpts, return created inode from devpts_pty_new</title>
<updated>2012-10-22T23:50:12Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-10-18T20:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=162b97cfa21f816f39ede1944f2a4220e3cf8969'/>
<id>urn:sha1:162b97cfa21f816f39ede1944f2a4220e3cf8969</id>
<content type='text'>
The goal is to stop setting and using tty-&gt;driver_data in devpts code.
It should be used solely by the driver's code, pty in this case.

For the cleanup of layering, we will need the inode created in
devpts_pty_new to be stored into slave's driver_data. So we convert
devpts_pty_new to return the inode or an ERR_PTR-encoded error in case
of failure.

The move of 'inode = new_inode(sb);' from declarators to the code is
only cosmetical, but it makes the code easier to read.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: devpts, don't care about TTY in devpts_get_tty</title>
<updated>2012-10-22T23:50:12Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-10-18T20:26:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8fcbaa2b7f5b70dba9ed1c7f91d0a270ce752e2c'/>
<id>urn:sha1:8fcbaa2b7f5b70dba9ed1c7f91d0a270ce752e2c</id>
<content type='text'>
The goal is to stop setting and using tty-&gt;driver_data in devpts code.
It should be used solely by the driver's code, pty in this case.

First, here we remove TTY from devpts_get_tty and rename it to
devpts_get_priv. Note we do not remove type safety, we just shift the
[implicit] (void *) cast one layer up.

index was unused in devpts_get_tty, so remove that from the prototype
too.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Add an instance parameter devpts interfaces</title>
<updated>2008-10-13T16:51:43Z</updated>
<author>
<name>Sukadev Bhattiprolu</name>
<email>sukadev@us.ibm.com</email>
</author>
<published>2008-10-13T09:42:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15f1a6338ddd4e69fff965d4b3a0e1bfb7a13d9c'/>
<id>urn:sha1:15f1a6338ddd4e69fff965d4b3a0e1bfb7a13d9c</id>
<content type='text'>
Pass-in 'inode' or 'tty' parameter to devpts interfaces.  With multiple
devpts instances, these parameters will be used in subsequent patches
to identify the instance of devpts mounted. The parameters also help
simplify devpts implementation.

Changelog[v3]:
	- minor changes due to merge with ttydev updates
	- rename parameters to emphasize they are ptmx or pts inodes
	- pass-in tty_struct * to devpts_pty_kill() (this will help
	  cleanup the get_node() call in a subsequent patch)

Signed-off-by: Sukadev Bhattiprolu &lt;sukadev@us.ibm.com&gt;
Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>devpts: factor out PTY index allocation</title>
<updated>2008-04-30T15:29:48Z</updated>
<author>
<name>Sukadev Bhattiprolu</name>
<email>sukadev@us.ibm.com</email>
</author>
<published>2008-04-30T07:54:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=718a916338e821a10961e6a7a17430c18e5e58d9'/>
<id>urn:sha1:718a916338e821a10961e6a7a17430c18e5e58d9</id>
<content type='text'>
Factor out the code used to allocate/free a pts index into new interfaces,
devpts_new_index() and devpts_kill_index().  This localizes the external data
structures used in managing the pts indices.

[akpm@linux-foundation.org: undo accidental mutex2sem conversion]
Signed-off-by: Sukadev Bhattiprolu &lt;sukadev@us.ibm.com&gt;
Signed-off-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: Matt Helsley &lt;matthltc@us.ibm.com&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] fix the build with CONFIG_UNIX98_PTYS=n</title>
<updated>2004-02-24T12:04:36Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-02-24T12:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a4580ad908e8a6d2217e3c5805f50dd533b3e68d'/>
<id>urn:sha1:a4580ad908e8a6d2217e3c5805f50dd533b3e68d</id>
<content type='text'>
From: Ian Wienand &lt;ianw@gelato.unsw.edu.au&gt;

- Fix inline function declarations

- Use #ifdef for CONFIG_*, not #if
</content>
</entry>
<entry>
<title>[PATCH] dynamic pty allocation</title>
<updated>2004-02-22T15:01:12Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-02-22T15:01:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=562123b5e1c5e73e141748e687b45321484804d1'/>
<id>urn:sha1:562123b5e1c5e73e141748e687b45321484804d1</id>
<content type='text'>
From: "H. Peter Anvin" &lt;hpa@transmeta.com&gt;

Remove the limit of 2048 pty's - allocate them on demand up to the 12:20
dev_t limit: a million.
</content>
</entry>
<entry>
<title>[PATCH] devpts cleanup</title>
<updated>2002-07-04T15:53:12Z</updated>
<author>
<name>Alexander Viro</name>
<email>viro@math.psu.edu</email>
</author>
<published>2002-07-04T15:53:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2aa859378756ae63d41b2cafb8bcdb9246afeb95'/>
<id>urn:sha1:2aa859378756ae63d41b2cafb8bcdb9246afeb95</id>
<content type='text'>
	* devpts "upcalls" eliminated.
	* instead of playing games with revalidation we simply use
ramfs-style tree and kill dentries upon devpts_pty_kill().  That
allows to get rid of a lot of code in fs/devpts/*.c.
	* devpts_fs.h cleaned up.
	* devpts/root.c and devpts/devpts_i.h removed.
	* array of pointers to devpts inodes killed; with ramfs-style tree
it's not needed anymore.
	* devpts/inode.c cleaned up.
	* devpts_pty_new() used to get mk_kdev() only to convert it to
dev_t (hardly a surprise, since it's mknod() in disguise).  Now it gets
dev_t as an argument.
</content>
</entry>
<entry>
<title>Import changeset</title>
<updated>2002-02-05T01:40:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@athlon.transmeta.com</email>
</author>
<published>2002-02-05T01:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7a2deb32924142696b8174cdf9b38cd72a11fc96'/>
<id>urn:sha1:7a2deb32924142696b8174cdf9b38cd72a11fc96</id>
<content type='text'>
</content>
</entry>
</feed>
