Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Ensure consistent struct stat definition
@ 2019-10-31  7:03 Doug Nazar
  2019-11-17 19:33 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Nazar @ 2019-10-31  7:03 UTC (permalink / raw)
  To: linux-nfs; +Cc: Doug Nazar

Although 2fbc62e2a13fc ("Fix include order between config.h and stat.h")
reorganized those files that were already including config.h, not all
files were including config.h.

Fixes at least stack smashing crashes in mountd on 32-bit systems.

Signed-off-by: Doug Nazar <nazard@nazar.ca>
---
 support/junction/junction.c | 4 ++++
 support/misc/file.c         | 4 ++++
 support/misc/mountpoint.c   | 4 ++++
 support/nfs/cacheio.c       | 4 ++++
 utils/mount/fstab.c         | 4 ++++
 utils/nfsdcld/legacy.c      | 4 ++++
 6 files changed, 24 insertions(+)

diff --git a/support/junction/junction.c b/support/junction/junction.c
index ab6caa61..41cce261 100644
--- a/support/junction/junction.c
+++ b/support/junction/junction.c
@@ -23,6 +23,10 @@
  *	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 
diff --git a/support/misc/file.c b/support/misc/file.c
index e7c38190..06f6bb2b 100644
--- a/support/misc/file.c
+++ b/support/misc/file.c
@@ -18,6 +18,10 @@
  * along with nfs-utils.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <sys/stat.h>
 
 #include <string.h>
diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c
index c6217f24..14d6731d 100644
--- a/support/misc/mountpoint.c
+++ b/support/misc/mountpoint.c
@@ -3,6 +3,10 @@
  * check if a given path is a mountpoint 
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <string.h>
 #include "xcommon.h"
 #include <sys/stat.h>
diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
index 9dc4cf1c..7c4cf373 100644
--- a/support/nfs/cacheio.c
+++ b/support/nfs/cacheio.c
@@ -15,6 +15,10 @@
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <nfslib.h>
 #include <stdio.h>
 #include <stdio_ext.h>
diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c
index eedbddab..8b0aaf1a 100644
--- a/utils/mount/fstab.c
+++ b/utils/mount/fstab.c
@@ -7,6 +7,10 @@
  * - Moved code to nfs-utils/support/nfs from util-linux/mount.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>
diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
index 07f477ab..3c6bea6c 100644
--- a/utils/nfsdcld/legacy.c
+++ b/utils/nfsdcld/legacy.c
@@ -15,6 +15,10 @@
  * Boston, MA 02110-1301, USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <dirent.h>
 #include <string.h>
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Ensure consistent struct stat definition
  2019-10-31  7:03 [PATCH] Ensure consistent struct stat definition Doug Nazar
@ 2019-11-17 19:33 ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2019-11-17 19:33 UTC (permalink / raw)
  To: Doug Nazar, linux-nfs



On 10/31/19 3:03 AM, Doug Nazar wrote:
> Although 2fbc62e2a13fc ("Fix include order between config.h and stat.h")
> reorganized those files that were already including config.h, not all
> files were including config.h.
> 
> Fixes at least stack smashing crashes in mountd on 32-bit systems.
> 
> Signed-off-by: Doug Nazar <nazard@nazar.ca>
> ---
>  support/junction/junction.c | 4 ++++
>  support/misc/file.c         | 4 ++++
>  support/misc/mountpoint.c   | 4 ++++
>  support/nfs/cacheio.c       | 4 ++++
>  utils/mount/fstab.c         | 4 ++++
>  utils/nfsdcld/legacy.c      | 4 ++++
>  6 files changed, 24 insertions(+)
Committed! 

steved.
> 
> diff --git a/support/junction/junction.c b/support/junction/junction.c
> index ab6caa61..41cce261 100644
> --- a/support/junction/junction.c
> +++ b/support/junction/junction.c
> @@ -23,6 +23,10 @@
>   *	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  
> diff --git a/support/misc/file.c b/support/misc/file.c
> index e7c38190..06f6bb2b 100644
> --- a/support/misc/file.c
> +++ b/support/misc/file.c
> @@ -18,6 +18,10 @@
>   * along with nfs-utils.  If not, see <http://www.gnu.org/licenses/>.
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
>  #include <sys/stat.h>
>  
>  #include <string.h>
> diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c
> index c6217f24..14d6731d 100644
> --- a/support/misc/mountpoint.c
> +++ b/support/misc/mountpoint.c
> @@ -3,6 +3,10 @@
>   * check if a given path is a mountpoint 
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
>  #include <string.h>
>  #include "xcommon.h"
>  #include <sys/stat.h>
> diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
> index 9dc4cf1c..7c4cf373 100644
> --- a/support/nfs/cacheio.c
> +++ b/support/nfs/cacheio.c
> @@ -15,6 +15,10 @@
>   *
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
>  #include <nfslib.h>
>  #include <stdio.h>
>  #include <stdio_ext.h>
> diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c
> index eedbddab..8b0aaf1a 100644
> --- a/utils/mount/fstab.c
> +++ b/utils/mount/fstab.c
> @@ -7,6 +7,10 @@
>   * - Moved code to nfs-utils/support/nfs from util-linux/mount.
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
>  #include <errno.h>
>  #include <stdio.h>
>  #include <fcntl.h>
> diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
> index 07f477ab..3c6bea6c 100644
> --- a/utils/nfsdcld/legacy.c
> +++ b/utils/nfsdcld/legacy.c
> @@ -15,6 +15,10 @@
>   * Boston, MA 02110-1301, USA.
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
>  #include <stdio.h>
>  #include <dirent.h>
>  #include <string.h>
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31  7:03 [PATCH] Ensure consistent struct stat definition Doug Nazar
2019-11-17 19:33 ` Steve Dickson

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git