<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/gadget/function/f_printer.c, branch v5.15.208</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-05T07:14:47+00:00</updated>
<entry>
<title>usb: gadget: printer: fix races against disable</title>
<updated>2024-07-05T07:14:47+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2024-06-20T11:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa14dca6392ace6b182d15103c40571e66edfb96'/>
<id>urn:sha1:aa14dca6392ace6b182d15103c40571e66edfb96</id>
<content type='text'>
commit e587a7633dfee8987a999cf253f7c52a8e09276c upstream.

printer_read() and printer_write() guard against the race
against disable() by checking the dev-&gt;interface flag,
which in turn is guarded by a spinlock.
These functions, however, drop the lock on multiple occasions.
This means that the test has to be redone after reacquiring
the lock and before doing IO.

Add the tests.

This also addresses CVE-2024-25741

Fixes: 7f2ca14d2f9b9 ("usb: gadget: function: printer: Interface is disabled and returns error")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Link: https://lore.kernel.org/r/20240620114039.5767-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: printer: SS+ support</title>
<updated>2024-07-05T07:14:47+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2024-06-20T09:37:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7abdf15c0c8e7087f3c8507ba392c78a6c149ed1'/>
<id>urn:sha1:7abdf15c0c8e7087f3c8507ba392c78a6c149ed1</id>
<content type='text'>
commit fd80731e5e9d1402cb2f85022a6abf9b1982ec5f upstream.

We need to treat super speed plus as super speed, not the default,
which is full speed.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/20240620093800.28901-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: fix dangling pnp_string in f_printer.c</title>
<updated>2022-10-26T10:35:13+00:00</updated>
<author>
<name>Albert Briscoe</name>
<email>albertsbriscoe@gmail.com</email>
</author>
<published>2022-09-11T22:37:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d05df7757f4114dd0e6be267cda745dc7527857'/>
<id>urn:sha1:1d05df7757f4114dd0e6be267cda745dc7527857</id>
<content type='text'>
[ Upstream commit 24b7ba2f88e04800b54d462f376512e8c41b8a3c ]

When opts-&gt;pnp_string is changed with configfs, new memory is allocated for
the string. It does not, however, update dev-&gt;pnp_string, even though the
memory is freed. When rquesting the string, the host then gets old or
corrupted data rather than the new string. The ieee 1284 id string should
be allowed to change while the device is connected.

The bug was introduced in commit fdc01cc286be ("usb: gadget: printer:
Remove pnp_string static buffer"), which changed opts-&gt;pnp_string from a
char[] to a char*.
This patch changes dev-&gt;pnp_string from a char* to a char** pointing to
opts-&gt;pnp_string.

Fixes: fdc01cc286be ("usb: gadget: printer: Remove pnp_string static buffer")
Signed-off-by: Albert Briscoe &lt;albertsbriscoe@gmail.com&gt;
Link: https://lore.kernel.org/r/20220911223753.20417-1-albertsbriscoe@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v5.13-rc6' into usb-next</title>
<updated>2021-06-14T07:18:07+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2021-06-14T07:18:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=37fdb7c90f8cc2f41bdf2190ccc44a37bbf1a295'/>
<id>urn:sha1:37fdb7c90f8cc2f41bdf2190ccc44a37bbf1a295</id>
<content type='text'>
We want the usb fixes in here as well, and this resolves some merge
issues with:
	drivers/usb/dwc3/debugfs.c
	drivers/usb/dwc3/gadget.c

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: printer: use list_move instead of list_del/list_add</title>
<updated>2021-06-09T09:11:30+00:00</updated>
<author>
<name>Baokun Li</name>
<email>libaokun1@huawei.com</email>
</author>
<published>2021-06-09T07:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=307462a6f5c5a563ec084bb315f4e0279dfb2026'/>
<id>urn:sha1:307462a6f5c5a563ec084bb315f4e0279dfb2026</id>
<content type='text'>
Using list_move() instead of list_del() + list_add().

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Baokun Li &lt;libaokun1@huawei.com&gt;
Link: https://lore.kernel.org/r/20210609070612.1325044-1-libaokun1@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: fix various gadgets null ptr deref on 10gbps cabling.</title>
<updated>2021-06-09T08:37:13+00:00</updated>
<author>
<name>Maciej Żenczykowski</name>
<email>maze@google.com</email>
</author>
<published>2021-06-08T04:41:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=90c4d05780d47e14a50e11a7f17373104cd47d25'/>
<id>urn:sha1:90c4d05780d47e14a50e11a7f17373104cd47d25</id>
<content type='text'>
This avoids a null pointer dereference in
f_{ecm,eem,hid,loopback,printer,rndis,serial,sourcesink,subset,tcm}
by simply reusing the 5gbps config for 10gbps.

Fixes: eaef50c76057 ("usb: gadget: Update usb_assign_descriptors for SuperSpeedPlus")
Cc: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Cc: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Cc: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Michael R Sweet &lt;msweet@msweet.org&gt;
Cc: Mike Christie &lt;michael.christie@oracle.com&gt;
Cc: Pawel Laszczak &lt;pawell@cadence.com&gt;
Cc: Peter Chen &lt;peter.chen@nxp.com&gt;
Cc: Sudhakar Panneerselvam &lt;sudhakar.panneerselvam@oracle.com&gt;
Cc: Wei Ming Chen &lt;jj251510319013@gmail.com&gt;
Cc: Will McVicker &lt;willmcvicker@google.com&gt;
Cc: Zqiang &lt;qiang.zhang@windriver.com&gt;
Reviewed-By: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Link: https://lore.kernel.org/r/20210608044141.3898496-1-zenczykowski@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: fix typo in f_printer.c</title>
<updated>2021-03-10T08:37:15+00:00</updated>
<author>
<name>Wei Ming Chen</name>
<email>jj251510319013@gmail.com</email>
</author>
<published>2021-02-14T12:19:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e21a2e0a0f6021cfc9239ec94e883bd119c330ef'/>
<id>urn:sha1:e21a2e0a0f6021cfc9239ec94e883bd119c330ef</id>
<content type='text'>
In line 824, it is trying to enable `out_ep`, so I
believe that in line 826, it should print `out_ep`
instead of `in_ep`.

Signed-off-by: Wei Ming Chen &lt;jj251510319013@gmail.com&gt;
Link: https://lore.kernel.org/r/20210214121929.9750-1-jj251510319013@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.11-rc3 into usb-next</title>
<updated>2021-01-11T07:11:26+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2021-01-11T07:11:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a66a7d48f34a253429999dcc7188f607cd7a206a'/>
<id>urn:sha1:a66a7d48f34a253429999dcc7188f607cd7a206a</id>
<content type='text'>
Resolves a merge issue in:
	drivers/usb/dwc3/gadget.c

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: gadget: f_printer: set a default q_len</title>
<updated>2021-01-04T15:49:08+00:00</updated>
<author>
<name>Michael R Sweet</name>
<email>msweet@msweet.org</email>
</author>
<published>2020-12-28T17:18:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ed054e4e95d6cb0582f1283707ddb40f18d14bfb'/>
<id>urn:sha1:ed054e4e95d6cb0582f1283707ddb40f18d14bfb</id>
<content type='text'>
The usb_f_printer gadget driver uses a default q_len value of *0* which prevents
any IO from occurring.  Moreover, once the driver is instantiated it is
impossible to change the q_len value.

The following patch uses a default q_len value of 10 which matches the legacy
g_printer gadget driver.  This minimizes the possibility that you end up with a
non-working printer gadget.  It is still possible to set the q_len to a
different value using the configfs path of the same name.

Signed-off-by: Michael R Sweet &lt;msweet@msweet.org&gt;
Link: https://lore.kernel.org/r/9DFB1605-63A5-46DB-A5A4-B59B315D8115@msweet.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: printer: Fix a memory leak for interface descriptor</title>
<updated>2020-12-28T14:45:16+00:00</updated>
<author>
<name>Zqiang</name>
<email>qiang.zhang@windriver.com</email>
</author>
<published>2020-12-10T02:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2cc332e4ee4febcbb685e2962ad323fe4b3b750a'/>
<id>urn:sha1:2cc332e4ee4febcbb685e2962ad323fe4b3b750a</id>
<content type='text'>
When printer driver is loaded, the printer_func_bind function is called, in
this function, the interface descriptor be allocated memory, if after that,
the error occurred, the interface descriptor memory need to be free.

Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Zqiang &lt;qiang.zhang@windriver.com&gt;
Link: https://lore.kernel.org/r/20201210020148.6691-1-qiang.zhang@windriver.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
