Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1673094
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Samuel Ortiz <sameo@linux.intel.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] nfc: Fix the sockaddr length sanitization in llcp_sock_connect |
| Date | Fri, 23 Jun 2017 00:30:01 +0200 |
| Message-ID | <tViLT-2eG-5@gated-at.bofh.it> (permalink) |
| References | <tKBIe-15d-15@gated-at.bofh.it> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.39,374,1493708400"; d="scan'208";a="100618113" |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.8.0 (2017-02-23) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 32 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | "David S. Miller" <davem@davemloft.net>, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, security@kernel.org |
| X-Original-Date | Fri, 23 Jun 2017 00:27:17 +0200 |
| X-Original-Message-ID | <20170622222717.GE21214@zurbaran.ger.intel.com> |
| X-Original-References | <20170524102620.13806-1-mjurczyk@google.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1673094 |
Show key headers only | View raw
Hi Mateusz, On Wed, May 24, 2017 at 12:26:20PM +0200, Mateusz Jurczyk wrote: > Fix the sockaddr length verification in the connect() handler of NFC/LLCP > sockets, to compare against the size of the actual structure expected on > input (sockaddr_nfc_llcp) instead of its shorter version (sockaddr_nfc). > > Both structures are defined in include/uapi/linux/nfc.h. The fields > specific to the _llcp extended struct are as follows: > > 276 __u8 dsap; /* Destination SAP, if known */ > 277 __u8 ssap; /* Source SAP to be bound to */ > 278 char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */; > 279 size_t service_name_len; > > If the caller doesn't provide a sufficiently long sockaddr buffer, these > fields remain uninitialized (and they currently originate from the stack > frame of the top-level sys_connect handler). They are then copied by > llcp_sock_connect() into internal storage (nfc_llcp_sock structure), and > could be subsequently read back through the user-mode getsockname() > function (handled by llcp_sock_getname()). This would result in the > disclosure of up to ~70 uninitialized bytes from the kernel stack to > user-mode clients capable of creating AFC_NFC sockets. > > Signed-off-by: Mateusz Jurczyk <mjurczyk@google.com> > --- > net/nfc/llcp_sock.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Applied to nfc-next, thanks. Cheers, Samuel.
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH] nfc: Fix the sockaddr length sanitization in llcp_sock_connect Samuel Ortiz <sameo@linux.intel.com> - 2017-06-23 00:30 +0200
csiph-web