lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20130404.025634.2151704690533287593.yamato@redhat.com>
Date:	Thu, 04 Apr 2013 02:56:34 +0900 (JST)
From:	Masatake YAMATO <yamato@...hat.com>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] pnp: extend char array field in pnp_fixup structure

The length of id field of pnp_fixup structure is 7:

     struct pnp_fixup {
	    char id[7];
	    void (*quirk_function) (struct pnp_dev * dev);	/* fixup function */
     }

In other hand the field is initialized with a constant cstring
consisting of 7 characters in pnp_fixups defined in drivers/pnp/quirks.c:

    static struct pnp_fixup pnp_fixups[] = {
	    /* Soundblaster awe io port quirk */
	    {"CTL0021", quirk_awe32_resources},
	    {"CTL0022", quirk_awe32_resources},

The constant cstring is too large to store; no space for nul char.

If the id field is just used as byte array, there is no problem.
However, it is used as c string in pnp_fixup_device function:

		pnp_dbg(&dev->dev, "%s: calling %pF\n", f->id,
			f->quirk_function);

Signed-off-by: Masatake YAMATO <yamato@...hat.com>
---
 include/linux/pnp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 195aafc..d734ee2 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -295,7 +295,7 @@ static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
 }
 
 struct pnp_fixup {
-	char id[7];
+	char id[8];
 	void (*quirk_function) (struct pnp_dev * dev);	/* fixup function */
 };
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ